use of org.apache.hadoop.hbase.trace.HBaseSemanticAttributes.Operation in project hbase by apache.
the class TableOperationSpanBuilder method unpackRowOperations.
private static Set<Operation> unpackRowOperations(final CheckAndMutate cam) {
final Set<Operation> ops = new HashSet<>();
final Operation op = valueFrom(cam.getAction());
switch(op) {
case BATCH:
case CHECK_AND_MUTATE:
ops.addAll(unpackRowOperations(cam.getAction()));
break;
default:
ops.add(op);
}
return ops;
}
use of org.apache.hadoop.hbase.trace.HBaseSemanticAttributes.Operation in project hbase by apache.
the class TableOperationSpanBuilder method unpackRowOperations.
private static Set<Operation> unpackRowOperations(final Row row) {
final Set<Operation> ops = new HashSet<>();
if (row instanceof CheckAndMutate) {
final CheckAndMutate cam = (CheckAndMutate) row;
ops.addAll(unpackRowOperations(cam));
}
if (row instanceof RowMutations) {
final RowMutations mutations = (RowMutations) row;
final List<Operation> operations = mutations.getMutations().stream().map(TableOperationSpanBuilder::valueFrom).collect(Collectors.toList());
ops.addAll(operations);
}
return ops;
}
Aggregations