mirror of https://github.com/apache/druid.git
fixed ByteBuffer usage
This commit is contained in:
parent
d6992d96d6
commit
5084fc0642
|
@ -67,7 +67,7 @@ public class StringInputRowParser implements ByteBufferInputRowParser
|
||||||
|
|
||||||
private Map<String, Object> buildStringKeyMap(ByteBuffer input)
|
private Map<String, Object> buildStringKeyMap(ByteBuffer input)
|
||||||
{
|
{
|
||||||
int payloadSize = input.limit();
|
int payloadSize = input.remaining();
|
||||||
|
|
||||||
if (chars == null || chars.remaining() < payloadSize)
|
if (chars == null || chars.remaining() < payloadSize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
package com.metamx.druid.indexer.data;
|
|
||||||
|
|
||||||
import junit.framework.Assert;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
public class StringInputRowParserTest {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPayloadSize() {
|
|
||||||
ByteBuffer payload = ByteBuffer.allocate(10);
|
|
||||||
payload.position(2);
|
|
||||||
payload.limit(5);
|
|
||||||
payload.rewind();
|
|
||||||
Assert.assertEquals(5, payload.limit());
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue