private void startServices() throws IOException { if (!isStopped() && !isAborted()) { initializeThreads();
/** * All initialization needed before we go register with Master. * * @throws IOException * @throws InterruptedException */ private void preRegistrationInitialization(){ try { initializeZooKeeper(); clusterId = new ClusterId(zooKeeper, this); if(clusterId.hasId()) { conf.set(HConstants.CLUSTER_ID, clusterId.getId()); } initializeThreads(); int nbBlocks = conf.getInt("hbase.regionserver.nbreservationblocks", 4); for (int i = 0; i < nbBlocks; i++) { reservedSpace.add(new byte[HConstants.DEFAULT_SIZE_RESERVATION_BLOCK]); } this.rpcEngine = HBaseRPC.getProtocolEngine(conf); } catch (Throwable t) { // Call stop if error or process will stick around for ever since server // puts up non-daemon threads. this.rpcServer.stop(); abort("Initialization of RS failed. Hence aborting RS.", t); } }
/** * All initialization needed before we go register with Master. * * @throws IOException * @throws InterruptedException */ private void preRegistrationInitialization(){ try { setupClusterConnection(); // Health checker thread. if (isHealthCheckerConfigured()) { int sleepTime = this.conf.getInt(HConstants.HEALTH_CHORE_WAKE_FREQ, HConstants.DEFAULT_THREAD_WAKE_FREQUENCY); healthCheckChore = new HealthCheckChore(sleepTime, this, getConfiguration()); } this.pauseMonitor = new JvmPauseMonitor(conf); pauseMonitor.start(); initializeZooKeeper(); if (!isStopped() && !isAborted()) { initializeThreads(); } } catch (Throwable t) { // Call stop if error or process will stick around for ever since server // puts up non-daemon threads. this.rpcServices.stop(); abort("Initialization of RS failed. Hence aborting RS.", t); } }