Tabnine Logo
SchemaBuilder.dropKeyspace
Code IndexAdd Tabnine to your IDE (free)

How to use
dropKeyspace
method
in
com.datastax.driver.core.schemabuilder.SchemaBuilder

Best Java code snippets using com.datastax.driver.core.schemabuilder.SchemaBuilder.dropKeyspace (Showing top 8 results out of 315)

origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "unit")
public void should_drop_keyspace() throws Exception {
 // When
 SchemaStatement statement = dropKeyspace("test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE test");
}
origin: hugegraph/hugegraph

protected void clearKeyspace() {
  // Drop keyspace with non-keyspace-session
  Statement stmt = SchemaBuilder.dropKeyspace(this.keyspace).ifExists();
  LOG.debug("Drop keyspace: {}", stmt);
  Session session = this.cluster().connect();
  try {
    session.execute(stmt);
  } finally {
    if (!session.isClosed()) {
      session.close();
    }
  }
}
origin: com.datastax.cassandra/cassandra-driver-core

 @Test(groups = "unit")
 public void should_drop_keyspace_if_exists() throws Exception {
  // When
  SchemaStatement statement = dropKeyspace("test").ifExists();

  // Then
  assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE IF EXISTS test");
 }
}
origin: locationtech/geowave

@Override
public void deleteAll() throws Exception {
 state.tableExistsCache.clear();
 state.preparedRangeReadsPerTable.clear();
 state.preparedRowReadPerTable.clear();
 state.preparedWritesPerTable.clear();
 session.execute(SchemaBuilder.dropKeyspace(gwNamespace).ifExists());
}
origin: com.datastax.dse/dse-java-driver-core

@Test(groups = "unit")
public void should_drop_keyspace() throws Exception {
 // When
 SchemaStatement statement = dropKeyspace("test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE test");
}
origin: com.baidu.hugegraph/hugegraph-cassandra

protected void clearKeyspace() {
  // Drop keyspace with non-keyspace-session
  Statement stmt = SchemaBuilder.dropKeyspace(this.keyspace).ifExists();
  LOG.debug("Drop keyspace: {}", stmt);
  Session session = this.cluster().connect();
  try {
    session.execute(stmt);
  } finally {
    if (!session.isClosed()) {
      session.close();
    }
  }
}
origin: com.datastax.dse/dse-java-driver-core

 @Test(groups = "unit")
 public void should_drop_keyspace_if_exists() throws Exception {
  // When
  SchemaStatement statement = dropKeyspace("test").ifExists();

  // Then
  assertThat(statement.getQueryString()).isEqualTo("DROP KEYSPACE IF EXISTS test");
 }
}
origin: org.janusgraph/janusgraph-cql

@Override
public void clearStorage() throws BackendException {
  if (this.storageConfig.get(DROP_ON_CLEAR)) {
    this.session.execute(dropKeyspace(this.keyspace));
  } else if (this.exists()) {
    final Future<Seq<ResultSet>> result = Future.sequence(
      Iterator.ofAll(this.cluster.getMetadata().getKeyspace(this.keyspace).getTables())
        .map(table -> Future.fromJavaFuture(this.session.executeAsync(truncate(this.keyspace, table.getName())))));
    result.await();
  } else {
    LOGGER.info("Keyspace {} does not exist in the cluster", this.keyspace);
  }
}
com.datastax.driver.core.schemabuilderSchemaBuilderdropKeyspace

Javadoc

Start building a new DROP KEYSPACE statement.

Popular methods of SchemaBuilder

  • createTable
    Start building a new CREATE TABLE statement.
  • createKeyspace
    Start building a new CREATE KEYSPACE statement.
  • dropTable
    Start building a new DROP TABLE statement.
  • leveledStrategy
    Create options for the leveled compaction strategy, to use in a CREATE or ALTER TABLE statement.
  • lz4
    Create options for the LZ4 compression strategy, to use in a CREATE or ALTER TABLE statement.
  • sizedTieredStategy
    Create options for the size-tiered compaction strategy, for use in a CREATE or ALTER TABLE statement
  • createType
    Start building a new CREATE TYPE statement.
  • noSpeculativeRetry
    Create the speculative retry strategy that never retries reads, to use in a CREATE or ALTER TABLE st
  • createIndex
    Start building a new CREATE INDEX statement.
  • dateTieredStrategy
    Create options for the date-tiered compaction strategy, to use in a CREATE or ALTER TABLE statement.
  • deflate
    Create options for the Deflate compression strategy, to use in a CREATE or ALTER TABLE statement.
  • dropType
    Start building a new DROP TYPE statement.
  • deflate,
  • dropType,
  • noCompression,
  • snappy,
  • allRows,
  • alterKeyspace,
  • alterTable,
  • always,
  • dropIndex

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • 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