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


Java MiniBatchOperationInProgress.setOperationStatus方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress.setOperationStatus方法的典型用法代码示例。如果您正苦于以下问题:Java MiniBatchOperationInProgress.setOperationStatus方法的具体用法?Java MiniBatchOperationInProgress.setOperationStatus怎么用?Java MiniBatchOperationInProgress.setOperationStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress的用法示例。


在下文中一共展示了MiniBatchOperationInProgress.setOperationStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(final ObserverContext<RegionCoprocessorEnvironment> c,
                           final MiniBatchOperationInProgress<Mutation> miniBatchOp)
    throws IOException {
  if (ops.incrementAndGet() % 20000 == 0) {
    LOG.info("Wrote " + ops.get() + " times in region " + regionName);
  }

  for (int i = 0; i < miniBatchOp.size(); i++) {
    miniBatchOp.setOperationStatus(i,
        new OperationStatus(HConstants.OperationStatusCode.SUCCESS));
  }
  c.bypass();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:WriteSinkCoprocessor.java

示例2: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(final ObserverContext<RegionCoprocessorEnvironment> c,
                  final MiniBatchOperationInProgress<Pair<Mutation, Integer>> miniBatchOp)
    throws IOException {
  if (ops.incrementAndGet() % 20000 == 0) {
    LOG.info("Wrote " + ops.get() + " times in region " + regionName);
  }

  for (int i = 0; i < miniBatchOp.size(); i++) {
    miniBatchOp.setOperationStatus(i,
        new OperationStatus(HConstants.OperationStatusCode.SUCCESS));
  }
  c.bypass();
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:15,代码来源:WriteSinkCoprocessor.java

示例3: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(final ObserverContext<RegionCoprocessorEnvironment> ctx,
    final MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException {
  HRegionServer rs = (HRegionServer) ctx.getEnvironment().getRegionServerServices();
  HRegion userRegion = ctx.getEnvironment().getRegion();
  HTableDescriptor userTableDesc = userRegion.getTableDesc();
  String tableName = userTableDesc.getNameAsString();
  if (isNotIndexedTableDescriptor(userTableDesc)) {
    return;
  }
  List<IndexSpecification> indices = indexManager.getIndicesForTable(tableName);
  if (indices == null || indices.isEmpty()) {
    LOG.trace("skipping preBatchMutate for the table " + tableName + " as there are no indices");
    return;
  }
  LOG.trace("Entering preBatchMutate for the table " + tableName);
  LOG.trace("Indices for the table " + tableName + " are: " + indices);
  HRegion indexRegion = getIndexTableRegion(tableName, userRegion, rs);
  // Storing this found HRegion in the index table within the thread locale.
  IndexEdits indexEdits = threadLocal.get();
  indexEdits.indexRegion = indexRegion;
  for (int i = 0; i < miniBatchOp.size(); i++) {
    Mutation m = miniBatchOp.getOperation(i);
    if (m instanceof Put) {
      try {
        prepareIndexMutations(indices, userRegion, m, tableName, indexRegion);
      } catch (IOException e) {
        miniBatchOp.setOperationStatus(i, new OperationStatus(
            OperationStatusCode.SANITY_CHECK_FAILURE, e.getMessage()));
      }
    } else if (m instanceof Delete) {
      prepareIndexMutations(indices, userRegion, m, tableName, indexRegion);
    }
  }
  indexEdits.setUpdateLocked();
  indexRegion.updatesLock();
  LOG.trace("Exiting preBatchMutate for the table " + tableName);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:39,代码来源:IndexRegionObserver.java


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