本文整理汇总了Java中com.couchbase.client.dcp.ControlEventHandler类的典型用法代码示例。如果您正苦于以下问题:Java ControlEventHandler类的具体用法?Java ControlEventHandler怎么用?Java ControlEventHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ControlEventHandler类属于com.couchbase.client.dcp包,在下文中一共展示了ControlEventHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CouchbaseStreamingConnection
import com.couchbase.client.dcp.ControlEventHandler; //导入依赖的package包/类
public CouchbaseStreamingConnection(String bootstrapNodes, String bucket, String password) {
connected = false;
streaming = false;
client = Client.configure()
.connectTimeout(10000L)
.hostnames(bootstrapNodes)
.bucket(bucket)
.password(password == null ? "" : password)
.controlParam(DcpControl.Names.CONNECTION_BUFFER_SIZE, 20480)
.bufferAckWatermark(60)
.build();
client.controlEventHandler(new ControlEventHandler() {
@Override
public void onEvent(ChannelFlowController controller, ByteBuf event) {
controller.ack(event);
event.release();
}
});
dataEventHandler = new EventHandler();
client.dataEventHandler(dataEventHandler);
}
示例2: controlEventHandler
import com.couchbase.client.dcp.ControlEventHandler; //导入依赖的package包/类
/**
* Returns the current attached control event handler.
*/
public ControlEventHandler controlEventHandler() {
return controlEventHandler;
}
示例3: setControlEventHandler
import com.couchbase.client.dcp.ControlEventHandler; //导入依赖的package包/类
/**
* Set/Override the control event handler.
*/
public void setControlEventHandler(ControlEventHandler controlEventHandler) {
this.controlEventHandler = controlEventHandler;
}