Search in sources :

Example 1 with ReopenTableRegionsProcedure

use of org.apache.hadoop.hbase.master.procedure.ReopenTableRegionsProcedure in project hbase by apache.

the class ModifyPeerProcedure method reopenRegions.

// will be override in test to simulate error
protected void reopenRegions(MasterProcedureEnv env) throws IOException {
    ReplicationPeerConfig peerConfig = getNewPeerConfig();
    ReplicationPeerConfig oldPeerConfig = getOldPeerConfig();
    TableStateManager tsm = env.getMasterServices().getTableStateManager();
    for (TableDescriptor td : env.getMasterServices().getTableDescriptors().getAll().values()) {
        if (!td.hasGlobalReplicationScope()) {
            continue;
        }
        TableName tn = td.getTableName();
        if (!peerConfig.needToReplicate(tn)) {
            continue;
        }
        if (oldPeerConfig != null && oldPeerConfig.isSerial() && oldPeerConfig.needToReplicate(tn)) {
            continue;
        }
        if (needReopen(tsm, tn)) {
            addChildProcedure(new ReopenTableRegionsProcedure(tn));
        }
    }
}
Also used : TableStateManager(org.apache.hadoop.hbase.master.TableStateManager) TableName(org.apache.hadoop.hbase.TableName) ReplicationPeerConfig(org.apache.hadoop.hbase.replication.ReplicationPeerConfig) ReopenTableRegionsProcedure(org.apache.hadoop.hbase.master.procedure.ReopenTableRegionsProcedure) TableDescriptor(org.apache.hadoop.hbase.client.TableDescriptor)

Aggregations

TableName (org.apache.hadoop.hbase.TableName)1 TableDescriptor (org.apache.hadoop.hbase.client.TableDescriptor)1 TableStateManager (org.apache.hadoop.hbase.master.TableStateManager)1 ReopenTableRegionsProcedure (org.apache.hadoop.hbase.master.procedure.ReopenTableRegionsProcedure)1 ReplicationPeerConfig (org.apache.hadoop.hbase.replication.ReplicationPeerConfig)1