001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.replication;
019
020import java.util.List;
021import java.util.Map;
022import java.util.Set;
023
024import org.apache.hadoop.conf.Configuration;
025import org.apache.hadoop.hbase.HBaseInterfaceAudience;
026import org.apache.hadoop.hbase.TableName;
027import org.apache.yetus.audience.InterfaceAudience;
028
029
030/**
031 * ReplicationPeer manages enabled / disabled state for the peer.
032 */
033@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
034public interface ReplicationPeer {
035
036  /**
037   * State of the peer, whether it is enabled or not
038   */
039  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
040  enum PeerState {
041    ENABLED,
042    DISABLED
043  }
044
045  /**
046   * Get the identifier of this peer
047   * @return string representation of the id
048   */
049  String getId();
050
051  /**
052   * Get the peer config object
053   * @return the ReplicationPeerConfig for this peer
054   */
055  public ReplicationPeerConfig getPeerConfig();
056
057  /**
058   * Returns the state of the peer
059   * @return the enabled state
060   */
061  PeerState getPeerState();
062
063  /**
064   * Get the configuration object required to communicate with this peer
065   * @return configuration object
066   */
067  public Configuration getConfiguration();
068
069  /**
070   * Get replicable (table, cf-list) map of this peer
071   * @return the replicable (table, cf-list) map
072   */
073  public Map<TableName, List<String>> getTableCFs();
074
075  /**
076   * Get replicable namespace set of this peer
077   * @return the replicable namespaces set
078   */
079  public Set<String> getNamespaces();
080
081  /**
082   * Get the per node bandwidth upper limit for this peer
083   * @return the bandwidth upper limit
084   */
085  public long getPeerBandwidth();
086
087  void trackPeerConfigChanges(ReplicationPeerConfigListener listener);
088
089}