@Override
  public boolean checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column,
    ByteBuffer value, Mutation mput, Map<ByteBuffer, ByteBuffer> attributes)
    throws IOError, IllegalArgument, TException {
    Put put;
    try {
      put = new Put(getBytes(row), HConstants.LATEST_TIMESTAMP);
      addAttributes(put, attributes);

      byte[][] famAndQf = CellUtil.parseColumn(getBytes(mput.column));
      put.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(put.getRow())
        .setFamily(famAndQf[0]).setQualifier(famAndQf[1]).setTimestamp(put.getTimestamp())
        .setType(Cell.Type.Put)
        .setValue(mput.value != null ? getBytes(mput.value) : HConstants.EMPTY_BYTE_ARRAY).build());
      put.setDurability(mput.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL);
    } catch (IOException | IllegalArgumentException e) {
      LOG.warn(e.getMessage(), e);
      throw new IllegalArgument(Throwables.getStackTraceAsString(e));
    }

    Table table = null;
    try {
      table = getTable(tableName);
      byte[][] famAndQf = CellUtil.parseColumn(getBytes(column));
      Table.CheckAndMutateBuilder mutateBuilder =
        table.checkAndMutate(getBytes(row), famAndQf[0]).qualifier(famAndQf[1]);
      if (value != null) {
        return mutateBuilder.ifEquals(getBytes(value)).thenPut(put);
      } else {
        return mutateBuilder.ifNotExists().thenPut(put);
      }
    } catch (IOException e) {
      LOG.warn(e.getMessage(), e);
      throw getIOError(e);
    } catch (IllegalArgumentException e) {
      LOG.warn(e.getMessage(), e);
      throw new IllegalArgument(Throwables.getStackTraceAsString(e));
    } finally {
      closeTable(table);
    }
  }
Note: this internal interface is slightly different from public APIs in regard to handling of
the qualifier. Here we differ from the public Java API in that null != byte[0]. Rather, we
respect qual == null as a request for the entire column family. The caller (
{@link #getVerTs(ByteBuffer, ByteBuffer, ByteBuffer, long, int, Map)}) interface IS consistent
in that the column is parse like normal.
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftHBaseServiceHandler.java