Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTableInterface.checkAndPut()


      if (checkingFieldName == null) {
        hTable.put(put);
        return 1;
      } else {
        Column checkingColumn = entityDefinition.getColumn(checkingFieldName);
        return hTable.checkAndPut(
            id,
            Bytes.toBytes(checkingColumn.getColumnFamily()),
            Bytes.toBytes(checkingColumn.getColumn()),
            checkingFieldValue,
            put) ? 1 : 0;
View Full Code Here


  @Override
  public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family,
      ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, TException {
    HTableInterface htable = getTable(table);
    try {
      return htable.checkAndPut(byteBufferToByteArray(row), byteBufferToByteArray(family),
        byteBufferToByteArray(qualifier), (value == null) ? null : byteBufferToByteArray(value),
        putFromThrift(put));
    } catch (IOException e) {
      throw getTIOError(e);
    } finally {
View Full Code Here

          put.add(
              Bytes.toBytes(entityDefinition.getVersionColumn().getColumnFamily()),
              Bytes.toBytes(entityDefinition.getVersionColumn().getColumn()),
              Bytes.toBytes(oldVersion == null ? 1 : oldVersion + 1));
        }
        return hTable.checkAndPut(
            id,
            Bytes.toBytes(entityDefinition.getVersionColumn().getColumnFamily()),
            Bytes.toBytes(entityDefinition.getVersionColumn().getColumn()),
            oldVersion == null ? null : Bytes.toBytes(oldVersion),
            put);
View Full Code Here

      if (checkingFieldName == null) {
        hTable.put(put);
        return 1;
      } else {
        Column checkingColumn = entityDefinition.getColumn(checkingFieldName);
        return hTable.checkAndPut(
            id,
            Bytes.toBytes(checkingColumn.getColumnFamily()),
            Bytes.toBytes(checkingColumn.getColumn()),
            checkingFieldValue,
            put) ? 1 : 0;
View Full Code Here

          .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
          .build();
      }

      table = pool.getTable(this.tableResource.getName());
      boolean retValue = table.checkAndPut(key, valueToPutParts[0],
        valueToPutParts[1], valueToCheckCell.getValue(), put);
      if (LOG.isDebugEnabled()) {
        LOG.debug("CHECK-AND-PUT " + put.toString() + ", returns " + retValue);
      }
      table.flushCommits();
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.