Package | Description |
---|---|
com.datastax.driver.core |
The main package for the DataStax Java driver for Cassandra.
|
com.datastax.driver.core.policies |
Policies that allow to control some of the behavior of the DataStax Java driver for Cassandra.
|
Modifier and Type | Method and Description |
---|---|
protected Host |
PerHostPercentileTracker.computeKey(Host host,
Statement statement,
Exception exception) |
Host |
StatementWrapper.getHost() |
Host |
Statement.getHost() |
Host |
Statement.getLastHost() |
Host |
ExecutionInfo.getQueriedHost()
Return the Cassandra host that coordinated this query.
|
Modifier and Type | Method and Description |
---|---|
Set<Host> |
Metadata.getAllHosts()
Returns the known hosts of this cluster.
|
Collection<Host> |
Session.State.getConnectedHosts()
The hosts to which the session is currently connected (more precisely, at the time this State
has been grabbed).
|
Set<Host> |
Metadata.getReplicas(String keyspace,
com.datastax.driver.core.Token.Factory partitioner,
ByteBuffer partitionKey)
Returns the set of hosts that are replica for a given partition key.
|
Set<Host> |
Metadata.getReplicas(String keyspace,
TokenRange range)
Returns the set of hosts that are replica for a given token range.
|
com.codahale.metrics.Gauge<Map<Host,Integer>> |
Metrics.getShardAwarenessInfo() |
List<Host> |
ExecutionInfo.getTriedHosts()
The list of tried hosts for this query.
|
Modifier and Type | Method and Description |
---|---|
protected Cluster |
ClusterWidePercentileTracker.computeKey(Host host,
Statement statement,
Exception exception) |
protected Host |
PerHostPercentileTracker.computeKey(Host host,
Statement statement,
Exception exception) |
protected abstract Object |
PercentileTracker.computeKey(Host host,
Statement statement,
Exception exception)
Computes a key used to categorize measurements.
|
int |
Session.State.getInFlightQueries(Host host)
The number of queries that are currently being executed through a given host.
|
long |
PercentileTracker.getLatencyAtPercentile(Host host,
Statement statement,
Exception exception,
double percentile)
Returns the request latency at a given percentile.
|
int |
Session.State.getOpenConnections(Host host)
The number of open connections to a given host.
|
Set<TokenRange> |
Metadata.getTokenRanges(String keyspace,
Host host)
Returns the token ranges that are replicated on the given host, for the given keyspace.
|
int |
Session.State.getTrashedConnections(Host host)
The number of "trashed" connections to a given host.
|
static String |
MetricsUtil.hostMetricName(String prefix,
Host host) |
protected boolean |
PercentileTracker.include(Host host,
Statement statement,
Exception exception)
Determines whether a particular measurement should be included.
|
protected void |
QueryLogger.maybeLogErrorQuery(Host host,
Statement statement,
Exception exception,
long latencyMs) |
protected abstract void |
QueryLogger.maybeLogNormalOrSlowQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
QueryLogger.ConstantThresholdQueryLogger.maybeLogNormalOrSlowQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
QueryLogger.DynamicThresholdQueryLogger.maybeLogNormalOrSlowQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
QueryLogger.maybeLogNormalQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
QueryLogger.ConstantThresholdQueryLogger.maybeLogSlowQuery(Host host,
Statement statement,
long latencyMs) |
protected void |
QueryLogger.DynamicThresholdQueryLogger.maybeLogSlowQuery(Host host,
Statement statement,
long latencyMs,
long threshold) |
void |
Host.StateListener.onAdd(Host host)
Called when a new node is added to the cluster.
|
void |
Host.StateListener.onDown(Host host)
Called when a node is determined to be down.
|
void |
Host.StateListener.onRemove(Host host)
Called when a node is removed from the cluster.
|
void |
Host.StateListener.onUp(Host host)
Called when a node is determined to be up.
|
void |
PoolingOptions.refreshConnectedHost(Host host)
Requests the driver to re-evaluate the
HostDistance for a given node. |
Statement |
StatementWrapper.setHost(Host host) |
Statement |
Statement.setHost(Host host)
Sets the
Host that should handle this query. |
void |
Statement.setLastHost(Host host) |
void |
LatencyTracker.update(Host host,
Statement statement,
Exception exception,
long newLatencyNanos)
A method that is called after each request to a Cassandra node with the duration of that
operation.
|
void |
QueryLogger.update(Host host,
Statement statement,
Exception exception,
long newLatencyNanos)
A method that is called after each request to a Cassandra node with the duration of that
operation.
|
void |
PercentileTracker.update(Host host,
Statement statement,
Exception exception,
long newLatencyNanos) |
Constructor and Description |
---|
ExecutionInfo(int speculativeExecutions,
int successfulExecutionIndex,
List<Host> triedHosts,
ConsistencyLevel achievedConsistency,
Map<String,ByteBuffer> customPayload) |
Modifier and Type | Method and Description |
---|---|
Map<Host,LatencyAwarePolicy.Snapshot.Stats> |
LatencyAwarePolicy.Snapshot.getAllStats()
A map with the stats for all hosts tracked by the
LatencyAwarePolicy at the time of
the snapshot. |
Iterator<Host> |
LoadBalancingPolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
RoundRobinPolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
LatencyAwarePolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
ErrorAwarePolicy.newQueryPlan(String loggedKeyspace,
Statement statement) |
Iterator<Host> |
DCAwareRoundRobinPolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
TokenAwarePolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
PagingOptimizingLoadBalancingPolicy.newQueryPlan(String loggedKeyspace,
Statement statement) |
Iterator<Host> |
HostFilterPolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Iterator<Host> |
RackAwareRoundRobinPolicy.newQueryPlan(String loggedKeyspace,
Statement statement)
Returns the hosts to use for a new query.
|
Modifier and Type | Method and Description |
---|---|
HostDistance |
LoadBalancingPolicy.distance(Host host)
Returns the distance assigned by this policy to the provided host.
|
HostDistance |
RoundRobinPolicy.distance(Host host)
Return the HostDistance for the provided host.
|
HostDistance |
LatencyAwarePolicy.distance(Host host)
Returns the HostDistance for the provided host.
|
HostDistance |
ErrorAwarePolicy.distance(Host host) |
HostDistance |
DCAwareRoundRobinPolicy.distance(Host host)
Return the HostDistance for the provided host.
|
HostDistance |
TokenAwarePolicy.distance(Host host)
Returns the distance assigned by this policy to the provided host.
|
HostDistance |
PagingOptimizingLoadBalancingPolicy.distance(Host host) |
HostDistance |
HostFilterPolicy.distance(Host host)
Returns the distance assigned by this policy to the provided host.
|
HostDistance |
RackAwareRoundRobinPolicy.distance(Host host)
Return the HostDistance for the provided host.
|
LatencyAwarePolicy.Snapshot.Stats |
LatencyAwarePolicy.Snapshot.getStats(Host host)
The
Stats object for a given host. |
long |
SpeculativeExecutionPolicy.SpeculativeExecutionPlan.nextExecution(Host lastQueried)
Returns the time before the next speculative query.
|
void |
LoadBalancingPolicy.onAdd(Host host)
Called when a new node is added to the cluster.
|
void |
RoundRobinPolicy.onAdd(Host host) |
void |
LatencyAwarePolicy.onAdd(Host host) |
void |
ErrorAwarePolicy.onAdd(Host host) |
void |
DCAwareRoundRobinPolicy.onAdd(Host host) |
void |
TokenAwarePolicy.onAdd(Host host) |
void |
PagingOptimizingLoadBalancingPolicy.onAdd(Host host) |
void |
HostFilterPolicy.onAdd(Host host) |
void |
RackAwareRoundRobinPolicy.onAdd(Host host) |
void |
LoadBalancingPolicy.onDown(Host host)
Called when a node is determined to be down.
|
void |
RoundRobinPolicy.onDown(Host host) |
void |
LatencyAwarePolicy.onDown(Host host) |
void |
ErrorAwarePolicy.onDown(Host host) |
void |
DCAwareRoundRobinPolicy.onDown(Host host) |
void |
TokenAwarePolicy.onDown(Host host) |
void |
PagingOptimizingLoadBalancingPolicy.onDown(Host host) |
void |
HostFilterPolicy.onDown(Host host) |
void |
RackAwareRoundRobinPolicy.onDown(Host host) |
void |
LoadBalancingPolicy.onRemove(Host host)
Called when a node is removed from the cluster.
|
void |
RoundRobinPolicy.onRemove(Host host) |
void |
LatencyAwarePolicy.onRemove(Host host) |
void |
ErrorAwarePolicy.onRemove(Host host) |
void |
DCAwareRoundRobinPolicy.onRemove(Host host) |
void |
TokenAwarePolicy.onRemove(Host host) |
void |
PagingOptimizingLoadBalancingPolicy.onRemove(Host host) |
void |
HostFilterPolicy.onRemove(Host host) |
void |
RackAwareRoundRobinPolicy.onRemove(Host host) |
void |
LoadBalancingPolicy.onUp(Host host)
Called when a node is determined to be up.
|
void |
RoundRobinPolicy.onUp(Host host) |
void |
LatencyAwarePolicy.onUp(Host host) |
void |
ErrorAwarePolicy.onUp(Host host) |
void |
DCAwareRoundRobinPolicy.onUp(Host host) |
void |
TokenAwarePolicy.onUp(Host host) |
void |
PagingOptimizingLoadBalancingPolicy.onUp(Host host) |
void |
HostFilterPolicy.onUp(Host host) |
void |
RackAwareRoundRobinPolicy.onUp(Host host) |
boolean |
ErrorAwarePolicy.ErrorFilter.shouldConsiderError(Exception e,
Host host,
Statement statement)
Whether an error should be counted in the host's error rate.
|
Modifier and Type | Method and Description |
---|---|
void |
LoadBalancingPolicy.init(Cluster cluster,
Collection<Host> hosts)
Initialize this load balancing policy.
|
void |
RoundRobinPolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
LatencyAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
ErrorAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
DCAwareRoundRobinPolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
TokenAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
PagingOptimizingLoadBalancingPolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
HostFilterPolicy.init(Cluster cluster,
Collection<Host> hosts)
Initialize this load balancing policy.
|
void |
RackAwareRoundRobinPolicy.init(Cluster cluster,
Collection<Host> hosts) |
Constructor and Description |
---|
HostFilterPolicy(LoadBalancingPolicy childPolicy,
Predicate<Host> predicate)
Create a new policy that wraps the provided child policy but only "allows" hosts matching the
predicate.
|
Copyright © 2012–2024. All rights reserved.