From 5084fc0642a4a2470becee0eb1a5618aa03b6270 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 11 Aug 2013 13:51:53 +0200 Subject: [PATCH] fixed ByteBuffer usage --- .../indexer/data/StringInputRowParser.java | 2 +- .../data/StringInputRowParserTest.java | 20 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 indexing-common/src/test/java/com/metamx/druid/indexer/data/StringInputRowParserTest.java diff --git a/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java b/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java index b3942d67d27..c1b52d142c6 100644 --- a/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java +++ b/indexing-common/src/main/java/com/metamx/druid/indexer/data/StringInputRowParser.java @@ -67,7 +67,7 @@ public class StringInputRowParser implements ByteBufferInputRowParser private Map buildStringKeyMap(ByteBuffer input) { - int payloadSize = input.limit(); + int payloadSize = input.remaining(); if (chars == null || chars.remaining() < payloadSize) { diff --git a/indexing-common/src/test/java/com/metamx/druid/indexer/data/StringInputRowParserTest.java b/indexing-common/src/test/java/com/metamx/druid/indexer/data/StringInputRowParserTest.java deleted file mode 100644 index bee550a9d6c..00000000000 --- a/indexing-common/src/test/java/com/metamx/druid/indexer/data/StringInputRowParserTest.java +++ /dev/null @@ -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()); - } -}