virajjasani commented on code in PR #2183: URL: https://github.com/apache/phoenix/pull/2183#discussion_r2138964009
########## 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: For projection, we are taking projectedValue's length, which will cover actual value. ########## 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: I tried that but it has lot of overhead values added, i see quite a diff in the cell values. It is using some additional heap bytes fixed overhead which is not serialized size that client application needs to worry about for memory tracking purpose. -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org