Codota Logo
Scassandra.activityClient
Code IndexAdd Codota to your IDE (free)

How to use
activityClient
method
in
org.scassandra.Scassandra

Best Java code snippets using org.scassandra.Scassandra.activityClient (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: com.datastax.cassandra/cassandra-driver-core

public void clearActivityLog() {
 for (Scassandra node : sCluster.nodes()) {
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

public void clearActivityLog() {
 for (Scassandra node : sCluster.nodes()) {
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

protected void assertQueried(int hostNumber, int times) {
 assertThat(scassandras.node(hostNumber).activityClient().retrieveQueries()).hasSize(times);
}
origin: com.datastax.cassandra/cassandra-driver-core

@BeforeClass(groups = {"short", "long"})
public void beforeTestClass() {
 scassandra = TestUtils.createScassandraServer();
 scassandra.start();
 primingClient = scassandra.primingClient();
 activityClient = scassandra.activityClient();
 currentClient = scassandra.currentClient();
 hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort());
}
origin: com.datastax.cassandra/cassandra-driver-core

public BatchExecution executeBatch(
  Session session, String statement, ConsistencyLevel level, ConsistencyLevel serialLevel) {
 BatchStatement batch = new BatchStatement();
 batch.add(new SimpleStatement(statement));
 if (level != null) {
  batch.setConsistencyLevel(level);
 }
 if (serialLevel != null) {
  batch.setSerialConsistencyLevel(serialLevel);
 }
 session.execute(batch);
 List<BatchExecution> batches = sCluster.node(1).activityClient().retrieveBatches();
 assertEquals(batches.size(), 1);
 return batches.get(0);
}
origin: com.datastax.cassandra/cassandra-driver-core

public PreparedStatementExecution executePrepared(
  Session session, String statement, ConsistencyLevel level, ConsistencyLevel serialLevel) {
 PreparedStatement ps = session.prepare(statement);
 BoundStatement bound = ps.bind();
 if (level != null) {
  bound.setConsistencyLevel(level);
 }
 if (serialLevel != null) {
  bound.setSerialConsistencyLevel(serialLevel);
 }
 session.execute(bound);
 List<PreparedStatementExecution> pses =
   sCluster.node(1).activityClient().retrievePreparedStatementExecutions();
 PreparedStatementExecution pse = pses.get(0);
 assertTrue(pse.getPreparedStatementText().equals(statement));
 return pse;
}
origin: com.datastax.cassandra/cassandra-driver-core

public Query executeSimple(
  Session session, String statement, ConsistencyLevel level, ConsistencyLevel serialLevel) {
 SimpleStatement simpleStatement = new SimpleStatement(statement);
 if (level != null) {
  simpleStatement.setConsistencyLevel(level);
 }
 if (serialLevel != null) {
  simpleStatement.setSerialConsistencyLevel(serialLevel);
 }
 session.execute(simpleStatement);
 // Find the unique query in the activity log.
 List<Query> queries = sCluster.node(1).activityClient().retrieveQueries();
 for (Query query : queries) {
  if (query.getQuery().equals(statement)) return query;
 }
 return null;
}
origin: org.scassandra/java-client

  public ActivityClient activityClient() {
    return scassandra.activityClient();
  }
}
origin: com.datastax.cassandra/cassandra-driver-core

public void validatePrepared(boolean expectAll) {
 // Prepare the statement
 String query = "select sansa_stark from the_known_world";
 PreparedStatement statement = session.prepare(query);
 assertThat(cluster.manager.preparedQueries).containsValue(statement);
 // Ensure prepared properly based on expectation.
 List<PreparedStatementPreparation> preparationOne =
   scassandra.node(1).activityClient().retrievePreparedStatementPreparations();
 List<PreparedStatementPreparation> preparationTwo =
   scassandra.node(2).activityClient().retrievePreparedStatementPreparations();
 List<PreparedStatementPreparation> preparationThree =
   scassandra.node(3).activityClient().retrievePreparedStatementPreparations();
 assertThat(preparationOne).hasSize(1);
 assertThat(preparationOne.get(0).getPreparedStatementText()).isEqualTo(query);
 if (expectAll) {
  assertThat(preparationTwo).hasSize(1);
  assertThat(preparationTwo.get(0).getPreparedStatementText()).isEqualTo(query);
  assertThat(preparationThree).hasSize(1);
  assertThat(preparationThree.get(0).getPreparedStatementText()).isEqualTo(query);
 } else {
  assertThat(preparationTwo).isEmpty();
  assertThat(preparationThree).isEmpty();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

  scassandra.node(1).activityClient().retrievePreparedStatementPreparations();
scassandra.node(1).activityClient().clearAllRecordedActivity();
scassandra.node(1).stop();
assertThat(cluster).host(1).goesDownWithin(10, TimeUnit.SECONDS);
assertThat(cluster).host(1).comesUpWithin(60, TimeUnit.SECONDS);
preparationOne = scassandra.node(1).activityClient().retrievePreparedStatementPreparations();
if (expectReprepare) {
  if (i == maxTries) throw e;
  scassandra.node(1).activityClient().clearAllRecordedActivity();
origin: com.datastax.cassandra/cassandra-driver-core

@BeforeMethod(groups = "short")
public void beforeMethod() {
 cluster =
   Cluster.builder()
     .addContactPoints(scassandras.address(1).getAddress())
     .withPort(scassandras.getBinaryPort())
     .withRetryPolicy(FallthroughRetryPolicy.INSTANCE)
     .build();
 session = cluster.connect();
 host1 = TestUtils.findHost(cluster, 1);
 errors = cluster.getMetrics().getErrorMetrics();
 for (Scassandra node : scassandras.nodes()) {
  node.primingClient().clearAllPrimes();
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

node.activityClient().clearAllRecordedActivity();
origin: com.datastax.cassandra/cassandra-driver-core

@BeforeMethod(groups = "short")
public void beforeMethod() {
 scassandra = ScassandraCluster.builder().withNodes(3).build();
 scassandra.init();
 queryOptions = new QueryOptions();
 loadBalancingPolicy = new SortingLoadBalancingPolicy();
 cluster =
   Cluster.builder()
     .addContactPoints(scassandra.address(2).getAddress())
     .withPort(scassandra.getBinaryPort())
     .withLoadBalancingPolicy(loadBalancingPolicy)
     .withQueryOptions(queryOptions)
     .withNettyOptions(nonQuietClusterCloseOptions)
     .build();
 session = cluster.connect();
 host1 = TestUtils.findHost(cluster, 1);
 host2 = TestUtils.findHost(cluster, 2);
 host3 = TestUtils.findHost(cluster, 3);
 // Make sure there are no prepares
 for (int host : Lists.newArrayList(1, 2, 3)) {
  assertThat(scassandra.node(host).activityClient().retrievePreparedStatementPreparations())
    .hasSize(0);
  scassandra.node(host).activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

@BeforeMethod(groups = "short")
public void beforeMethod() {
 scassandras = ScassandraCluster.builder().withNodes(3).build();
 scassandras.init();
 cluster =
   Cluster.builder()
     .addContactPoints(scassandras.address(1).getAddress())
     .withPort(scassandras.getBinaryPort())
     .withRetryPolicy(retryPolicy)
     .withLoadBalancingPolicy(new SortingLoadBalancingPolicy())
     .withPoolingOptions(
       new PoolingOptions()
         .setCoreConnectionsPerHost(HostDistance.LOCAL, 1)
         .setMaxConnectionsPerHost(HostDistance.LOCAL, 1)
         .setHeartbeatIntervalSeconds(0))
     .withNettyOptions(nonQuietClusterCloseOptions)
     // Mark everything as idempotent by default so RetryPolicy is exercised.
     .withQueryOptions(new QueryOptions().setDefaultIdempotence(true))
     .build();
 session = cluster.connect();
 host1 = TestUtils.findHost(cluster, 1);
 host2 = TestUtils.findHost(cluster, 2);
 host3 = TestUtils.findHost(cluster, 3);
 errors = cluster.getMetrics().getErrorMetrics();
 Mockito.reset(retryPolicy);
 for (Scassandra node : scassandras.nodes()) {
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.dse/dse-java-driver-core

public void clearActivityLog() {
 for (Scassandra node : sCluster.nodes()) {
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.dse/dse-java-driver-core

public void clearActivityLog() {
 for (Scassandra node : sCluster.nodes()) {
  node.activityClient().clearAllRecordedActivity();
 }
}
origin: com.datastax.dse/dse-java-driver-core

protected void assertQueried(int hostNumber, int times) {
 assertThat(scassandras.node(hostNumber).activityClient().retrieveQueries()).hasSize(times);
}
origin: com.datastax.dse/dse-java-driver-core

@BeforeClass(groups = {"short", "long"})
public void beforeTestClass() {
 scassandra = TestUtils.createScassandraServer();
 scassandra.start();
 primingClient = scassandra.primingClient();
 activityClient = scassandra.activityClient();
 currentClient = scassandra.currentClient();
 hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort());
}
origin: com.datastax.dse/dse-java-driver-core

public BatchExecution executeBatch(
  Session session, String statement, ConsistencyLevel level, ConsistencyLevel serialLevel) {
 BatchStatement batch = new BatchStatement();
 batch.add(new SimpleStatement(statement));
 if (level != null) {
  batch.setConsistencyLevel(level);
 }
 if (serialLevel != null) {
  batch.setSerialConsistencyLevel(serialLevel);
 }
 session.execute(batch);
 List<BatchExecution> batches = sCluster.node(1).activityClient().retrieveBatches();
 assertEquals(batches.size(), 1);
 return batches.get(0);
}
origin: com.datastax.dse/dse-java-driver-core

@BeforeMethod(groups = "short")
public void beforeMethod() {
 cluster =
   Cluster.builder()
     .addContactPoints(scassandras.address(1).getAddress())
     .withPort(scassandras.getBinaryPort())
     .withRetryPolicy(FallthroughRetryPolicy.INSTANCE)
     .build();
 session = cluster.connect();
 host1 = TestUtils.findHost(cluster, 1);
 errors = cluster.getMetrics().getErrorMetrics();
 for (Scassandra node : scassandras.nodes()) {
  node.primingClient().clearAllPrimes();
  node.activityClient().clearAllRecordedActivity();
 }
}
org.scassandraScassandraactivityClient

Javadoc

Retrieves an Activity client that is configured with the same admin port as Scassandra.

Popular methods of Scassandra

  • primingClient
    Retrieves a Priming client that is configured with the same admin port as Scassandra.
  • start
    Start Scassandra. This will result in both the binary port for Cassandra to be opened and the admin
  • stop
    Stops Scassandra.
  • currentClient
    Retrieves a Current client that is configured with the same admin port as Scassandra.
  • getAdminPort
    The port that Scassandars REST API is listening on. This is the port that Priming / Activity verific
  • getBinaryPort
    The port Scassandra is listening on for connections from Cassandra.

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now