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 java.io.IOException;
22 import java.util.List;
23 import java.util.UUID;
24
25 import org.apache.hadoop.conf.Configuration;
26 import org.apache.hadoop.fs.FileSystem;
27 import org.apache.hadoop.fs.Path;
28 import org.apache.hadoop.hbase.Stoppable;
29 import org.apache.hadoop.hbase.TableName;
30 import org.apache.hadoop.hbase.replication.regionserver.MetricsSource;
31 import org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceInterface;
32 import org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceManager;
33 import org.apache.hadoop.hbase.util.Pair;
34
35
36
37
38 public class ReplicationSourceDummy implements ReplicationSourceInterface {
39
40 ReplicationSourceManager manager;
41 String peerClusterId;
42 Path currentPath;
43
44 @Override
45 public void init(Configuration conf, FileSystem fs, ReplicationSourceManager manager,
46 ReplicationQueues rq, ReplicationPeers rp, Stoppable stopper, String peerClusterId,
47 UUID clusterId, ReplicationEndpoint replicationEndpoint, MetricsSource metrics)
48 throws IOException {
49
50 this.manager = manager;
51 this.peerClusterId = peerClusterId;
52 }
53
54 @Override
55 public void enqueueLog(Path log) {
56 this.currentPath = log;
57 }
58
59 @Override
60 public Path getCurrentPath() {
61 return this.currentPath;
62 }
63
64 @Override
65 public void startup() {
66
67 }
68
69 @Override
70 public void terminate(String reason) {
71
72 }
73
74 @Override
75 public void terminate(String reason, Exception e) {
76
77 }
78
79 @Override
80 public String getPeerClusterZnode() {
81 return peerClusterId;
82 }
83
84 @Override
85 public String getPeerClusterId() {
86 String[] parts = peerClusterId.split("-", 2);
87 return parts.length != 1 ?
88 parts[0] : peerClusterId;
89 }
90
91 @Override
92 public String getStats() {
93 return "";
94 }
95
96 @Override
97 public void addHFileRefs(TableName tableName, byte[] family, List<Pair<Path, Path>> files)
98 throws ReplicationException {
99 return;
100 }
101 }