Search in sources :

Example 11 with GOSSIP

use of org.apache.cassandra.distributed.api.Feature.GOSSIP in project cassandra by apache.

the class ReprepareTestOldBehaviour method testReprepareMixedVersionWithoutReset.

@Test
public void testReprepareMixedVersionWithoutReset() throws Throwable {
    try (ICluster<IInvokableInstance> c = init(builder().withNodes(2).withConfig(config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL)).withInstanceInitializer(PrepareBehaviour::oldBehaviour).start())) {
        ForceHostLoadBalancingPolicy lbp = new ForceHostLoadBalancingPolicy();
        c.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck));"));
        // 1 has old behaviour
        for (int firstContact : new int[] { 1, 2 }) {
            for (boolean withUse : new boolean[] { true, false }) {
                for (boolean clearBetweenExecutions : new boolean[] { true, false }) {
                    try (com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint("127.0.0.1").addContactPoint("127.0.0.2").withLoadBalancingPolicy(lbp).build();
                        Session session = cluster.connect()) {
                        if (withUse)
                            session.execute(withKeyspace("USE %s"));
                        lbp.setPrimary(firstContact);
                        final PreparedStatement select = session.prepare(withKeyspace("SELECT * FROM %s.tbl"));
                        session.execute(select.bind());
                        if (clearBetweenExecutions)
                            c.get(2).runOnInstance(QueryProcessor::clearPreparedStatementsCache);
                        lbp.setPrimary(firstContact == 1 ? 2 : 1);
                        session.execute(select.bind());
                        if (clearBetweenExecutions)
                            c.get(2).runOnInstance(QueryProcessor::clearPreparedStatementsCache);
                        lbp.setPrimary(firstContact);
                        session.execute(select.bind());
                        c.get(2).runOnInstance(QueryProcessor::clearPreparedStatementsCache);
                    }
                }
            }
        }
    }
}
Also used : PreparedStatement(com.datastax.driver.core.PreparedStatement) IInvokableInstance(org.apache.cassandra.distributed.api.IInvokableInstance) Session(com.datastax.driver.core.Session) ICluster(org.apache.cassandra.distributed.api.ICluster) Test(org.junit.Test) QueryProcessor(org.apache.cassandra.cql3.QueryProcessor) NETWORK(org.apache.cassandra.distributed.api.Feature.NETWORK) GOSSIP(org.apache.cassandra.distributed.api.Feature.GOSSIP) NATIVE_PROTOCOL(org.apache.cassandra.distributed.api.Feature.NATIVE_PROTOCOL) IInvokableInstance(org.apache.cassandra.distributed.api.IInvokableInstance) PreparedStatement(com.datastax.driver.core.PreparedStatement) QueryProcessor(org.apache.cassandra.cql3.QueryProcessor) Session(com.datastax.driver.core.Session) Test(org.junit.Test)

Example 12 with GOSSIP

use of org.apache.cassandra.distributed.api.Feature.GOSSIP in project cassandra by apache.

the class MigrationCoordinatorTest method explicitEndpointIgnore.

@Test
public void explicitEndpointIgnore() throws Throwable {
    try (Cluster cluster = Cluster.build(2).withTokenSupplier(TokenSupplier.evenlyDistributedTokens(3)).withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(3, "dc0", "rack0")).withConfig(config -> config.with(NETWORK, GOSSIP)).start()) {
        cluster.schemaChange("CREATE KEYSPACE ks with replication={'class':'SimpleStrategy', 'replication_factor':2}");
        InetAddress ignoredEndpoint = cluster.get(2).broadcastAddress().getAddress();
        cluster.get(2).shutdown(false);
        cluster.schemaChangeIgnoringStoppedInstances("CREATE TABLE ks.tbl (k int primary key, v int)");
        IInstanceConfig config = cluster.newInstanceConfig();
        config.set("auto_bootstrap", true);
        System.setProperty(MigrationCoordinator.IGNORED_ENDPOINTS_PROP, ignoredEndpoint.getHostAddress());
        System.setProperty("cassandra.consistent.rangemovement", "false");
        cluster.bootstrap(config).startup();
    }
}
Also used : InetAddress(java.net.InetAddress) TokenSupplier(org.apache.cassandra.distributed.api.TokenSupplier) Test(org.junit.Test) Cluster(org.apache.cassandra.distributed.Cluster) UUID(java.util.UUID) MigrationCoordinator(org.apache.cassandra.schema.MigrationCoordinator) IInstanceConfig(org.apache.cassandra.distributed.api.IInstanceConfig) NetworkTopology(org.apache.cassandra.distributed.shared.NetworkTopology) NETWORK(org.apache.cassandra.distributed.api.Feature.NETWORK) Before(org.junit.Before) Schema(org.apache.cassandra.schema.Schema) GOSSIP(org.apache.cassandra.distributed.api.Feature.GOSSIP) IInstanceConfig(org.apache.cassandra.distributed.api.IInstanceConfig) Cluster(org.apache.cassandra.distributed.Cluster) InetAddress(java.net.InetAddress) Test(org.junit.Test)

