ActorSelection service = getContext().actorSelection( address + routerPath ); service.tell( message, getSender() );
private void sendMessageToParent(final Object message) { // Using actor selection to find parent , as message of indexing // completion is received from child actors. // To find parent, because of $val syntax and routee, using actor path // for the same. getContext().actorSelection(parentActorPathString).tell(message, null); }
private void sendMessageToParent(final Object message) { // Find parent actor in the hierarchy. // akka://SearchIndexingSystem/user/setupIndexMasterActor/setupIndexWorkerActor/$a getContext().actorSelection("../../").tell(message, null); }
private void sendRegistrationRequests() { for (Map.Entry<String, Boolean> entry : notifierRegistrationStatus.entrySet()) { if (!entry.getValue()) { try { LOG.debug("{} registering with {}", getSelf().path().toString(), entry.getKey()); ActorRef notifier = Await.result( getContext().actorSelection(entry.getKey()).resolveOne(duration), duration); notifier.tell(new RegisterRoleChangeListener(), getSelf()); } catch (Exception e) { LOG.error("ERROR!! Unable to send registration request to notifier {}", entry.getKey()); } } } }
@SuppressWarnings("checkstyle:IllegalCatch") private void sendRegistrationRequests() { for (Map.Entry<String, Boolean> entry : notifierRegistrationStatus.entrySet()) { if (!entry.getValue()) { try { LOG.debug("{} registering with {}", getSelf().path().toString(), entry.getKey()); ActorRef notifier = Await.result( getContext().actorSelection(entry.getKey()).resolveOne(DURATION), DURATION); notifier.tell(new RegisterRoleChangeListener(), getSelf()); } catch (Exception e) { LOG.error("ERROR!! Unable to send registration request to notifier {}", entry.getKey()); } } } }
private void reportRetrievedResult(BenchmarkRunResult benchmarkRunResult) { String executorAddress = getExecutorAddress(); LOG.info(String.format("Report benchmark result for %s at %s.", runner.getBenchmarkId(), executorAddress)); getContext().actorSelection(executorAddress).tell(benchmarkRunResult, getSelf()); }
private void reportExecution() { String masterAddress = getExecutorAddress(); LOG.info(String.format("Report execution %s at %s.", runner.getBenchmarkId(), masterAddress)); Notification notification = new Notification( runner.getBenchmarkId(), "Executed benchmark.", Notification.Label.EXECUTION); getContext().actorSelection(masterAddress).tell(notification, getSelf()); }
private void reportValidation() { String masterAddress = getExecutorAddress(); LOG.info(String.format("Report validation for %s at %s.", runner.getBenchmarkId(), masterAddress)); Notification notification = new Notification( runner.getBenchmarkId(), "Validated benchmark result.", Notification.Label.VALIDATION); getContext().actorSelection(masterAddress).tell(notification, getSelf()); }
private void register() { String masterAddress = getExecutorAddress(); LOG.info(String.format("Register %s at %s.", runner.getBenchmarkId(), masterAddress)); Integer processId = ProcessUtil.getProcessId(); Notification notification = new Notification( runner.getBenchmarkId(), processId, Notification.Label.REGISTRATION); getContext().actorSelection(masterAddress).tell(notification, getSelf()); }
private void reportFailure(BenchmarkFailure failure) { String masterAddress = getExecutorAddress(); LOG.info(String.format("Report failures (%s) of %s at %s.", failure, runner.getBenchmarkId(), masterAddress)); Notification notification = new Notification( runner.getBenchmarkId(), failure, Notification.Label.FAILURE); getContext().actorSelection(masterAddress).tell(notification, getSelf()); TimeUtil.waitFor(5); }
@Override public void preStart() throws Exception { remotePublisher = getContext().actorSelection(urlOfPublisher); remotePublisher.tell(new SubscribeReceiver(getSelf()), getSelf()); }
public WorkerActor(final Session de, Model model, String monitorPath, int workerIndex) { this.monitor = getContext().actorSelection(monitorPath); this.workerIndex = workerIndex; this.model = model; this.de = de; this.monitor.tell(new RegisterRequest(this.workerIndex), getSelf()); log("Worker " + workerIndex + " register to monitor: " + monitorPath); }
@Override public void preStart() throws Exception { remotePublisher = getContext().actorSelection(urlOfPublisher); remotePublisher.tell(new SubscribeReceiver(getSelf()), getSelf()); }
persistenceId(), shardName, address, visitedAddresses); getContext().actorSelection(address).forward(new RemoteFindPrimary(shardName, message.isWaitUntilReady(), visitedAddresses), getContext()); return;
PSActor(Model model, HashMap<String, DataStore> stores, String monitorPath, int serverIndex, String executorId, String psNetwordPrefix) { this.monitor = getContext().actorSelection(monitorPath); this.serverIndex = serverIndex; this.executorId = executorId; this.model = model; this.stores = stores; this.lastReportTime = 0; agent = new PSAgent(getSelf(), model, stores, psNetwordPrefix); agent.start(); this.monitor.tell(new RegisterRequest(serverIndex, executorId, agent.hostName(), agent.addr()), getSelf()); }
Future<Object> futureObj = ask(getContext().actorSelection(primaryPath), new RemoveServer(shardId.toString()), removeServerTimeout);
Future<Object> futureObj = ask(getContext().actorSelection(response.getPrimaryPath()), new AddServer(shardInfo.getShardId().toString(), localShardAddress, true), addServerTimeout);