Search in sources :

Example 1 with BaseCoordinatedStateManager

use of org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager in project hbase by apache.

the class LogRollMasterProcedureManager method initialize.

@Override
public void initialize(MasterServices master, MetricsMaster metricsMaster) throws KeeperException, IOException, UnsupportedOperationException {
    this.master = master;
    this.done = false;
    // setup the default procedure coordinator
    String name = master.getServerName().toString();
    ThreadPoolExecutor tpool = ProcedureCoordinator.defaultPool(name, 1);
    BaseCoordinatedStateManager coordManager = (BaseCoordinatedStateManager) CoordinatedStateManagerFactory.getCoordinatedStateManager(master.getConfiguration());
    coordManager.initialize(master);
    ProcedureCoordinatorRpcs comms = coordManager.getProcedureCoordinatorRpcs(getProcedureSignature(), name);
    this.coordinator = new ProcedureCoordinator(comms, tpool);
}
Also used : ProcedureCoordinator(org.apache.hadoop.hbase.procedure.ProcedureCoordinator) BaseCoordinatedStateManager(org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) ProcedureCoordinatorRpcs(org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs)

Example 2 with BaseCoordinatedStateManager

use of org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager in project hbase by apache.

the class LogRollRegionServerProcedureManager method initialize.

@Override
public void initialize(RegionServerServices rss) throws KeeperException {
    this.rss = rss;
    if (!BackupManager.isBackupEnabled(rss.getConfiguration())) {
        LOG.warn("Backup is not enabled. Check your " + BackupRestoreConstants.BACKUP_ENABLE_KEY + " setting");
        return;
    }
    BaseCoordinatedStateManager coordManager = (BaseCoordinatedStateManager) CoordinatedStateManagerFactory.getCoordinatedStateManager(rss.getConfiguration());
    coordManager.initialize(rss);
    this.memberRpcs = coordManager.getProcedureMemberRpcs(LogRollMasterProcedureManager.ROLLLOG_PROCEDURE_SIGNATURE);
    // read in the backup handler configuration properties
    Configuration conf = rss.getConfiguration();
    long keepAlive = conf.getLong(BACKUP_TIMEOUT_MILLIS_KEY, BACKUP_TIMEOUT_MILLIS_DEFAULT);
    int opThreads = conf.getInt(BACKUP_REQUEST_THREADS_KEY, BACKUP_REQUEST_THREADS_DEFAULT);
    // create the actual cohort member
    ThreadPoolExecutor pool = ProcedureMember.defaultPool(rss.getServerName().toString(), opThreads, keepAlive);
    this.member = new ProcedureMember(memberRpcs, pool, new BackupSubprocedureBuilder());
}
Also used : ProcedureMember(org.apache.hadoop.hbase.procedure.ProcedureMember) BaseCoordinatedStateManager(org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager) Configuration(org.apache.hadoop.conf.Configuration) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Aggregations

ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)2 BaseCoordinatedStateManager (org.apache.hadoop.hbase.coordination.BaseCoordinatedStateManager)2 Configuration (org.apache.hadoop.conf.Configuration)1 ProcedureCoordinator (org.apache.hadoop.hbase.procedure.ProcedureCoordinator)1 ProcedureCoordinatorRpcs (org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs)1 ProcedureMember (org.apache.hadoop.hbase.procedure.ProcedureMember)1