jpisaac commented on code in PR #2183:
URL: https://github.com/apache/phoenix/pull/2183#discussion_r2138907113
##########
phoenix-core-client/src/main/java/org/apache/phoenix/execute/TupleProjector.java:
##########
@@ -322,6 +322,15 @@ public void getKey(ImmutableBytesWritable ptr) {
ptr.set(keyPtr.get(), keyPtr.getOffset(), keyPtr.getLength());
}
+ @Override
+ public long getKeyValueBytesSize() {
+ long size = keyPtr.getLength() + projectedValue.getLength();
+ if (keyValue != null) {
+ size += keyValue.getFamilyLength() +
keyValue.getQualifierLength();
Review Comment:
Don't you need the length of the actual value object?
##########
phoenix-core-client/src/main/java/org/apache/phoenix/schema/tuple/ResultTuple.java:
##########
@@ -101,4 +101,16 @@ public boolean getValue(byte[] family, byte[] qualifier,
ptr.set(kv.getValueArray(), kv.getValueOffset(), kv.getValueLength());
return true;
}
+
+ @Override
+ public long getKeyValueBytesSize() {
+ if (result == null || result.isEmpty()) {
+ return 0;
+ }
+ long totalSize = 0;
+ for (Cell cell : result.rawCells()) {
Review Comment:
nit: There seems to be a utility method - getTotalSizeOfCells on the Result
class
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]