本文整理匯總了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;
}