diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/ArrowToTableConverter.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/ArrowToTableConverter.java index 3f9b22248bb..aa8bdf4b73e 100644 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/ArrowToTableConverter.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/ArrowToTableConverter.java @@ -48,7 +48,7 @@ public class ArrowToTableConverter { private volatile boolean completed = false; - private BarrageProtoUtil.MessageInfo parseArrowIpcMessage(final ByteBuffer bb) throws IOException { + private static BarrageProtoUtil.MessageInfo parseArrowIpcMessage(final ByteBuffer bb) throws IOException { final BarrageProtoUtil.MessageInfo mi = new BarrageProtoUtil.MessageInfo(); bb.order(ByteOrder.LITTLE_ENDIAN); @@ -68,6 +68,11 @@ private BarrageProtoUtil.MessageInfo parseArrowIpcMessage(final ByteBuffer bb) t return mi; } + /** + * The input ByteBuffer instance (especially originated from Python) can't be assumed to be valid after the return + * of this method. Until jpy-consortium/jpy#126 is resolved, we need to copy the input ByteBuffer to a new + * ByteBuffer instance that is safe to use after the return of this method. + */ @ScriptApi public synchronized void setSchema(final ByteBuffer ipcMessage) { if (completed) { @@ -80,6 +85,11 @@ public synchronized void setSchema(final ByteBuffer ipcMessage) { parseSchema((Schema) mi.header.header(new Schema())); } + /** + * The input ByteBuffer instance (especially originated from Python) can't be assumed to be valid after the return + * of this method. Until jpy-consortium/jpy#126 is resolved, we need to copy the input ByteBuffer to a new + * ByteBuffer instance that is safe to use after the return of this method. + */ @ScriptApi public synchronized void addRecordBatches(final ByteBuffer... ipcMessages) { for (final ByteBuffer ipcMessage : ipcMessages) { @@ -87,6 +97,11 @@ public synchronized void addRecordBatches(final ByteBuffer... ipcMessages) { } } + /** + * The input ByteBuffer instance (especially originated from Python) can't be assumed to be valid after the return + * of this method. Until jpy-consortium/jpy#126 is resolved, we need to copy the input ByteBuffer to a new + * ByteBuffer instance that is safe to use after the return of this method. + */ @ScriptApi public synchronized void addRecordBatch(final ByteBuffer ipcMessage) { if (completed) {