private static void addAttributes(OperationWithAttributes op,
    Map<ByteBuffer, ByteBuffer> attributes) {
    if (attributes == null || attributes.isEmpty()) {
      return;
    }
    for (Map.Entry<ByteBuffer, ByteBuffer> entry : attributes.entrySet()) {
      String name = Bytes.toStringBinary(getBytes(entry.getKey()));
      byte[] value = getBytes(entry.getValue());
      op.setAttribute(name, value);
    }
  }
Adds all the attributes into the Operation object
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java