Search in sources :

Example 1 with ProcedureMember

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

the class RegionServerSnapshotManager method initialize.

/**
 * Create a default snapshot handler - uses a zookeeper based member controller.
 * @param rss region server running the handler
 * @throws KeeperException if the zookeeper cluster cannot be reached
 */
@Override
public void initialize(RegionServerServices rss) throws KeeperException {
    this.rss = rss;
    ZKWatcher zkw = rss.getZooKeeper();
    this.memberRpcs = new ZKProcedureMemberRpcs(zkw, SnapshotManager.ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION);
    // read in the snapshot request configuration properties
    Configuration conf = rss.getConfiguration();
    long keepAlive = conf.getLong(SNAPSHOT_TIMEOUT_MILLIS_KEY, SNAPSHOT_TIMEOUT_MILLIS_DEFAULT);
    int opThreads = conf.getInt(SNAPSHOT_REQUEST_THREADS_KEY, SNAPSHOT_REQUEST_THREADS_DEFAULT);
    // create the actual snapshot procedure member
    ThreadPoolExecutor pool = ProcedureMember.defaultPool(rss.getServerName().toString(), opThreads, keepAlive);
    this.member = new ProcedureMember(memberRpcs, pool, new SnapshotSubprocedureBuilder());
}
Also used : ProcedureMember(org.apache.hadoop.hbase.procedure.ProcedureMember) Configuration(org.apache.hadoop.conf.Configuration) ZKWatcher(org.apache.hadoop.hbase.zookeeper.ZKWatcher) ZKProcedureMemberRpcs(org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Example 2 with ProcedureMember

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

the class RegionServerFlushTableProcedureManager method initialize.

/**
 * Initialize this region server flush procedure manager
 * Uses a zookeeper based member controller.
 * @param rss region server
 * @throws KeeperException if the zookeeper cannot be reached
 */
@Override
public void initialize(RegionServerServices rss) throws KeeperException {
    this.rss = rss;
    ZKWatcher zkw = rss.getZooKeeper();
    this.memberRpcs = new ZKProcedureMemberRpcs(zkw, MasterFlushTableProcedureManager.FLUSH_TABLE_PROCEDURE_SIGNATURE);
    Configuration conf = rss.getConfiguration();
    long keepAlive = conf.getLong(FLUSH_TIMEOUT_MILLIS_KEY, FLUSH_TIMEOUT_MILLIS_DEFAULT);
    int opThreads = conf.getInt(FLUSH_REQUEST_THREADS_KEY, FLUSH_REQUEST_THREADS_DEFAULT);
    // create the actual flush table procedure member
    ThreadPoolExecutor pool = ProcedureMember.defaultPool(rss.getServerName().toString(), opThreads, keepAlive);
    this.member = new ProcedureMember(memberRpcs, pool, new FlushTableSubprocedureBuilder());
}
Also used : ProcedureMember(org.apache.hadoop.hbase.procedure.ProcedureMember) Configuration(org.apache.hadoop.conf.Configuration) ZKWatcher(org.apache.hadoop.hbase.zookeeper.ZKWatcher) ZKProcedureMemberRpcs(org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Example 3 with ProcedureMember

use of org.apache.hadoop.hbase.procedure.ProcedureMember 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)3 Configuration (org.apache.hadoop.conf.Configuration)3 ProcedureMember (org.apache.hadoop.hbase.procedure.ProcedureMember)3 ZKProcedureMemberRpcs (org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs)2 ZKWatcher (org.apache.hadoop.hbase.zookeeper.ZKWatcher)2 ProcedureCoordinationManager (org.apache.hadoop.hbase.procedure.ProcedureCoordinationManager)1 ZKProcedureCoordinationManager (org.apache.hadoop.hbase.procedure.ZKProcedureCoordinationManager)1