use of org.opendaylight.controller.cluster.datastore.messages.DataTreeListenerInfo in project controller by opendaylight.
the class ShardDataTreeListenerInfoMXBeanImpl method getListenerActorsInfo.
@SuppressWarnings("checkstyle:IllegalCatch")
private List<DataTreeListenerInfo> getListenerActorsInfo(Collection<ActorSelection> actors) {
final Timeout timeout = new Timeout(20, TimeUnit.SECONDS);
final List<Future<Object>> futureList = new ArrayList<>(actors.size());
for (ActorSelection actor : actors) {
futureList.add(Patterns.ask(actor, GetInfo.INSTANCE, timeout));
}
try {
final List<DataTreeListenerInfo> listenerInfoList = new ArrayList<>();
Await.result(Futures.sequence(futureList, ExecutionContext.Implicits$.MODULE$.global()), timeout.duration()).forEach(obj -> listenerInfoList.add((DataTreeListenerInfo) obj));
return listenerInfoList;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations