Search in sources :

Example 11 with IndexUpdate

use of org.apache.phoenix.hbase.index.covered.IndexUpdate in project phoenix by apache.

the class PhoenixTxIndexMutationGenerator method generatePuts.

private boolean generatePuts(PhoenixIndexMetaData indexMetaData, Collection<Pair<Mutation, byte[]>> indexUpdates, TxTableState state) throws IOException {
    state.applyMutation();
    Iterable<IndexUpdate> puts = codec.getIndexUpserts(state, indexMetaData);
    boolean validPut = false;
    for (IndexUpdate put : puts) {
        if (put.isValid()) {
            indexUpdates.add(new Pair<Mutation, byte[]>(put.getUpdate(), put.getTableName()));
            validPut = true;
        }
    }
    return validPut;
}
Also used : IndexUpdate(org.apache.phoenix.hbase.index.covered.IndexUpdate) Mutation(org.apache.hadoop.hbase.client.Mutation) MultiMutation(org.apache.phoenix.hbase.index.MultiMutation)

Aggregations

IndexUpdate (org.apache.phoenix.hbase.index.covered.IndexUpdate)11 ArrayList (java.util.ArrayList)4 Mutation (org.apache.hadoop.hbase.client.Mutation)4 MultiMutation (org.apache.phoenix.hbase.index.MultiMutation)4 LocalTableState (org.apache.phoenix.hbase.index.covered.LocalTableState)4 Delete (org.apache.hadoop.hbase.client.Delete)3 Put (org.apache.hadoop.hbase.client.Put)3 IOException (java.io.IOException)2 List (java.util.List)2 Result (org.apache.hadoop.hbase.client.Result)2 ImmutableBytesWritable (org.apache.hadoop.hbase.io.ImmutableBytesWritable)2 ValueGetter (org.apache.phoenix.hbase.index.ValueGetter)2 LocalHBaseState (org.apache.phoenix.hbase.index.covered.data.LocalHBaseState)2 Scanner (org.apache.phoenix.hbase.index.scanner.Scanner)2 Configuration (org.apache.hadoop.conf.Configuration)1 KeyValue (org.apache.hadoop.hbase.KeyValue)1 RegionCoprocessorEnvironment (org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment)1 ColumnReference (org.apache.phoenix.hbase.index.covered.update.ColumnReference)1 Test (org.junit.Test)1