Package io.deephaven.server.arrow
Interface ExchangeMarshaller
- All Known Implementing Classes:
HierarchicalTableViewExchangeMarshaller
,TableExchangeMarshaller
public interface ExchangeMarshaller
The ExchangeMarshaller is a pluggable component within
ArrowFlightUtil
that translated exported objects into
suitable Barrage messages. Only one marshaller may be responsible for each object. Each marshaller provides support
for snapshots and/or subscriptions.
Note: this interface is not yet stable.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
The return value from asubscribe(BarrageSubscriptionRequest, BarrageSubscriptionOptions, Object, StreamObserver)
call. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Does this marshaller accept the given export?static @Nullable ExchangeMarshaller
getMarshaller
(Object export, Collection<ExchangeMarshaller> marshallers) Given the ordered Collection ofExchangeMarshaller
s return the first marshaller that will accept the exported object.int
priority()
The priority of this marshaller.void
snapshot
(io.deephaven.barrage.flatbuf.BarrageSnapshotRequest snapshotRequest, BarrageSnapshotOptions options, Object export, BarragePerformanceLog.SnapshotMetricsHelper metrics, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, String ticketLogName, BarrageMessageWriter.Factory streamGeneratorFactory) Processes a snapshot request using the provided parameters.subscribe
(io.deephaven.barrage.flatbuf.BarrageSubscriptionRequest subscriptionRequest, BarrageSubscriptionOptions options, Object export, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener) Subscribes to a Barrage stream using the provided subscription request and options.
-
Method Details
-
getMarshaller
@Nullable static @Nullable ExchangeMarshaller getMarshaller(Object export, Collection<ExchangeMarshaller> marshallers) Given the ordered Collection ofExchangeMarshaller
s return the first marshaller that will accept the exported object. If no marshaller accepts the object, then null is returned.- Parameters:
export
- the object to be exportedmarshallers
- the ordered collection of marshallers- Returns:
- the first matching marshaller, or null if none exists
-
priority
int priority()The priority of this marshaller.All available marshallers are consulted in sequence, in ascending numerical priority. The first (lowest numerical priority) marshaller to accept an object is used.
- Returns:
- the priority of this marshaller
-
accept
Does this marshaller accept the given export?- Parameters:
export
- the object to test- Returns:
- true if this marshaller should be used, false to use the remainder of the marshaller chain
-
snapshot
void snapshot(io.deephaven.barrage.flatbuf.BarrageSnapshotRequest snapshotRequest, BarrageSnapshotOptions options, Object export, BarragePerformanceLog.SnapshotMetricsHelper metrics, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener, String ticketLogName, BarrageMessageWriter.Factory streamGeneratorFactory) Processes a snapshot request using the provided parameters.- Parameters:
snapshotRequest
- the request specifying details for the snapshot operationoptions
- the configuration options for the snapshot, such as batch size or message size limitsexport
- the object to be exported as part of the snapshotmetrics
- helper for recording and reporting snapshot performance metricslistener
- the observer to handle messages generated during the snapshot processticketLogName
- the name of the ticket log associated with the snapshot requeststreamGeneratorFactory
- the factory to generate message streams for the snapshot operation
-
subscribe
ExchangeMarshaller.Subscription subscribe(io.deephaven.barrage.flatbuf.BarrageSubscriptionRequest subscriptionRequest, BarrageSubscriptionOptions options, Object export, io.grpc.stub.StreamObserver<BarrageMessageWriter.MessageView> listener) Subscribes to a Barrage stream using the provided subscription request and options.- Parameters:
subscriptionRequest
- the request specifying the details of the subscriptionoptions
- the options to configure the subscriptionexport
- the exported object to be subscribedlistener
- the listener to handle messages generated by the subscription- Returns:
- a Subscription object to manage the lifecycle of the Barrage subscription
-