@InterfaceStability.Experimental @InterfaceAudience.Public public class BucketStreamAggregator extends Object
Provides a higher level abstraction over a DCP stream.
The bucket is expected to be opened already when the feed()
method is called.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONNECTION_NAME |
Constructor and Description |
---|
BucketStreamAggregator(ClusterFacade core,
String bucket) |
BucketStreamAggregator(String name,
ClusterFacade core,
String bucket)
Create BucketStreamAggregator instance
|
Modifier and Type | Method and Description |
---|---|
Observable<DCPRequest> |
feed()
Opens a DCP stream with default name and returns the feed of changes from beginning.
|
Observable<DCPRequest> |
feed(BucketStreamAggregatorState aggregatorState)
Opens a DCP stream and returns the feed of changes.
|
Observable<BucketStreamAggregatorState> |
getCurrentState()
Retrieve current state of the partitions.
|
String |
name() |
public static String DEFAULT_CONNECTION_NAME
public BucketStreamAggregator(ClusterFacade core, String bucket)
public BucketStreamAggregator(String name, ClusterFacade core, String bucket)
Create BucketStreamAggregator instance
name
- name for DCP connectioncore
- bucket
- bucket namepublic String name()
public Observable<DCPRequest> feed()
Opens a DCP stream with default name and returns the feed of changes from beginning.
DCPRequest
s.public Observable<DCPRequest> feed(BucketStreamAggregatorState aggregatorState)
Opens a DCP stream and returns the feed of changes.
aggregatorState
- state objectDCPRequest
s.public Observable<BucketStreamAggregatorState> getCurrentState()
Retrieve current state of the partitions.
It has all sequence and snapshot numbers set to the last known sequence number.
Copyright © 2016 Couchbase, Inc.. All rights reserved.