Package org.apache.fluo.api.observer
Interface ObserverProvider
-
public interface ObserverProvider
Fluo Workers use this class to registerObserver
s to process notifications. Implementations of this class should register zero or moreObserver
s.When Fluo is initialized
provideColumns(BiConsumer, Context)
is called. The columns it registers are stored in Zookeeper. Transactions will use the columns stored in Zookeeper to determine when to set notifications. When Workers callprovide(Registry, Context)
, the columns registered must be the same as those registered during initialization. If this is not the case, then the worker will fail to start.- Since:
- 1.1.0
- See Also:
FluoConfiguration.setObserverProvider(String)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ObserverProvider.Context
static interface
ObserverProvider.Registry
Observers are registered with the worker using this interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
provide(ObserverProvider.Registry or, ObserverProvider.Context ctx)
This is method is called by Fluo Workers to register observers to process notifications.default void
provideColumns(BiConsumer<Column,Observer.NotificationType> colRegistry, ObserverProvider.Context ctx)
Called during Fluo initialization to determine what columns are being observed.
-
-
-
Method Detail
-
provide
void provide(ObserverProvider.Registry or, ObserverProvider.Context ctx)
This is method is called by Fluo Workers to register observers to process notifications.Observers registered may be called concurrently by multiple threads to process different notifications. Observers should be tolerant of this.
- Parameters:
or
- Register observers with this.
-
provideColumns
default void provideColumns(BiConsumer<Column,Observer.NotificationType> colRegistry, ObserverProvider.Context ctx)
Called during Fluo initialization to determine what columns are being observed. The default implementation of this method callsprovide(Registry, Context)
and ignores Observers.- Parameters:
colRegistry
- register all observed columns with this consumer
-
-