public static Task<Void> flushAll(Actor actor) { final List<NodeAddress> nodes = ActorRuntime.getRuntime().getAllNodes(); return Task.allOf(nodes.stream() .map(nodeAddress -> DefaultDescriptorFactory.observerRef(nodeAddress, ExecutionCacheFlushObserver.class, "").flush(actor))); } }
/** * Requests the global actor count across the cluster. * * @return A task indicating containing the total actor count across the cluster. */ static Task<Long> getClusterActorCount() { final List<Task<Long>> countList = ActorRuntime.getRuntime().getAllNodes().stream() .map(address -> { final RuntimeActions runtimeActions = DefaultDescriptorFactory.observerRef(address, RuntimeActions.class, ""); return runtimeActions.getActorCount(); }) .collect(Collectors.toList()); await(Task.allOf(countList)); final Long actorCount = countList.stream() .mapToLong(Task<Long>::join) .sum(); return Task.fromValue(actorCount); }
public static Task<Void> flushAll(Actor actor) { final List<NodeAddress> nodes = ActorRuntime.getRuntime().getAllNodes(); return Task.allOf(nodes.stream() .map(nodeAddress -> DefaultDescriptorFactory.observerRef(nodeAddress, ExecutionCacheFlushObserver.class, "").flush(actor))); } }
/** * Requests the global actor count across the cluster. * * @return A task indicating containing the total actor count across the cluster. */ static Task<Long> getClusterActorCount() { final List<Task<Long>> countList = ActorRuntime.getRuntime().getAllNodes().stream() .map(address -> { final RuntimeActions runtimeActions = DefaultDescriptorFactory.observerRef(address, RuntimeActions.class, ""); return runtimeActions.getActorCount(); }) .collect(Collectors.toList()); await(Task.allOf(countList)); final Long actorCount = countList.stream() .mapToLong(Task<Long>::join) .sum(); return Task.fromValue(actorCount); }