本文整理汇总了Java中org.apache.hadoop.hbase.thrift.generated.BatchMutation类的典型用法代码示例。如果您正苦于以下问题:Java BatchMutation类的具体用法?Java BatchMutation怎么用?Java BatchMutation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BatchMutation类属于org.apache.hadoop.hbase.thrift.generated包,在下文中一共展示了BatchMutation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBatchMutations
import org.apache.hadoop.hbase.thrift.generated.BatchMutation; //导入依赖的package包/类
/**
*
* @return a List of BatchMutations with the following effects:
* (rowA, columnA): delete
* (rowA, columnB): place valueC
* (rowB, columnA): place valueC
* (rowB, columnB): place valueD
*/
private static List<BatchMutation> getBatchMutations() {
List<BatchMutation> batchMutations = new ArrayList<BatchMutation>();
// Mutations to rowA. You can't mix delete and put anymore.
List<Mutation> rowAmutations = new ArrayList<Mutation>();
rowAmutations.add(new Mutation(true, columnAname, null, true));
batchMutations.add(new BatchMutation(rowAname, rowAmutations));
rowAmutations = new ArrayList<Mutation>();
rowAmutations.add(new Mutation(false, columnBname, valueCname, true));
batchMutations.add(new BatchMutation(rowAname, rowAmutations));
// Mutations to rowB
List<Mutation> rowBmutations = new ArrayList<Mutation>();
rowBmutations.add(new Mutation(false, columnAname, valueCname, true));
rowBmutations.add(new Mutation(false, columnBname, valueDname, true));
batchMutations.add(new BatchMutation(rowBname, rowBmutations));
return batchMutations;
}
示例2: getBatchMutations
import org.apache.hadoop.hbase.thrift.generated.BatchMutation; //导入依赖的package包/类
/**
* @return a List of BatchMutations with the following effects:
* (rowA, columnA): delete
* (rowA, columnB): place valueC
* (rowB, columnA): place valueC
* (rowB, columnB): place valueD
*/
private static List<BatchMutation> getBatchMutations() {
List<BatchMutation> batchMutations = new ArrayList<>(3);
// Mutations to rowA. You can't mix delete and put anymore.
List<Mutation> rowAmutations = new ArrayList<>(1);
rowAmutations.add(new Mutation(true, columnAname, null, true));
batchMutations.add(new BatchMutation(rowAname, rowAmutations));
rowAmutations = new ArrayList<>(1);
rowAmutations.add(new Mutation(false, columnBname, valueCname, true));
batchMutations.add(new BatchMutation(rowAname, rowAmutations));
// Mutations to rowB
List<Mutation> rowBmutations = new ArrayList<>(2);
rowBmutations.add(new Mutation(false, columnAname, valueCname, true));
rowBmutations.add(new Mutation(false, columnBname, valueDname, true));
batchMutations.add(new BatchMutation(rowBname, rowBmutations));
return batchMutations;
}
示例3: mutateRows
import org.apache.hadoop.hbase.thrift.generated.BatchMutation; //导入依赖的package包/类
@Override
public void mutateRows(ByteBuffer tableName, List<BatchMutation> rowBatches,
Map<ByteBuffer, ByteBuffer> attributes)
throws IOError, IllegalArgument, TException {
mutateRowsTs(tableName, rowBatches, HConstants.LATEST_TIMESTAMP, attributes);
}
示例4: mutateRows
import org.apache.hadoop.hbase.thrift.generated.BatchMutation; //导入依赖的package包/类
@Override
public void mutateRows(ByteBuffer tableName, List<BatchMutation> rowBatches)
throws IOError, IllegalArgument, TException {
mutateRowsTs(tableName, rowBatches, HConstants.LATEST_TIMESTAMP);
}