@Override protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics) { // first, de-register from YARN FinalApplicationStatus yarnStatus = getYarnStatus(finalStatus); LOG.info("Unregistering application from the YARN Resource Manager"); try { resourceManagerClient.unregisterApplicationMaster(yarnStatus, optionalDiagnostics, ""); } catch (Throwable t) { LOG.error("Could not unregister the application master.", t); } // now shut down all our components try { resourceManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Asynchronous Resource Manager Client", t); } try { nodeManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Node Manager Client", t); } // stop the actor after finishing processing the stop message getContext().system().stop(getSelf()); }
scala.Option<Object> portOption = AkkaUtils.getAddress(getContext().system()).port(); int actorSystemPort = portOption.isDefined() ? (int) portOption.get() : -1;
public ReservationCacheActor() { // subscribe to the topic named "content" ActorRef mediator = DistributedPubSub.get(getContext().system()).mediator(); mediator.tell(new DistributedPubSubMediator.Subscribe("content", getSelf()), getSelf()); }
Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.MILLISECONDS ), Duration.create( qakkaFig.getQueueRefreshMilliseconds(), TimeUnit.MILLISECONDS ), Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.SECONDS ), Duration.create( qakkaFig.getQueueTimeoutSeconds() / 2, TimeUnit.SECONDS ), Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.MILLISECONDS ), Duration.create( qakkaFig.getShardAllocationCheckFrequencyMillis(), TimeUnit.MILLISECONDS ),
/** * Wait and retry. */ public void waitAndRetry() { ContinueToSendToBatchSenderAsstManager continueToSendToBatchSenderAsstManager = new ContinueToSendToBatchSenderAsstManager( processedWorkerCount); logger.debug("NOW WAIT Another " + asstManagerRetryIntervalMillis + " MS. at " + PcDateUtils.getNowDateTimeStrStandard()); getContext() .system() .scheduler() .scheduleOnce( Duration.create(asstManagerRetryIntervalMillis, TimeUnit.MILLISECONDS), getSelf(), continueToSendToBatchSenderAsstManager, getContext().system().dispatcher(), getSelf()); return; }
/** * * 201412: now consider the poller. With poller, will cancel this future * task and reschedule */ private void cancelExistingIfAnyAndScheduleTimeoutCall() { // To handle cases where this operation takes extremely long, schedule a // 'timeout' message to be sent to us if (timeoutMessageCancellable != null && !timeoutMessageCancellable.isCancelled()) { timeoutMessageCancellable.cancel(); } // now reschedule timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce(timeoutDuration, getSelf(), OperationWorkerMsgType.OPERATION_TIMEOUT, getContext().system().dispatcher(), getSelf()); }
actorMaxOperationTimeoutSec, TimeUnit.SECONDS); timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce( getSelf(), RequestWorkerMsgType.PROCESS_ON_TIMEOUT, getContext().system().dispatcher(), getSelf()); .system() .scheduler() .scheduleOnce( getSelf()); }, getContext().system().dispatcher()); .system() .scheduler() .scheduleOnce( getSelf()); }, getContext().system().dispatcher());
actorMaxOperationTimeoutSec, TimeUnit.SECONDS); timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce( getSelf(), RequestWorkerMsgType.PROCESS_ON_TIMEOUT, getContext().system().dispatcher(), getSelf()); .system() .scheduler() .scheduleOnce( getSelf()); }, getContext().system().dispatcher()); .system() .scheduler() .scheduleOnce( getSelf()); }, getContext().system().dispatcher());
+ " at " + prepareRequestTimeStr); ActorRef worker = getContext().system().actorOf( Props.create(OperationWorker.class, new TaskRequest(task.getConfig() maxConcurrency); batchSenderAsstManager = getContext().system().actorOf( Props.create(AssistantExecutionManager.class), "RequestToBatchSenderAsstManager-" TimeUnit.SECONDS); timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce(timeOutDuration, getSelf(), ExecutionManagerMsgType.OPERATION_TIMEOUT, getContext().system().dispatcher(), getSelf());
PcDateUtils.getNowDateTimeStrStandard(), null); if (!getContext().system().deadLetters().equals(sender)) { sender.tell(res, getSelf());
statusCodeInt, PcDateUtils.getNowDateTimeStrStandard(), responseHeaders); if (!getContext().system().deadLetters().equals(sender)) { sender.tell(res, getSelf());
&& !sender.equals(getContext().system().deadLetters())) {
PcDateUtils.getNowDateTimeStrStandard(), null); if (!getContext().system().deadLetters().equals(sender)) { sender.tell(res, getSelf());
response, error, errorMessage, stackTrace, statusCode, statusCodeInt, PcDateUtils.getNowDateTimeStrStandard(), null); if (!getContext().system().deadLetters().equals(sender)) { sender.tell(res, getSelf());
response, error, errorMessage, stackTrace, statusCode, statusCodeInt, PcDateUtils.getNowDateTimeStrStandard(), null); if (!getContext().system().deadLetters().equals(sender)) {