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 |
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,
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.
|
List<Host> |
ExecutionInfo.getTriedHosts()
The list of tried hosts for this query.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
PercentileTracker.computeKey(Host host,
Statement statement,
Exception exception)
Computes a key used to categorize measurements.
|
protected Host |
PerHostPercentileTracker.computeKey(Host host,
Statement statement,
Exception exception) |
protected Cluster |
ClusterWidePercentileTracker.computeKey(Host host,
Statement statement,
Exception exception) |
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 |
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) |
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.
|
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> |
TokenAwarePolicy.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> |
LoadBalancingPolicy.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> |
HostFilterPolicy.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.
|
Modifier and Type | Method and Description |
---|---|
HostDistance |
TokenAwarePolicy.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 |
LoadBalancingPolicy.distance(Host host)
Returns the distance assigned by this policy to the provided host.
|
HostDistance |
LatencyAwarePolicy.distance(Host host)
Returns the HostDistance for the provided host.
|
HostDistance |
HostFilterPolicy.distance(Host host)
Returns the distance assigned by this policy to the provided host.
|
HostDistance |
ErrorAwarePolicy.distance(Host host) |
HostDistance |
DCAwareRoundRobinPolicy.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 |
TokenAwarePolicy.onAdd(Host host) |
void |
RoundRobinPolicy.onAdd(Host host) |
void |
LoadBalancingPolicy.onAdd(Host host)
Called when a new node is added to the cluster.
|
void |
LatencyAwarePolicy.onAdd(Host host) |
void |
HostFilterPolicy.onAdd(Host host) |
void |
ErrorAwarePolicy.onAdd(Host host) |
void |
DCAwareRoundRobinPolicy.onAdd(Host host) |
void |
TokenAwarePolicy.onDown(Host host) |
void |
RoundRobinPolicy.onDown(Host host) |
void |
LoadBalancingPolicy.onDown(Host host)
Called when a node is determined to be down.
|
void |
LatencyAwarePolicy.onDown(Host host) |
void |
HostFilterPolicy.onDown(Host host) |
void |
ErrorAwarePolicy.onDown(Host host) |
void |
DCAwareRoundRobinPolicy.onDown(Host host) |
void |
TokenAwarePolicy.onRemove(Host host) |
void |
RoundRobinPolicy.onRemove(Host host) |
void |
LoadBalancingPolicy.onRemove(Host host)
Called when a node is removed from the cluster.
|
void |
LatencyAwarePolicy.onRemove(Host host) |
void |
HostFilterPolicy.onRemove(Host host) |
void |
ErrorAwarePolicy.onRemove(Host host) |
void |
DCAwareRoundRobinPolicy.onRemove(Host host) |
void |
TokenAwarePolicy.onUp(Host host) |
void |
RoundRobinPolicy.onUp(Host host) |
void |
LoadBalancingPolicy.onUp(Host host)
Called when a node is determined to be up.
|
void |
LatencyAwarePolicy.onUp(Host host) |
void |
HostFilterPolicy.onUp(Host host) |
void |
ErrorAwarePolicy.onUp(Host host) |
void |
DCAwareRoundRobinPolicy.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 |
TokenAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
RoundRobinPolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
LoadBalancingPolicy.init(Cluster cluster,
Collection<Host> hosts)
Initialize this load balancing policy.
|
void |
LatencyAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
HostFilterPolicy.init(Cluster cluster,
Collection<Host> hosts)
Initialize this load balancing policy.
|
void |
ErrorAwarePolicy.init(Cluster cluster,
Collection<Host> hosts) |
void |
DCAwareRoundRobinPolicy.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–2023. All rights reserved.