Interface CommandResolver

All Superinterfaces:
TicketResolver
All Known Implementing Classes:
FlightSqlResolver

public interface CommandResolver extends TicketResolver
A specialization of TicketResolver that signifies this resolver supports Flight descriptor commands.

Unfortunately, there is no universal way to know whether a command belongs to a given Flight protocol or not; at best, we can assume (or mandate) that all the supportable command bytes are sufficiently unique such that there is no potential for overlap amongst the installed Flight protocols.

For example there could be command protocols built on top of Flight that simply use integer ordinals as their command serialization format. In such a case, only one such protocol could safely be installed; otherwise, there would be no reliable way of differentiating between them from the command bytes. (It's possible that other means of differentiating could be established, like header values.)

If Deephaven is in a position to create a protocol that uses Flight commands, or advise on their creation, it would probably be wise to use a command serialization format that has a "unique" magic value as its prefix.

The Flight SQL approach is to use the protobuf message Any to wrap up the respective protobuf Flight SQL command message. While this approach is very likely to produce a sufficiently unique selection criteria, it requires "non-trivial" parsing to determine whether the command is supported or not.

  • Method Details

    • handlesCommand

      boolean handlesCommand(org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor)
      Returns true if this resolver is responsible for handling the descriptor command. Implementations should prefer to return true here if they know the command is in their domain even if they don't implement it; this allows them to provide a more specific error message for unsupported commands.
      Parameters:
      descriptor - the descriptor
      Returns:
      true if this resolver handles the descriptor command