Package com.datastax.driver.core.exceptions

Examples of com.datastax.driver.core.exceptions.AlreadyExistsException


      UnavailableException ux = (UnavailableException) x;
      return new CassandraInsufficientReplicasAvailableException(ux.getRequiredReplicas(), ux.getAliveReplicas(),
          x.getMessage(), x);
    }
    if (x instanceof AlreadyExistsException) {
      AlreadyExistsException aex = (AlreadyExistsException) x;

      return aex.wasTableCreation() ? new CassandraTableExistsException(aex.getTable(), x.getMessage(), x)
          : new CassandraKeyspaceExistsException(aex.getKeyspace(), x.getMessage(), x);
    }
    if (x instanceof InvalidConfigurationInQueryException) {
      return new CassandraInvalidConfigurationInQueryException(x.getMessage(), x);
    }
    if (x instanceof InvalidQueryException) {
View Full Code Here


  @Test
  public void testTableExistsException() {
    String keyspace = "";
    String table = "tbl";
    AlreadyExistsException cx = new AlreadyExistsException(keyspace, table);
    DataAccessException dax = tx.translateExceptionIfPossible(cx);
    assertNotNull(dax);
    assertTrue(dax instanceof CassandraTableExistsException);

    CassandraTableExistsException x = (CassandraTableExistsException) dax;
View Full Code Here

  @Test
  public void testKeyspaceExistsException() {
    String keyspace = "ks";
    String table = "";
    AlreadyExistsException cx = new AlreadyExistsException(keyspace, table);
    DataAccessException dax = tx.translateExceptionIfPossible(cx);
    assertNotNull(dax);
    assertTrue(dax instanceof CassandraKeyspaceExistsException);

    CassandraKeyspaceExistsException x = (CassandraKeyspaceExistsException) dax;
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.exceptions.AlreadyExistsException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.