public interface NoSQLSubscriber extends org.reactivestreams.Subscriber<StreamOperation>
Implementation of NOSQLSubscriber should follow the Subscriber rules in the Reactive Streams Specification.
Modifier and Type | Method and Description |
---|---|
NoSQLSubscriptionConfig |
getSubscriptionConfig()
Invoked by the NoSQL publisher when creating a Subscription.
|
void |
onCheckpointComplete(StreamPosition streamPosition,
Throwable failureCause)
Signals when a previously requested checkpoint is completed.
|
void |
onComplete()
Signals the completion of a subscription
|
void |
onError(Throwable t)
Signals an unrecoverable error in subscription.
|
void |
onNext(StreamOperation t)
Signals the next NoSQL Operation.
|
void |
onSubscribe(org.reactivestreams.Subscription s)
Invoked after the
NoSQLPublisher has successfully established
contact with the store using helper hosts. |
void |
onWarn(Throwable t)
Signals a warning during subscription.
|
void onSubscribe(org.reactivestreams.Subscription s)
NoSQLPublisher
has successfully established
contact with the store using helper hosts. When this method is called by
NoSQLPublisher, the argument is an implementation of NoSQLSubscription
.onSubscribe
in interface org.reactivestreams.Subscriber<StreamOperation>
NoSQLSubscription.request(long)
void onNext(StreamOperation t)
The sequence of onNext calls represents the stream of changes, both updates and deletions, made to the store. The order of calls to onNext for a given key represents the exact order of the operations on that key performed on the store. There are no guarantees about the order of operations across different keys in the stream.
If a shard is down, events associated with rows stored on that shard could be arbitrarily delayed until the shard comes back up again and the NoSQL Publisher can establish a shard stream to it.
onNext
in interface org.reactivestreams.Subscriber<StreamOperation>
void onError(Throwable t)
There are many potential sources of error that the publisher may signal
via this method. One of them is worth special mention: the publisher may
invoke this method if it finds that it cannot resume the stream from
NoSQLSubscriptionConfig.getInitialPosition()
because the relevant
logs are no longer available at one of the shards.
onError
in interface org.reactivestreams.Subscriber<StreamOperation>
void onComplete()
Note streaming from kvstore table is unbounded by nature since unbounded updates can be applied to a table. Thus onComplete() will never be called in Stream API. User of Stream API shall implement this method as no-op and any no-op implementation will be ignored.
onComplete
in interface org.reactivestreams.Subscriber<StreamOperation>
NoSQLSubscriptionConfig getSubscriptionConfig()
An ill configuration or null return will cancel the subscription and the publisher will release all resources allocated for that subscription.
void onWarn(Throwable t)
A call to this method warns the user of a potential issue that does not yet represent a disruption in service, for example, a warning that a shard was not available for an extended period of time. Note that onWarn, unlike onError, does not terminate the flow of signals. It's used to warn the subscriber that the publisher's functioning is impaired, but not as yet fatally and some exception-specific action could be taken to restore the health of the Publisher.
void onCheckpointComplete(StreamPosition streamPosition, Throwable failureCause)
streamPosition
- the stream position in checkpointfailureCause
- null if checkpoint succeeds, otherwise the cause
of checkpoint failure.Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved.