Clarify closing of timeout listeners

This commit is contained in:
Jason Tedor 2016-04-02 13:41:23 -04:00
parent 1f12beea9a
commit 8b970d970d
1 changed files with 6 additions and 2 deletions

View File

@ -219,8 +219,12 @@ public class ClusterService extends AbstractLifecycleComponent<ClusterService> {
} }
} }
ThreadPool.terminate(updateTasksExecutor, 10, TimeUnit.SECONDS); ThreadPool.terminate(updateTasksExecutor, 10, TimeUnit.SECONDS);
postAppliedListeners.stream().filter(listener -> listener instanceof TimeoutClusterStateListener) // close timeout listeners that did not have an ongoing timeout
.forEach(listener -> ((TimeoutClusterStateListener) listener).onClose()); postAppliedListeners
.stream()
.filter(listener -> listener instanceof TimeoutClusterStateListener)
.map(listener -> (TimeoutClusterStateListener)listener)
.forEach(TimeoutClusterStateListener::onClose);
remove(localNodeMasterListeners); remove(localNodeMasterListeners);
} }