public interface ObserverProvider
Observer
s to process notifications.
Implementations of this class should register zero or more Observer
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 call provide(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.
FluoConfiguration.setObserverProvider(String)
Modifier and Type | Interface and Description |
---|---|
static interface |
ObserverProvider.Context |
static interface |
ObserverProvider.Registry
Observers are registered with the worker using this interface.
|
Modifier and Type | Method and 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.
|
void provide(ObserverProvider.Registry or, ObserverProvider.Context ctx)
Observers registered may be called concurrently by multiple threads to process different notifications. Observers should be tolerant of this.
or
- Register observers with this.default void provideColumns(BiConsumer<Column,Observer.NotificationType> colRegistry, ObserverProvider.Context ctx)
provide(Registry, Context)
and ignores Observers.colRegistry
- register all observed columns with this consumerCopyright © 2016–2018 The Apache Software Foundation. All rights reserved.