@Override public void stop() throws IOException { if (mIsPrimary) { LOG.info("{}: Stopping primary master.", getName()); } // Shut down the executor service, interrupting any running threads. if (mExecutorService != null) { try { mExecutorService.shutdownNow(); String awaitFailureMessage = "waiting for {} executor service to shut down. Daemons may still be running"; try { if (!mExecutorService.awaitTermination(SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { LOG.warn("Timed out " + awaitFailureMessage, this.getClass().getSimpleName()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warn("Interrupted while " + awaitFailureMessage, this.getClass().getSimpleName()); } } finally { mExecutorService = null; } } LOG.info("{}: Stopped {} master.", getName(), mIsPrimary ? "primary" : "secondary"); }
@Override public void start(Boolean isLeader) throws IOException { super.start(isLeader); }
@Override public void stop() throws IOException { if (mAsyncAuditLogWriter != null) { mAsyncAuditLogWriter.stop(); mAsyncAuditLogWriter = null; } super.stop(); }
@Override public void start(Boolean isLeader) throws IOException { super.start(isLeader); if (isLeader) { getExecutorService().submit(mClusterMetricsUpdater); } }
@Override public void start(Boolean isLeader) throws IOException { super.start(isLeader); if (isLeader) { mLostWorkerDetectionService = getExecutorService().submit(new HeartbeatThread( HeartbeatContext.MASTER_LOST_WORKER_DETECTION, new LostWorkerDetectionHeartbeatExecutor(), (int) Configuration.getMs(PropertyKey.MASTER_WORKER_HEARTBEAT_INTERVAL))); } }
@Override public void start(Boolean isPrimary) throws IOException { Preconditions.checkState(mExecutorService == null); mExecutorService = mExecutorServiceFactory.create(); mIsPrimary = isPrimary; if (mIsPrimary) { /** * The sequence for dealing with the journal before starting as the primary: * * 1. Replay the journal entries. * 2. Start the journal writer and optionally journal the master bootstrap states * if this is a fresh start. * * Since this method is called before the master RPC server starts serving, there is no * concurrent access to the master during these phases. */ LOG.info("{}: Starting primary master.", getName()); } }
@Override public void start(Boolean isLeader) throws IOException { super.start(isLeader); if (isLeader) { getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_CHECKPOINT_SCHEDULING, new CheckpointSchedulingExecutor(this, mFileSystemMaster), (int) Configuration.getMs(PropertyKey.MASTER_LINEAGE_CHECKPOINT_INTERVAL_MS))); getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_FILE_RECOMPUTATION, new RecomputeExecutor(new RecomputePlanner(mLineageStore, mFileSystemMaster), mFileSystemMaster), (int) Configuration.getMs(PropertyKey.MASTER_LINEAGE_RECOMPUTE_INTERVAL_MS))); } }
@Override public void stop() throws IOException { if (mIsPrimary) { LOG.info("{}: Stopping primary master.", getName()); } // Shut down the executor service, interrupting any running threads. if (mExecutorService != null) { try { mExecutorService.shutdownNow(); String awaitFailureMessage = "waiting for {} executor service to shut down. Daemons may still be running"; try { if (!mExecutorService.awaitTermination(SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { LOG.warn("Timed out " + awaitFailureMessage, this.getClass().getSimpleName()); } } catch (InterruptedException e) { LOG.warn("Interrupted while " + awaitFailureMessage, this.getClass().getSimpleName()); } } finally { mExecutorService = null; } } LOG.info("{}: Stopped {} master.", getName(), mIsPrimary ? "primary" : "secondary"); }
@Override public void start(Boolean isPrimary) throws IOException { super.start(isPrimary); mWorkerConfigStore.reset(); mMasterConfigStore.reset();
@Override public void start(Boolean isPrimary) throws IOException { Preconditions.checkState(mExecutorService == null); mExecutorService = mExecutorServiceFactory.create(); mIsPrimary = isPrimary; if (mIsPrimary) { /** * The sequence for dealing with the journal before starting as the primary: * * 1. Replay the journal entries. * 2. Start the journal writer and optionally journal the master bootstrap states * if this is a fresh start. * * Since this method is called before the master RPC server starts serving, there is no * concurrent access to the master during these phases. */ LOG.info("{}: Starting primary master.", getName()); } }
@Override public void start(Boolean isPrimary) throws IOException { super.start(isPrimary); if (isPrimary) { LOG.info("Starting fs master as primary");