You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/10 18:29:29 UTC

[GitHub] [hbase] wchevreuil commented on a change in pull request #2064: HBASE-24735: Refactor ReplicationSourceManager: move logPositionAndCl…

wchevreuil commented on a change in pull request #2064:
URL: https://github.com/apache/hbase/pull/2064#discussion_r468097091



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
##########
@@ -770,4 +770,137 @@ void removeWorker(ReplicationSourceShipper worker) {
   private String logPeerId(){
     return "[Source for peer " + this.getPeer().getId() + "]:";
   }
+
+  @VisibleForTesting

Review comment:
       Better use _IA.Private_, instead. See: See: https://lists.apache.org/thread.html/r9a2df6a3b58e00c0c482d8660434d8ce6075863c18700978e6ea8b21%40%3Cdev.hbase.apache.org%3E

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
##########
@@ -130,8 +137,6 @@
   protected final ConcurrentHashMap<String, ReplicationSourceShipper> workerThreads =
       new ConcurrentHashMap<>();
 
-  private AtomicLong totalBufferUsed;

Review comment:
       Since we are cleaning out this extra, unnecessary variable, could we make "this.manager" package private (or provide a package private getter), so that source readers and source shippers don't have to define an additional reference to ReplicationSourceManager? 

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
##########
@@ -398,10 +402,11 @@ protected ReplicationSourceShipper createNewShipper(String walGroupId,
   }
 
   private ReplicationSourceWALReader createNewWALReader(String walGroupId,
-      PriorityBlockingQueue<Path> queue, long startPosition) {
-    return replicationPeer.getPeerConfig().isSerial()
-      ? new SerialReplicationSourceWALReader(fs, conf, queue, startPosition, walEntryFilter, this)
-      : new ReplicationSourceWALReader(fs, conf, queue, startPosition, walEntryFilter, this);
+    PriorityBlockingQueue<Path> queue, long startPosition) {
+    return replicationPeer.getPeerConfig().isSerial() ?
+      new SerialReplicationSourceWALReader(fs, conf, queue, startPosition, walEntryFilter, this,
+        manager) :
+      new ReplicationSourceWALReader(fs, conf, queue, startPosition, walEntryFilter, this, manager);

Review comment:
       Might not be needed if we make "ReplicationSource.manager" accessible (see my comments above).




----------------------------------------------------------------
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:
users@infra.apache.org