Example 13 with GOSSIP

use of org.apache.cassandra.distributed.api.Feature.GOSSIP in project cassandra by apache.

the class MigrationCoordinatorTest method replaceNode.

/**
 * We shouldn't wait on versions only available from a node being replaced
 * see CASSANDRA-
 */
@Test
public void replaceNode() throws Throwable {
    try (Cluster cluster = Cluster.build(2).withTokenSupplier(TokenSupplier.evenlyDistributedTokens(3)).withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(3, "dc0", "rack0")).withConfig(config -> config.with(NETWORK, GOSSIP)).start()) {
        cluster.schemaChange("CREATE KEYSPACE ks with replication={'class':'SimpleStrategy', 'replication_factor':2}");
        InetAddress replacementAddress = cluster.get(2).broadcastAddress().getAddress();
        cluster.get(2).shutdown(false);
        cluster.schemaChangeIgnoringStoppedInstances("CREATE TABLE ks.tbl (k int primary key, v int)");
        IInstanceConfig config = cluster.newInstanceConfig();
        config.set("auto_bootstrap", true);
        System.setProperty("cassandra.replace_address", replacementAddress.getHostAddress());
        cluster.bootstrap(config).startup();
    }
}
Also used : InetAddress(java.net.InetAddress) TokenSupplier(org.apache.cassandra.distributed.api.TokenSupplier) Test(org.junit.Test) Cluster(org.apache.cassandra.distributed.Cluster) UUID(java.util.UUID) MigrationCoordinator(org.apache.cassandra.schema.MigrationCoordinator) IInstanceConfig(org.apache.cassandra.distributed.api.IInstanceConfig) NetworkTopology(org.apache.cassandra.distributed.shared.NetworkTopology) NETWORK(org.apache.cassandra.distributed.api.Feature.NETWORK) Before(org.junit.Before) Schema(org.apache.cassandra.schema.Schema) GOSSIP(org.apache.cassandra.distributed.api.Feature.GOSSIP) IInstanceConfig(org.apache.cassandra.distributed.api.IInstanceConfig) Cluster(org.apache.cassandra.distributed.Cluster) InetAddress(java.net.InetAddress) Test(org.junit.Test)

Example 14 with GOSSIP

use of org.apache.cassandra.distributed.api.Feature.GOSSIP in project cassandra by apache.

the class MixedModeFuzzTest method mixedModeFuzzTest.

