Class MutationState

java.lang.Object
com.twilio.kudu.sql.mutation.MutationState
Direct Known Subclasses:
CubeMutationState

public class MutationState extends Object
  • Field Details

    • calciteModifiableKuduTable

      protected final CalciteModifiableKuduTable calciteModifiableKuduTable
    • kuduTable

      protected final org.apache.kudu.client.KuduTable kuduTable
    • session

      protected final org.apache.kudu.client.KuduSession session
  • Constructor Details

  • Method Details

    • mutateTuples

      public int mutateTuples(List<Integer> columnIndexes, List<List<org.apache.calcite.rex.RexLiteral>> tuples)
      Mutate Kudu table using RexLiteral. Called while using a regular Statement
      Parameters:
      columnIndexes - the kudu indexes to mutate
      tuples - a collection of rows to insert
      Returns:
      number of rows inserted
    • mutateRow

      public int mutateRow(List<Integer> columnIndexes, List<Object> values)
      Mutate Kudu table using Object.
      Parameters:
      columnIndexes - the kudu indexes to mutate
      values - a collection of rows to insert
      Returns:
      number of rows inserted
    • updateMutationState

      protected void updateMutationState(Map<Integer,Object> colIndexToValueMap)
      Creates a mutation for the row being inserted and adds it to the kudu session. Also calls updateMutationState() for all cube tables (if any exist).
      Parameters:
      colIndexToValueMap - Kudu index to new value mapping
    • flush

      public void flush()
    • clear

      public void clear()
      Clears the cube mutation state (and thus frees up memory)