Class ExportTicketHelper

java.lang.Object
io.deephaven.proto.util.ExportTicketHelper

public class ExportTicketHelper extends Object
  • Field Details

  • Constructor Details

    • ExportTicketHelper

      public ExportTicketHelper()
  • Method Details

    • wrapExportIdInTicket

      public static Ticket wrapExportIdInTicket(int exportId)
      Convenience method to convert from export id to Ticket.
      Parameters:
      exportId - the export id
      Returns:
      a grpc Ticket wrapping the export id
    • tableReference

      public static TableReference tableReference(int exportId)
      Convenience method to convert from export id to a ticket TableReference.
      Parameters:
      exportId - the export id
      Returns:
      a table reference
    • ticketToExportId

      public static int ticketToExportId(Ticket ticket, String logId)
      Convenience method to convert from Ticket 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 Ticket
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      the export id that the Ticket wraps
    • ticketToExportId

      public static int ticketToExportId(ByteBuffer ticket, String logId)
      Convenience method to convert from ByteBuffer to export id. Most efficient when ticket is ByteOrder.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
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      the export id that the Ticket wraps
    • wrapExportIdInTicket

      public static Ticket wrapExportIdInTicket(ByteBuffer ticket)
      Convenience method to convert from ByteBuffer to export ticket. Most efficient when ticket is ByteOrder.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

      public static String toReadableString(Ticket ticket, String logId)
      Convenience method to create a human readable string from the flight ticket.
      Parameters:
      ticket - the ticket to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a log-friendly string
    • toReadableString

      public static String toReadableString(TableReference tableReference, String logId)
      Convenience method to create a human readable string from a table reference.
      Parameters:
      tableReference - the table reference
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a log-friendly string
    • toReadableString

      public static String toReadableString(ByteBuffer ticket, String logId)
      Convenience method to create a human readable string from the flight ticket (as ByteBuffer). Most efficient when ticket is ByteOrder.LITTLE_ENDIAN.

      Does not consume the ticket.

      Parameters:
      ticket - the ticket to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a log-friendly string
    • toReadableString

      public static String toReadableString(int exportId)
      Convenience method to create a human readable string for the export ID.
      Parameters:
      exportId - the export ID
      Returns:
      a log-friendly string
    • exportIdToPath

      public static List<String> exportIdToPath(int exportId)
      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

      public static int ticketToExportIdInternal(ByteBuffer ticket, String logId)