Skip to content

SnapshotsSubscriber

SnapshotsSubscriber is used by ExecutorPodsSnapshotsStoreImpl to manage snapshot subscribers that are notified about new ExecutorPodsSnapshots regularly.

SnapshotsSubscriber manages snapshotsBuffer queue of ExecutorPodsSnapshots.

SnapshotsSubscriber is a private class of ExecutorPodsSnapshotsStoreImpl with full access to its internals.

Creating Instance

SnapshotsSubscriber takes the following to be created:

SnapshotsSubscriber is created when:

onNewSnapshots Callback Function

onNewSnapshots: Seq[ExecutorPodsSnapshot] => Unit

SnapshotsSubscriber is given a onNewSnapshots callback function when created.

snapshotsBuffer Queue

snapshotsBuffer: LinkedBlockingQueue[ExecutorPodsSnapshot]

SnapshotsSubscriber manages a snapshotsBuffer queue of ExecutorPodsSnapshots.

notificationCount Counter

notificationCount: AtomicInteger

SnapshotsSubscriber manages a notificationCount counter.

addCurrentSnapshot

addCurrentSnapshot(): Unit

addCurrentSnapshot requests the snapshotsBuffer internal queue to add the current ExecutorPodsSnapshot.

addCurrentSnapshot is used when:

processSnapshots

processSnapshots(): Unit

processSnapshots increments the notificationCount counter followed by processSnapshotsInternal.

processSnapshots is used when:

processSnapshotsInternal

processSnapshotsInternal(): Unit

processSnapshotsInternal...FIXME

Note

processSnapshotsInternal can be called again recursively when the notificationCount counter has been incremented while the processSnapshotsInternal was running.


Last update: 2021-01-31