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

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

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

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

@Test(groups = "unit")
public void should_create_index() throws Exception {
 // Given //When
 SchemaStatement statement =
   createIndex("myIndex").ifNotExists().onTable("ks", "test").andColumn("col");
 // Then
 assertThat(statement.getQueryString())
   .isEqualTo("\n\tCREATE INDEX IF NOT EXISTS myIndex ON ks.test(col)");
}
origin: com.datastax.cassandra/cassandra-driver-core

 @Test(groups = "unit")
 public void should_create_index_on_keys_of_map_column() throws Exception {
  // Given //When
  SchemaStatement statement =
    createIndex("myIndex").ifNotExists().onTable("ks", "test").andKeysOfColumn("col");

  // Then
  assertThat(statement.getQueryString())
    .isEqualTo("\n\tCREATE INDEX IF NOT EXISTS myIndex ON ks.test(KEYS(col))");
 }
}
origin: hugegraph/hugegraph

protected void createIndex(CassandraSessionPool.Session session,
              String indexLabel, HugeKeys column) {
  String indexName = joinTableName(this.table(), indexLabel);
  SchemaStatement index = SchemaBuilder.createIndex(indexName)
                     .ifNotExists()
                     .onTable(this.table())
                     .andColumn(formatKey(column));
  LOG.debug("Create index: {}", index);
  session.execute(index);
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "short")
public void should_drop_an_index() {
 // Create a table
 session()
   .execute(
     SchemaBuilder.createTable("ks", "DropIndex")
       .addPartitionKey("a", DataType.cint())
       .addClusteringColumn("b", DataType.cint()));
 // Create an index
 // Note: we have to pick a lower-case name because Cassandra uses the CamelCase index name at
 // creation
 // but a lowercase index name at deletion
 // See : https://issues.apache.org/jira/browse/CASSANDRA-8365
 session()
   .execute(SchemaBuilder.createIndex("ks_index").onTable("ks", "DropIndex").andColumn("b"));
 // Verify that the PK index and the secondary indexes both exist
 assertThat(numberOfIndexedColumns()).isEqualTo(1);
 // Delete the index
 session().execute(SchemaBuilder.dropIndex("ks", "ks_index"));
 // Verify that only the PK index exists
 assertThat(numberOfIndexedColumns()).isEqualTo(0);
}
origin: com.datastax.cassandra/cassandra-driver-core

  .execute(SchemaBuilder.createIndex("ks_Index").onTable("ks", "CreateIndex").andColumn("b"));
session()
  .execute(
    SchemaBuilder.createIndex("ks_IndexOnMap")
      .onTable("ks", "CreateIndex")
      .andKeysOfColumn("c"));
origin: com.datastax.cassandra/cassandra-driver-core

 SchemaBuilder.createIndex("cyclist_by_country")
   .onTable("cyclist_mv")
   .andColumn("country"));
SchemaBuilder.createIndex("ryear").onTable("rank_by_year_and_name").andColumn("race_year"));
SchemaBuilder.createIndex("rrank").onTable("rank_by_year_and_name").andColumn("rank"));
origin: com.datastax.dse/dse-java-driver-core

@Test(groups = "unit")
public void should_create_index() throws Exception {
 // Given //When
 SchemaStatement statement =
   createIndex("myIndex").ifNotExists().onTable("ks", "test").andColumn("col");
 // Then
 assertThat(statement.getQueryString())
   .isEqualTo("\n\tCREATE INDEX IF NOT EXISTS myIndex ON ks.test(col)");
}
origin: com.datastax.dse/dse-java-driver-core

 @Test(groups = "unit")
 public void should_create_index_on_keys_of_map_column() throws Exception {
  // Given //When
  SchemaStatement statement =
    createIndex("myIndex").ifNotExists().onTable("ks", "test").andKeysOfColumn("col");

  // Then
  assertThat(statement.getQueryString())
    .isEqualTo("\n\tCREATE INDEX IF NOT EXISTS myIndex ON ks.test(KEYS(col))");
 }
}
origin: com.baidu.hugegraph/hugegraph-cassandra

protected void createIndex(CassandraSessionPool.Session session,
              String indexLabel, HugeKeys column) {
  String indexName = joinTableName(this.table(), indexLabel);
  SchemaStatement index = SchemaBuilder.createIndex(indexName)
                     .ifNotExists()
                     .onTable(this.table())
                     .andColumn(formatKey(column));
  LOG.debug("Create index: {}", index);
  session.execute(index);
}
origin: com.datastax.dse/dse-java-driver-core

 SchemaBuilder.createIndex("cyclist_by_country")
   .onTable("cyclist_mv")
   .andColumn("country"));
SchemaBuilder.createIndex("ryear").onTable("rank_by_year_and_name").andColumn("race_year"));
SchemaBuilder.createIndex("rrank").onTable("rank_by_year_and_name").andColumn("rank"));
com.datastax.driver.core.schemabuilderSchemaBuildercreateIndex

Javadoc

Start building a new CREATE INDEX statement.

Popular methods of SchemaBuilder

  • createTable
    Start building a new CREATE TABLE statement.
  • createKeyspace
    Start building a new CREATE KEYSPACE statement.
  • dropKeyspace
    Start building a new DROP 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
  • 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

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Runner (org.openjdk.jmh.runner)
  • CodeWhisperer alternatives
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