Package io.deephaven.proto.util
Class ExportTicketHelper
java.lang.Object
io.deephaven.proto.util.ExportTicketHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]exportIdToBytes(int exportId) Convenience method to create the flight ticket bytes for the export ID.exportIdToPath(int exportId) Convenience method to create the flight descriptor path for the export ID.static TableReferencetableReference(int exportId) Convenience method to convert from export id to a ticketTableReference.static intticketToExportId(Ticket ticket, String logId) Convenience method to convert fromTicketto export id.static intticketToExportId(ByteBuffer ticket, String logId) Convenience method to convert fromByteBufferto export id.static intticketToExportIdInternal(ByteBuffer ticket, String logId) static StringtoReadableString(int exportId) Convenience method to create a human readable string for the export ID.static StringtoReadableString(TableReference tableReference, String logId) Convenience method to create a human readable string from a table reference.static StringtoReadableString(Ticket ticket, String logId) Convenience method to create a human readable string from the flight ticket.static StringtoReadableString(ByteBuffer ticket, String logId) Convenience method to create a human readable string from the flight ticket (as ByteBuffer).static TicketwrapExportIdInTicket(int exportId) Convenience method to convert from export id toTicket.static TicketwrapExportIdInTicket(ByteBuffer ticket) Convenience method to convert fromByteBufferto export ticket.
-
Field Details
-
TICKET_PREFIX
public static final byte TICKET_PREFIX- See Also:
-
FLIGHT_DESCRIPTOR_ROUTE
- See Also:
-
-
Constructor Details
-
ExportTicketHelper
public ExportTicketHelper()
-
-
Method Details
-
wrapExportIdInTicket
Convenience method to convert from export id toTicket.- Parameters:
exportId- the export id- Returns:
- a grpc Ticket wrapping the export id
-
tableReference
Convenience method to convert from export id to a ticketTableReference.- Parameters:
exportId- the export id- Returns:
- a table reference
-
ticketToExportId
Convenience method to convert fromTicketto export id.Ticket's byte[0] must be
TICKET_PREFIX, bytes[1-4] are a signed int export id in little-endian.- Parameters:
ticket- the grpc TicketlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- the export id that the Ticket wraps
-
ticketToExportId
Convenience method to convert fromByteBufferto export id. Most efficient whenticketisByteOrder.LITTLE_ENDIAN.Ticket's byte[0] must be
TICKET_PREFIX, bytes[1-4] are a signed int export id in little-endian.Does not consume the
ticket.- Parameters:
ticket- the grpc TicketlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- the export id that the Ticket wraps
-
wrapExportIdInTicket
Convenience method to convert fromByteBufferto export ticket. Most efficient whenticketisByteOrder.LITTLE_ENDIAN.Ticket's byte[0] must be
TICKET_PREFIX, bytes[1-4] are a signed int export id in little-endian.Does not consume the
ticket.- Parameters:
ticket- the grpc Ticket- Returns:
- the export id that the Ticket wraps
-
toReadableString
Convenience method to create a human readable string from the flight ticket.- Parameters:
ticket- the ticket to convertlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- a log-friendly string
-
toReadableString
Convenience method to create a human readable string from a table reference.- Parameters:
tableReference- the table referencelogId- an end-user friendly identification of the ticket should an error occur- Returns:
- a log-friendly string
-
toReadableString
Convenience method to create a human readable string from the flight ticket (as ByteBuffer). Most efficient whenticketisByteOrder.LITTLE_ENDIAN.Does not consume the
ticket.- Parameters:
ticket- the ticket to convertlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- a log-friendly string
-
toReadableString
Convenience method to create a human readable string for the export ID.- Parameters:
exportId- the export ID- Returns:
- a log-friendly string
-
exportIdToPath
Convenience method to create the flight descriptor path for the export ID.- Parameters:
exportId- the export ID- Returns:
- the path
-
exportIdToBytes
public static byte[] exportIdToBytes(int exportId) Convenience method to create the flight ticket bytes for the export ID.- Parameters:
exportId- the export ID- Returns:
- the ticket bytes
-
ticketToExportIdInternal
-