Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API updated to specify viewport rows/columns when taking snapshots #1973

Merged
merged 7 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static class AddColumnData {
// Ensure that we clean up only after all copies of the update are released.
private volatile int refCount = 1;

// Underlying RecordBatch.length, visible for reading snapshots
public long length;

// Field updater for refCount, so we can avoid creating an {@link java.util.concurrent.atomic.AtomicInteger} for
// each instance.
private static final AtomicIntegerFieldUpdater<BarrageMessage> REFERENCE_COUNT_UPDATER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public BarrageMessage safelyParseFrom(final StreamReaderOptions options,
bodyParsed = true;
final int size = decoder.readRawVarint32();
final RecordBatch batch = (RecordBatch) header.header(new RecordBatch());
msg.length = batch.length();

// noinspection UnstableApiUsage
try (final LittleEndianDataInputStream ois =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onNext(final BarrageMessage barrageMessage) {
}

// override server-supplied data and regenerate local rowsets
barrageMessage.rowsAdded = RowSetFactory.flat(barrageMessage.addColumnData[0].data.size());
barrageMessage.rowsAdded = RowSetFactory.flat(barrageMessage.length);
barrageMessage.rowsIncluded = barrageMessage.rowsAdded.copy();

listener.handleBarrageMessage(barrageMessage);
Expand Down
Loading