/** * Add updates first to the wal and then add values to memstore. * <p> * Warning: Assumption is caller has lock on passed in row. * @param edits Cell updates by column */ void put(final byte[] row, byte[] family, List<Cell> edits) throws IOException { NavigableMap<byte[], List<Cell>> familyMap; familyMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); familyMap.put(family, edits); Put p = new Put(row); p.setFamilyCellMap(familyMap); doBatchMutate(p); }
private boolean doCheckAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException { Put put = new Put(row); put.setFamilyCellMap(delete.getFamilyCellMap());
/** * Add updates first to the wal and then add values to memstore. * Warning: Assumption is caller has lock on passed in row. * @param edits Cell updates by column * @throws IOException */ private void put(final byte [] row, byte [] family, List<Cell> edits) throws IOException { NavigableMap<byte[], List<Cell>> familyMap; familyMap = new TreeMap<byte[], List<Cell>>(Bytes.BYTES_COMPARATOR); familyMap.put(family, edits); Put p = new Put(row); p.setFamilyCellMap(familyMap); doBatchMutate(p); }
private boolean doCheckAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException { Put put = new Put(row); put.setFamilyCellMap(delete.getFamilyCellMap());
private boolean doCheckAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException { Put put = new Put(row); put.setFamilyCellMap(delete.getFamilyCellMap());
@Override public void prePut(ObserverContext<RegionCoprocessorEnvironment> ctx, Put put, WALEdit edit, Durability durability) throws IOException { if (put.getAttribute(Constants.DELTA_WRITE) != null) { // incremental write NavigableMap<byte[], List<Cell>> newFamilyMap = new TreeMap<byte[], List<Cell>>(Bytes.BYTES_COMPARATOR); for (Map.Entry<byte[], List<Cell>> entry : put.getFamilyCellMap().entrySet()) { List<Cell> newCells = new ArrayList<Cell>(entry.getValue().size()); for (Cell cell : entry.getValue()) { // rewrite the cell value with a special prefix to identify it as a delta // for 0.98 we can update this to use cell tags byte[] newValue = Bytes.add(DELTA_MAGIC_PREFIX, CellUtil.cloneValue(cell)); newCells.add(CellUtil.createCell(CellUtil.cloneRow(cell), CellUtil.cloneFamily(cell), CellUtil.cloneQualifier(cell), cell.getTimestamp(), cell.getTypeByte(), newValue)); } newFamilyMap.put(entry.getKey(), newCells); } put.setFamilyCellMap(newFamilyMap); } // put completes normally with value prefix marker }
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);
put.setFamilyCellMap(newFamilyMap);