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.

  • Method Details

    • getMarshaller

      @Nullable static @Nullable ExchangeMarshaller getMarshaller(Object export, Collection<ExchangeMarshaller> marshallers)
      Given the ordered Collection of ExchangeMarshallers 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 exported
      marshallers - 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

      boolean accept(Object export)
      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 operation
      options - the configuration options for the snapshot, such as batch size or message size limits
      export - the object to be exported as part of the snapshot
      metrics - helper for recording and reporting snapshot performance metrics
      listener - the observer to handle messages generated during the snapshot process
      ticketLogName - the name of the ticket log associated with the snapshot request
      streamGeneratorFactory - 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 subscription
      options - the options to configure the subscription
      export - the exported object to be subscribed
      listener - the listener to handle messages generated by the subscription
      Returns:
      a Subscription object to manage the lifecycle of the Barrage subscription