com.datastax.driver.core.PagingOptimizingLatencyTracker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scylla-driver-core Show documentation
Show all versions of scylla-driver-core Show documentation
A driver for Scylla and Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3
(CQL3) and Cassandra's binary protocol.
// Copyright (C) 2018 ScyllaDB
// Use of this source code is governed by a ALv2-style
// license that can be found in the LICENSE file.
package com.datastax.driver.core;
class PagingOptimizingLatencyTracker implements LatencyTracker {
@Override
public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) {
if (exception == null) {
statement.setLastHost(host);
} else {
final Host lastHost = statement.getLastHost();
if (lastHost != null && lastHost.equals(host)) {
statement.setLastHost(null);
}
}
}
@Override
public void onRegister(Cluster cluster) {}
@Override
public void onUnregister(Cluster cluster) {}
}