本文整理了Java中com.datastax.driver.core.Configuration.getQueryOptions()
方法的一些代码示例,展示了Configuration.getQueryOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getQueryOptions()
方法的具体详情如下:
包路径:com.datastax.driver.core.Configuration
类名称:Configuration
方法名:getQueryOptions
[英]Returns the queries configuration.
[中]返回查询配置。
代码示例来源:origin: apache/nifi
@OnScheduled
public void onScheduled(final ProcessContext context) {
super.onScheduled(context);
final int fetchSize = context.getProperty(FETCH_SIZE).evaluateAttributeExpressions().asInteger();
if (fetchSize > 0) {
synchronized (cluster.get()) {
cluster.get().getConfiguration().getQueryOptions().setFetchSize(fetchSize);
}
}
}
代码示例来源:origin: apache/nifi
newCluster.getConfiguration().getQueryOptions().setConsistencyLevel(ConsistencyLevel.valueOf(consistencyLevel));
Metadata metadata = newCluster.getMetadata();
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
long delayMs() {
return configuration.getQueryOptions().getRefreshNodeListIntervalMillis();
}
};
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
long delayMs() {
return configuration.getQueryOptions().getRefreshSchemaIntervalMillis();
}
};
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
long delayMs() {
return configuration.getQueryOptions().getRefreshNodeIntervalMillis();
}
};
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
int maxPendingEvents() {
return configuration.getQueryOptions().getMaxPendingRefreshSchemaRequests();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
int maxPendingEvents() {
return configuration.getQueryOptions().getMaxPendingRefreshNodeListRequests();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
int maxPendingEvents() {
return configuration.getQueryOptions().getMaxPendingRefreshNodeRequests();
}
代码示例来源:origin: apache/nifi
newSession = newCluster.connect();
newCluster.getConfiguration().getQueryOptions().setConsistencyLevel(ConsistencyLevel.valueOf(consistencyLevel));
Metadata metadata = newCluster.getMetadata();
log.info("Connected to Cassandra cluster: {}", new Object[]{metadata.getClusterName()});
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Override
public void init(Cluster cluster) {
childPolicy.init(cluster);
queryOptions = cluster.getConfiguration().getQueryOptions();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
? configuration.getQueryOptions().getConsistencyLevel()
: statement.getConsistencyLevel();
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@BeforeMethod(groups = "short")
public void setUpDefaultIdempotence() {
cluster.getConfiguration().getQueryOptions().setDefaultIdempotence(false);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
ConsistencyLevel cl =
statement.getConsistencyLevel() == null
? configuration.getQueryOptions().getConsistencyLevel()
: statement.getConsistencyLevel();
if (cl.isDCLocal()) {
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@BeforeMethod(groups = {"short"})
public void storeDefaultCL() {
defaultCL = cluster.getConfiguration().getQueryOptions().getConsistencyLevel();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
public RequestHandler(SessionManager manager, Callback callback, Statement statement) {
this.id = Long.toString(System.identityHashCode(this));
if (logger.isTraceEnabled()) logger.trace("[{}] {}", id, statement);
this.manager = manager;
this.callback = callback;
this.scheduler = manager.cluster.manager.connectionFactory.timer;
callback.register(this);
// If host is explicitly set on statement, bypass load balancing policy.
if (statement.getHost() != null) {
this.queryPlan = new QueryPlan(Iterators.singletonIterator(statement.getHost()));
} else {
this.queryPlan =
new QueryPlan(
manager.loadBalancingPolicy().newQueryPlan(manager.poolsState.keyspace, statement));
}
this.speculativeExecutionPlan =
manager.speculativeExecutionPolicy().newPlan(manager.poolsState.keyspace, statement);
this.allowSpeculativeExecutions =
statement != Statement.DEFAULT
&& statement.isIdempotentWithDefault(manager.configuration().getQueryOptions());
this.statement = statement;
this.timerContext = metricsEnabled() ? metrics().getRequestsTimer().time() : null;
this.startTime = System.nanoTime();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
pmsg, cluster, query, poolsState.keyspace);
stmt = cluster.manager.addPrepared(stmt);
if (cluster.getConfiguration().getQueryOptions().isPrepareOnAllHosts()) {
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
private RetryPolicy.RetryDecision computeRetryDecisionOnRequestError(
DriverException exception) {
RetryPolicy.RetryDecision decision;
if (statement.isIdempotentWithDefault(manager.cluster.getConfiguration().getQueryOptions())) {
decision =
retryPolicy()
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
/**
* Copy constructor.
*
* @param toCopy the object to copy from.
*/
protected Configuration(Configuration toCopy) {
this(
toCopy.getPolicies(),
toCopy.getProtocolOptions(),
toCopy.getPoolingOptions(),
toCopy.getSocketOptions(),
toCopy.getMetricsOptions(),
toCopy.getQueryOptions(),
toCopy.getThreadingOptions(),
toCopy.getNettyOptions(),
toCopy.getCodecRegistry());
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
/**
* Tests that settings for a debouncer can be modified dynamically without requiring the cluster
* to be restarted.
*
* @throws InterruptedException
* @jira_ticket JAVA-1192
*/
@CCMConfig(numberOfNodes = 1)
@Test(groups = "short")
public void should_change_debouncer_settings_dynamically() throws InterruptedException {
// Create a spy of the Cluster's control connection and replace it with the spy.
ControlConnection controlConnection = spy(cluster().manager.controlConnection);
cluster().manager.controlConnection = controlConnection;
for (int i = 0; i < 10; i++) {
cluster().manager.submitNodeListRefresh();
Thread.sleep(100);
}
// all requests should be coalesced into a single one
verify(controlConnection, timeout(10000)).refreshNodeListAndTokenMap();
reset(controlConnection);
// disable debouncing
cluster().getConfiguration().getQueryOptions().setRefreshNodeListIntervalMillis(0);
for (int i = 0; i < 10; i++) {
cluster().manager.submitNodeListRefresh();
Thread.sleep(100);
}
// each request should have been handled separately
verify(controlConnection, timeout(10000).times(10)).refreshNodeListAndTokenMap();
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
throws Exception {
try {
schemaDisabledCluster.getConfiguration().getQueryOptions().setMetadataEnabled(true);
schemaDisabledCluster.getConfiguration().getQueryOptions().setMetadataEnabled(true);
verify(schemaDisabledControlConnection, after(1000).never())
.refreshSchema(null, null, null, null);
schemaDisabledCluster.getConfiguration().getQueryOptions().setMetadataEnabled(false);
内容来源于网络,如有侵权,请联系作者删除!