mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.2' into cassandra-3.0
This commit is contained in:
commit
f1d07ac198
|
|
@ -445,6 +445,7 @@ public class Instance extends IsolatedExecutor implements IInvokableInstance
|
|||
{
|
||||
CassandraDaemon.getInstanceForTesting().initializeNativeTransport();
|
||||
CassandraDaemon.getInstanceForTesting().startNativeTransport();
|
||||
StorageService.instance.setRpcReady(true);
|
||||
}
|
||||
|
||||
if (!FBUtilities.getBroadcastAddress().equals(broadcastAddressAndPort().address))
|
||||
|
|
@ -544,7 +545,9 @@ public class Instance extends IsolatedExecutor implements IInvokableInstance
|
|||
Future<?> future = async((ExecutorService executor) -> {
|
||||
Throwable error = null;
|
||||
|
||||
error = parallelRun(error, executor, CassandraDaemon.getInstanceForTesting()::destroyNativeTransport);
|
||||
error = parallelRun(error, executor,
|
||||
() -> StorageService.instance.setRpcReady(false),
|
||||
CassandraDaemon.getInstanceForTesting()::destroyNativeTransport);
|
||||
|
||||
if (config.has(GOSSIP) || config.has(NETWORK))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,4 +56,23 @@ public class NativeProtocolTest extends DistributedTestBase
|
|||
cluster.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withCounters() throws Throwable
|
||||
{
|
||||
try (Cluster dtCluster = init(Cluster.create(3,
|
||||
config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL))))
|
||||
{
|
||||
final com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint("127.0.0.1").build();
|
||||
Session session = cluster.connect();
|
||||
session.execute("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck counter, PRIMARY KEY (pk));");
|
||||
session.execute("UPDATE " + KEYSPACE + ".tbl set ck = ck + 10 where pk = 1;");
|
||||
Statement select = new SimpleStatement("select * from " + KEYSPACE + ".tbl;").setConsistencyLevel(ConsistencyLevel.ALL);
|
||||
final ResultSet resultSet = session.execute(select);
|
||||
assertRows(resultSet, row(1, 10L));
|
||||
Assert.assertEquals(3, cluster.getMetadata().getAllHosts().size());
|
||||
session.close();
|
||||
cluster.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue