Examples of checkAndDelete()


Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Object run() throws Exception {
        Delete d = new Delete(TEST_ROW);
        d.deleteFamily(TEST_FAMILY);
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          t.checkAndDelete(TEST_ROW, TEST_FAMILY, TEST_QUALIFIER,
            Bytes.toBytes("test_value"), d);
        } finally {
          t.close();
        }
        return null;
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Void run() throws Exception {
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Delete d = new Delete(TEST_ROW1);
          d.deleteColumns(TEST_FAMILY1, TEST_Q1, 120);
          t.checkAndDelete(TEST_ROW1, TEST_FAMILY1, TEST_Q1, ZERO, d);
        } finally {
          t.close();
        }
        return null;
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Void run() throws Exception {
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Delete d = new Delete(TEST_ROW1);
          d.deleteColumns(TEST_FAMILY1, TEST_Q1);
          t.checkAndDelete(TEST_ROW1, TEST_FAMILY1, TEST_Q1, ZERO, d);
          fail("user2 should not be allowed to do checkAndDelete");
        } catch (Exception e) {
        } finally {
          t.close();
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Void run() throws Exception {
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Delete d = new Delete(TEST_ROW1);
          d.deleteColumn(TEST_FAMILY1, TEST_Q2, 120);
          t.checkAndDelete(TEST_ROW1, TEST_FAMILY1, TEST_Q2, ZERO, d);
        } finally {
          t.close();
        }
        return null;
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      }
      byte[][] parts = KeyValue.parseColumn(valueToDeleteColumn);
      if (parts.length == 2) {
        if (parts[1].length != 0) {
          delete.deleteColumns(parts[0], parts[1]);
          retValue = table.checkAndDelete(key, parts[0], parts[1],
            valueToDeleteCell.getValue(), delete);
        } else {
          // The case of empty qualifier.
          delete.deleteColumns(parts[0], Bytes.toBytes(StringUtils.EMPTY));
          retValue = table.checkAndDelete(key, parts[0], Bytes.toBytes(StringUtils.EMPTY),
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

          retValue = table.checkAndDelete(key, parts[0], parts[1],
            valueToDeleteCell.getValue(), delete);
        } else {
          // The case of empty qualifier.
          delete.deleteColumns(parts[0], Bytes.toBytes(StringUtils.EMPTY));
          retValue = table.checkAndDelete(key, parts[0], Bytes.toBytes(StringUtils.EMPTY),
            valueToDeleteCell.getValue(), delete);
        }
      } else {
        servlet.getMetrics().incrementFailedDeleteRequests(1);
        return Response.status(Response.Status.BAD_REQUEST)
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) throws TIOError, TException {
    Table htable = getTable(table);

    try {
      if (value == null) {
        return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family),
          byteBufferToByteArray(qualifier), null, deleteFromThrift(deleteSingle));
      } else {
        return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family),
          byteBufferToByteArray(qualifier), byteBufferToByteArray(value),
          deleteFromThrift(deleteSingle));
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

    try {
      if (value == null) {
        return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family),
          byteBufferToByteArray(qualifier), null, deleteFromThrift(deleteSingle));
      } else {
        return htable.checkAndDelete(byteBufferToByteArray(row), byteBufferToByteArray(family),
          byteBufferToByteArray(qualifier), byteBufferToByteArray(value),
          deleteFromThrift(deleteSingle));
      }
    } catch (IOException e) {
      throw getTIOError(e);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Void run() throws Exception {
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Delete d = new Delete(TEST_ROW1);
          d.deleteColumns(TEST_FAMILY1, TEST_Q1, 120);
          t.checkAndDelete(TEST_ROW1, TEST_FAMILY1, TEST_Q1, ZERO, d);
        } finally {
          t.close();
        }
        return null;
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.Table.checkAndDelete()

      public Void run() throws Exception {
        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Delete d = new Delete(TEST_ROW1);
          d.deleteColumns(TEST_FAMILY1, TEST_Q1);
          t.checkAndDelete(TEST_ROW1, TEST_FAMILY1, TEST_Q1, ZERO, d);
          fail("user2 should not be allowed to do checkAndDelete");
        } catch (Exception e) {
        } finally {
          t.close();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.