dlmarion commented on code in PR #3151:
URL: https://github.com/apache/accumulo/pull/3151#discussion_r1063756280


##########
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:
   > There are other options that could be added, like only check for free 
memory if the length is over some size.
   > So instead of just continuing if free_memory is large enough, we don't 
continue until free_memory + some_configurable_size
   
   I added both of these things in 0177dbd. The default size threshold to 
perform the free memory check is 5% of max memory. The buffer size is 2% of the 
Value size.



-- 
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]

Reply via email to