org.apache.hadoop.hbase.client.Delete - java examples

Here are the examples of the java api org.apache.hadoop.hbase.client.Delete taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
protected void makeRollbackOperation(Delete delete) {
    delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(Delete delete) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    hTable.delete(transactionalizeAction(delete));
}

19 View Complete Implementation : ThriftTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(Delete delete) throws IOException {
    TDelete tDelete = ThriftUtilities.deleteFromHBase(delete);
    try {
        client.deleteSingle(tableNameInBytes, tDelete);
    } catch (TException e) {
        throw new IOException(e);
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(Delete delete) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    hTable.delete(transactionalizeAction(delete));
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Put> transactionalizedDeletes = new ArrayList<>(deletes.size());
    for (Delete delete : deletes) {
        Put txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.put(transactionalizedDeletes);
}

19 View Complete Implementation : TestPassCustomCellViaRegionObserver.java
Copyright Apache License 2.0
Author : apache
private static Cell createCustomCell(Delete delete) {
    return createCustomCell(delete.getRow(), FAMILY, QUALIFIER_FROM_CP, Cell.Type.DeleteColumn, null);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
protected void makeRollbackOperation(Delete delete) {
    delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]);
}

19 View Complete Implementation : TestSpaceQuotaBasicFunctioning.java
Copyright Apache License 2.0
Author : apache
@Test
public void testDeletesAfterNoInserts() throws Exception {
    final TableName tn = helper.writeUntilViolation(SpaceViolationPolicy.NO_INSERTS);
    // Try a couple of times to verify that the quota never gets enforced, same as we
    // do when we're trying to catch the failure.
    Delete d = new Delete(Bytes.toBytes("should_not_be_rejected"));
    for (int i = 0; i < NUM_RETRIES; i++) {
        try (Table t = TEST_UTIL.getConnection().getTable(tn)) {
            t.delete(d);
        }
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
protected void makeRollbackOperation(Delete delete) {
    delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]);
}

19 View Complete Implementation : TimestampTestBase.java
Copyright Apache License 2.0
Author : apache
public static void delete(final Table loader, final byte[] column, final long ts) throws IOException {
    Delete delete = ts == HConstants.LATEST_TIMESTAMP ? new Delete(ROW) : new Delete(ROW, ts);
    delete.addColumn(FAMILY_NAME, QUALIFIER_NAME, ts);
    loader.delete(delete);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Delete> transactionalizedDeletes = new ArrayList<Delete>(deletes.size());
    for (Delete delete : deletes) {
        Delete txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.delete(transactionalizedDeletes);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Delete> transactionalizedDeletes = new ArrayList<Delete>(deletes.size());
    for (Delete delete : deletes) {
        Delete txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.delete(transactionalizedDeletes);
}

19 View Complete Implementation : TestSpaceQuotaBasicFunctioning.java
Copyright Apache License 2.0
Author : apache
@Test
public void testNoWritesWithDelete() throws Exception {
    Delete d = new Delete(Bytes.toBytes("to_reject"));
    helper.writeUntilViolationAndVerifyViolation(SpaceViolationPolicy.NO_WRITES, d);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] bytes, byte[] bytes1, byte[] bytes2, CompareFilter.CompareOp compareOp, byte[] bytes3, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(bytes, bytes1, bytes2, compareOp, bytes3, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : TestRegionObserverInterface.java
Copyright Apache License 2.0
Author : apache
// called from testPreWALAppendIsWrittenToWAL
private void testPreWALAppendHook(Table table, TableName tableName) throws IOException {
    int expectedCalls = 0;
    String[] methodArray = new String[1];
    methodArray[0] = "getCtPreWALAppend";
    Object[] resultArray = new Object[1];
    Put p = new Put(ROW);
    p.addColumn(A, A, A);
    table.put(p);
    resultArray[0] = ++expectedCalls;
    verifyMethodResult(SimpleRegionObserver.clreplaced, methodArray, tableName, resultArray);
    Append a = new Append(ROW);
    a.addColumn(B, B, B);
    table.append(a);
    resultArray[0] = ++expectedCalls;
    verifyMethodResult(SimpleRegionObserver.clreplaced, methodArray, tableName, resultArray);
    Increment i = new Increment(ROW);
    i.addColumn(C, C, 1);
    table.increment(i);
    resultArray[0] = ++expectedCalls;
    verifyMethodResult(SimpleRegionObserver.clreplaced, methodArray, tableName, resultArray);
    Delete d = new Delete(ROW);
    table.delete(d);
    resultArray[0] = ++expectedCalls;
    verifyMethodResult(SimpleRegionObserver.clreplaced, methodArray, tableName, resultArray);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
protected void makeRollbackOperation(Delete delete) {
    delete.setAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY, new byte[0]);
}

19 View Complete Implementation : TestMasterReplication.java
Copyright Apache License 2.0
Author : apache
private void deleteAndWait(byte[] row, Table source, Table target) throws Exception {
    Delete del = new Delete(row);
    source.delete(del);
    wait(row, target, true);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] bytes, byte[] bytes1, byte[] bytes2, CompareFilter.CompareOp compareOp, byte[] bytes3, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(bytes, bytes1, bytes2, compareOp, bytes3, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : TestKeepDeletes.java
Copyright Apache License 2.0
Author : apache
/**
 * Test keeping deleted rows together with min versions set
 * @throws Exception
 */
@Test
public void testWithTTL() throws Exception {
    HTableDescriptor htd = hbu.createTableDescriptor(name.getMethodName(), 1, 1000, 1, KeepDeletedCells.TTL);
    HRegion region = hbu.createLocalHRegion(htd, null, null);
    // 2s in the past
    long ts = EnvironmentEdgeManager.currentTime() - 2000;
    Put p = new Put(T1, ts);
    p.addColumn(c0, c0, T3);
    region.put(p);
    // place an old row, to make the family marker expires anyway
    p = new Put(T2, ts - 10);
    p.addColumn(c0, c0, T1);
    region.put(p);
    checkGet(region, T1, c0, c0, ts + 1, T3);
    // place a family delete marker
    Delete d = new Delete(T1, ts + 2);
    region.delete(d);
    checkGet(region, T1, c0, c0, ts + 1, T3);
    // 3 families, one column delete marker
    replacedertEquals(3, countDeleteMarkers(region));
    region.flush(true);
    // no delete marker removes by the flush
    replacedertEquals(3, countDeleteMarkers(region));
    // but the Put is gone
    checkGet(region, T1, c0, c0, ts + 1);
    region.compact(true);
    // all delete marker gone
    replacedertEquals(0, countDeleteMarkers(region));
    HBaseTestingUtility.closeRegionAndWAL(region);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : TimestampTestBase.java
Copyright Apache License 2.0
Author : apache
/*
   * Run test that delete works according to description in <a
   * href="https://issues.apache.org/jira/browse/HADOOP-1784">hadoop-1784</a>.
   * @param incommon
   * @param flusher
   * @throws IOException
   */
public static void doTestDelete(final Table table, FlushCache flusher) throws IOException {
    // Add values at various timestamps (Values are timestampes as bytes).
    put(table, T0);
    put(table, T1);
    put(table, T2);
    put(table);
    // Verify that returned versions match preplaceded timestamps.
    replacedertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T2, T1 });
    // If I delete w/o specifying a timestamp, this means I'm deleting the latest.
    delete(table);
    // Verify that I get back T2 through T1 -- that the latest version has been deleted.
    replacedertVersions(table, new long[] { T2, T1, T0 });
    // Flush everything out to disk and then retry
    flusher.flushcache();
    replacedertVersions(table, new long[] { T2, T1, T0 });
    // Now add, back a latest so I can test remove other than the latest.
    put(table);
    replacedertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T2, T1 });
    delete(table, T2);
    replacedertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T1, T0 });
    // Flush everything out to disk and then retry
    flusher.flushcache();
    replacedertVersions(table, new long[] { HConstants.LATEST_TIMESTAMP, T1, T0 });
    // Now try deleting all from T2 back inclusive (We first need to add T2
    // back into the mix and to make things a little interesting, delete and then readd T1.
    put(table, T2);
    delete(table, T1);
    put(table, T1);
    Delete delete = new Delete(ROW);
    delete.addColumns(FAMILY_NAME, QUALIFIER_NAME, T2);
    table.delete(delete);
    // Should only be current value in set.  replacedert this is so
    replacedertOnlyLatest(table, HConstants.LATEST_TIMESTAMP);
    // Flush everything out to disk and then redo above tests
    flusher.flushcache();
    replacedertOnlyLatest(table, HConstants.LATEST_TIMESTAMP);
}

