Package io.deephaven.proto.util
Class ExportTicketHelper
java.lang.Object
io.deephaven.proto.util.ExportTicketHelper
-
Field Summary
-
Constructor Summary
-
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 TableReference
tableReference
(int exportId) Convenience method to convert from export id to a ticketTableReference
.static int
ticketToExportId
(Ticket ticket, String logId) Convenience method to convert fromTicket
to export id.static int
ticketToExportId
(ByteBuffer ticket, String logId) Convenience method to convert fromByteBuffer
to export id.static int
ticketToExportIdInternal
(ByteBuffer ticket, String logId) static String
toReadableString
(int exportId) Convenience method to create a human readable string for the export ID.static String
toReadableString
(TableReference tableReference, String logId) Convenience method to create a human readable string from a table reference.static String
toReadableString
(Ticket ticket, String logId) Convenience method to create a human readable string from the flight ticket.static String
toReadableString
(ByteBuffer ticket, String logId) Convenience method to create a human readable string from the flight ticket (as ByteBuffer).static Ticket
wrapExportIdInTicket
(int exportId) Convenience method to convert from export id toTicket
.static Ticket
wrapExportIdInTicket
(ByteBuffer ticket) Convenience method to convert fromByteBuffer
to 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 fromTicket
to 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 fromByteBuffer
to export id. Most efficient whenticket
isByteOrder.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 fromByteBuffer
to export ticket. Most efficient whenticket
isByteOrder.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 whenticket
isByteOrder.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
-