arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [3/6] arrow git commit: ARROW-1109: [JAVA] transferOwnership fails when readerIndex is not 0
Date Thu, 08 Jun 2017 22:00:03 GMT
ARROW-1109: [JAVA] transferOwnership fails when readerIndex is not 0

Closes #745


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/9fe2123a
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/9fe2123a
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/9fe2123a

Branch: refs/heads/master
Commit: 9fe2123a565edebbcea0f41042edf5712d35566d
Parents: 6d71b8c
Author: Julien Le Dem <julien@apache.org>
Authored: Tue Apr 11 09:40:09 2017 -0700
Committer: Steven Phillips <steven@dremio.com>
Committed: Thu Jun 8 14:57:53 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/io/netty/buffer/ArrowBuf.java | 29 ++++++++++----------
 1 file changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/9fe2123a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
----------------------------------------------------------------------
diff --git a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
index 06272a7..0328a16 100644
--- a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
+++ b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
@@ -18,19 +18,6 @@
 
 package io.netty.buffer;
 
-import com.google.common.base.Preconditions;
-
-import io.netty.util.internal.PlatformDependent;
-
-import org.apache.arrow.memory.AllocationManager.BufferLedger;
-import org.apache.arrow.memory.ArrowByteBufAllocator;
-import org.apache.arrow.memory.BaseAllocator;
-import org.apache.arrow.memory.BaseAllocator.Verbosity;
-import org.apache.arrow.memory.BoundsChecking;
-import org.apache.arrow.memory.BufferAllocator;
-import org.apache.arrow.memory.BufferManager;
-import org.apache.arrow.memory.util.HistoricalLog;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -42,6 +29,19 @@ import java.nio.charset.Charset;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.arrow.memory.AllocationManager.BufferLedger;
+import org.apache.arrow.memory.ArrowByteBufAllocator;
+import org.apache.arrow.memory.BaseAllocator;
+import org.apache.arrow.memory.BaseAllocator.Verbosity;
+import org.apache.arrow.memory.BoundsChecking;
+import org.apache.arrow.memory.BufferAllocator;
+import org.apache.arrow.memory.BufferManager;
+import org.apache.arrow.memory.util.HistoricalLog;
+
+import com.google.common.base.Preconditions;
+
+import io.netty.util.internal.PlatformDependent;
+
 public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable {
 
   private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ArrowBuf.class);
@@ -245,8 +245,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable
{
 
     final BufferLedger otherLedger = this.ledger.getLedgerForAllocator(target);
     final ArrowBuf newBuf = otherLedger.newArrowBuf(offset, length, null);
-    newBuf.readerIndex(this.readerIndex);
-    newBuf.writerIndex(this.writerIndex);
+    newBuf.setIndex(this.readerIndex, this.writerIndex);
     final boolean allocationFit = this.ledger.transferBalance(otherLedger);
     return new TransferResult(allocationFit, newBuf);
   }


Mime
View raw message