saintstack commented on a change in pull request #2413:
URL: https://github.com/apache/hbase/pull/2413#discussion_r490414044
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceFactory.java
##########
@@ -18,37 +17,52 @@
*/
package org.apache.hadoop.hbase.replication.regionserver;
+import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.replication.ReplicationQueueInfo;
+import org.apache.hadoop.hbase.wal.WALFactory;
+import org.apache.hadoop.hbase.wal.WALProvider;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.hadoop.hbase.replication.ReplicationQueueInfo;
/**
- * Constructs a {@link ReplicationSourceInterface}
+ * Constructs appropriate {@link ReplicationSourceInterface}.
+ * Considers whether Recovery or not, whether hbase:meta Region Read Replicas
or not, etc.
*/
@InterfaceAudience.Private
-public class ReplicationSourceFactory {
-
+public final class ReplicationSourceFactory {
private static final Logger LOG =
LoggerFactory.getLogger(ReplicationSourceFactory.class);
- static ReplicationSourceInterface create(Configuration conf, String queueId)
{
+ private ReplicationSourceFactory() {}
+
+ static ReplicationSourceInterface create(Configuration conf, String queueId,
+ WALFactory walFactory) throws IOException {
+ // Check for the marker name used to enable a replication source for
hbase:meta for region read
+ // replicas. There is no peer nor use of replication storage (or need for
queue recovery) when
+ // running hbase:meta region read replicas.
+ if
(ReplicationSourceManager.META_REGION_REPLICA_REPLICATION_SOURCE.equals(queueId))
{
+ return new HBaseMetaNoQueueStoreReplicationSource(walFactory == null?
Review comment:
Removed. It shouldn't be null.
----------------------------------------------------------------
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]