out.setDurability(durabilityFromHBase(in.getDurability())); for (Map.Entry<byte [], List<Cell>> entry : in.getFamilyCellMap().entrySet()) { byte[] family = entry.getKey(); for (Cell cell : entry.getValue()) {
@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; }
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");
@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; }
@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); } }
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();
/** * 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()); } }
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
boolean transactional = state.containsTransactionalFamily(increment.getFamilyCellMap().keySet()); if (!isIncrement || !transactional) { return null;
@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; }
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");
@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; }
@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); } }
checkResources(); checkRow(mutation.getRow(), op.toString()); checkFamilies(mutation.getFamilyCellMap().keySet()); startRegionOperation(op); this.writeRequestsCount.increment();
for (Map.Entry<byte[], List<Cell>> family: increment.getFamilyCellMap().entrySet()) { columnBuilder.setFamily(ByteStringer.wrap(family.getKey())); columnBuilder.clearQualifierValue();