public class KeyspaceMetadata extends Object
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a CQL query representing this keyspace.
|
boolean |
equals(Object o) |
String |
exportAsString()
Returns a
String containing CQL queries representing this
keyspace and the user types and tables 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.
|
UserType |
getUserType(String name)
Returns the definition for a user defined type (UDT) in this keyspace.
|
Collection<UserType> |
getUserTypes()
Returns the user types defined in this keyspace.
|
int |
hashCode() |
boolean |
isDurableWrites()
Returns whether durable writes are set on this keyspace.
|
String |
toString() |
public static final String KS_NAME
public String getName()
public boolean isDurableWrites()
true
if durable writes are set on this keyspace (the
default), false
otherwise.public Map<String,String> getReplication()
public TableMetadata getTable(String name)
name
- the name of table to retrievename
if it exists in this keyspace,
null
otherwise.public Collection<TableMetadata> getTables()
public UserType getUserType(String name)
name
- the name of UDT definition to retrievename
if it exists in this keyspace,
null
otherwise.public Collection<UserType> getUserTypes()
public String exportAsString()
String
containing CQL queries representing this
keyspace and the user types and tables it contains.
In other words, this method returns the queries that would allow to
recreate the schema of this keyspace, along with all its user
types/tables.
Note that the returned String is formatted to be human readable (for
some definition of human readable at least).public String asCQLQuery()
exportAsString()