Class StoreChangeTasks

java.lang.Object
com.linkedin.venice.meta.StoreChangeTasks

@Immutable public final class StoreChangeTasks extends Object
Immutable collection of tasks for different store change events.

Adapters register these tasks to react to store metadata changes. Each task is optional - adapters only register tasks for events they care about.

Usage Example:


 StoreChangeTasks tasks = StoreChangeTasks.builder()
     .onStoreCreated(store -> cache.initialize(store.getName()))
     .onVersionAdded((store, version) -> cache.invalidate(store.getName()))
     .onVersionDeleted((store, version) -> cache.cleanup(store.getName(), version))
     .onCurrentVersionChanged((store, newVersion, oldVersion) ->
         cache.updateCurrentVersion(store.getName(), newVersion))
     .onStoreDeleted(store -> cache.remove(store.getName()))
     .build();

 String taskId = notifier.registerTasks("MyAdapter", tasks);
 

Thread Safety: This class is immutable and thread-safe. Tasks are executed asynchronously, so task implementations should be thread-safe.