public class QueryPolicy extends Policy
Modifier and Type | Field and Description |
---|---|
QueryDuration |
expectedDuration
Expected query duration.
|
boolean |
failOnClusterChange
Terminate query if cluster is in migration state.
|
boolean |
includeBinData
Should bin data be retrieved.
|
int |
infoTimeout
Timeout in milliseconds for "cluster-stable" info command that is run when
failOnClusterChange is true and server version is less than 6.0. |
int |
maxConcurrentNodes
Maximum number of concurrent requests to server nodes at any point in time.
|
long |
maxRecords
Deprecated.
|
int |
recordQueueSize
Number of records to place in queue before blocking.
|
boolean |
shortQuery
Deprecated.
|
compress, connectTimeout, failOnFilteredOut, filterExp, maxRetries, readModeAP, readModeSC, readTouchTtlPercent, replica, sendKey, sleepBetweenRetries, socketTimeout, timeoutDelay, totalTimeout
Constructor and Description |
---|
QueryPolicy()
Default constructor.
|
QueryPolicy(Policy other)
Copy query policy from another policy.
|
QueryPolicy(QueryPolicy other)
Copy query policy from another query policy.
|
Modifier and Type | Method and Description |
---|---|
void |
setExpectedDuration(QueryDuration expectedDuration) |
void |
setFailOnClusterChange(boolean failOnClusterChange) |
void |
setIncludeBinData(boolean includeBinData) |
void |
setInfoTimeout(int infoTimeout) |
void |
setMaxConcurrentNodes(int maxConcurrentNodes) |
void |
setMaxRecords(long maxRecords) |
void |
setRecordQueueSize(int recordQueueSize) |
void |
setShortQuery(boolean shortQuery) |
equals, hashCode, setCompress, setConnectTimeout, setFailOnFilteredOut, setFilterExp, setMaxRetries, setReadModeAP, setReadModeSC, setReadTouchTtlPercent, setReplica, setSendKey, setSleepBetweenRetries, setSocketTimeout, setTimeout, setTimeoutDelay, setTimeouts, setTotalTimeout
public QueryDuration expectedDuration
Default: QueryDuration.LONG
@Deprecated public long maxRecords
Statement.setMaxRecords(long)
instead.
Approximate number of records to return to client. This number is divided by the number of nodes involved in the query. The actual number of records returned may be less than maxRecords if node record counts are small and unbalanced across nodes.
maxRecords is only supported when query filter is null. maxRecords exists here because query methods will convert into a scan when the query filter is null. maxRecords is ignored when the query contains a filter.
Default: 0 (do not limit record count)
public int maxConcurrentNodes
Default: 0 (issue requests to all server nodes in parallel)
public int recordQueueSize
Default: 5000
public int infoTimeout
failOnClusterChange
is true and server version is less than 6.0.
Default: 1000
public boolean includeBinData
Default: true
public boolean failOnClusterChange
Default: false
@Deprecated public boolean shortQuery
expectedDuration
instead.
For backwards compatibility: If shortQuery is true, the query is treated as a short query and
expectedDuration
is ignored. If shortQuery is false, expectedDuration
is used
and defaults to QueryDuration.LONG
.
Is query expected to return less than 100 records per node. If true, the server will optimize the query for a small record set. This field is ignored for aggregation queries, background queries and server versions < 6.0.
Default: false
public QueryPolicy(QueryPolicy other)
public QueryPolicy(Policy other)
public QueryPolicy()
The latest servers support retries on individual data partitions. This feature is useful when a cluster is migrating and partition(s) are missed or incomplete on the first query attempt.
If the first query attempt misses 2 of 4096 partitions, then only those 2 partitions are retried in the next query attempt from the last key digest received for each respective partition. A higher default maxRetries is used because it's wasteful to invalidate all query results because a single partition was missed.
public void setExpectedDuration(QueryDuration expectedDuration)
public void setMaxRecords(long maxRecords)
public void setMaxConcurrentNodes(int maxConcurrentNodes)
public void setRecordQueueSize(int recordQueueSize)
public void setInfoTimeout(int infoTimeout)
public void setIncludeBinData(boolean includeBinData)
public void setFailOnClusterChange(boolean failOnClusterChange)
public void setShortQuery(boolean shortQuery)
Copyright © 2012–2024 Aerospike, Inc. All rights reserved.