adoroszlai commented on code in PR #7797:
URL: https://github.com/apache/ozone/pull/7797#discussion_r1939026921
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/Table.java:
##########
@@ -337,12 +337,8 @@ interface KeyValue<KEY, VALUE> {
VALUE getValue() throws IOException;
- default byte[] getRawKey() throws IOException {
- return null;
- }
-
- default byte[] getRawValue() throws IOException {
- return null;
+ default int getReadableBytes() throws IOException {
+ return -1;
Review Comment:
I think 0 would be safer for size calculations.
`consumedSize += objectSerializedSize` etc.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/Table.java:
##########
@@ -396,13 +392,8 @@ public V getValue() {
}
@Override
- public byte[] getRawKey() throws IOException {
- return rawKey;
- }
-
- @Override
- public byte[] getRawValue() throws IOException {
- return rawValue;
+ public int getReadableBytes() throws IOException {
+ return readableBytes;
Review Comment:
nit: I think `readableBytes` is in `CodecBuffer` terms (which supports
reading the data from the buffer). For `KeyValue`, it may be better to rename
this to `rawSize`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]