public YarnApplicationStatusMonitor( YarnClient yarnClient, ApplicationId yarnApplicationId, ScheduledExecutor scheduledExecutor) { this.yarnClient = Preconditions.checkNotNull(yarnClient); this.yarnApplicationId = Preconditions.checkNotNull(yarnApplicationId); applicationStatusUpdateFuture = scheduledExecutor.scheduleWithFixedDelay( this::updateApplicationStatus, 0L, UPDATE_INTERVAL, TimeUnit.MILLISECONDS); applicationStatus = ApplicationStatus.UNKNOWN; }
@Override public void restart(final RestartCallback restarter, ScheduledExecutor executor) { currentRestartAttempt++; executor.schedule(new Runnable() { @Override public void run() { restarter.triggerFullRecovery(); } }, delayBetweenRestartAttempts, TimeUnit.MILLISECONDS); }
public HeartbeatManagerSenderImpl( long heartbeatPeriod, long heartbeatTimeout, ResourceID ownResourceID, HeartbeatListener<I, O> heartbeatListener, Executor executor, ScheduledExecutor scheduledExecutor, Logger log) { super( heartbeatTimeout, ownResourceID, heartbeatListener, executor, scheduledExecutor, log); triggerFuture = scheduledExecutor.scheduleAtFixedRate(this, 0L, heartbeatPeriod, TimeUnit.MILLISECONDS); }
@Override public void restart(final RestartCallback restarter, ScheduledExecutor executor) { currentRestartAttempt++; executor.schedule(new Runnable() { @Override public void run() { restarter.triggerFullRecovery(); } }, delayBetweenRestartAttempts, TimeUnit.MILLISECONDS); }
public HeartbeatManagerSenderImpl( long heartbeatPeriod, long heartbeatTimeout, ResourceID ownResourceID, HeartbeatListener<I, O> heartbeatListener, Executor executor, ScheduledExecutor scheduledExecutor, Logger log) { super( heartbeatTimeout, ownResourceID, heartbeatListener, executor, scheduledExecutor, log); triggerFuture = scheduledExecutor.scheduleAtFixedRate(this, 0L, heartbeatPeriod, TimeUnit.MILLISECONDS); }
this.executionGraphCleanupTask = scheduledExecutor.scheduleWithFixedDelay( executionGraphCache::cleanup, cleanupInterval,
@Override public void restart(final RestartCallback restarter, ScheduledExecutor executor) { currentRestartAttempt++; executor.schedule(new Runnable() { @Override public void run() { restarter.triggerFullRecovery(); } }, delayBetweenRestartAttempts, TimeUnit.MILLISECONDS); }
public HeartbeatManagerSenderImpl( long heartbeatPeriod, long heartbeatTimeout, ResourceID ownResourceID, HeartbeatListener<I, O> heartbeatListener, Executor executor, ScheduledExecutor scheduledExecutor, Logger log) { super( heartbeatTimeout, ownResourceID, heartbeatListener, executor, scheduledExecutor, log); triggerFuture = scheduledExecutor.scheduleAtFixedRate(this, 0L, heartbeatPeriod, TimeUnit.MILLISECONDS); }
public YarnApplicationStatusMonitor( YarnClient yarnClient, ApplicationId yarnApplicationId, ScheduledExecutor scheduledExecutor) { this.yarnClient = Preconditions.checkNotNull(yarnClient); this.yarnApplicationId = Preconditions.checkNotNull(yarnApplicationId); applicationStatusUpdateFuture = scheduledExecutor.scheduleWithFixedDelay( this::updateApplicationStatus, 0L, UPDATE_INTERVAL, TimeUnit.MILLISECONDS); applicationStatus = ApplicationStatus.UNKNOWN; }
@Override public void restart(final RestartCallback restarter, ScheduledExecutor executor) { currentRestartAttempt++; executor.schedule(new Runnable() { @Override public void run() { restarter.triggerFullRecovery(); } }, delayBetweenRestartAttempts, TimeUnit.MILLISECONDS); }
public HeartbeatManagerSenderImpl( long heartbeatPeriod, long heartbeatTimeout, ResourceID ownResourceID, HeartbeatListener<I, O> heartbeatListener, Executor executor, ScheduledExecutor scheduledExecutor, Logger log) { super( heartbeatTimeout, ownResourceID, heartbeatListener, executor, scheduledExecutor, log); triggerFuture = scheduledExecutor.scheduleAtFixedRate(this, 0L, heartbeatPeriod, TimeUnit.MILLISECONDS); }
public YarnApplicationStatusMonitor( YarnClient yarnClient, ApplicationId yarnApplicationId, ScheduledExecutor scheduledExecutor) { this.yarnClient = Preconditions.checkNotNull(yarnClient); this.yarnApplicationId = Preconditions.checkNotNull(yarnApplicationId); applicationStatusUpdateFuture = scheduledExecutor.scheduleWithFixedDelay( this::updateApplicationStatus, 0L, UPDATE_INTERVAL, TimeUnit.MILLISECONDS); applicationStatus = ApplicationStatus.UNKNOWN; }
void resetHeartbeatTimeout(long heartbeatTimeout) { if (state.get() == State.RUNNING) { cancelTimeout(); futureTimeout = scheduledExecutor.schedule(this, heartbeatTimeout, TimeUnit.MILLISECONDS); // Double check for concurrent accesses (e.g. a firing of the scheduled future) if (state.get() != State.RUNNING) { cancelTimeout(); } } }
/** * Starts the slot manager with the given leader id and resource manager actions. * * @param newResourceManagerId to use for communication with the task managers * @param newMainThreadExecutor to use to run code in the ResourceManager's main thread * @param newResourceActions to use for resource (de-)allocations */ public void start(ResourceManagerId newResourceManagerId, Executor newMainThreadExecutor, ResourceActions newResourceActions) { LOG.info("Starting the SlotManager."); this.resourceManagerId = Preconditions.checkNotNull(newResourceManagerId); mainThreadExecutor = Preconditions.checkNotNull(newMainThreadExecutor); resourceActions = Preconditions.checkNotNull(newResourceActions); started = true; taskManagerTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkTaskManagerTimeouts()), 0L, taskManagerTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); slotRequestTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkSlotRequestTimeouts()), 0L, slotRequestTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); }
void resetHeartbeatTimeout(long heartbeatTimeout) { if (state.get() == State.RUNNING) { cancelTimeout(); futureTimeout = scheduledExecutor.schedule(this, heartbeatTimeout, TimeUnit.MILLISECONDS); // Double check for concurrent accesses (e.g. a firing of the scheduled future) if (state.get() != State.RUNNING) { cancelTimeout(); } } }
taskManagerTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay(new Runnable() { @Override public void run() { slotRequestTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay(new Runnable() { @Override public void run() {
void resetHeartbeatTimeout(long heartbeatTimeout) { if (state.get() == State.RUNNING) { cancelTimeout(); futureTimeout = scheduledExecutor.schedule(this, heartbeatTimeout, TimeUnit.MILLISECONDS); // Double check for concurrent accesses (e.g. a firing of the scheduled future) if (state.get() != State.RUNNING) { cancelTimeout(); } } }
/** * Starts the slot manager with the given leader id and resource manager actions. * * @param newResourceManagerId to use for communication with the task managers * @param newMainThreadExecutor to use to run code in the ResourceManager's main thread * @param newResourceActions to use for resource (de-)allocations */ public void start(ResourceManagerId newResourceManagerId, Executor newMainThreadExecutor, ResourceActions newResourceActions) { LOG.info("Starting the SlotManager."); this.resourceManagerId = Preconditions.checkNotNull(newResourceManagerId); mainThreadExecutor = Preconditions.checkNotNull(newMainThreadExecutor); resourceActions = Preconditions.checkNotNull(newResourceActions); started = true; taskManagerTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkTaskManagerTimeouts()), taskManagerCheckerInitialDelay.toMilliseconds(), taskManagerTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); slotRequestTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkSlotRequestTimeouts()), 0L, slotRequestTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); }
void resetHeartbeatTimeout(long heartbeatTimeout) { if (state.get() == State.RUNNING) { cancelTimeout(); futureTimeout = scheduledExecutor.schedule(this, heartbeatTimeout, TimeUnit.MILLISECONDS); // Double check for concurrent accesses (e.g. a firing of the scheduled future) if (state.get() != State.RUNNING) { cancelTimeout(); } } }
/** * Starts the slot manager with the given leader id and resource manager actions. * * @param newResourceManagerId to use for communication with the task managers * @param newMainThreadExecutor to use to run code in the ResourceManager's main thread * @param newResourceActions to use for resource (de-)allocations */ public void start(ResourceManagerId newResourceManagerId, Executor newMainThreadExecutor, ResourceActions newResourceActions) { LOG.info("Starting the SlotManager."); this.resourceManagerId = Preconditions.checkNotNull(newResourceManagerId); mainThreadExecutor = Preconditions.checkNotNull(newMainThreadExecutor); resourceActions = Preconditions.checkNotNull(newResourceActions); started = true; taskManagerTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkTaskManagerTimeouts()), 0L, taskManagerTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); slotRequestTimeoutCheck = scheduledExecutor.scheduleWithFixedDelay( () -> mainThreadExecutor.execute( () -> checkSlotRequestTimeouts()), 0L, slotRequestTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); }