public class CouchbaseReader extends Object
CouchbaseReader
is in charge of accepting events from Couchbase.Constructor and Description |
---|
CouchbaseReader(com.couchbase.client.core.ClusterFacade core,
CouchbaseKafkaEnvironment environment,
com.couchbase.client.deps.com.lmax.disruptor.RingBuffer<DCPEvent> dcpRingBuffer,
StateSerializer stateSerializer)
Creates a new
CouchbaseReader . |
CouchbaseReader(List<String> couchbaseNodes,
String couchbaseBucket,
String couchbasePassword,
com.couchbase.client.core.ClusterFacade core,
CouchbaseKafkaEnvironment environment,
com.couchbase.client.deps.com.lmax.disruptor.RingBuffer<DCPEvent> dcpRingBuffer,
StateSerializer stateSerializer)
Creates a new
CouchbaseReader . |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Performs connection with 2 seconds timeout.
|
void |
connect(long timeout,
TimeUnit timeUnit)
Performs connection with arbitrary timeout
|
ConnectorState |
currentState()
Returns current state of the cluster.
|
void |
run(ConnectorState fromState,
ConnectorState toState)
Executes worker reading loop, which relays events from Couchbase to Kafka.
|
public CouchbaseReader(com.couchbase.client.core.ClusterFacade core, CouchbaseKafkaEnvironment environment, com.couchbase.client.deps.com.lmax.disruptor.RingBuffer<DCPEvent> dcpRingBuffer, StateSerializer stateSerializer)
CouchbaseReader
.core
- the core reference.environment
- the environment object, which carries settings.dcpRingBuffer
- the buffer where to publish new events.stateSerializer
- the object to serialize the state of DCP streams.public CouchbaseReader(List<String> couchbaseNodes, String couchbaseBucket, String couchbasePassword, com.couchbase.client.core.ClusterFacade core, CouchbaseKafkaEnvironment environment, com.couchbase.client.deps.com.lmax.disruptor.RingBuffer<DCPEvent> dcpRingBuffer, StateSerializer stateSerializer)
CouchbaseReader
.couchbaseNodes
- list of the Couchbase nodes to override CouchbaseKafkaEnvironment.couchbaseNodes()
couchbaseBucket
- bucket name to override CouchbaseKafkaEnvironment.couchbaseBucket()
couchbasePassword
- password to override CouchbaseKafkaEnvironment.couchbasePassword()
core
- the core reference.environment
- the environment object, which carries settings.dcpRingBuffer
- the buffer where to publish new events.stateSerializer
- the object to serialize the state of DCP streams.public void connect()
public void connect(long timeout, TimeUnit timeUnit)
timeout
- the custom timeout.timeUnit
- the unit for the timeout.public ConnectorState currentState()
public void run(ConnectorState fromState, ConnectorState toState)
fromState
- initial state for the streamstoState
- target state for the streamsCopyright © 2015 Couchbase, Inc.