protected void stopMasters() { try { if (LineageUtils.isLineageEnabled(MasterContext.getConf())) { mLineageMaster.stop(); } mBlockMaster.stop(); mFileSystemMaster.stop(); mRawTableMaster.stop(); } catch (IOException e) { LOG.error(e.getMessage(), e); throw Throwables.propagate(e); } }
protected void startMasters(boolean isLeader) { try { connectToUFS(); mBlockMaster.start(isLeader); mFileSystemMaster.start(isLeader); mRawTableMaster.start(isLeader); if (LineageUtils.isLineageEnabled(MasterContext.getConf())) { mLineageMaster.start(isLeader); } } catch (IOException e) { LOG.error(e.getMessage(), e); throw Throwables.propagate(e); } }
/** * Runs the block worker. The thread calling this will be blocked until the thrift server shuts * down. */ public void process() { mWorkerMetricsSystem.start(); // Add the metrics servlet to the web server, this must be done after the metrics system starts mWebServer.addHandler(mWorkerMetricsSystem.getServletHandler()); mSyncExecutorService.submit(mBlockMasterSync); // Start the pinlist syncer to perform the periodical fetching mSyncExecutorService.submit(mPinListSync); // Start the session cleanup checker to perform the periodical checking mSyncExecutorService.submit(mSessionCleanerThread); // Start the lineage worker if (LineageUtils.isLineageEnabled(WorkerContext.getConf())) { mLineageWorker.start(); } // Start the space reserver if (mSpaceReserver != null) { mSyncExecutorService.submit(mSpaceReserver); } mWebServer.startWebServer(); mThriftServer.serve(); }
mFileSystemMaster = new FileSystemMaster(mBlockMaster, mFileSystemMasterJournal); mRawTableMaster = new RawTableMaster(mFileSystemMaster, mRawTableMasterJournal); if (LineageUtils.isLineageEnabled(MasterContext.getConf())) { mLineageMaster = new LineageMaster(mFileSystemMaster, mLineageMasterJournal);
mThriftServer.stop(); mThriftServerSocket.close(); if (LineageUtils.isLineageEnabled(WorkerContext.getConf())) { mLineageWorker.stop();
if (LineageUtils.isLineageEnabled(WorkerContext.getConf())) { mLineageWorker = new LineageWorker(mBlockDataManager);
protected void startServingRPCServer() { // set up multiplexed thrift processors TMultiplexedProcessor processor = new TMultiplexedProcessor(); processor.registerProcessor(mBlockMaster.getServiceName(), mBlockMaster.getProcessor()); processor.registerProcessor(mFileSystemMaster.getServiceName(), mFileSystemMaster.getProcessor()); processor.registerProcessor(mRawTableMaster.getServiceName(), mRawTableMaster.getProcessor()); if (LineageUtils.isLineageEnabled(MasterContext.getConf())) { processor.registerProcessor(mLineageMaster.getServiceName(), mLineageMaster.getProcessor()); } // Return a TTransportFactory based on the authentication type TTransportFactory transportFactory; try { transportFactory = AuthenticationUtils.getServerTransportFactory(MasterContext.getConf()); } catch (IOException ioe) { throw Throwables.propagate(ioe); } // create master thrift service with the multiplexed processor. mMasterServiceServer = new TThreadPoolServer(new TThreadPoolServer.Args(mTServerSocket) .maxWorkerThreads(mMaxWorkerThreads).minWorkerThreads(mMinWorkerThreads) .processor(processor).transportFactory(transportFactory) .protocolFactory(new TBinaryProtocol.Factory(true, true))); // start thrift rpc server mIsServing = true; mStartTimeMs = System.currentTimeMillis(); mMasterServiceServer.serve(); }