View Javadoc

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  package org.apache.hadoop.hbase.replication;
20  
21  import org.apache.hadoop.hbase.classification.InterfaceAudience;
22  
23  import java.util.List;
24  
25  /**
26   * This is the interface for a Replication Tracker. A replication tracker provides the facility to
27   * subscribe and track events that reflect a change in replication state. These events are used by
28   * the ReplicationSourceManager to coordinate replication tasks such as addition/deletion of queues
29   * and queue failover. These events are defined in the ReplicationListener interface. If a class
30   * would like to listen to replication events it must implement the ReplicationListener interface
31   * and register itself with a Replication Tracker.
32   */
33  @InterfaceAudience.Private
34  public interface ReplicationTracker {
35  
36    /**
37     * Register a replication listener to receive replication events.
38     * @param listener
39     */
40    public void registerListener(ReplicationListener listener);
41  
42    public void removeListener(ReplicationListener listener);
43  
44    /**
45     * Returns a list of other live region servers in the cluster.
46     * @return List of region servers.
47     */
48    public List<String> getListOfRegionServers();
49  }