Package com.twilio.kudu.sql.mutation
Class MutationState
java.lang.Object
com.twilio.kudu.sql.mutation.MutationState
- Direct Known Subclasses:
CubeMutationState
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CalciteModifiableKuduTable
protected final org.apache.kudu.client.KuduTable
protected final org.apache.kudu.client.KuduSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the cube mutation state (and thus frees up memory)void
flush()
int
Mutate Kudu table usingObject
.int
mutateTuples
(List<Integer> columnIndexes, List<List<org.apache.calcite.rex.RexLiteral>> tuples) Mutate Kudu table usingRexLiteral
.protected void
updateMutationState
(Map<Integer, Object> colIndexToValueMap) Creates a mutation for the row being inserted and adds it to the kudu session.
-
Field Details
-
calciteModifiableKuduTable
-
kuduTable
protected final org.apache.kudu.client.KuduTable kuduTable -
session
protected final org.apache.kudu.client.KuduSession session
-
-
Constructor Details
-
MutationState
-
-
Method Details
-
mutateTuples
public int mutateTuples(List<Integer> columnIndexes, List<List<org.apache.calcite.rex.RexLiteral>> tuples) Mutate Kudu table usingRexLiteral
. Called while using a regular Statement- Parameters:
columnIndexes
- the kudu indexes to mutatetuples
- a collection of rows to insert- Returns:
- number of rows inserted
-
mutateRow
Mutate Kudu table usingObject
.- Parameters:
columnIndexes
- the kudu indexes to mutatevalues
- a collection of rows to insert- Returns:
- number of rows inserted
-
updateMutationState
Creates a mutation for the row being inserted and adds it to the kudu session. Also callsupdateMutationState()
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)
-