dlmarion commented on code in PR #3151:
URL: https://github.com/apache/accumulo/pull/3151#discussion_r1063610082
##########
core/src/main/java/org/apache/accumulo/core/data/Value.java:
##########
@@ -181,6 +182,15 @@ public void readFields(final DataInput in) throws
IOException {
in.readFully(this.value, 0, this.value.length);
}
+ public void readFields(final DataInput in, Supplier<Long>
freeMemorySupplier) throws IOException {
+ int length = in.readInt();
+ while (freeMemorySupplier.get() < length) {
+ Thread.onSpinWait();
+ }
+ this.value = new byte[length];
Review Comment:
I agree that it's not a perfect solution, it's an attempt at doing
something. There are other options that could be added, like only check for
free memory if the length is over some size. The problem we run into is that
the tablet server is running N scans concurrently, JVM memory is under
pressure, and it doesn't know that the next K/V it's going to read is going to
create a very large (500MB, 1GB) Value object.
--
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]