public class GenericQueryRequest extends AbstractCouchbaseRequest implements QueryRequest, PrelocatedRequest
For the lack of a better name, a query request against a query server.
Modifier | Constructor and Description |
---|---|
protected |
GenericQueryRequest(String query,
boolean jsonFormat,
String bucket,
String username,
String password,
InetAddress targetNode,
String contextId) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterSpanSet(io.opentracing.Span span)
Use this method to add custom span values on insert.
|
boolean |
isJsonFormat() |
static GenericQueryRequest |
jsonQuery(String jsonQuery,
String bucket,
String password,
InetAddress targetNode,
String contextId)
Create a
GenericQueryRequest and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…). |
static GenericQueryRequest |
jsonQuery(String jsonQuery,
String bucket,
String password,
String contextId)
Create a
GenericQueryRequest and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…). |
static GenericQueryRequest |
jsonQuery(String jsonQuery,
String bucket,
String username,
String password,
InetAddress targetNode,
String contextId)
Create a
GenericQueryRequest and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…). |
static GenericQueryRequest |
jsonQuery(String jsonQuery,
String bucket,
String username,
String password,
String contextId)
Create a
GenericQueryRequest and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…). |
String |
operationId()
Default implementation, sub requests need to override this.
|
String |
query() |
InetAddress |
sendTo()
The
node to send this request to, or null to use default node location process . |
static GenericQueryRequest |
simpleStatement(String statement,
String bucket,
String password)
Creates a
GenericQueryRequest and mark it as containing a single simple statement (e.g. |
static GenericQueryRequest |
simpleStatement(String statement,
String bucket,
String username,
String password)
Creates a
GenericQueryRequest and mark it as containing a single simple statement (e.g. |
bucket, complete, creationTime, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, toString, username
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bucket, complete, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, username
creationTime
protected void afterSpanSet(io.opentracing.Span span)
AbstractCouchbaseRequest
Use this method to add custom span values on insert.
afterSpanSet
in class AbstractCouchbaseRequest
public String operationId()
AbstractCouchbaseRequest
Default implementation, sub requests need to override this.
operationId
in interface CouchbaseRequest
operationId
in class AbstractCouchbaseRequest
public String query()
public boolean isJsonFormat()
public InetAddress sendTo()
PrelocatedRequest
The node
to send this request to, or null to use default node location process
.
sendTo
in interface PrelocatedRequest
public static GenericQueryRequest simpleStatement(String statement, String bucket, String password)
Creates a GenericQueryRequest
and mark it as containing a single simple statement (e.g. “SELECT * FROM default”).
statement
- the N1QL query statement to perform.bucket
- the bucket on which to search.password
- the password for the target bucket.GenericQueryRequest
for this simple statement.public static GenericQueryRequest simpleStatement(String statement, String bucket, String username, String password)
Creates a GenericQueryRequest
and mark it as containing a single simple statement (e.g. “SELECT * FROM default”).
statement
- the N1QL query statement to perform.bucket
- the bucket on which to search.username
- the user authorized for bucket access.password
- the password for the user.GenericQueryRequest
for this simple statement.public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String password, String contextId)
Create a GenericQueryRequest
and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…).
The simplest form of such a query is a single statement encapsulated in a json query object:
{“statement”:“SELECT * FROM default”}.
jsonQuery
- the N1QL query in json form.bucket
- the bucket on which to perform the query.password
- the password for the target bucket.contextId
- the context id to store and use for tracing purposes.GenericQueryRequest
for this full query.public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String username, String password, String contextId)
Create a GenericQueryRequest
and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…).
The simplest form of such a query is a single statement encapsulated in a json query object:
{“statement”:“SELECT * FROM default”}.
jsonQuery
- the N1QL query in json form.bucket
- the bucket on which to perform the query.username
- the user authorized for bucket access.password
- the password for the user.contextId
- the context id to store and use for tracing purposes.GenericQueryRequest
for this full query.public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String password, InetAddress targetNode, String contextId)
Create a GenericQueryRequest
and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…).
The simplest form of such a query is a single statement encapsulated in a json query object:
{“statement”:“SELECT * FROM default”}.
jsonQuery
- the N1QL query in json form.bucket
- the bucket on which to perform the query.password
- the password for the target bucket.targetNode
- the node on which to execute this request (or null to let the core locate and choose one).contextId
- the context id to store and use for tracing purposes.GenericQueryRequest
for this full query.public static GenericQueryRequest jsonQuery(String jsonQuery, String bucket, String username, String password, InetAddress targetNode, String contextId)
Create a GenericQueryRequest
and mark it as containing a full N1QL query in Json form (including additional query parameters like named arguments, etc…).
The simplest form of such a query is a single statement encapsulated in a json query object:
{“statement”:“SELECT * FROM default”}.
jsonQuery
- the N1QL query in json form.bucket
- the bucket on which to perform the query.username
- the user authorized for bucket access.password
- the password for the user.targetNode
- the node on which to execute this request (or null to let the core locate and choose one).contextId
- the context id to store and use for tracing purposes.GenericQueryRequest
for this full query.Copyright © 2018 Couchbase, Inc.. All rights reserved.