saintstack commented on a change in pull request #832: HBASE-23298 Refactor
LogRecoveredEditsOutputSink and BoundedLogWriter…
URL: https://github.com/apache/hbase/pull/832#discussion_r350891989
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/EntryBuffers.java
##########
@@ -138,21 +129,56 @@ void doneWriting(RegionEntryBuffer buffer) {
}
}
+ @VisibleForTesting
synchronized boolean isRegionCurrentlyWriting(byte[] region) {
return currentlyWriting.contains(region);
}
- public void waitUntilDrained() {
- synchronized (controller.dataAvailable) {
- while (totalBuffered > 0) {
- try {
- controller.dataAvailable.wait(2000);
- } catch (InterruptedException e) {
- LOG.warn("Got interrupted while waiting for EntryBuffers is
drained");
- Thread.interrupted();
- break;
- }
- }
+ /**
+ * A buffer of some number of edits for a given region.
+ * This accumulates edits and also provides a memory optimization in order to
+ * share a single byte array instance for the table and region name.
+ * Also tracks memory usage of the accumulated edits.
+ */
+ public static class RegionEntryBuffer implements HeapSize {
Review comment:
Good. Has to be public? Needs to be accessed outside this package?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services