@Override public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<Cell> results) throws IOException { LOG.debug("Got preGet for row: " + Bytes.toStringBinary(get.getRow())); // vv RegionObserverWithCompleteExample if (Bytes.equals(get.getRow(), FIXED_ROW)) { long time = System.currentTimeMillis(); Cell cell = CellUtil.createCell(get.getRow(), FIXED_ROW, FIXED_ROW, time, KeyValue.Type.Put.getCode(), Bytes.toBytes(time)); // ^^ RegionObserverWithCompleteExample LOG.debug("Had a match, adding fake cell: " + cell); // vv RegionObserverWithCompleteExample results.add(cell); /*[*/e.complete();/*]*/ // co RegionObserverWithCompleteExample-2-Bypass Once the special cell is inserted all further processing is skipped. } // ^^ RegionObserverWithCompleteExample } }
e.complete(); HRegion region = env.getRegion(); byte[] row = append.getRow();
e.complete(); HRegion region = env.getRegion(); byte[] row = increment.getRow();