Search in sources :

Example 1 with ProcedureCoordinationManager

use of org.apache.hadoop.hbase.procedure.ProcedureCoordinationManager in project hbase by apache.

the class LogRollMasterProcedureManager method initialize.

@Override
public void initialize(MasterServices master, MetricsMaster metricsMaster) throws IOException, UnsupportedOperationException {
    this.master = master;
    this.done = false;
    // setup the default procedure coordinator
    String name = master.getServerName().toString();
    // get the configuration for the coordinator
    Configuration conf = master.getConfiguration();
    long wakeFrequency = conf.getInt(BACKUP_WAKE_MILLIS_KEY, BACKUP_WAKE_MILLIS_DEFAULT);
    long timeoutMillis = conf.getLong(BACKUP_TIMEOUT_MILLIS_KEY, BACKUP_TIMEOUT_MILLIS_DEFAULT);
    int opThreads = conf.getInt(BACKUP_POOL_THREAD_NUMBER_KEY, BACKUP_POOL_THREAD_NUMBER_DEFAULT);
    // setup the default procedure coordinator
    ThreadPoolExecutor tpool = ProcedureCoordinator.defaultPool(name, opThreads);
    ProcedureCoordinationManager coordManager = new ZKProcedureCoordinationManager(master);
    ProcedureCoordinatorRpcs comms = coordManager.getProcedureCoordinatorRpcs(getProcedureSignature(), name);
    this.coordinator = new ProcedureCoordinator(comms, tpool, timeoutMillis, wakeFrequency);
}
Also used : ZKProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ZKProcedureCoordinationManager) ProcedureCoordinator(org.apache.hadoop.hbase.procedure.ProcedureCoordinator) Configuration(org.apache.hadoop.conf.Configuration) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) ZKProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ZKProcedureCoordinationManager) ProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ProcedureCoordinationManager) ProcedureCoordinatorRpcs(org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs)

Example 2 with ProcedureCoordinationManager

use of org.apache.hadoop.hbase.procedure.ProcedureCoordinationManager 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;
    }
    ProcedureCoordinationManager coordManager = new ZKProcedureCoordinationManager(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 : ZKProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ZKProcedureCoordinationManager) ProcedureMember(org.apache.hadoop.hbase.procedure.ProcedureMember) Configuration(org.apache.hadoop.conf.Configuration) ZKProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ZKProcedureCoordinationManager) ProcedureCoordinationManager(org.apache.hadoop.hbase.procedure.ProcedureCoordinationManager) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Aggregations

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