Class BarrageUtil
java.lang.Object
io.deephaven.extensions.barrage.util.BarrageUtil
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The deephaven metadata tag to indicate the deephaven column component type.static final String
The Apache Arrow metadata prefix for Deephaven attributes.static final String
The deephaven metadata tag to indicate the deephaven column type.static final BarrageSnapshotOptions
static final BarrageSubscriptionOptions
static final long
static final long
static final long
static final org.apache.arrow.vector.types.pojo.ArrowType.Timestamp
Note that arrow's wire format states that Timestamps without timezones are not UTC -- that they are no timezone at all.static final String
The name of the attribute that indicates that a table is flat.static final double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.arrow.vector.types.pojo.Field
arrowFieldFor
(String name, Class<?> type, Class<?> componentType, Map<String, String> metadata, boolean columnAsList) attributesToMetadata
(@NotNull Map<String, Object> attributes) attributesToMetadata
(@NotNull Map<String, Object> attributes, boolean isFlat) static Stream<org.apache.arrow.vector.types.pojo.Field>
columnDefinitionsToFields
(@NotNull Map<String, String> columnDescriptions, @Nullable InputTableUpdater inputTableUpdater, @NotNull TableDefinition tableDefinition, @NotNull Collection<ColumnDefinition<?>> columnDefinitions, @NotNull Function<String, Map<String, String>> fieldMetadataFactory, @NotNull Map<String, Object> attributes) static Stream<org.apache.arrow.vector.types.pojo.Field>
columnDefinitionsToFields
(@NotNull Map<String, String> columnDescriptions, @Nullable InputTableUpdater inputTableUpdater, @NotNull TableDefinition tableDefinition, @NotNull Collection<ColumnDefinition<?>> columnDefinitions, @NotNull Function<String, Map<String, String>> fieldMetadataFactory, @NotNull Map<String, Object> attributes, boolean columnsAsList) convertArrowSchema
(org.apache.arrow.flatbuf.Schema schema) convertArrowSchema
(org.apache.arrow.vector.types.pojo.Schema schema) static TableDefinition
static void
createAndSendSnapshot
(BarrageMessageWriter.Factory bwmFactory, BaseTable<?> table, BitSet columns, RowSet viewport, boolean reverseViewport, BarrageSnapshotOptions options, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, BarragePerformanceLog.SnapshotMetricsHelper metrics) static void
createAndSendStaticSnapshot
(BarrageMessageWriter.Factory bmwFactory, BaseTable<?> table, BitSet columns, RowSet viewport, boolean reverseViewport, BarrageSnapshotOptions snapshotRequestOptions, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, BarragePerformanceLog.SnapshotMetricsHelper metrics) static byte[]
createSerializationOptionsMetadataBytes
(@org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable BarrageSubscriptionOptions options) Create a snapshot request payload to be sent via DoExchange.static byte[]
createSnapshotRequestMetadataBytes
(@org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable BarrageSnapshotOptions options) Create a snapshot request payload to be sent via DoExchange.static byte[]
createSnapshotRequestMetadataBytes
(@org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable BarrageSnapshotOptions options, @Nullable RowSet viewport, @Nullable BitSet columns, boolean reverseViewport) Create a subscription request payload to be sent via DoExchange.static byte[]
createSubscriptionRequestMetadataBytes
(@org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable BarrageSubscriptionOptions options) Create a subscription request payload to be sent via DoExchange.static byte[]
createSubscriptionRequestMetadataBytes
(@org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable BarrageSubscriptionOptions options, @Nullable RowSet viewport, @Nullable BitSet columns, boolean reverseViewport) Create a subscription request payload to be sent via DoExchange.static org.apache.arrow.flatbuf.Field
flatbufFieldFor
(ColumnDefinition<?> columnDefinition, Map<String, String> metadata) static org.apache.arrow.flatbuf.Field
static BarrageTypeInfo<org.apache.arrow.vector.types.pojo.Field>
getDefaultType
(@NotNull org.apache.arrow.vector.types.pojo.Field field) static org.apache.arrow.vector.types.pojo.Schema
makeSchema
(@NotNull BarrageOptions options, @NotNull TableDefinition tableDefinition, @NotNull Map<String, Object> attributes, boolean isFlat) static int
makeTableSchemaPayload
(@NotNull com.google.flatbuffers.FlatBufferBuilder builder, @NotNull BarrageOptions options, @NotNull TableDefinition tableDefinition, @NotNull Map<String, Object> attributes, boolean isFlat) static void
static com.google.protobuf.ByteString
schemaBytes
(@NotNull ToIntFunction<com.google.flatbuffers.FlatBufferBuilder> schemaPayloadWriter) static com.google.protobuf.ByteString
schemaBytesFromTable
(@NotNull Table table) static com.google.protobuf.ByteString
schemaBytesFromTableDefinition
(@NotNull TableDefinition tableDefinition, @NotNull Map<String, Object> attributes, boolean isFlat) static org.apache.arrow.vector.types.pojo.Schema
schemaFromTable
(@NotNull Table table) static org.apache.arrow.vector.types.pojo.Schema
toSchema
(TableDefinition definition, Map<String, Object> attributes, boolean isFlat)
-
Field Details
-
DEFAULT_SUBSCRIPTION_OPTIONS
-
DEFAULT_SNAPSHOT_OPTIONS
-
FLATBUFFER_MAGIC
public static final long FLATBUFFER_MAGIC- See Also:
-
TARGET_SNAPSHOT_PERCENTAGE
public static final double TARGET_SNAPSHOT_PERCENTAGE -
MIN_SNAPSHOT_CELL_COUNT
public static final long MIN_SNAPSHOT_CELL_COUNT -
MAX_SNAPSHOT_CELL_COUNT
public static final long MAX_SNAPSHOT_CELL_COUNT -
NANO_SINCE_EPOCH_TYPE
public static final org.apache.arrow.vector.types.pojo.ArrowType.Timestamp NANO_SINCE_EPOCH_TYPENote that arrow's wire format states that Timestamps without timezones are not UTC -- that they are no timezone at all. It's very important that we mark these times as UTC. -
TABLE_ATTRIBUTE_IS_FLAT
The name of the attribute that indicates that a table is flat.- See Also:
-
ATTR_DH_PREFIX
The Apache Arrow metadata prefix for Deephaven attributes.- See Also:
-
ATTR_TYPE_TAG
The deephaven metadata tag to indicate the deephaven column type.- See Also:
-
ATTR_COMPONENT_TYPE_TAG
The deephaven metadata tag to indicate the deephaven column component type.- See Also:
-
-
Constructor Details
-
BarrageUtil
public BarrageUtil()
-
-
Method Details
-
createSubscriptionRequestMetadataBytes
public static byte[] createSubscriptionRequestMetadataBytes(@NotNull @org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable @Nullable BarrageSubscriptionOptions options) Create a subscription request payload to be sent via DoExchange.- Parameters:
ticketId
- the ticket id of the table to subscribe tooptions
- the barrage options- Returns:
- the subscription request payload
-
createSubscriptionRequestMetadataBytes
public static byte[] createSubscriptionRequestMetadataBytes(@NotNull @org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable @Nullable BarrageSubscriptionOptions options, @Nullable @Nullable RowSet viewport, @Nullable @Nullable BitSet columns, boolean reverseViewport) Create a subscription request payload to be sent via DoExchange.- Parameters:
ticketId
- the ticket id of the table to subscribe tooptions
- the barrage optionsviewport
- the viewport to subscribe tocolumns
- the columns to subscribe toreverseViewport
- whether to reverse the viewport- Returns:
- the subscription request payload
-
createSnapshotRequestMetadataBytes
public static byte[] createSnapshotRequestMetadataBytes(@NotNull @org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable @Nullable BarrageSnapshotOptions options) Create a snapshot request payload to be sent via DoExchange.- Parameters:
ticketId
- the ticket id of the table to subscribe tooptions
- the barrage options- Returns:
- the subscription request payload
-
createSnapshotRequestMetadataBytes
public static byte[] createSnapshotRequestMetadataBytes(@NotNull @org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable @Nullable BarrageSnapshotOptions options, @Nullable @Nullable RowSet viewport, @Nullable @Nullable BitSet columns, boolean reverseViewport) Create a subscription request payload to be sent via DoExchange.- Parameters:
ticketId
- the ticket id of the table to subscribe tooptions
- the barrage optionsviewport
- the viewport to subscribe tocolumns
- the columns to subscribe toreverseViewport
- whether to reverse the viewport- Returns:
- the subscription request payload
-
createSerializationOptionsMetadataBytes
public static byte[] createSerializationOptionsMetadataBytes(@NotNull @org.jetbrains.annotations.NotNull byte[] ticketId, @Nullable @Nullable BarrageSubscriptionOptions options) Create a snapshot request payload to be sent via DoExchange.- Parameters:
ticketId
- the ticket id of the table to subscribe tooptions
- the barrage options- Returns:
- the subscription request payload
-
schemaBytesFromTable
-
schemaBytesFromTableDefinition
public static com.google.protobuf.ByteString schemaBytesFromTableDefinition(@NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Map<String, Object> attributes, boolean isFlat) -
schemaFromTable
public static org.apache.arrow.vector.types.pojo.Schema schemaFromTable(@NotNull @NotNull Table table) -
toSchema
public static org.apache.arrow.vector.types.pojo.Schema toSchema(TableDefinition definition, Map<String, Object> attributes, boolean isFlat) -
schemaBytes
public static com.google.protobuf.ByteString schemaBytes(@NotNull @NotNull ToIntFunction<com.google.flatbuffers.FlatBufferBuilder> schemaPayloadWriter) -
makeTableSchemaPayload
public static int makeTableSchemaPayload(@NotNull @NotNull com.google.flatbuffers.FlatBufferBuilder builder, @NotNull @NotNull BarrageOptions options, @NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Map<String, Object> attributes, boolean isFlat) -
makeSchema
public static org.apache.arrow.vector.types.pojo.Schema makeSchema(@NotNull @NotNull BarrageOptions options, @NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Map<String, Object> attributes, boolean isFlat) -
attributesToMetadata
-
attributesToMetadata
-
columnDefinitionsToFields
public static Stream<org.apache.arrow.vector.types.pojo.Field> columnDefinitionsToFields(@NotNull @NotNull Map<String, String> columnDescriptions, @Nullable @Nullable InputTableUpdater inputTableUpdater, @NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Collection<ColumnDefinition<?>> columnDefinitions, @NotNull @NotNull Function<String, Map<String, String>> fieldMetadataFactory, @NotNull @NotNull Map<String, Object> attributes) -
columnDefinitionsToFields
public static Stream<org.apache.arrow.vector.types.pojo.Field> columnDefinitionsToFields(@NotNull @NotNull Map<String, String> columnDescriptions, @Nullable @Nullable InputTableUpdater inputTableUpdater, @NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Collection<ColumnDefinition<?>> columnDefinitions, @NotNull @NotNull Function<String, Map<String, String>> fieldMetadataFactory, @NotNull @NotNull Map<String, Object> attributes, boolean columnsAsList) -
putMetadata
-
getDefaultType
public static BarrageTypeInfo<org.apache.arrow.vector.types.pojo.Field> getDefaultType(@NotNull @NotNull org.apache.arrow.vector.types.pojo.Field field) -
convertTableDefinition
-
convertArrowSchema
public static BarrageUtil.ConvertedArrowSchema convertArrowSchema(ExportedTableCreationResponse response) -
convertArrowSchema
public static BarrageUtil.ConvertedArrowSchema convertArrowSchema(org.apache.arrow.flatbuf.Schema schema) -
convertArrowSchema
public static BarrageUtil.ConvertedArrowSchema convertArrowSchema(org.apache.arrow.vector.types.pojo.Schema schema) -
arrowFieldFor
-
flatbufFieldFor
public static org.apache.arrow.flatbuf.Field flatbufFieldFor(ColumnDefinition<?> columnDefinition, Map<String, String> metadata) -
flatbufFieldFor
-
createAndSendStaticSnapshot
public static void createAndSendStaticSnapshot(BarrageMessageWriter.Factory bmwFactory, BaseTable<?> table, BitSet columns, RowSet viewport, boolean reverseViewport, BarrageSnapshotOptions snapshotRequestOptions, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, BarragePerformanceLog.SnapshotMetricsHelper metrics) -
createAndSendSnapshot
public static void createAndSendSnapshot(BarrageMessageWriter.Factory bwmFactory, BaseTable<?> table, BitSet columns, RowSet viewport, boolean reverseViewport, BarrageSnapshotOptions options, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, BarragePerformanceLog.SnapshotMetricsHelper metrics)
-