Search in sources :

Example 41 with CqlSession

use of com.datastax.oss.driver.api.core.CqlSession in project zipkin by openzipkin.

the class CassandraStorageExtension method blockWhileInFlight.

static void blockWhileInFlight(CassandraStorage storage) {
    CqlSession session = storage.session.get();
    // Now, block until writes complete, notably so we can read them.
    boolean wasInFlight = false;
    while (true) {
        if (!poolInFlight(session)) {
            // give a little more to avoid flakey tests
            if (wasInFlight)
                sleep(100);
            return;
        }
        wasInFlight = true;
        sleep(100);
    }
}
Also used : CqlSession(com.datastax.oss.driver.api.core.CqlSession)

Aggregations

CqlSession (com.datastax.oss.driver.api.core.CqlSession)41 Node (com.datastax.oss.driver.api.core.metadata.Node)20 Test (org.junit.jupiter.api.Test)20 Health (org.springframework.boot.actuate.health.Health)20 Metadata (com.datastax.oss.driver.api.core.metadata.Metadata)19 ArrayList (java.util.ArrayList)14 NodeState (com.datastax.oss.driver.api.core.metadata.NodeState)12 DriverTimeoutException (com.datastax.oss.driver.api.core.DriverTimeoutException)11 List (java.util.List)11 UUID (java.util.UUID)11 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)11 Version (com.datastax.oss.driver.api.core.Version)10 Collections (java.util.Collections)10 HashMap (java.util.HashMap)10 Map (java.util.Map)10 Assertions.assertThatIllegalArgumentException (org.assertj.core.api.Assertions.assertThatIllegalArgumentException)10 BDDMockito.given (org.mockito.BDDMockito.given)10 Mockito.mock (org.mockito.Mockito.mock)10 Status (org.springframework.boot.actuate.health.Status)10 Mono (reactor.core.publisher.Mono)10