1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.replication;
20
21 import org.apache.hadoop.hbase.classification.InterfaceAudience;
22 import org.apache.hadoop.conf.Configuration;
23 import org.apache.hadoop.hbase.Abortable;
24 import org.apache.hadoop.hbase.Stoppable;
25 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
26
27
28
29
30 @InterfaceAudience.Private
31 public class ReplicationFactory {
32
33 public static ReplicationQueues getReplicationQueues(final ZooKeeperWatcher zk,
34 Configuration conf, Abortable abortable) {
35 return new ReplicationQueuesZKImpl(zk, conf, abortable);
36 }
37
38 public static ReplicationQueuesClient getReplicationQueuesClient(final ZooKeeperWatcher zk,
39 Configuration conf, Abortable abortable) {
40 return new ReplicationQueuesClientZKImpl(zk, conf, abortable);
41 }
42
43 public static ReplicationPeers getReplicationPeers(final ZooKeeperWatcher zk, Configuration conf,
44 Abortable abortable) {
45 return getReplicationPeers(zk, conf, null, abortable);
46 }
47
48 public static ReplicationPeers getReplicationPeers(final ZooKeeperWatcher zk, Configuration conf,
49 final ReplicationQueuesClient queuesClient, Abortable abortable) {
50 return new ReplicationPeersZKImpl(zk, conf, queuesClient, abortable);
51 }
52
53 public static ReplicationTracker getReplicationTracker(ZooKeeperWatcher zookeeper,
54 final ReplicationPeers replicationPeers, Configuration conf, Abortable abortable,
55 Stoppable stopper) {
56 return new ReplicationTrackerZKImpl(zookeeper, replicationPeers, conf, abortable, stopper);
57 }
58 }