Codota Logo
CurrentClient
Code IndexAdd Codota to your IDE (free)

How to use
CurrentClient
in
org.scassandra.http.client

Best Java code snippets using org.scassandra.http.client.CurrentClient (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: com.datastax.cassandra/cassandra-driver-core

currentClient.disableListener();
currentClient.closeConnections(CLOSE);
TestUtils.waitForDown(TestUtils.IP_PREFIX + "1", cluster);
currentClient.enableListener();
TestUtils.waitForUp(TestUtils.IP_PREFIX + "1", cluster);
origin: com.datastax.cassandra/cassandra-driver-core

currentClient.disableListener();
currentClient.closeConnection(CLOSE, ((InetSocketAddress) core0.channel.localAddress()));
currentClient.closeConnection(CLOSE, ((InetSocketAddress) core2.channel.localAddress()));
Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
currentClient.enableListener();
origin: org.scassandra/java-client

  public CurrentClient build() {
    return new CurrentClient(this.host, this.port, this.socketTimeout);
  }
}
origin: com.datastax.cassandra/cassandra-driver-core

/**
 * Ensures that if a connection on a host is lost but other connections remain intact in the Pool
 * that the host is not marked down.
 *
 * @jira_ticket JAVA-544
 * @test_category connection:connection_pool
 * @since 2.0.11
 */
@Test(groups = "short")
public void should_keep_host_up_when_one_connection_lost() throws Exception {
 Cluster cluster = createClusterBuilder().build();
 try {
  HostConnectionPool pool = createPool(cluster, 2, 2);
  Connection core0 = pool.connections.get(0);
  Connection core1 = pool.connections.get(1);
  // Drop a connection and ensure the host stays up.
  currentClient.disableListener();
  currentClient.closeConnection(CLOSE, ((InetSocketAddress) core0.channel.localAddress()));
  Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
  // connection 0 should be down, while connection 1 and the Host should remain up.
  assertThat(core0.isClosed()).isTrue();
  assertThat(core1.isClosed()).isFalse();
  assertThat(pool.connections).doesNotContain(core0);
  assertThat(cluster).host(1).hasState(Host.State.UP);
  assertThat(cluster).hasOpenControlConnection();
 } finally {
  cluster.close();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

currentClient.disableListener(4);
HostConnectionPool pool = createPool(cluster, 8, 8);
currentClient.enableListener();
origin: org.scassandra/java-client

public boolean disableListener() {
  return disableListener(0);
}
origin: com.datastax.cassandra/cassandra-driver-core

@BeforeMethod(groups = {"short", "long"})
@AfterMethod(groups = {"short", "long"})
public void resetClients() {
 activityClient.clearAllRecordedActivity();
 primingClient.clearAllPrimes();
 currentClient.enableListener();
}
origin: com.datastax.cassandra/cassandra-driver-core

scassandra.node(1).currentClient().closeConnection(CLOSE, controlSocket);
origin: org.scassandra/java-client

public ClosedConnectionReport closeConnections(CloseType closeType, String ip) {
  return closeConnectionsByUrl(closeType, "/" + ip);
}
origin: org.scassandra/java-client

public ConnectionReport getConnection(String host, int port) {
  return getConnectionsByUrl("/" + host + "/" + port);
}
origin: org.scassandra/java-client

public ConnectionReport getConnection(InetSocketAddress address) {
  return getConnection(address.getAddress().getHostAddress(), address.getPort());
}
origin: org.scassandra/java-client

ScassandraRunner(String binaryListenAddress, int binaryPort, String adminListenAddress, int adminPort, long startupTimeout) {
  this.binaryPort = binaryPort;
  this.adminPort = adminPort;
  this.serverStubRunner = new ServerStubRunner(binaryListenAddress, binaryPort, adminListenAddress, adminPort, startupTimeout);
  this.primingClient = PrimingClient.builder().withHost(adminListenAddress).withPort(adminPort).build();
  this.activityClient = ActivityClient.builder().withHost(adminListenAddress).withPort(adminPort).build();
  this.currentClient = CurrentClient.builder().withHost(adminListenAddress).withPort(adminPort).build();
  this.versionUrl = "http://" + binaryListenAddress + ":" + adminPort + "/version";
}
origin: com.datastax.cassandra/cassandra-driver-core

/**
 * Ensures that if all connections fail to a host on pool init that the host is marked down.
 *
 * @jira_ticket JAVA-544
 * @test_category connection:connection_pool
 * @since 2.0.11
 */
@Test(groups = "short")
public void should_mark_host_down_if_all_connections_fail_on_init() {
 // Prevent any connections on node 2.
 scassandra.node(2).currentClient().disableListener();
 createCluster(8, 8);
 // Node 2 should be in a down state while node 1 stays up.
 assertThat(cluster).host(2).goesDownWithin(10, SECONDS);
 assertThat(cluster).host(1).isUp();
 // Node 2 should come up as soon as it is able to reconnect.
 scassandra.node(2).currentClient().enableListener();
 assertThat(cluster).host(2).comesUpWithin(2, SECONDS);
}
origin: com.datastax.dse/dse-java-driver-core

/**
 * Ensures that if a connection on a host is lost but other connections remain intact in the Pool
 * that the host is not marked down.
 *
 * @jira_ticket JAVA-544
 * @test_category connection:connection_pool
 * @since 2.0.11
 */
@Test(groups = "short")
public void should_keep_host_up_when_one_connection_lost() throws Exception {
 Cluster cluster = createClusterBuilder().build();
 try {
  HostConnectionPool pool = createPool(cluster, 2, 2);
  Connection core0 = pool.connections.get(0);
  Connection core1 = pool.connections.get(1);
  // Drop a connection and ensure the host stays up.
  currentClient.disableListener();
  currentClient.closeConnection(CLOSE, ((InetSocketAddress) core0.channel.localAddress()));
  Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
  // connection 0 should be down, while connection 1 and the Host should remain up.
  assertThat(core0.isClosed()).isTrue();
  assertThat(core1.isClosed()).isFalse();
  assertThat(pool.connections).doesNotContain(core0);
  assertThat(cluster).host(1).hasState(Host.State.UP);
  assertThat(cluster).hasOpenControlConnection();
 } finally {
  cluster.close();
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

currentClient.disableListener();
HostConnectionPool pool = createPool(cluster, 8, 8);
origin: com.datastax.dse/dse-java-driver-core

@BeforeMethod(groups = {"short", "long"})
@AfterMethod(groups = {"short", "long"})
public void resetClients() {
 activityClient.clearAllRecordedActivity();
 primingClient.clearAllPrimes();
 currentClient.enableListener();
}
origin: com.datastax.dse/dse-java-driver-core

scassandra.node(1).currentClient().closeConnection(CLOSE, controlSocket);
origin: org.scassandra/java-client

public ClosedConnectionReport closeConnections(CloseType closeType) {
  return closeConnectionsByUrl(closeType, "");
}
origin: org.scassandra/java-client

public ConnectionReport getConnections() {
  return getConnectionsByUrl("");
}
origin: com.datastax.cassandra/cassandra-driver-core

currentClient.disableListener();
currentClient.closeConnections(CLOSE);
currentClient.enableListener();
org.scassandra.http.clientCurrentClient

Most used methods

  • disableListener
  • closeConnection
  • closeConnections
  • enableListener
  • <init>
  • builder
  • closeConnectionsByUrl
  • getConnection
  • getConnectionsByUrl
  • invokeListener

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • addToBackStack (FragmentTransaction)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JList (javax.swing)
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