@Override public Duration pushTimeOut() { return Duration.Zero(); }
@Override public Duration pushTimeOut() { return Duration.Zero(); }
@Override public SupervisorStrategy supervisorStrategy() { return new OneForOneStrategy(0, Duration.Zero(), new Function<Throwable, Directive>() { public Directive apply(Throwable cause) { log.error("Problem with processing",cause); return SupervisorStrategy.resume(); } } ); }
@Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // default behaviour return SupervisorStrategy.escalate(); } }); return supervisorStrategy; }
@Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // default behaviour return SupervisorStrategy.escalate(); } }); return supervisorStrategy; } }
@Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // default behaviour return SupervisorStrategy.escalate(); } }); return supervisorStrategy; }
@Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // default behaviour return SupervisorStrategy.escalate(); } }); return supervisorStrategy; }
@Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // default behaviour return SupervisorStrategy.escalate(); } }); return supervisorStrategy; } }
/** * set supervision strategy for worker actors and handle failed crawling actions * * @return */ @Override public SupervisorStrategy supervisorStrategy() { SupervisorStrategy supervisorStrategy = new OneForOneStrategy( 0, Duration.Zero(), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) throws Exception { log.warning("Actor encountered error: {}", t); // save the failed status of a crawlingWorker during crawling if (t instanceof CrawlWrapperException) { CrawlWrapperException e = (CrawlWrapperException) t; log.warning("Handled breaking message: {}", e.getBreakingMessage()); log.warning("Exception was: {}", e.getException()); processCrawlUriMessage(e.getBreakingMessage()); return SupervisorStrategy.resume(); } // default behaviour in other cases return SupervisorStrategy.escalate(); } }); return supervisorStrategy; }
@Override public SupervisorStrategy supervisorStrategy() { return new OneForOneStrategy(0, Duration.Zero(), new Function<Throwable, Directive>() { public Directive apply(Throwable cause) { log.error("Problem with processing",cause); mediator.tell(new DistributedPubSubMediator.Publish(MasterActor.MASTER, new ClearWorker(id)), getSelf()); return SupervisorStrategy.restart(); } } ); }
public Worker(ActorRef clusterClient, Props workExecutorProps, FiniteDuration registerInterval) { this.clusterClient = clusterClient; this.workExecutor = getContext().watch(getContext().actorOf(workExecutorProps, "exec")); this.registerTask = getContext().system().scheduler().schedule(Duration.Zero(), registerInterval, clusterClient, new SendToAll("/user/master/singleton", new RegisterWorker(workerId)), getContext().dispatcher(), getSelf()); }
try { answer = Await.result(jobSubmissionFuture, Duration.Zero());
try { answer = Await.result(jobSubmissionFuture, Duration.Zero());
try { answer = Await.result(jobSubmissionFuture, Duration.Zero());
try { answer = Await.result(jobSubmissionFuture, Duration.Zero());