本文整理了Java中com.couchbase.client.java.Bucket.async()
方法的一些代码示例,展示了Bucket.async()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bucket.async()
方法的具体详情如下:
包路径:com.couchbase.client.java.Bucket
类名称:Bucket
方法名:async
[英]Provides access to the underlying asynchronous bucket interface.
[中]提供对底层异步bucket接口的访问。
代码示例来源:origin: brianfrankcooper/YCSB
@Override
public Observable<RawJsonDocument> call(AsyncN1qlQueryRow row) {
String id = new String(row.byteValue()).trim();
return bucket.async().get(id.substring(1, id.length()-1), RawJsonDocument.class);
}
})
代码示例来源:origin: brianfrankcooper/YCSB
/**
* Performs the {@link #delete(String, String)} (String, String)} operation via Key/Value ("remove").
*
* @param docId the document ID.
* @return The result of the operation.
*/
private Status deleteKv(final String docId) {
waitForMutationResponse(bucket.async().remove(
docId,
persistTo,
replicateTo
));
return Status.OK;
}
代码示例来源:origin: brianfrankcooper/YCSB
waitForMutationResponse(bucket.async().insert(
RawJsonDocument.create(docId, documentExpiry, encode(values)),
persistTo,
代码示例来源:origin: brianfrankcooper/YCSB
/**
* Performs the {@link #update(String, String, Map)} operation via Key/Value ("replace").
*
* @param docId the document ID
* @param values the values to update the document with.
* @return The result of the operation.
*/
private Status updateKv(final String docId, final Map<String, ByteIterator> values) {
waitForMutationResponse(bucket.async().replace(
RawJsonDocument.create(docId, documentExpiry, encode(values)),
persistTo,
replicateTo
));
return Status.OK;
}
代码示例来源:origin: brianfrankcooper/YCSB
/**
* Performs the {@link #upsert(String, String, Map)} operation via Key/Value ("upsert").
*
* If this option should be used, the "-p couchbase.upsert=true" property must be set.
*
* @param docId the document ID
* @param values the values to update the document with.
* @return The result of the operation.
*/
private Status upsertKv(final String docId, final Map<String, ByteIterator> values) {
waitForMutationResponse(bucket.async().upsert(
RawJsonDocument.create(docId, documentExpiry, encode(values)),
persistTo,
replicateTo
));
return Status.OK;
}
代码示例来源:origin: brianfrankcooper/YCSB
final Vector<HashMap<String, ByteIterator>> result) {
final List<HashMap<String, ByteIterator>> data = new ArrayList<HashMap<String, ByteIterator>>(recordcount);
bucket.async()
.query(N1qlQuery.parameterized(
scanAllQuery,
代码示例来源:origin: jooby-project/jooby
AsyncBucket async = bucket.async();
bind.apply(AsyncBucket.class, name, async);
代码示例来源:origin: apache/incubator-gobblin
((TupleDocument) record).content().value1().retain();
Observable<D> observable = _bucket.async().upsert(record);
if (callback == null) {
return new WriteResponseFuture<>(
代码示例来源:origin: com.couchbase.client/java-client
public CouchbaseRepository(Bucket bucket, CouchbaseEnvironment environment) {
this.timeout = environment.kvTimeout();
this.asyncRepository = bucket.async().repository().toBlocking().single();
}
代码示例来源:origin: spring-projects/spring-data-couchbase
public RxJavaCouchbaseTemplate(final ClusterInfo clusterInfo, final Bucket client,
final CouchbaseConverter converter,
final TranslationService translationService) {
this.syncClient = client;
this.clusterInfo = clusterInfo;
this.client = client.async();
this.converter = converter == null ? getDefaultConverter() : converter;
this.translationService = translationService == null ? getDefaultTranslationService() : translationService;
this.mappingContext = this.converter.getMappingContext();
}
代码示例来源:origin: org.springframework.data/spring-data-couchbase
public RxJavaCouchbaseTemplate(final ClusterInfo clusterInfo, final Bucket client,
final CouchbaseConverter converter,
final TranslationService translationService) {
this.syncClient = client;
this.clusterInfo = clusterInfo;
this.client = client.async();
this.converter = converter == null ? getDefaultConverter() : converter;
this.translationService = translationService == null ? getDefaultTranslationService() : translationService;
this.mappingContext = this.converter.getMappingContext();
}
代码示例来源:origin: com.couchbase.client/java-client
@Override
public void onNext(CouchbaseEvent event) {
RawJsonDocument doc = RawJsonDocument.create(
generateKey(event),
Events.toJson(event, false)
);
Observable<RawJsonDocument> stored;
if (storeType == StoreType.INSERT) {
stored = bucket.async().insert(doc);
} else if (storeType == StoreType.UPSERT) {
stored = bucket.async().upsert(doc);
} else {
throw new UnsupportedOperationException("Store type " + storeType + " is not supported");
}
stored
.onErrorResumeNext(new Func1<Throwable, Observable<? extends RawJsonDocument>>() {
@Override
public Observable<? extends RawJsonDocument> call(Throwable ex) {
LOGGER.warn("Received error while storing document in bucket consumer.", ex);
return Observable.empty();
}
})
.subscribe();
}
代码示例来源:origin: org.springframework.data/spring-data-couchbase
return bucket.async().query(createPrimary)
.flatMap(new Func1<AsyncN1qlQueryResult, Observable<JsonObject>>() {
@Override
代码示例来源:origin: spring-projects/spring-data-couchbase
return bucket.async().query(createPrimary)
.flatMap(new Func1<AsyncN1qlQueryResult, Observable<JsonObject>>() {
@Override
代码示例来源:origin: com.couchbase.client/java-client
.async()
.getFromReplica(id, ReplicaMode.ALL, target)
.timeout(replicaTimeout, TimeUnit.MILLISECONDS)
.async()
.get(id, target)
.timeout(primaryTimeout, TimeUnit.MILLISECONDS)
代码示例来源:origin: org.springframework.data/spring-data-couchbase
return bucket.async().query(createIndex)
.flatMap(new Func1<AsyncN1qlQueryResult, Observable<JsonObject>>() {
@Override
代码示例来源:origin: spring-projects/spring-data-couchbase
return bucket.async().query(createIndex)
.flatMap(new Func1<AsyncN1qlQueryResult, Observable<JsonObject>>() {
@Override
代码示例来源:origin: spring-projects/spring-data-couchbase
return executeAsync(client.async().query(query))
.flatMap(new Func1<AsyncViewResult, Observable<AsyncViewRow>>() {
@Override
代码示例来源:origin: org.springframework.data/spring-data-couchbase
return executeAsync(client.async().query(query))
.flatMap(new Func1<AsyncViewResult, Observable<AsyncViewRow>>() {
@Override
代码示例来源:origin: com.couchbase.client/java-client
.async()
.query(query)
.timeout(anTimeout, TimeUnit.MILLISECONDS)
内容来源于网络,如有侵权,请联系作者删除!