use of com.couchbase.client.java.manager.query.AsyncQueryIndexManager.QueryType.READ_ONLY in project couchbase-jvm-clients by couchbase.
the class AsyncQueryIndexManager method exec.
private CompletableFuture<QueryResult> exec(QueryType queryType, CharSequence statement, CommonOptions<?>.BuiltCommonOptions options, String spanName, String bucketName, JsonArray parameters) {
QueryOptions queryOpts = toQueryOptions(options).readonly(requireNonNull(queryType) == READ_ONLY);
if (parameters != null && !parameters.isEmpty()) {
queryOpts.parameters(parameters);
}
RequestSpan parent = cluster.environment().requestTracer().requestSpan(spanName, options.parentSpan().orElse(null));
parent.attribute(TracingIdentifiers.ATTR_SYSTEM, TracingIdentifiers.ATTR_SYSTEM_COUCHBASE);
if (bucketName != null) {
parent.attribute(TracingIdentifiers.ATTR_NAME, bucketName);
}
queryOpts.parentSpan(parent);
return cluster.query(statement.toString(), queryOpts).exceptionally(t -> {
throw translateException(t);
}).whenComplete((r, t) -> parent.end());
}
Aggregations