19 View Complete Implementation : TestPartialResultsFromClientSide.java
Copyright Apache License 2.0
Author : apache
@Test
public void testReadPointAndPartialResults() throws Exception {
    final TableName tableName = TableName.valueOf(name.getMethodName());
    int numRows = 5;
    int numFamilies = 5;
    int numQualifiers = 5;
    byte[][] rows = HTestConst.makeNAscii(Bytes.toBytes("testRow"), numRows);
    byte[][] families = HTestConst.makeNAscii(Bytes.toBytes("testFamily"), numFamilies);
    byte[][] qualifiers = HTestConst.makeNAscii(Bytes.toBytes("testQualifier"), numQualifiers);
    byte[] value = Bytes.createMaxByteArray(100);
    Table tmpTable = createTestTable(tableName, rows, families, qualifiers, value);
    // Open scanner before deletes
    ResultScanner scanner = tmpTable.getScanner(new Scan().setMaxResultSize(1).setAllowPartialResults(true));
    // now the openScanner will also fetch data and will be executed lazily, i.e, only openScanner
    // when you call next, so here we need to make a next call to open scanner. The maxResultSize
    // limit can make sure that we will not fetch all the data at once, so the test sill works.
    int scannerCount = scanner.next().rawCells().length;
    Delete delete1 = new Delete(rows[0]);
    delete1.addColumn(families[0], qualifiers[0], 0);
    tmpTable.delete(delete1);
    Delete delete2 = new Delete(rows[1]);
    delete2.addColumn(families[1], qualifiers[1], 1);
    tmpTable.delete(delete2);
    // Should see all cells because scanner was opened prior to deletes
    scannerCount += countCellsFromScanner(scanner);
    int expectedCount = numRows * numFamilies * numQualifiers;
    replacedertTrue("scannerCount: " + scannerCount + " expectedCount: " + expectedCount, scannerCount == expectedCount);
    // Minus 2 for the two cells that were deleted
    scanner = tmpTable.getScanner(new Scan().setMaxResultSize(1).setAllowPartialResults(true));
    scannerCount = countCellsFromScanner(scanner);
    expectedCount = numRows * numFamilies * numQualifiers - 2;
    replacedertTrue("scannerCount: " + scannerCount + " expectedCount: " + expectedCount, scannerCount == expectedCount);
    scanner = tmpTable.getScanner(new Scan().setMaxResultSize(1).setAllowPartialResults(true));
    scannerCount = scanner.next().rawCells().length;
    // Put in 2 new rows. The timestamps differ from the deleted rows
    Put put1 = new Put(rows[0]);
    put1.add(new KeyValue(rows[0], families[0], qualifiers[0], 1, value));
    tmpTable.put(put1);
    Put put2 = new Put(rows[1]);
    put2.add(new KeyValue(rows[1], families[1], qualifiers[1], 2, value));
    tmpTable.put(put2);
    // Scanner opened prior to puts. Cell count shouldn't have changed
    scannerCount += countCellsFromScanner(scanner);
    expectedCount = numRows * numFamilies * numQualifiers - 2;
    replacedertTrue("scannerCount: " + scannerCount + " expectedCount: " + expectedCount, scannerCount == expectedCount);
    // Now the scanner should see the cells that were added by puts
    scanner = tmpTable.getScanner(new Scan().setMaxResultSize(1).setAllowPartialResults(true));
    scannerCount = countCellsFromScanner(scanner);
    expectedCount = numRows * numFamilies * numQualifiers;
    replacedertTrue("scannerCount: " + scannerCount + " expectedCount: " + expectedCount, scannerCount == expectedCount);
    TEST_UTIL.deleteTable(tableName);
}

