All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.driver.core.PagingOptimizingLatencyTracker Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.11.5.3
Show newest version
// 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) {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy