/** * This method allows you to retrieve the identifier for the operation if one * was set. * @return the id or null if not set */ public String getId() { byte[] attr = getAttribute(ID_ATRIBUTE); return attr == null? null: Bytes.toString(attr); }
/** * This method allows you to set an identifier on an operation. The original * motivation for this was to allow the identifier to be used in slow query * logging, but this could obviously be useful in other places. One use of * this could be to put a class.method identifier in here to see where the * slow query is coming from. * @param id * id to set for the scan */ public OperationWithAttributes setId(String id) { setAttribute(ID_ATRIBUTE, Bytes.toBytes(id)); return this; }
protected OperationWithAttributes(OperationWithAttributes clone) { this.attributes = clone.getAttributesMap() == null ? null : clone.getAttributesMap().entrySet().stream() .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue(), (k, v) -> { throw new RuntimeException("collisions!!!"); }, () -> new TreeMap<>())); this.priority = clone.getPriority(); }
/** * This method allows you to retrieve the identifier for the operation if one * was set. * @return the id or null if not set */ public String getId() { byte[] attr = getAttribute(ID_ATRIBUTE); return attr == null? null: Bytes.toString(attr); }
/** * Adds all the attributes into the Operation object */ 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); } }
protected OperationWithAttributes(OperationWithAttributes clone) { this.attributes = clone.getAttributesMap() == null ? null : clone.getAttributesMap().entrySet().stream() .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue(), (k, v) -> { throw new RuntimeException("collisions!!!"); }, () -> new TreeMap<>())); this.priority = clone.getPriority(); }
private boolean isRollbackOperation(OperationWithAttributes op) throws IOException { return op.getAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY) != null || // to support old clients op.getAttribute(TxConstants.OLD_TX_ROLLBACK_ATTRIBUTE_KEY) != null; }
/** * Adds all the attributes into the Operation object */ 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); } }
protected OperationWithAttributes(OperationWithAttributes clone) { this.attributes = clone.getAttributesMap() == null ? null : clone.getAttributesMap().entrySet().stream() .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue(), (k, v) -> { throw new RuntimeException("collisions!!!"); }, () -> new TreeMap<>())); this.priority = clone.getPriority(); }
private boolean isRollbackOperation(OperationWithAttributes op) throws IOException { return op.getAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY) != null || // to support old clients op.getAttribute(TxConstants.OLD_TX_ROLLBACK_ATTRIBUTE_KEY) != null; }
/** * This method allows you to set an identifier on an operation. The original * motivation for this was to allow the identifier to be used in slow query * logging, but this could obviously be useful in other places. One use of * this could be to put a class.method identifier in here to see where the * slow query is coming from. * @param id * id to set for the scan */ public OperationWithAttributes setId(String id) { setAttribute(ID_ATRIBUTE, Bytes.toBytes(id)); return this; }
private boolean isRollbackOperation(OperationWithAttributes op) throws IOException { return op.getAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY) != null || // to support old clients op.getAttribute(TxConstants.OLD_TX_ROLLBACK_ATTRIBUTE_KEY) != null; }
/** * This method allows you to set an identifier on an operation. The original * motivation for this was to allow the identifier to be used in slow query * logging, but this could obviously be useful in other places. One use of * this could be to put a class.method identifier in here to see where the * slow query is coming from. * @param id * id to set for the scan */ public void setId(String id) { setAttribute(ID_ATRIBUTE, Bytes.toBytes(id)); }
private boolean isRollbackOperation(OperationWithAttributes op) throws IOException { return op.getAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY) != null || // to support old clients op.getAttribute(TxConstants.OLD_TX_ROLLBACK_ATTRIBUTE_KEY) != null; }
/** * This method allows you to set an identifier on an operation. The original * motivation for this was to allow the identifier to be used in slow query * logging, but this could obviously be useful in other places. One use of * this could be to put a class.method identifier in here to see where the * slow query is coming from. * @param id * id to set for the scan */ public OperationWithAttributes setId(String id) { setAttribute(ID_ATRIBUTE, Bytes.toBytes(id)); return this; }
private boolean isRollbackOperation(OperationWithAttributes op) throws IOException { return op.getAttribute(TxConstants.TX_ROLLBACK_ATTRIBUTE_KEY) != null || // to support old clients op.getAttribute(TxConstants.OLD_TX_ROLLBACK_ATTRIBUTE_KEY) != null; }
/** * @see {@link #APP_NAME_ATT} */ public static void setApplication(String appName, OperationWithAttributes op) { op.setAttribute(APP_NAME_ATT, Bytes.toBytes(appName)); }
/** * This method allows you to retrieve the identifier for the operation if one * was set. * @return the id or null if not set */ public String getId() { byte[] attr = getAttribute(ID_ATRIBUTE); return attr == null? null: Bytes.toString(attr); } }
/** * This method allows you to set an identifier on an operation. The original * motivation for this was to allow the identifier to be used in slow query * logging, but this could obviously be useful in other places. One use of * this could be to put a class.method identifier in here to see where the * slow query is coming from. * @param id * id to set for the scan */ public OperationWithAttributes setId(String id) { setAttribute(ID_ATRIBUTE, Bytes.toBytes(id)); return this; }
/** * This method allows you to retrieve the identifier for the operation if one * was set. * @return the id or null if not set */ public String getId() { byte[] attr = getAttribute(ID_ATRIBUTE); return attr == null? null: Bytes.toString(attr); }