Class CalciteScannerMessage<T>

java.lang.Object
com.twilio.kudu.sql.CalciteScannerMessage<T>
Type Parameters:
T - The Calcite type. For multicolumn rows it is an Object[] for single it is Object

public final class CalciteScannerMessage<T> extends Object
Message object represents a Message from an active scanner. There are multiple types defined in CalciteScannerMessage.MessageType and each consumer is expected handle each type. Types are 1. ROW -- contains a row 2. CLOSE -- scanner is closing so shouldn't expect any more ROW 3. ERROR -- scanner failed in some manner, contains a failure. When an ERROR message is received, the producer needs to produce a CLOSE message just after. ERROR message is not terminal, only CLOSE is terminal We use this in a Queue as the only synchronization and shared state between a ScannerCallback and CalciteKuduEnumerable. A Queue with heterogeneous messages is the only solution we were able to make work. Using a queue and another synchronization object did not work.
  • Field Details

  • Constructor Details

    • CalciteScannerMessage

      public CalciteScannerMessage(Exception failure)
      Construct a Scanner Message that contains an exception. When this message is consumed the consumer is _expected_ to throw the exception.
      Parameters:
      failure - the exception this message represents
    • CalciteScannerMessage

      public CalciteScannerMessage(T row)
      Constructs a Scanner Message that contains a row. Row must by nonNull
      Parameters:
      row - the T that should be consumed.
    • CalciteScannerMessage

      public CalciteScannerMessage(ScannerCallback callback)
      Constructs a Batch Completed Scanner Message.
      Parameters:
      callback - the ScannerCallback that completed it's batch
  • Method Details