当前位置: 首页>>代码示例>>Java>>正文


Java BatchMutation类代码示例

本文整理汇总了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;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:TestThriftServer.java

示例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;
}
 
开发者ID:apache,项目名称:hbase,代码行数:28,代码来源:TestThriftServer.java

示例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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:ThriftServerRunner.java

示例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);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:6,代码来源:ThriftServer.java


注:本文中的org.apache.hadoop.hbase.thrift.generated.BatchMutation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。