/** * Advanced use only. Add an existing delete marker to this Delete object. * @param kv An existing KeyValue of type "delete". * @return this for invocation chaining * @throws IOException * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use {@link #add(Cell)} * instead */ @SuppressWarnings("unchecked") @Deprecated public Delete addDeleteMarker(Cell kv) throws IOException { return this.add(kv); }
@Test public void testDeleteCopyConstructor() throws IOException { Delete origin = new Delete(Bytes.toBytes("ROW-01")); origin.setPriority(100); byte[] family = Bytes.toBytes("CF-01"); origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) .setType(Type.Delete) .build()); origin.addColumn(family, Bytes.toBytes("q0")); origin.addColumns(family, Bytes.toBytes("q1")); origin.addFamily(family); origin.addColumns(family, Bytes.toBytes("q2"), 100); origin.addFamilyVersion(family, 1000); Delete clone = new Delete(origin); assertEquals(origin, clone); origin.addColumn(family, Bytes.toBytes("q3")); //They should have different cell lists assertNotEquals(origin.getCellList(family), clone.getCellList(family)); }
new Delete(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(), timestamp); delete.add(cell);
@Override public boolean preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c, byte[] row, byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator, Delete delete, boolean result) throws IOException { delete.add(createCustomCell(delete)); COUNT.incrementAndGet(); return result; }
new Delete(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(), timestamp); delete.add(cell);
@Override public void preDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete delete, WALEdit edit, Durability durability) throws IOException { delete.add(createCustomCell(delete)); COUNT.incrementAndGet(); }
@Test public void testDeleteCopyConstructor() throws IOException { Delete origin = new Delete(Bytes.toBytes("ROW-01")); origin.setPriority(100); byte[] family = Bytes.toBytes("CF-01"); origin.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY) .setRow(origin.getRow()) .setFamily(family) .setQualifier(Bytes.toBytes("q")) .setType(Type.Delete) .build()); origin.addColumn(family, Bytes.toBytes("q0")); origin.addColumns(family, Bytes.toBytes("q1")); origin.addFamily(family); origin.addColumns(family, Bytes.toBytes("q2"), 100); origin.addFamilyVersion(family, 1000); Delete clone = new Delete(origin); assertEquals(origin, clone); origin.addColumn(family, Bytes.toBytes("q3")); //They should have different cell lists assertNotEquals(origin.getCellList(family), clone.getCellList(family)); }
del.add(cell); } else { put.add(cell);
new Delete(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(), timestamp); delete.add(cell);
new Delete(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(), timestamp); delete.add(cell);
((Delete) mutation).add(cell); } else { ((Put) mutation).add(cell);
new KeyValue(rows[i], CellUtil.cloneFamily(kv), CellUtil.cloneQualifier(kv), kv.getTimestamp(), KeyValue.Type.Delete); d.add(kvDelete); Put p = new Put(rows[1 - i]); KeyValue kvAdd =
((Delete) m).add(cell); } else { ((Put) m).add(cell);
/** * Advanced use only. Add an existing delete marker to this Delete object. * @param kv An existing KeyValue of type "delete". * @return this for invocation chaining * @throws IOException * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. Use {@link #add(Cell)} * instead */ @SuppressWarnings("unchecked") @Deprecated public Delete addDeleteMarker(Cell kv) throws IOException { return this.add(kv); }
/** * Helper method for a {@link KeyValueBuilder} that catches an IOException from a {@link Put} * when adding a {@link KeyValue} generated by the KeyValueBuilder. * @throws RuntimeException if there is an IOException thrown from the underlying {@link Put} */ @SuppressWarnings("javadoc") public static void deleteQuietly(Delete delete, KeyValueBuilder builder, KeyValue kv) { try { delete.add(kv); } catch (IOException e) { throw new RuntimeException("KeyValue Builder " + builder + " created an invalid kv: " + kv + "!"); } }
} else if (m instanceof Delete) { Delete d = (Delete) m; d.add(cell);
mutationList.add(del); del.add(cell);
mutations.add(del); del.add(cell);
mutations.add(delete); delete.add(cell);