diff --git a/java/format/README.md b/java/format/README.md index 623b30d..48412d1 100644 --- a/java/format/README.md +++ b/java/format/README.md @@ -18,6 +18,7 @@ rm -rf java/format/src # regenerate from the .fbs files flatc --java -o java/format/src/main/java format/*.fbs # generate license headers +cd java mvn compile ``` @@ -26,4 +27,4 @@ mvn compile ```bash cd $BARRAGE_HOME find java/format/src -type f | while read file; do git add $file; done -``` \ No newline at end of file +``` diff --git a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageMessageType.java b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageMessageType.java index 3f3756a..1339b70 100644 --- a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageMessageType.java +++ b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageMessageType.java @@ -25,6 +25,11 @@ private BarrageMessageType() { } public static final byte None = 0; /** * enum values 1 - 3 are reserved for future use + */ + public static final byte UNUSED_1 = 1; + public static final byte UNUSED_2 = 2; + public static final byte UNUSED_3 = 3; + /** * for subscription parsing/management (aka DoPut, DoExchange) */ public static final byte BarrageSerializationOptions = 4; @@ -33,7 +38,7 @@ private BarrageMessageType() { } public static final byte BarrageSnapshotRequest = 7; public static final byte BarragePublicationRequest = 8; - public static final String[] names = { "None", "", "", "", "BarrageSerializationOptions", "BarrageSubscriptionRequest", "BarrageUpdateMetadata", "BarrageSnapshotRequest", "BarragePublicationRequest", }; + public static final String[] names = { "None", "UNUSED_1", "UNUSED_2", "UNUSED_3", "BarrageSerializationOptions", "BarrageSubscriptionRequest", "BarrageUpdateMetadata", "BarrageSnapshotRequest", "BarragePublicationRequest", }; public static String name(int e) { return names[e]; } } diff --git a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java index 604cf29..4ad28ef 100644 --- a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java +++ b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSnapshotOptions.java @@ -58,18 +58,21 @@ public final class BarrageSnapshotOptions extends Table { */ public int maxMessageSize() { int o = __offset(10); return o != 0 ? bb.getInt(o + bb_pos) : 0; } /** - * If zero, list lengths will not be limited. If greater than zero, the server will limit the length of any encoded - * list / array to the first n elements, where n is the specified value. If the column value has length less than - * zero, the server will send the last n elements of the list / array. If the column value has length greater than - * the limit, the server will encode the list up to the limit and append an arbitrary value to indicate truncation. + * The maximum length of any list / array to encode. + * - If zero, list lengths will not be limited. + * - If non-zero, the server will limit the length of any encoded list / array to the absolute value of the returned length. + * - If less than zero, the server will encode elements from the end of the list / array, rather than from the beginning. + * + * Note: The server is unable to indicate when truncation occurs. To detect truncation request one more element than + * the maximum number you wish to display. */ - public int previewListLengthLimit() { int o = __offset(12); return o != 0 ? bb.getInt(o + bb_pos) : 0; } + public long previewListLengthLimit() { int o = __offset(12); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } public static int createBarrageSnapshotOptions(FlatBufferBuilder builder, boolean useDeephavenNulls, int batchSize, int maxMessageSize, - int previewListLengthLimit) { + long previewListLengthLimit) { builder.startTable(5); BarrageSnapshotOptions.addPreviewListLengthLimit(builder, previewListLengthLimit); BarrageSnapshotOptions.addMaxMessageSize(builder, maxMessageSize); @@ -82,7 +85,7 @@ public static int createBarrageSnapshotOptions(FlatBufferBuilder builder, public static void addUseDeephavenNulls(FlatBufferBuilder builder, boolean useDeephavenNulls) { builder.addBoolean(1, useDeephavenNulls, false); } public static void addBatchSize(FlatBufferBuilder builder, int batchSize) { builder.addInt(2, batchSize, 0); } public static void addMaxMessageSize(FlatBufferBuilder builder, int maxMessageSize) { builder.addInt(3, maxMessageSize, 0); } - public static void addPreviewListLengthLimit(FlatBufferBuilder builder, int previewListLengthLimit) { builder.addInt(4, previewListLengthLimit, 0); } + public static void addPreviewListLengthLimit(FlatBufferBuilder builder, long previewListLengthLimit) { builder.addLong(4, previewListLengthLimit, 0L); } public static int endBarrageSnapshotOptions(FlatBufferBuilder builder) { int o = builder.endTable(); return o; diff --git a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java index ed762ae..d0c0581 100644 --- a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java +++ b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageSubscriptionOptions.java @@ -72,12 +72,15 @@ public final class BarrageSubscriptionOptions extends Table { */ public boolean columnsAsList() { int o = __offset(14); return o != 0 ? 0!=bb.get(o + bb_pos) : false; } /** - * If zero, list lengths will not be limited. If greater than zero, the server will limit the length of any encoded - * list / array to the first n elements, where n is the specified value. If the column value has length less than - * zero, the server will send the last n elements of the list / array. If the column value has length greater than - * the limit, the server will encode the list up to the limit and append an arbitrary value to indicate truncation. + * The maximum length of any list / array to encode. + * - If zero, list lengths will not be limited. + * - If non-zero, the server will limit the length of any encoded list / array to the absolute value of the returned length. + * - If less than zero, the server will encode elements from the end of the list / array, rather than from the beginning. + * + * Note: The server is unable to indicate when truncation occurs. To detect truncation request one more element than + * the maximum number you wish to display. */ - public int previewListLengthLimit() { int o = __offset(16); return o != 0 ? bb.getInt(o + bb_pos) : 0; } + public long previewListLengthLimit() { int o = __offset(16); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } public static int createBarrageSubscriptionOptions(FlatBufferBuilder builder, boolean useDeephavenNulls, @@ -85,7 +88,7 @@ public static int createBarrageSubscriptionOptions(FlatBufferBuilder builder, int batchSize, int maxMessageSize, boolean columnsAsList, - int previewListLengthLimit) { + long previewListLengthLimit) { builder.startTable(7); BarrageSubscriptionOptions.addPreviewListLengthLimit(builder, previewListLengthLimit); BarrageSubscriptionOptions.addMaxMessageSize(builder, maxMessageSize); @@ -102,7 +105,7 @@ public static int createBarrageSubscriptionOptions(FlatBufferBuilder builder, public static void addBatchSize(FlatBufferBuilder builder, int batchSize) { builder.addInt(3, batchSize, 0); } public static void addMaxMessageSize(FlatBufferBuilder builder, int maxMessageSize) { builder.addInt(4, maxMessageSize, 0); } public static void addColumnsAsList(FlatBufferBuilder builder, boolean columnsAsList) { builder.addBoolean(5, columnsAsList, false); } - public static void addPreviewListLengthLimit(FlatBufferBuilder builder, int previewListLengthLimit) { builder.addInt(6, previewListLengthLimit, 0); } + public static void addPreviewListLengthLimit(FlatBufferBuilder builder, long previewListLengthLimit) { builder.addLong(6, previewListLengthLimit, 0L); } public static int endBarrageSubscriptionOptions(FlatBufferBuilder builder) { int o = builder.endTable(); return o; diff --git a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java index 07bd0c1..c83f881 100644 --- a/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java +++ b/java/format/src/main/java/io/deephaven/barrage/flatbuf/BarrageUpdateMetadata.java @@ -125,6 +125,10 @@ public final class BarrageUpdateMetadata extends Table { public int modColumnNodesLength() { int o = __offset(24); return o != 0 ? __vector_len(o) : 0; } public io.deephaven.barrage.flatbuf.BarrageModColumnMetadata.Vector modColumnNodesVector() { return modColumnNodesVector(new io.deephaven.barrage.flatbuf.BarrageModColumnMetadata.Vector()); } public io.deephaven.barrage.flatbuf.BarrageModColumnMetadata.Vector modColumnNodesVector(io.deephaven.barrage.flatbuf.BarrageModColumnMetadata.Vector obj) { int o = __offset(24); return o != 0 ? obj.__assign(__vector(o), 4, bb) : null; } + /** + * The current size of the table. + */ + public long tableSize() { int o = __offset(26); return o != 0 ? bb.getLong(o + bb_pos) : 0L; } public static int createBarrageUpdateMetadata(FlatBufferBuilder builder, long firstSeq, @@ -137,8 +141,10 @@ public static int createBarrageUpdateMetadata(FlatBufferBuilder builder, int removedRowsOffset, int shiftDataOffset, int addedRowsIncludedOffset, - int modColumnNodesOffset) { - builder.startTable(11); + int modColumnNodesOffset, + long tableSize) { + builder.startTable(12); + BarrageUpdateMetadata.addTableSize(builder, tableSize); BarrageUpdateMetadata.addLastSeq(builder, lastSeq); BarrageUpdateMetadata.addFirstSeq(builder, firstSeq); BarrageUpdateMetadata.addModColumnNodes(builder, modColumnNodesOffset); @@ -153,7 +159,7 @@ public static int createBarrageUpdateMetadata(FlatBufferBuilder builder, return BarrageUpdateMetadata.endBarrageUpdateMetadata(builder); } - public static void startBarrageUpdateMetadata(FlatBufferBuilder builder) { builder.startTable(11); } + public static void startBarrageUpdateMetadata(FlatBufferBuilder builder) { builder.startTable(12); } public static void addFirstSeq(FlatBufferBuilder builder, long firstSeq) { builder.addLong(0, firstSeq, 0L); } public static void addLastSeq(FlatBufferBuilder builder, long lastSeq) { builder.addLong(1, lastSeq, 0L); } public static void addIsSnapshot(FlatBufferBuilder builder, boolean isSnapshot) { builder.addBoolean(2, isSnapshot, false); } @@ -185,6 +191,7 @@ public static int createBarrageUpdateMetadata(FlatBufferBuilder builder, public static void addModColumnNodes(FlatBufferBuilder builder, int modColumnNodesOffset) { builder.addOffset(10, modColumnNodesOffset, 0); } public static int createModColumnNodesVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); } public static void startModColumnNodesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); } + public static void addTableSize(FlatBufferBuilder builder, long tableSize) { builder.addLong(11, tableSize, 0L); } public static int endBarrageUpdateMetadata(FlatBufferBuilder builder) { int o = builder.endTable(); return o;