@Test
public void mixedModeFuzzTest() throws Throwable {
    try (ICluster<IInvokableInstance> c = builder().withNodes(2).withConfig(config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL)).withInstanceInitializer(PrepareBehaviour::oldNewBehaviour).start()) {
        // Long string to make us invalidate caches occasionally
        String veryLongString = "very";
        for (int i = 0; i < 2; i++) veryLongString += veryLongString;
        final String qualified = "SELECT pk as " + veryLongString + "%d, ck as " + veryLongString + "%d FROM ks%d.tbl";
        final String unqualified = "SELECT pk as " + veryLongString + "%d, ck as " + veryLongString + "%d FROM tbl";
        int KEYSPACES = 3;
        final int STATEMENTS_PER_KS = 2;
        for (int i = 0; i < KEYSPACES; i++) {
            c.schemaChange(withKeyspace("CREATE KEYSPACE ks" + i + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2};"));
            c.schemaChange(withKeyspace("CREATE TABLE ks" + i + ".tbl (pk int, ck int, PRIMARY KEY (pk, ck));"));
            for (int j = 0; j < i; j++) c.coordinator(1).execute("INSERT INTO ks" + i + ".tbl (pk, ck) VALUES (?, ?)", ConsistencyLevel.ALL, 1, j);
        }
        List<Thread> threads = new ArrayList<>();
        AtomicBoolean interrupt = new AtomicBoolean(false);
        AtomicReference<Throwable> thrown = new AtomicReference<>();
        int INFREQUENT_ACTION_COEF = 100;
        long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(20);
        for (int i = 0; i < 3; i++) {
            int seed = i;
            threads.add(new Thread(() -> {
                com.datastax.driver.core.Cluster cluster = null;
                Map<String, Session> sessions = new HashMap<>();
                try {
                    AtomicBoolean nodeWithFix = new AtomicBoolean(false);
                    Supplier<Cluster> clusterSupplier = () -> {
                        return com.datastax.driver.core.Cluster.builder().addContactPoint("127.0.0.1").addContactPoint("127.0.0.2").build();
                    };
                    AtomicBoolean allUpgraded = new AtomicBoolean(false);
                    Random rng = new Random(seed);
                    boolean reconnected = false;
                    Map<Pair<Integer, Integer>, PreparedStatement> qualifiedStatements = new HashMap<>();
                    Map<Pair<Integer, Integer>, PreparedStatement> unqualifiedStatements = new HashMap<>();
                    cluster = clusterSupplier.get();
                    for (int j = 0; j < KEYSPACES; j++) {
                        String ks = "ks" + j;
                        sessions.put(ks, cluster.connect(ks));
                        Assert.assertEquals(sessions.get(ks).getLoggedKeyspace(), ks);
                    }
                    long firstVersionBump = System.nanoTime() + TimeUnit.SECONDS.toNanos(5);
                    long reconnectAfter = System.nanoTime() + TimeUnit.SECONDS.toNanos(15);
                    while (!interrupt.get() && (System.nanoTime() < deadline)) {
                        nodeWithFix.set(rng.nextBoolean());
                        final int ks = rng.nextInt(KEYSPACES);
                        final int statementIdx = rng.nextInt(STATEMENTS_PER_KS);
                        final Pair<Integer, Integer> statementId = Pair.create(ks, statementIdx);
                        int v = rng.nextInt(INFREQUENT_ACTION_COEF + 1);
                        Action[] pool;
                        if (v == INFREQUENT_ACTION_COEF)
                            pool = infrequent;
                        else
                            pool = frequent;
                        Action action = pool[rng.nextInt(pool.length)];
                        // logger.info(String.format("Executing %s on the node %s. ks %d", action, nodeWithFix.get() ? "1" : "2", ks));
                        switch(action) {
                            case BUMP_VERSION:
                                if (System.nanoTime() < firstVersionBump)
                                    break;
                                c.stream().forEach(node -> node.runOnInstance(() -> {
                                    if (version.get().equals(INITIAL_VERSION)) {
                                        CassandraVersion upgradeTo = QueryProcessor.NEW_PREPARED_STATEMENT_BEHAVIOUR_SINCE_40;
                                        while (!version.get().equals(upgradeTo)) {
                                            if (version.compareAndSet(INITIAL_VERSION, upgradeTo)) {
                                                logger.info("Bumped version to " + upgradeTo);
                                                break;
                                            }
                                        }
                                    }
                                }));
                                break;
                            case EXECUTE_QUALIFIED:
                                if (!qualifiedStatements.containsKey(statementId))
                                    continue;
                                try {
                                    int counter = 0;
                                    BoundStatement boundStatement = qualifiedStatements.get(statementId).bind();
                                    boundStatement.setHost(getHost(cluster, nodeWithFix.get()));
                                    for (Iterator<Object[]> iter = RowUtil.toObjects(sessions.get("ks" + ks).execute(boundStatement)); iter.hasNext(); ) {
                                        Object[] current = iter.next();
                                        int v0 = (int) current[0];
                                        int v1 = (int) current[1];
                                        Assert.assertEquals(v0, 1);
                                        Assert.assertEquals(v1, counter++);
                                    }
                                    if (nodeWithFix.get())
                                        Assert.assertEquals(ks, counter);
                                } catch (Throwable t) {
                                    if (t.getCause() != null && t.getCause().getMessage().contains("Statement was prepared on keyspace"))
                                        continue;
                                    throw t;
                                }
                                break;
                            case EXECUTE_UNQUALIFIED:
                                if (!unqualifiedStatements.containsKey(statementId))
                                    continue;
                                try {
                                    BoundStatement boundStatement = unqualifiedStatements.get(statementId).bind();
                                    boundStatement.setHost(getHost(cluster, nodeWithFix.get()));
                                    int counter = 0;
                                    for (Iterator<Object[]> iter = RowUtil.toObjects(sessions.get("ks" + ks).execute(boundStatement)); iter.hasNext(); ) {
                                        Object[] current = iter.next();
                                        int v0 = (int) current[0];
                                        int v1 = (int) current[1];
                                        Assert.assertEquals(v0, 1);
                                        Assert.assertEquals(v1, counter++);
                                    }
                                    if (nodeWithFix.get() && allUpgraded.get()) {
                                        Assert.assertEquals(unqualifiedStatements.get(statementId).getQueryKeyspace() + " " + ks + " " + statementId, ks, counter);
                                    }
                                } catch (Throwable t) {
                                    if (t.getMessage().contains("ID mismatch while trying to reprepare") || (t.getCause() != null && t.getCause().getMessage().contains("Statement was prepared on keyspace"))) {
                                        logger.info("Detected id mismatch, skipping as it is expected: ");
                                        continue;
                                    }
                                    throw t;
                                }
                                break;
                            case FORGET_PREPARED:
                                Map<Pair<Integer, Integer>, PreparedStatement> toCleanup = rng.nextBoolean() ? qualifiedStatements : unqualifiedStatements;
                                Set<Pair<Integer, Integer>> toDrop = new HashSet<>();
                                for (Pair<Integer, Integer> e : toCleanup.keySet()) {
                                    if (rng.nextBoolean())
                                        toDrop.add(e);
                                }
                                for (Pair<Integer, Integer> e : toDrop) toCleanup.remove(e);
                                toDrop.clear();
                                break;
                            case CLEAR_CACHES:
                                if (!nodeWithFix.get() && !allUpgraded.get())
                                    continue;
                                c.get(nodeWithFix.get() ? 1 : 2).runOnInstance(() -> {
                                    SystemKeyspace.loadPreparedStatements((id, query, keyspace) -> {
                                        if (rng.nextBoolean())
                                            QueryProcessor.instance.evictPrepared(id);
                                        return true;
                                    });
                                });
                                break;
                            case PREPARE_QUALIFIED:
                                if (unqualifiedStatements.containsKey(statementId))
                                    continue;
                                try {
                                    String qs = String.format(qualified, statementIdx, statementIdx, ks);
                                    String keyspace = "ks" + ks;
                                    PreparedStatement preparedQualified = sessions.get("ks" + ks).prepare(qs);
                                    // With prepared qualified, keyspace will be set to the keyspace of the statement when it was first executed
                                    if (allUpgraded.get())
                                        PreparedStatementHelper.assertHashWithoutKeyspace(preparedQualified, qs, keyspace);
                                    qualifiedStatements.put(statementId, preparedQualified);
                                } catch (Throwable t) {
                                    throw t;
                                }
                                break;
                            case PREPARE_UNQUALIFIED:
                                if (unqualifiedStatements.containsKey(statementId))
                                    continue;
                                try {
                                    String qs = String.format(unqualified, statementIdx, statementIdx);
                                    // we don't know where it's going to be executed
                                    PreparedStatement preparedUnqalified = sessions.get("ks" + ks).prepare(qs);
                                    unqualifiedStatements.put(Pair.create(ks, statementIdx), preparedUnqalified);
                                } catch (InvalidQueryException iqe) {
                                    if (!iqe.getMessage().contains("No keyspace has been"))
                                        throw iqe;
                                } catch (Throwable t) {
                                    throw t;
                                }
                                break;
                            case BOUNCE_CLIENT:
                                if (System.nanoTime() < reconnectAfter)
                                    break;
                                if (!reconnected) {
                                    for (Session s : sessions.values()) s.close();
                                    cluster.close();
                                    cluster = clusterSupplier.get();
                                    for (int j = 0; j < KEYSPACES; j++) sessions.put("ks" + j, cluster.connect("ks" + j));
                                    qualifiedStatements.clear();
                                    unqualifiedStatements.clear();
                                    reconnected = true;
                                }
                                break;
                        }
                    }
                } catch (Throwable t) {
                    interrupt.set(true);
                    t.printStackTrace();
                    while (true) {
                        Throwable seen = thrown.get();
                        Throwable merged = Throwables.merge(seen, t);
                        if (thrown.compareAndSet(seen, merged))
                            break;
                    }
                    throw t;
                } finally {
                    logger.info("Exiting...");
                    if (cluster != null)
                        cluster.close();
                }
            }));
        }
        for (Thread thread : threads) thread.start();
        for (Thread thread : threads) thread.join();
        if (thrown.get() != null)
            throw thrown.get();
    }
}
Also used : DynamicType(net.bytebuddy.dynamic.DynamicType) MethodDelegation(net.bytebuddy.implementation.MethodDelegation) ByteBuddy(net.bytebuddy.ByteBuddy) ElementMatchers.takesArguments(net.bytebuddy.matcher.ElementMatchers.takesArguments) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) PreparedStatementHelper(com.datastax.driver.core.PreparedStatementHelper) HashMap(java.util.HashMap) Random(java.util.Random) CQLStatement(org.apache.cassandra.cql3.CQLStatement) QueryProcessor(org.apache.cassandra.cql3.QueryProcessor) AtomicReference(java.util.concurrent.atomic.AtomicReference) Supplier(java.util.function.Supplier) QueryHandler(org.apache.cassandra.cql3.QueryHandler) ByteBuffer(java.nio.ByteBuffer) SystemKeyspace(org.apache.cassandra.db.SystemKeyspace) ArrayList(java.util.ArrayList) NATIVE_PROTOCOL(org.apache.cassandra.distributed.api.Feature.NATIVE_PROTOCOL) HashSet(java.util.HashSet) PreparedStatement(com.datastax.driver.core.PreparedStatement) RowUtil(org.apache.cassandra.distributed.impl.RowUtil) BoundStatement(com.datastax.driver.core.BoundStatement) Pair(org.apache.cassandra.utils.Pair) Map(java.util.Map) Session(com.datastax.driver.core.Session) CassandraVersion(org.apache.cassandra.utils.CassandraVersion) InvalidRequestException(org.apache.cassandra.exceptions.InvalidRequestException) NETWORK(org.apache.cassandra.distributed.api.Feature.NETWORK) ResultMessage(org.apache.cassandra.transport.messages.ResultMessage) Logger(org.slf4j.Logger) FBUtilities(org.apache.cassandra.utils.FBUtilities) Iterator(java.util.Iterator) ElementMatchers.named(net.bytebuddy.matcher.ElementMatchers.named) ClientState(org.apache.cassandra.service.ClientState) Set(java.util.Set) ICluster(org.apache.cassandra.distributed.api.ICluster) Test(org.junit.Test) ConsistencyLevel(org.apache.cassandra.distributed.api.ConsistencyLevel) ClassLoadingStrategy(net.bytebuddy.dynamic.loading.ClassLoadingStrategy) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) IInvokableInstance(org.apache.cassandra.distributed.api.IInvokableInstance) Cluster(com.datastax.driver.core.Cluster) Host(com.datastax.driver.core.Host) InvalidQueryException(com.datastax.driver.core.exceptions.InvalidQueryException) Throwables(org.apache.cassandra.utils.Throwables) Assert(org.junit.Assert) GOSSIP(org.apache.cassandra.distributed.api.Feature.GOSSIP) IInvokableInstance(org.apache.cassandra.distributed.api.IInvokableInstance) HashSet(java.util.HashSet) Set(java.util.Set) ArrayList(java.util.ArrayList) Random(java.util.Random) Iterator(java.util.Iterator) Supplier(java.util.function.Supplier) CassandraVersion(org.apache.cassandra.utils.CassandraVersion) Pair(org.apache.cassandra.utils.Pair) ICluster(org.apache.cassandra.distributed.api.ICluster) Cluster(com.datastax.driver.core.Cluster) AtomicReference(java.util.concurrent.atomic.AtomicReference) PreparedStatement(com.datastax.driver.core.PreparedStatement) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) Map(java.util.Map) BoundStatement(com.datastax.driver.core.BoundStatement) InvalidQueryException(com.datastax.driver.core.exceptions.InvalidQueryException) Session(com.datastax.driver.core.Session) Test(org.junit.Test)

