com.datastax.driver.core
Class KeyspaceMetadata

java.lang.Object
  extended by com.datastax.driver.core.KeyspaceMetadata

public class KeyspaceMetadata
extends Object

Describes a keyspace defined in this cluster.


Field Summary
static String KS_NAME
           
 
Method Summary
 String asCQLQuery()
          Returns a CQL query representing this keyspace.
 String exportAsString()
          Return a String containing CQL queries representing this keyspace and the table it contains.
 String getName()
          Returns the name of this keyspace.
 Map<String,String> getReplication()
          Returns the replication options for this keyspace.
 TableMetadata getTable(String name)
          Returns the metadata for a table contained in this keyspace.
 Collection<TableMetadata> getTables()
          Returns the tables defined in this keyspace.
 boolean isDurableWrites()
          Returns whether durable writes are set on this keyspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KS_NAME

public static final String KS_NAME
See Also:
Constant Field Values
Method Detail

getName

public String getName()
Returns the name of this keyspace.

Returns:
the name of this CQL keyspace.

isDurableWrites

public boolean isDurableWrites()
Returns whether durable writes are set on this keyspace.

Returns:
true if durable writes are set on this keyspace (the default), false otherwise.

getReplication

public Map<String,String> getReplication()
Returns the replication options for this keyspace.

Returns:
a map containing the replication options for this keyspace.

getTable

public TableMetadata getTable(String name)
Returns the metadata for a table contained in this keyspace.

Parameters:
name - the name of table to retrieve
Returns:
the metadata for table name in this keyspace if it exists, false otherwise.

getTables

public Collection<TableMetadata> getTables()
Returns the tables defined in this keyspace.

Returns:
a collection of the metadata for the tables defined in this keyspace.

exportAsString

public String exportAsString()
Return a String containing CQL queries representing this keyspace and the table it contains. In other words, this method returns the queries that would allow to recreate the schema of this keyspace, along with all its table. Note that the returned String is formatted to be human readable (for some defintion of human readable at least).

Returns:
the CQL queries representing this keyspace schema as a {code String}.

asCQLQuery

public String asCQLQuery()
Returns a CQL query representing this keyspace. This method returns a single 'CREATE KEYSPACE' query with the options corresponding to this keyspace definition.

Returns:
the 'CREATE KEYSPACE' query corresponding to this keyspace.
See Also:
exportAsString()


Copyright © 2013. All Rights Reserved.