Search in sources :

Example 41 with MasterCoprocessorHost

use of org.apache.hadoop.hbase.master.MasterCoprocessorHost in project hbase by apache.

the class UpdatePeerConfigProcedure method postPeerModification.

@Override
protected void postPeerModification(MasterProcedureEnv env) throws IOException, ReplicationException {
    if (oldPeerConfig.isSerial() && !peerConfig.isSerial()) {
        env.getReplicationPeerManager().removeAllLastPushedSeqIds(peerId);
    }
    LOG.info("Successfully updated peer config of {} to {}", peerId, peerConfig);
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
        cpHost.postUpdateReplicationPeerConfig(peerId, peerConfig);
    }
}
Also used : MasterCoprocessorHost(org.apache.hadoop.hbase.master.MasterCoprocessorHost)

Example 42 with MasterCoprocessorHost

use of org.apache.hadoop.hbase.master.MasterCoprocessorHost in project hbase by apache.

the class AddPeerProcedure method postPeerModification.

@Override
protected void postPeerModification(MasterProcedureEnv env) throws IOException, ReplicationException {
    LOG.info("Successfully added {} peer {}, config {}", enabled ? "ENABLED" : "DISABLED", peerId, peerConfig);
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
        env.getMasterCoprocessorHost().postAddReplicationPeer(peerId, peerConfig);
    }
}
Also used : MasterCoprocessorHost(org.apache.hadoop.hbase.master.MasterCoprocessorHost)

Example 43 with MasterCoprocessorHost

use of org.apache.hadoop.hbase.master.MasterCoprocessorHost in project hbase by apache.

the class AddPeerProcedure method prePeerModification.

@Override
protected void prePeerModification(MasterProcedureEnv env) throws IOException, ReplicationException, InterruptedException {
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
        cpHost.preAddReplicationPeer(peerId, peerConfig);
    }
    if (peerConfig.isSyncReplication()) {
        env.getReplicationPeerManager().acquireSyncReplicationPeerLock();
    }
    env.getReplicationPeerManager().preAddPeer(peerId, peerConfig);
}
Also used : MasterCoprocessorHost(org.apache.hadoop.hbase.master.MasterCoprocessorHost)

Example 44 with MasterCoprocessorHost

use of org.apache.hadoop.hbase.master.MasterCoprocessorHost in project hbase by apache.

the class DisablePeerProcedure method postPeerModification.

@Override
protected void postPeerModification(MasterProcedureEnv env) throws IOException {
    LOG.info("Successfully disabled peer {}", peerId);
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
        cpHost.postDisableReplicationPeer(peerId);
    }
}
Also used : MasterCoprocessorHost(org.apache.hadoop.hbase.master.MasterCoprocessorHost)

Example 45 with MasterCoprocessorHost

use of org.apache.hadoop.hbase.master.MasterCoprocessorHost in project hbase by apache.

the class EnablePeerProcedure method prePeerModification.

@Override
protected void prePeerModification(MasterProcedureEnv env) throws IOException {
    MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
    if (cpHost != null) {
        cpHost.preEnableReplicationPeer(peerId);
    }
    env.getReplicationPeerManager().preEnablePeer(peerId);
}
Also used : MasterCoprocessorHost(org.apache.hadoop.hbase.master.MasterCoprocessorHost)

Aggregations

MasterCoprocessorHost (org.apache.hadoop.hbase.master.MasterCoprocessorHost)62 Test (org.junit.Test)18 IOException (java.io.IOException)16 HMaster (org.apache.hadoop.hbase.master.HMaster)14 SingleProcessHBaseCluster (org.apache.hadoop.hbase.SingleProcessHBaseCluster)13 TableName (org.apache.hadoop.hbase.TableName)12 RegionServerCoprocessorHost (org.apache.hadoop.hbase.regionserver.RegionServerCoprocessorHost)7 BeforeClass (org.junit.BeforeClass)7 ArrayList (java.util.ArrayList)6 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)6 TableDescriptor (org.apache.hadoop.hbase.client.TableDescriptor)6 Admin (org.apache.hadoop.hbase.client.Admin)5 Configuration (org.apache.hadoop.conf.Configuration)4 Path (org.apache.hadoop.fs.Path)4 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)4 Mutation (org.apache.hadoop.hbase.client.Mutation)4 InterruptedIOException (java.io.InterruptedIOException)3 FileSystem (org.apache.hadoop.fs.FileSystem)3 MasterFileSystem (org.apache.hadoop.hbase.master.MasterFileSystem)3 FileNotFoundException (java.io.FileNotFoundException)2