Example 15 with GOSSIP

use of org.apache.cassandra.distributed.api.Feature.GOSSIP in project cassandra by apache.

the class GossipShutdownTest method shutdownStayDownTest.

/**
 * Makes sure that a node that has shutdown doesn't come back as live (without being restarted)
 */
@Test
public void shutdownStayDownTest() throws IOException, InterruptedException, ExecutionException {
    ExecutorService es = Executors.newSingleThreadExecutor();
    try (Cluster cluster = init(builder().withNodes(2).withConfig(config -> config.with(GOSSIP).with(NETWORK)).start())) {
        cluster.schemaChange("create table " + KEYSPACE + ".tbl (id int primary key, v int)");
        for (int i = 0; i < 10; i++) cluster.coordinator(1).execute("insert into " + KEYSPACE + ".tbl (id, v) values (?,?)", ALL, i, i);
        Condition timeToShutdown = newOneTimeCondition();
        Condition waitForShutdown = newOneTimeCondition();
        AtomicBoolean signalled = new AtomicBoolean(false);
        Future f = es.submit(() -> {
            await(timeToShutdown);
            cluster.get(1).runOnInstance(() -> {
                instance.register(new EPChanges());
            });
            cluster.get(2).runOnInstance(() -> {
                StorageService.instance.setIsShutdownUnsafeForTests(true);
                instance.stop();
            });
            waitForShutdown.signalAll();
        });
        cluster.filters().outbound().from(2).to(1).verbs(GOSSIP_DIGEST_SYN.id).messagesMatching((from, to, message) -> true).drop();
        cluster.filters().outbound().from(2).to(1).verbs(GOSSIP_DIGEST_ACK.id).messagesMatching((from, to, message) -> {
            if (signalled.compareAndSet(false, true)) {
                timeToShutdown.signalAll();
                await(waitForShutdown);
                return false;
            }
            return true;
        }).drop();
        // wait for gossip to exchange a few messages
        sleep(10000);
        f.get();
    } finally {
        es.shutdown();
    }
}
Also used : Condition(org.apache.cassandra.utils.concurrent.Condition) Condition.newOneTimeCondition(org.apache.cassandra.utils.concurrent.Condition.newOneTimeCondition) EndpointState(org.apache.cassandra.gms.EndpointState) VersionedValue(org.apache.cassandra.gms.VersionedValue) InetAddressAndPort(org.apache.cassandra.locator.InetAddressAndPort) ApplicationState(org.apache.cassandra.gms.ApplicationState) IEndpointStateChangeSubscriber(org.apache.cassandra.gms.IEndpointStateChangeSubscriber) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) StorageService(org.apache.cassandra.service.StorageService) IOException(java.io.IOException) Condition(org.apache.cassandra.utils.concurrent.Condition) Test(org.junit.Test) Executors(java.util.concurrent.Executors) Serializable(java.io.Serializable) ExecutionException(java.util.concurrent.ExecutionException) Future(java.util.concurrent.Future) GOSSIP_DIGEST_SYN(org.apache.cassandra.net.Verb.GOSSIP_DIGEST_SYN) GOSSIP_DIGEST_ACK(org.apache.cassandra.net.Verb.GOSSIP_DIGEST_ACK) Gossiper.instance(org.apache.cassandra.gms.Gossiper.instance) Thread.sleep(java.lang.Thread.sleep) Cluster(org.apache.cassandra.distributed.Cluster) Condition.newOneTimeCondition(org.apache.cassandra.utils.concurrent.Condition.newOneTimeCondition) ALL(org.apache.cassandra.distributed.api.ConsistencyLevel.ALL) ExecutorService(java.util.concurrent.ExecutorService) NETWORK(org.apache.cassandra.distributed.api.Feature.NETWORK) GOSSIP(org.apache.cassandra.distributed.api.Feature.GOSSIP) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ExecutorService(java.util.concurrent.ExecutorService) Cluster(org.apache.cassandra.distributed.Cluster) Future(java.util.concurrent.Future) Test(org.junit.Test)

