View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional information regarding
4    * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
8    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
9    * for the specific language governing permissions and limitations under the License.
10   */
11  package org.apache.hadoop.hbase.replication.regionserver;
12  
13  import java.io.IOException;
14  
15  import org.apache.hadoop.conf.Configuration;
16  import org.apache.hadoop.hbase.HBaseInterfaceAudience;
17  import org.apache.hadoop.hbase.classification.InterfaceAudience;
18  
19  /**
20   * Interface that defines how a region server in peer cluster will get source cluster file system
21   * configurations. User can configure their custom implementation implementing this interface by
22   * setting the value of their custom implementation's fully qualified class name to
23   * hbase.replication.source.fs.conf.provider property in RegionServer configuration. Default is
24   * {@link DefaultSourceFSConfigurationProvider}
25   */
26  @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
27  public interface SourceFSConfigurationProvider {
28  
29    /**
30     * Returns the source cluster file system configuration for the given source cluster replication
31     * ID.
32     * @param sinkConf sink cluster configuration
33     * @param replicationClusterId unique ID which identifies the source cluster
34     * @return source cluster file system configuration
35     * @throws IOException for invalid directory or for a bad disk.
36     */
37    public Configuration getConf(Configuration sinkConf, String replicationClusterId)
38        throws IOException;
39  
40  }