ExecutorPodsSnapshotsStoreImpl¶
ExecutorPodsSnapshotsStoreImpl
is an ExecutorPodsSnapshotsStore.
Creating Instance¶
ExecutorPodsSnapshotsStoreImpl
takes the following to be created:
- Java's ScheduledExecutorService
ExecutorPodsSnapshotsStoreImpl
is created when:
KubernetesClusterManager
is requested for a SchedulerBackend
replaceSnapshot¶
replaceSnapshot(
newSnapshot: Seq[Pod]): Unit
replaceSnapshot
is part of the ExecutorPodsSnapshotsStore abstraction.
replaceSnapshot
replaces the currentSnapshot internal registry with a new ExecutorPodsSnapshot (with the given snapshot and the current time).
In the end, updatePod
addCurrentSnapshotToSubscribers.
updatePod¶
updatePod(
updatedPod: Pod): Unit
updatePod
is part of the ExecutorPodsSnapshotsStore abstraction.
updatePod
requests the current ExecutorPodsSnapshot to update based on the given updated pod.
In the end, updatePod
addCurrentSnapshotToSubscribers.
Registering Subscriber¶
addSubscriber(
processBatchIntervalMillis: Long)
(onNewSnapshots: Seq[ExecutorPodsSnapshot] => Unit): Unit
addSubscriber
is part of the ExecutorPodsSnapshotsStore abstraction.
addSubscriber
adds a new SnapshotsSubscriber
to the subscribers internal registry.
addSubscriber
requests the ScheduledExecutorService to schedule processing executor pods by the SnapshotsSubscriber
every given processBatchIntervalMillis
delay (starting immediately).
In the end, addSubscriber
adds the scheduled action to the pollingTasks internal registry.
callSubscriber¶
callSubscriber(
subscriber: SnapshotsSubscriber): Unit
callSubscriber
...FIXME
callSubscriber
is used when:
ExecutorPodsSnapshotsStoreImpl
is requested to addSubscriber and notifySubscribers
pollingTasks Registry¶
pollingTasks: CopyOnWriteArrayList[Future[_]]
ExecutorPodsSnapshotsStoreImpl
uses pollingTasks
internal registry to track the recurring actions scheduled for subscribers.
pollingTasks
are cancelled when ExecutorPodsSnapshotsStoreImpl
is requested to stop.
subscribers Registry¶
subscribers: CopyOnWriteArrayList[SnapshotsSubscriber]
ExecutorPodsSnapshotsStoreImpl
uses subscribers
internal registry to track subscribers that want to be notified regularly about the current state of executor pods in a cluster.
addCurrentSnapshotToSubscribers¶
addCurrentSnapshotToSubscribers(): Unit
addCurrentSnapshotToSubscribers
requests every SnapshotsSubscriber to addCurrentSnapshot.
addCurrentSnapshotToSubscribers
is used when:
ExecutorPodsSnapshotsStoreImpl
is requested to updatePod and replaceSnapshot