Aggregations

GOSSIP (org.apache.cassandra.distributed.api.Feature.GOSSIP)34 NETWORK (org.apache.cassandra.distributed.api.Feature.NETWORK)33 Test (org.junit.Test)32 Cluster (org.apache.cassandra.distributed.Cluster)27 Assert (org.junit.Assert)16 IInvokableInstance (org.apache.cassandra.distributed.api.IInvokableInstance)15 ConsistencyLevel (org.apache.cassandra.distributed.api.ConsistencyLevel)14 NATIVE_PROTOCOL (org.apache.cassandra.distributed.api.Feature.NATIVE_PROTOCOL)14 ByteBuddy (net.bytebuddy.ByteBuddy)12 ClassLoadingStrategy (net.bytebuddy.dynamic.loading.ClassLoadingStrategy)12 MethodDelegation (net.bytebuddy.implementation.MethodDelegation)12 ElementMatchers.named (net.bytebuddy.matcher.ElementMatchers.named)12 StorageService (org.apache.cassandra.service.StorageService)12 TimeUnit (java.util.concurrent.TimeUnit)11 List (java.util.List)10 Map (java.util.Map)10 ICluster (org.apache.cassandra.distributed.api.ICluster)10 NetworkTopology (org.apache.cassandra.distributed.shared.NetworkTopology)10 IOException (java.io.IOException)9 TokenSupplier (org.apache.cassandra.distributed.api.TokenSupplier)9