Search in sources :

Example 1 with RegionProcedureStore

use of org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore in project hbase by apache.

the class RegionProcedureStoreTestHelper method createStore.

static RegionProcedureStore createStore(Server server, MasterRegion region, ProcedureLoader loader) throws IOException {
    RegionProcedureStore store = new RegionProcedureStore(server, region, new LeaseRecovery() {

        @Override
        public void recoverFileLease(FileSystem fs, Path path) throws IOException {
        }
    });
    store.start(1);
    store.recoverLease();
    store.load(loader);
    return store;
}
Also used : Path(org.apache.hadoop.fs.Path) LeaseRecovery(org.apache.hadoop.hbase.procedure2.store.LeaseRecovery) FileSystem(org.apache.hadoop.fs.FileSystem) IOException(java.io.IOException)

Example 2 with RegionProcedureStore

use of org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore in project hbase by apache.

the class HMaster method createProcedureExecutor.

private void createProcedureExecutor() throws IOException {
    MasterProcedureEnv procEnv = new MasterProcedureEnv(this);
    procedureStore = new RegionProcedureStore(this, masterRegion, new MasterProcedureEnv.FsUtilsLeaseRecovery(this));
    procedureStore.registerListener(new ProcedureStoreListener() {

        @Override
        public void abortProcess() {
            abort("The Procedure Store lost the lease", null);
        }
    });
    MasterProcedureScheduler procedureScheduler = procEnv.getProcedureScheduler();
    procedureExecutor = new ProcedureExecutor<>(conf, procEnv, procedureStore, procedureScheduler);
    configurationManager.registerObserver(procEnv);
    int cpus = Runtime.getRuntime().availableProcessors();
    final int numThreads = conf.getInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, Math.max((cpus > 0 ? cpus / 4 : 0), MasterProcedureConstants.DEFAULT_MIN_MASTER_PROCEDURE_THREADS));
    final boolean abortOnCorruption = conf.getBoolean(MasterProcedureConstants.EXECUTOR_ABORT_ON_CORRUPTION, MasterProcedureConstants.DEFAULT_EXECUTOR_ABORT_ON_CORRUPTION);
    procedureStore.start(numThreads);
    // Just initialize it but do not start the workers, we will start the workers later by calling
    // startProcedureExecutor. See the javadoc for finishActiveMasterInitialization for more
    // details.
    procedureExecutor.init(numThreads, abortOnCorruption);
    if (!procEnv.getRemoteDispatcher().start()) {
        throw new HBaseIOException("Failed start of remote dispatcher");
    }
}
Also used : HBaseIOException(org.apache.hadoop.hbase.HBaseIOException) RegionProcedureStore(org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore) MasterProcedureEnv(org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv) MasterProcedureScheduler(org.apache.hadoop.hbase.master.procedure.MasterProcedureScheduler) ProcedureStoreListener(org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureStoreListener) RSGroupAdminEndpoint(org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint)

Aggregations

IOException (java.io.IOException)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)1 MasterProcedureEnv (org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv)1 MasterProcedureScheduler (org.apache.hadoop.hbase.master.procedure.MasterProcedureScheduler)1 LeaseRecovery (org.apache.hadoop.hbase.procedure2.store.LeaseRecovery)1 ProcedureStoreListener (org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureStoreListener)1 RegionProcedureStore (org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore)1 RSGroupAdminEndpoint (org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint)1