use of com.couchbase.client.core.msg.kv.GetMetaRequest in project couchbase-jvm-clients by couchbase.
the class AsyncCollection method existsRequest.
/**
* Helper method to create the exists request from its options.
*
* @param id the document ID
* @param options custom options to change the default behavior
* @return the observe request used for exists.
*/
GetMetaRequest existsRequest(final String id, final ExistsOptions options) {
notNullOrEmpty(id, "Id", () -> ReducedKeyValueErrorContext.create(id, collectionIdentifier));
notNull(options, "ExistsOptions", () -> ReducedKeyValueErrorContext.create(id, collectionIdentifier));
ExistsOptions.Built opts = options.build();
Duration timeout = opts.timeout().orElse(environment.timeoutConfig().kvTimeout());
RetryStrategy retryStrategy = opts.retryStrategy().orElse(environment.retryStrategy());
RequestSpan span = environment.requestTracer().requestSpan(TracingIdentifiers.SPAN_REQUEST_KV_EXISTS, opts.parentSpan().orElse(null));
GetMetaRequest request = new GetMetaRequest(id, timeout, coreContext, collectionIdentifier, retryStrategy, span);
request.context().clientContext(opts.clientContext());
return request;
}
Aggregations