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


Java MiniBatchOperationInProgress.getOperation方法代码示例

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


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

示例1: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
    MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException {
  Mutation mut = miniBatchOp.getOperation(0);

  if (mut instanceof Delete) {
    List<Cell> cells = mut.getFamilyCellMap().get(test);
    Delete[] deletes = new Delete[] {
        // delete only 2 rows
        new Delete(row1).addColumns(test, dummy, cells.get(0).getTimestamp()),
        new Delete(row2).addColumns(test, dummy, cells.get(0).getTimestamp()),
    };
    LOG.info("Deleting:" + Arrays.toString(deletes));
    miniBatchOp.addOperationsFromCP(0, deletes);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:TestRegionObserverForAddingMutationsFromCoprocessors.java

示例2: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
    MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException {
  if (cellFeaturesEnabled && !compatibleEarlyTermination) {
    TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
    for (int i = 0; i < miniBatchOp.size(); i++) {
      Mutation m = miniBatchOp.getOperation(i);
      if (m.getAttribute(CHECK_COVERING_PERM) != null) {
        // We have a failure with table, cf and q perm checks and now giving a chance for cell
        // perm check
        OpType opType;
        if (m instanceof Put) {
          checkForReservedTagPresence(getActiveUser(), m);
          opType = OpType.PUT;
        } else {
          opType = OpType.DELETE;
        }
        AuthResult authResult = null;
        if (checkCoveringPermission(opType, c.getEnvironment(), m.getRow(),
          m.getFamilyCellMap(), m.getTimeStamp(), Action.WRITE)) {
          authResult = AuthResult.allow(opType.toString(), "Covering cell set",
            getActiveUser(), Action.WRITE, table, m.getFamilyCellMap());
        } else {
          authResult = AuthResult.deny(opType.toString(), "Covering cell set",
            getActiveUser(), Action.WRITE, table, m.getFamilyCellMap());
        }
        logResult(authResult);
        if (authorizationEnabled && !authResult.isAllowed()) {
          throw new AccessDeniedException("Insufficient permissions "
            + authResult.toContextString());
        }
      }
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:36,代码来源:AccessController.java

示例3: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
    MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException {
  if (cellFeaturesEnabled && !compatibleEarlyTermination) {
    TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
    for (int i = 0; i < miniBatchOp.size(); i++) {
      Mutation m = miniBatchOp.getOperation(i);
      if (m.getAttribute(CHECK_COVERING_PERM) != null) {
        // We have a failure with table, cf and q perm checks and now giving a chance for cell
        // perm check
        OpType opType;
        if (m instanceof Put) {
          checkForReservedTagPresence(getActiveUser(), m);
          opType = OpType.PUT;
        } else {
          opType = OpType.DELETE;
        }
        AuthResult authResult = null;
        if (checkCoveringPermission(opType, c.getEnvironment(), m.getRow(), m.getFamilyCellMap(),
            m.getTimeStamp(), Action.WRITE)) {
          authResult = AuthResult.allow(opType.toString(), "Covering cell set", getActiveUser(),
              Action.WRITE, table, m.getFamilyCellMap());
        } else {
          authResult = AuthResult.deny(opType.toString(), "Covering cell set", getActiveUser(),
              Action.WRITE, table, m.getFamilyCellMap());
        }
        logResult(authResult);
        if (!authResult.isAllowed()) {
          throw new AccessDeniedException("Insufficient permissions "
              + authResult.toContextString());
        }
      }
    }
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:36,代码来源:AccessController.java

示例4: 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

示例5: preBatchMutate

import org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress; //导入方法依赖的package包/类
@Override
public void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
    MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException {
  if (cellFeaturesEnabled && !compatibleEarlyTermination) {
    TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
    User user = getActiveUser(c);
    for (int i = 0; i < miniBatchOp.size(); i++) {
      Mutation m = miniBatchOp.getOperation(i);
      if (m.getAttribute(CHECK_COVERING_PERM) != null) {
        // We have a failure with table, cf and q perm checks and now giving a chance for cell
        // perm check
        OpType opType;
        if (m instanceof Put) {
          checkForReservedTagPresence(user, m);
          opType = OpType.PUT;
        } else {
          opType = OpType.DELETE;
        }
        AuthResult authResult = null;
        if (checkCoveringPermission(user, opType, c.getEnvironment(), m.getRow(),
          m.getFamilyCellMap(), m.getTimeStamp(), Action.WRITE)) {
          authResult = AuthResult.allow(opType.toString(), "Covering cell set",
            user, Action.WRITE, table, m.getFamilyCellMap());
        } else {
          authResult = AuthResult.deny(opType.toString(), "Covering cell set",
            user, Action.WRITE, table, m.getFamilyCellMap());
        }
        AccessChecker.logResult(authResult);
        if (authorizationEnabled && !authResult.isAllowed()) {
          throw new AccessDeniedException("Insufficient permissions "
            + authResult.toContextString());
        }
      }
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:37,代码来源:AccessController.java


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