Tabnine Logo
ConnectionException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
com.netflix.astyanax.connectionpool.exceptions.ConnectionException

Best Java code snippets using com.netflix.astyanax.connectionpool.exceptions.ConnectionException.getMessage (Showing top 9 results out of 315)

origin: apache/usergrid

private void addKeyspace (Cluster cluster, String keyspaceName) throws Exception {
  try {
    keyspaces.put( keyspaceName, cluster.getKeyspace( keyspaceName ) );
  } catch (ConnectionException e) {
    logger.error("Unable to get keyspace client for keyspace: {}, detail: {}",
      keyspaceName,
      e.getMessage());
    throw e;
  }
}
origin: com.netflix.astyanax/astyanax-test

  @Override
  public boolean failure(ConnectionException e) {
    LOG.error(e.getMessage(), e);
    return false;
  }
});
origin: com.netflix.astyanax/astyanax-test

  @Override
  public boolean onException(ConnectionException e) {
    Assert.fail(e.getMessage());
    return true;
  }
}).execute();
origin: com.netflix.astyanax/astyanax-test

@Test
public void testGetSingleColumnNotExistsAsync() {
  Future<OperationResult<Column<String>>> future = null;
  try {
    future = keyspace.prepareQuery(CF_STANDARD1).getKey("A")
        .getColumn("DoesNotExist").executeAsync();
    future.get(1000, TimeUnit.MILLISECONDS);
  } catch (ConnectionException e) {
    LOG.info("ConnectionException: " + e.getMessage());
    Assert.fail();
  } catch (InterruptedException e) {
    LOG.info(e.getMessage());
    Assert.fail();
  } catch (ExecutionException e) {
    if (e.getCause() instanceof NotFoundException)
      LOG.info(e.getCause().getMessage());
    else {
      Assert.fail(e.getMessage());
    }
  } catch (TimeoutException e) {
    future.cancel(true);
    LOG.info(e.getMessage());
    Assert.fail();
  }
}
origin: com.netflix.astyanax/astyanax-queue

@Override
public void dropStorage() throws MessageQueueException {
  try {
    keyspace.dropColumnFamily(this.queueColumnFamily);
    try {
      Thread.sleep(SCHEMA_CHANGE_DELAY);
    } catch (InterruptedException e) {
    }
  } catch (ConnectionException e) {
    if (!e.getMessage().contains("already exist"))
      throw new MessageQueueException("Failed to create column family for " + queueColumnFamily.getName(), e);
  }
  try {
    keyspace.dropColumnFamily(this.keyIndexColumnFamily);
    try {
      Thread.sleep(SCHEMA_CHANGE_DELAY);
    } catch (InterruptedException e) {
    }
  } catch (ConnectionException e) {
    if (!e.getMessage().contains("already exist"))
      throw new MessageQueueException("Failed to create column family for " + queueColumnFamily.getName(), e);
    }
}
origin: com.netflix.astyanax/astyanax-test

  @Test
  public void testCompositeKey() {
    MockCompositeType key = new MockCompositeType("A", 1, 2, true, "B");
    MutationBatch m = keyspace.prepareMutationBatch();
    m.withRow(CF_COMPOSITE_KEY, key).putColumn("Test", "Value", null);
    try {
      m.execute();
    } catch (ConnectionException e) {
      LOG.error(e.getMessage(), e);
      Assert.fail();
    }

    try {
      ColumnList<String> row = keyspace.prepareQuery(CF_COMPOSITE_KEY)
          .getKey(key).execute().getResult();
      Assert.assertFalse(row.isEmpty());
    } catch (ConnectionException e) {
      LOG.error(e.getMessage(), e);
      Assert.fail();
    }
  }
}
origin: com.intuit.wasabi/wasabi-cassandra

  /**
   * {@inheritDoc}
   */
  @Override
  public Result check() {
    boolean res = false;
    String msg = "";
    try {
      keyspace.prepareCqlStatement()
          .withCql("SELECT now() FROM system.local")
          .withConsistencyLevel(ConsistencyLevel.CL_QUORUM)
          .execute();
      res = true;
    } catch (ConnectionException ex) {
      LOGGER.error("Unable to connect to cassandra", ex);
      msg = ex.getMessage();
    }
    return res ? Result.healthy() : Result.unhealthy(msg);
  }
}
origin: com.intuit.wasabi/wasabi-cassandra

  /**
   * @return Result of healthy or unhealthy based on the cql statement
   */
  @Override
  public Result check() {
    boolean res = false;
    String msg = "";
    try {
      this.keyspace.prepareCqlStatement()
          .withCql(SELECT_NOW_FROM_SYSTEM_LOCAL)
          .withConsistencyLevel(ConsistencyLevel.CL_QUORUM)
          .execute();
      res = true;
    } catch (ConnectionException ex) {
      LOGGER.trace("Health Check encountered exception: ", ex);
      msg = ex.getMessage();
    }
    return res ? Result.healthy() : Result.unhealthy(msg);
  }
}
origin: com.netflix.astyanax/astyanax-test

} catch (ConnectionException e) {
  Assert.fail();
  LOG.info(e.getMessage());
  e.printStackTrace();
com.netflix.astyanax.connectionpool.exceptionsConnectionExceptiongetMessage

Popular methods of ConnectionException

  • printStackTrace
  • setHost
  • setLatency
  • getHost
  • setAttempt
  • setLatencyWithPool

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • Menu (java.awt)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JComboBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now