19 View Complete Implementation : ExpAsStringVisibilityLabelServiceImpl.java
Copyright Apache License 2.0
Author : apache
@Override
public OperationStatus[] clearAuths(byte[] user, List<byte[]> authLabels) throws IOException {
    replacedert labelsRegion != null;
    OperationStatus[] finalOpStatus = new OperationStatus[authLabels.size()];
    List<String> currentAuths;
    if (AuthUtil.isGroupPrincipal(Bytes.toString(user))) {
        String group = AuthUtil.getGroupName(Bytes.toString(user));
        currentAuths = this.getGroupAuths(new String[] { group }, true);
    } else {
        currentAuths = this.getUserAuths(user, true);
    }
    Delete d = new Delete(user);
    int i = 0;
    for (byte[] authLabel : authLabels) {
        String authLabelStr = Bytes.toString(authLabel);
        if (currentAuths.contains(authLabelStr)) {
            d.addColumns(LABELS_TABLE_FAMILY, authLabel);
        } else {
            // This label is not set for the user.
            finalOpStatus[i] = new OperationStatus(OperationStatusCode.FAILURE, new InvalidLabelException("Label '" + authLabelStr + "' is not set for the user " + Bytes.toString(user)));
        }
        i++;
    }
    this.labelsRegion.delete(d);
    // This is a testing impl and so not doing any caching
    for (i = 0; i < authLabels.size(); i++) {
        if (finalOpStatus[i] == null) {
            finalOpStatus[i] = new OperationStatus(OperationStatusCode.SUCCESS);
        }
    }
    return finalOpStatus;
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Delete> transactionalizedDeletes = new ArrayList<>(deletes.size());
    for (Delete delete : deletes) {
        Delete txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.delete(transactionalizedDeletes);
}

19 View Complete Implementation : RegionAsTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    for (Delete delete : deletes) delete(delete);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Delete> transactionalizedDeletes = new ArrayList<Delete>(deletes.size());
    for (Delete delete : deletes) {
        Delete txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.delete(transactionalizedDeletes);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Put> transactionalizedDeletes = new ArrayList<>(deletes.size());
    for (Delete delete : deletes) {
        Put txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.put(transactionalizedDeletes);
}

19 View Complete Implementation : RegionAsTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(Delete delete) throws IOException {
    this.region.delete(delete);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Put> transactionalizedDeletes = new ArrayList<>(deletes.size());
    for (Delete delete : deletes) {
        Put txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.put(transactionalizedDeletes);
}

19 View Complete Implementation : SimpleRegionObserver.java
Copyright Apache License 2.0
Author : apache
@Override
public void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c, final Delete delete, final WALEdit edit, final Durability durability) throws IOException {
    Map<byte[], List<Cell>> familyMap = delete.getFamilyCellMap();
    RegionCoprocessorEnvironment e = c.getEnvironment();
    replacedertNotNull(e);
    replacedertNotNull(e.getRegion());
    replacedertNotNull(familyMap);
    if (ctBeforeDelete.get() > 0) {
        ctPreDeleted.incrementAndGet();
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(Delete delete) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    hTable.delete(transactionalizeAction(delete));
}

19 View Complete Implementation : QuotaUtil.java
Copyright Apache License 2.0
Author : apache
private static void deleteQuotas(final Connection connection, final byte[] rowKey, final byte[] qualifier) throws IOException {
    Delete delete = new Delete(rowKey);
    if (qualifier != null) {
        delete.addColumns(QUOTA_FAMILY_INFO, qualifier);
    }
    doDelete(connection, delete);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, op, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : ThriftHBaseServiceHandler.java
Copyright Apache License 2.0
Author : apache
@Override
public void deleteAllRowTs(ByteBuffer tableName, ByteBuffer row, long timestamp, Map<ByteBuffer, ByteBuffer> attributes) throws IOError {
    Table table = null;
    try {
        table = getTable(tableName);
        Delete delete = new Delete(getBytes(row), timestamp);
        addAttributes(delete, attributes);
        table.delete(delete);
    } catch (IOException e) {
        LOG.warn(e.getMessage(), e);
        throw getIOError(e);
    } finally {
        closeTable(table);
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : RemoteHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    for (Delete delete : deletes) {
        delete(delete);
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : SimpleRegionObserver.java
Copyright Apache License 2.0
Author : apache
@Override
public void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c, final Delete delete, final WALEdit edit, final Durability durability) throws IOException {
    Map<byte[], List<Cell>> familyMap = delete.getFamilyCellMap();
    RegionCoprocessorEnvironment e = c.getEnvironment();
    replacedertNotNull(e);
    replacedertNotNull(e.getRegion());
    replacedertNotNull(familyMap);
    ctBeforeDelete.set(0);
    ctPostDeleted.incrementAndGet();
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] bytes, byte[] bytes1, byte[] bytes2, CompareFilter.CompareOp compareOp, byte[] bytes3, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(bytes, bytes1, bytes2, compareOp, bytes3, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : TestMinorCompaction.java
Copyright Apache License 2.0
Author : apache
/*
   * A helper function to test the minor compaction algorithm. We check that
   * the delete markers are left behind. Takes delete as an argument, which
   * can be any delete (row, column, columnfamliy etc), that essentially
   * deletes row2 and column2. row1 and column1 should be undeleted
   */
private void testMinorCompactionWithDelete(Delete delete) throws Exception {
    testMinorCompactionWithDelete(delete, 0);
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : QuotaTableUtil.java
Copyright Apache License 2.0
Author : apache
/**
 * Returns a list of {@code Delete} to remove given namespace snapshot
 * entries to removefrom quota table
 * @param snapshotEntriesToRemove the entries to remove
 */
static List<Delete> createDeletesForExistingNamespaceSnapshotSizes(Set<String> snapshotEntriesToRemove) {
    List<Delete> deletes = new ArrayList<>();
    for (String snapshot : snapshotEntriesToRemove) {
        Delete d = new Delete(getNamespaceRowKey(snapshot));
        d.addColumns(QUOTA_FAMILY_USAGE, QUOTA_SNAPSHOT_SIZE_QUALIFIER);
        deletes.add(d);
    }
    return deletes;
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    if (allowNonTransactional) {
        return hTable.checkAndDelete(row, family, qualifier, value, delete);
    } else {
        throw new UnsupportedOperationException("Operation is not supported transactionally");
    }
}

19 View Complete Implementation : QuotaUtil.java
Copyright Apache License 2.0
Author : apache
private static void doDelete(final Connection connection, final Delete delete) throws IOException {
    try (Table table = connection.getTable(QuotaUtil.QUOTA_TABLE_NAME)) {
        table.delete(delete);
    }
}

19 View Complete Implementation : RSGroupInfoManagerImpl.java
Copyright Apache License 2.0
Author : apache
private synchronized Map<TableName, String> flushConfigTable(Map<String, RSGroupInfo> groupMap) throws IOException {
    Map<TableName, String> newTableMap = Maps.newHashMap();
    List<Mutation> mutations = Lists.newArrayList();
    // populate deletes
    for (String groupName : prevRSGroups) {
        if (!groupMap.containsKey(groupName)) {
            Delete d = new Delete(Bytes.toBytes(groupName));
            mutations.add(d);
        }
    }
    // populate puts
    for (RSGroupInfo RSGroupInfo : groupMap.values()) {
        RSGroupProtos.RSGroupInfo proto = RSGroupProtobufUtil.toProtoGroupInfo(RSGroupInfo);
        Put p = new Put(Bytes.toBytes(RSGroupInfo.getName()));
        p.addColumn(META_FAMILY_BYTES, META_QUALIFIER_BYTES, proto.toByteArray());
        mutations.add(p);
        for (TableName entry : RSGroupInfo.getTables()) {
            newTableMap.put(entry, RSGroupInfo.getName());
        }
    }
    if (mutations.size() > 0) {
        multiMutate(mutations);
    }
    return newTableMap;
}

19 View Complete Implementation : DefaultVisibilityLabelServiceImpl.java
Copyright Apache License 2.0
Author : apache
@Override
public OperationStatus[] clearAuths(byte[] user, List<byte[]> authLabels) throws IOException {
    replacedert labelsRegion != null;
    OperationStatus[] finalOpStatus = new OperationStatus[authLabels.size()];
    List<String> currentAuths;
    if (AuthUtil.isGroupPrincipal(Bytes.toString(user))) {
        String group = AuthUtil.getGroupName(Bytes.toString(user));
        currentAuths = this.getGroupAuths(new String[] { group }, true);
    } else {
        currentAuths = this.getUserAuths(user, true);
    }
    List<Mutation> deletes = new ArrayList<>(authLabels.size());
    int i = 0;
    for (byte[] authLabel : authLabels) {
        String authLabelStr = Bytes.toString(authLabel);
        if (currentAuths.contains(authLabelStr)) {
            int labelOrdinal = this.labelsCache.getLabelOrdinal(authLabelStr);
            replacedert labelOrdinal > 0;
            Delete d = new Delete(Bytes.toBytes(labelOrdinal));
            d.addColumns(LABELS_TABLE_FAMILY, user);
            deletes.add(d);
        } else {
            // This label is not set for the user.
            finalOpStatus[i] = new OperationStatus(OperationStatusCode.FAILURE, new InvalidLabelException("Label '" + authLabelStr + "' is not set for the user " + Bytes.toString(user)));
        }
        i++;
    }
    if (mutateLabelsRegion(deletes, finalOpStatus)) {
        updateZk(false);
    }
    return finalOpStatus;
}

19 View Complete Implementation : RemoteHTable.java
Copyright Apache License 2.0
Author : apache
private boolean doCheckAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException {
    Put put = new Put(row, HConstants.LATEST_TIMESTAMP, delete.getFamilyCellMap());
    // column to check-the-value
    put.add(new KeyValue(row, family, qualifier, value));
    CellSetModel model = buildModelFromPut(put);
    StringBuilder sb = new StringBuilder();
    sb.append('/');
    sb.append(Bytes.toString(name));
    sb.append('/');
    sb.append(toURLEncodedBytes(row));
    sb.append("?check=delete");
    for (int i = 0; i < maxRetries; i++) {
        Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput());
        int code = response.getCode();
        switch(code) {
            case 200:
                return true;
            case // NOT-MODIFIED
            304:
                return false;
            case 509:
                try {
                    Thread.sleep(sleepTime);
                } catch (final InterruptedException e) {
                    throw (InterruptedIOException) new InterruptedIOException().initCause(e);
                }
                break;
            default:
                throw new IOException("checkAndDelete request failed with " + code);
        }
    }
    throw new IOException("checkAndDelete request timed out");
}

19 View Complete Implementation : TestSplitTableRegionProcedure.java
Copyright Apache License 2.0
Author : apache
private void deleteData(final TableName tableName, final int startDeleteRowNum) throws IOException, InterruptedException {
    Table t = UTIL.getConnection().getTable(tableName);
    final int numRows = rowCount + startRowNum - startDeleteRowNum;
    Delete d;
    for (int i = startDeleteRowNum; i <= numRows + startDeleteRowNum; i++) {
        d = new Delete(Bytes.toBytes("" + i));
        t.delete(d);
        if (i % 5 == 0) {
            UTIL.getAdmin().flush(tableName);
        }
    }
}

19 View Complete Implementation : PermissionStorage.java
Copyright Apache License 2.0
Author : apache
private static void removePermissionRecord(Configuration conf, UserPermission userPerm, Table t) throws IOException {
    Delete d = new Delete(userPermissionRowKey(userPerm.getPermission()));
    d.addColumns(ACL_LIST_FAMILY, userPermissionKey(userPerm));
    try {
        t.delete(d);
    } finally {
        t.close();
    }
}

19 View Complete Implementation : TransactionAwareHTable.java
Copyright Apache License 2.0
Author : apache
@Override
public void delete(List<Delete> deletes) throws IOException {
    if (tx == null) {
        throw new IOException("Transaction not started");
    }
    List<Delete> transactionalizedDeletes = new ArrayList<Delete>(deletes.size());
    for (Delete delete : deletes) {
        Delete txDelete = transactionalizeAction(delete);
        transactionalizedDeletes.add(txDelete);
    }
    hTable.delete(transactionalizedDeletes);
}