org.apache.hadoop.hbase.client.Increment.getFamilyCellMap()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.apache.hadoop.hbase.client.Increment.getFamilyCellMap()方法的一些代码示例,展示了Increment.getFamilyCellMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Increment.getFamilyCellMap()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Increment
类名称:Increment
方法名:getFamilyCellMap

Increment.getFamilyCellMap介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

out.setDurability(durabilityFromHBase(in.getDurability()));
for (Map.Entry<byte [], List<Cell>> entry : in.getFamilyCellMap().entrySet()) {
 byte[] family = entry.getKey();
 for (Cell cell : entry.getValue()) {

代码示例来源:origin: apache/hbase

@Override
public Result preIncrementAfterRowLock(final ObserverContext<RegionCoprocessorEnvironment> c,
  final Increment increment) throws IOException {
 if (increment.getAttribute(CHECK_COVERING_PERM) != null) {
  // We had failure with table, cf and q perm checks and now giving a chance for cell
  // perm check
  TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
  AuthResult authResult = null;
  User user = getActiveUser(c);
  if (checkCoveringPermission(user, OpType.INCREMENT, c.getEnvironment(), increment.getRow(),
    increment.getFamilyCellMap(), increment.getTimeRange().getMax(), Action.WRITE)) {
   authResult = AuthResult.allow(OpType.INCREMENT.toString(), "Covering cell set",
     user, Action.WRITE, table, increment.getFamilyCellMap());
  } else {
   authResult = AuthResult.deny(OpType.INCREMENT.toString(), "Covering cell set",
     user, Action.WRITE, table, increment.getFamilyCellMap());
  }
  AccessChecker.logResult(authResult);
  if (authorizationEnabled && !authResult.isAllowed()) {
   throw new AccessDeniedException("Insufficient permissions " +
    authResult.toContextString());
  }
 }
 return null;
}

代码示例来源:origin: apache/hbase

Map<byte[],? extends Collection<Cell>> families = increment.getFamilyCellMap();
AuthResult authResult = permissionGranted(OpType.INCREMENT,
  user, env, families, Action.WRITE);
if (bytes != null) {
 if (cellFeaturesEnabled) {
  addCellPermissions(bytes, increment.getFamilyCellMap());
 } else {
  throw new DoNotRetryIOException("Cell ACLs cannot be persisted");

代码示例来源:origin: apache/hbase

@Override
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment)
  throws IOException {
 byte[] row = increment.getRow();
 Put put = new Put(row);
 long ts = getUniqueTimestamp(row);
 for (Map.Entry<byte[], List<Cell>> entry : increment.getFamilyCellMap().entrySet()) {
  for (Cell cell : entry.getValue()) {
   put.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(row)
     .setFamily(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength())
     .setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
      cell.getQualifierLength())
     .setValue(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
     .setType(Cell.Type.Put).setTimestamp(ts).build());
  }
 }
 c.getEnvironment().getRegion().put(put);
 c.bypass();
 return Result.EMPTY_RESULT;
}

代码示例来源:origin: apache/hbase

@Override
 public Result preIncrement(final ObserverContext<RegionCoprocessorEnvironment> e,
   final Increment increment) throws IOException {
  NavigableMap<byte [], List<Cell>> map = increment.getFamilyCellMap();
  for (Map.Entry<byte [], List<Cell>> entry : map.entrySet()) {
   for (Cell cell : entry.getValue()) {
    long incr = Bytes.toLong(cell.getValueArray(), cell.getValueOffset(),
      cell.getValueLength());
    if (incr == 10) {
     tr10 = increment.getTimeRange();
    } else if (incr == 2 && !increment.getTimeRange().isAllTime()) {
     tr2 = increment.getTimeRange();
    }
   }
  }
  return super.preIncrement(e, increment);
 }
}

代码示例来源:origin: apache/phoenix

Get get = new Get(row);
get.setTimeRange(tr.getMin(), tr.getMax());
for (Map.Entry<byte[], List<Cell>> entry : increment.getFamilyCellMap().entrySet()) {
  byte[] cf = entry.getKey();
  for (Cell cq : entry.getValue()) {
Put put = new Put(row, timestamp);
int numIncrementKVs = increment.getFamilyCellMap().get(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_FAMILY_BYTES).size();

代码示例来源:origin: harbby/presto-connectors

/**
 * Copy constructor
 * @param i
 */
public Increment(Increment i) {
 this.row = i.getRow();
 this.ts = i.getTimeStamp();
 this.tr = i.getTimeRange();
 this.familyMap.putAll(i.getFamilyCellMap());
 for (Map.Entry<String, byte[]> entry : i.getAttributesMap().entrySet()) {
  this.setAttribute(entry.getKey(), entry.getValue());
 }
}

代码示例来源:origin: cdapio/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: caskdata/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: cdapio/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: cdapio/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: caskdata/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: cdapio/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: caskdata/cdap

boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet());
if (!isIncrement || !transactional) {
 return null;

代码示例来源:origin: harbby/presto-connectors

@Override
public Result preIncrementAfterRowLock(final ObserverContext<RegionCoprocessorEnvironment> c,
  final Increment increment) throws IOException {
 if (increment.getAttribute(CHECK_COVERING_PERM) != null) {
  // We had failure with table, cf and q perm checks and now giving a chance for cell
  // perm check
  TableName table = c.getEnvironment().getRegion().getRegionInfo().getTable();
  AuthResult authResult = null;
  if (checkCoveringPermission(OpType.INCREMENT, c.getEnvironment(), increment.getRow(),
    increment.getFamilyCellMap(), increment.getTimeRange().getMax(), Action.WRITE)) {
   authResult = AuthResult.allow(OpType.INCREMENT.toString(), "Covering cell set",
     getActiveUser(), Action.WRITE, table, increment.getFamilyCellMap());
  } else {
   authResult = AuthResult.deny(OpType.INCREMENT.toString(), "Covering cell set",
     getActiveUser(), Action.WRITE, table, increment.getFamilyCellMap());
  }
  logResult(authResult);
  if (authorizationEnabled && !authResult.isAllowed()) {
   throw new AccessDeniedException("Insufficient permissions " +
    authResult.toContextString());
  }
 }
 return null;
}

代码示例来源:origin: harbby/presto-connectors

Map<byte[],? extends Collection<Cell>> families = increment.getFamilyCellMap();
AuthResult authResult = permissionGranted(OpType.INCREMENT, user, env, families,
 Action.WRITE);
if (bytes != null) {
 if (cellFeaturesEnabled) {
  addCellPermissions(bytes, increment.getFamilyCellMap());
 } else {
  throw new DoNotRetryIOException("Cell ACLs cannot be persisted");

代码示例来源:origin: com.aliyun.hbase/alihbase-examples

@Override
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment)
  throws IOException {
 byte[] row = increment.getRow();
 Put put = new Put(row);
 long ts = getUniqueTimestamp(row);
 for (Map.Entry<byte[], List<Cell>> entry : increment.getFamilyCellMap().entrySet()) {
  for (Cell cell : entry.getValue()) {
   put.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(row)
     .setFamily(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength())
     .setQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
      cell.getQualifierLength())
     .setValue(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
     .setType(Cell.Type.Put).setTimestamp(ts).build());
  }
 }
 c.getEnvironment().getRegion().put(put);
 c.bypass();
 return Result.EMPTY_RESULT;
}

代码示例来源:origin: org.apache.hbase/hbase-server

@Override
 public Result preIncrement(final ObserverContext<RegionCoprocessorEnvironment> e,
   final Increment increment) throws IOException {
  NavigableMap<byte [], List<Cell>> map = increment.getFamilyCellMap();
  for (Map.Entry<byte [], List<Cell>> entry : map.entrySet()) {
   for (Cell cell : entry.getValue()) {
    long incr = Bytes.toLong(cell.getValueArray(), cell.getValueOffset(),
      cell.getValueLength());
    if (incr == 10) {
     tr10 = increment.getTimeRange();
    } else if (incr == 2 && !increment.getTimeRange().isAllTime()) {
     tr2 = increment.getTimeRange();
    }
   }
  }
  return super.preIncrement(e, increment);
 }
}

代码示例来源:origin: harbby/presto-connectors

checkResources();
checkRow(mutation.getRow(), op.toString());
checkFamilies(mutation.getFamilyCellMap().keySet());
startRegionOperation(op);
this.writeRequestsCount.increment();

代码示例来源:origin: harbby/presto-connectors

for (Map.Entry<byte[], List<Cell>> family: increment.getFamilyCellMap().entrySet()) {
 columnBuilder.setFamily(ByteStringer.wrap(family.getKey()));
 columnBuilder.clearQualifierValue();

相关文章