001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
003 * agreements. See the NOTICE file distributed with this work for additional information regarding
004 * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
005 * "License"); you may not use this file except in compliance with the License. You may obtain a
006 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
007 * law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
008 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
009 * for the specific language governing permissions and limitations under the License.
010 */
011package org.apache.hadoop.hbase.replication.regionserver;
012
013import java.io.IOException;
014
015import org.apache.hadoop.conf.Configuration;
016import org.apache.hadoop.hbase.HBaseInterfaceAudience;
017import org.apache.yetus.audience.InterfaceAudience;
018
019/**
020 * Interface that defines how a region server in peer cluster will get source cluster file system
021 * configurations. User can configure their custom implementation implementing this interface by
022 * setting the value of their custom implementation's fully qualified class name to
023 * hbase.replication.source.fs.conf.provider property in RegionServer configuration. Default is
024 * {@link DefaultSourceFSConfigurationProvider}
025 */
026@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION)
027public interface SourceFSConfigurationProvider {
028
029  /**
030   * Returns the source cluster file system configuration for the given source cluster replication
031   * ID.
032   * @param sinkConf sink cluster configuration
033   * @param replicationClusterId unique ID which identifies the source cluster
034   * @return source cluster file system configuration
035   * @throws IOException for invalid directory or for a bad disk.
036   */
037  public Configuration getConf(Configuration sinkConf, String replicationClusterId)
038      throws IOException;
039
040}