wchevreuil commented on code in PR #6532:
URL: https://github.com/apache/hbase/pull/6532#discussion_r1879993151


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java:
##########
@@ -260,14 +264,27 @@ private WALFactory(Configuration conf, String factoryId, 
Abortable abortable) th
     // end required early initialization
     if (conf.getBoolean(WAL_ENABLED, true)) {
       WALProvider provider = createProvider(getProviderClass(WAL_PROVIDER, 
DEFAULT_WAL_PROVIDER));
+      WALProvider providerInReplicationScope =
+        createProvider(getProviderClass(WAL_PROVIDER, DEFAULT_WAL_PROVIDER));
       provider.init(this, conf, null, this.abortable);
       provider.addWALActionsListener(new MetricsWAL());
       this.provider = provider;
+
+      if (conf.getBoolean(REPLICATION_WAL_FILTER_BY_SCOPE_ENABLED,
+          REPLICATION_WAL_FILTER_BY_SCOPE_ENABLED_DEFAULT)) {
+        providerInReplicationScope.init(this, conf,
+          AbstractFSWALProvider.REPLICATION_WAL_PROVIDER_ID, this.abortable);
+        providerInReplicationScope.addWALActionsListener(new MetricsWAL());
+        this.providerInReplicationScope = providerInReplicationScope;
+      } else {
+        this.providerInReplicationScope = null;
+      }
     } else {
       // special handling of existing configuration behavior.
       LOG.warn("Running with WAL disabled.");
       provider = new DisabledWALProvider();
       provider.init(this, conf, factoryId, null);
+      providerInReplicationScope = null;

Review Comment:
   nit: do we really need setting null here?



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