forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
java client support for column as list feature
- Loading branch information
1 parent
4ba36f0
commit aa45bcd
Showing
5 changed files
with
84 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ge/src/main/java/io/deephaven/extensions/barrage/chunk/SingleElementListHeaderReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.extensions.barrage.chunk; | ||
|
||
import io.deephaven.chunk.WritableChunk; | ||
import io.deephaven.chunk.attributes.Values; | ||
import io.deephaven.util.datastructures.LongSizedDataStructure; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.io.DataInput; | ||
import java.io.IOException; | ||
import java.util.Iterator; | ||
import java.util.PrimitiveIterator; | ||
|
||
public class SingleElementListHeaderReader<READ_CHUNK_TYPE extends WritableChunk<Values>> | ||
extends BaseChunkReader<READ_CHUNK_TYPE> { | ||
private static final String DEBUG_NAME = "SingleElementListHeaderReader"; | ||
|
||
private final ExpansionKernel<?> kernel; | ||
private final ChunkReader<READ_CHUNK_TYPE> componentReader; | ||
|
||
public SingleElementListHeaderReader( | ||
final ExpansionKernel<?> kernel, | ||
final ChunkReader<READ_CHUNK_TYPE> componentReader) { | ||
this.componentReader = componentReader; | ||
this.kernel = kernel; | ||
} | ||
|
||
@Override | ||
public READ_CHUNK_TYPE readChunk( | ||
@NotNull final Iterator<ChunkWriter.FieldNodeInfo> fieldNodeIter, | ||
@NotNull final PrimitiveIterator.OfLong bufferInfoIter, | ||
@NotNull final DataInput is, | ||
@Nullable final WritableChunk<Values> outChunk, | ||
final int outOffset, | ||
final int totalRows) throws IOException { | ||
final ChunkWriter.FieldNodeInfo nodeInfo = fieldNodeIter.next(); | ||
final long validityBufferLength = bufferInfoIter.nextLong(); | ||
final long offsetsBufferLength = bufferInfoIter.nextLong(); | ||
|
||
if (nodeInfo.numElements == 0) { | ||
is.skipBytes(LongSizedDataStructure.intSize(DEBUG_NAME, validityBufferLength + offsetsBufferLength)); | ||
return componentReader.readChunk(fieldNodeIter, bufferInfoIter, is, null, 0, 0); | ||
} | ||
|
||
// skip validity buffer: | ||
int jj = 0; | ||
if (validityBufferLength > 0) { | ||
is.skipBytes(LongSizedDataStructure.intSize(DEBUG_NAME, validityBufferLength)); | ||
} | ||
|
||
// skip offsets: | ||
if (offsetsBufferLength > 0) { | ||
is.skipBytes(LongSizedDataStructure.intSize(DEBUG_NAME, offsetsBufferLength)); | ||
} | ||
|
||
return componentReader.readChunk(fieldNodeIter, bufferInfoIter, is, null, 0, 0); | ||
} | ||
} |