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.util.HashMap;
22  import java.util.Map;
23  import java.util.TreeMap;
24  
25  import org.apache.hadoop.hbase.classification.InterfaceAudience;
26  import org.apache.hadoop.hbase.classification.InterfaceStability;
27  import org.apache.hadoop.hbase.util.Bytes;
28  
29  
30  
31  
32  @InterfaceAudience.Public
33  @InterfaceStability.Evolving
34  public class ReplicationPeerConfig {
35  
36    private String clusterKey;
37    private String replicationEndpointImpl;
38    private final Map<byte[], byte[]> peerData;
39    private final Map<String, String> configuration;
40  
41  
42    public ReplicationPeerConfig() {
43      this.peerData = new TreeMap<byte[], byte[]>(Bytes.BYTES_COMPARATOR);
44      this.configuration = new HashMap<String, String>(0);
45    }
46  
47    
48  
49  
50  
51    public ReplicationPeerConfig setClusterKey(String clusterKey) {
52      this.clusterKey = clusterKey;
53      return this;
54    }
55  
56    
57  
58  
59  
60    public ReplicationPeerConfig setReplicationEndpointImpl(String replicationEndpointImpl) {
61      this.replicationEndpointImpl = replicationEndpointImpl;
62      return this;
63    }
64  
65    public String getClusterKey() {
66      return clusterKey;
67    }
68  
69    public String getReplicationEndpointImpl() {
70      return replicationEndpointImpl;
71    }
72  
73    public Map<byte[], byte[]> getPeerData() {
74      return peerData;
75    }
76  
77    public Map<String, String> getConfiguration() {
78      return configuration;
79    }
80  
81    @Override
82    public String toString() {
83      StringBuilder builder = new StringBuilder("clusterKey=").append(clusterKey).append(",");
84      builder.append("replicationEndpointImpl=").append(replicationEndpointImpl);
85      return builder.toString();
86    }
87  }