Skip to content

Commit

Permalink
Add in Wellington's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
joshelser committed Aug 4, 2020
1 parent 115a8b3 commit e2c75b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ public interface MetricsReplicationGlobalSourceSource extends MetricsReplication
public static final String SOURCE_WAL_READER_EDITS_BUFFER = "source.walReaderEditsBufferUsage";

/**
* Sets the total usage of memory used by edits in memory read from WALs.
* Sets the total usage of memory used by edits in memory read from WALs. The memory represented
* by this usage measure is across peers/sources. For example, we may batch the same WAL edits
* multiple times for the sake of replicating them to multiple peers..
* @param usage The memory used by edits in bytes
*/
void setWALReaderEditsBufferBytes(long usage);

/**
* Returns the size, in bytes, of edits held in memory to be replicated.
* Returns the size, in bytes, of edits held in memory to be replicated across all peers.
*/
long getWALReaderEditsBufferBytes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ public Path getCurrentPath() {
private boolean checkQuota() {
// try not to go over total quota
if (totalBufferUsed.get() > totalBufferQuota) {
LOG.warn("Can't read more edits from WAL as buffer usage {}B exceeds limit {}B",
totalBufferUsed.get(), totalBufferQuota);
LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B",
this.source.getPeerId(), totalBufferUsed.get(), totalBufferQuota);
Threads.sleep(sleepForRetries);
return false;
}
Expand Down

0 comments on commit e2c75b5

Please sign in to comment.