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. |
AggregateMetadata |
getAggregate(String name,
Collection<DataType> argumentTypes)
Returns the definition of an aggregate in this keyspace.
|
AggregateMetadata |
getAggregate(String name,
DataType... argumentTypes)
Returns the definition of an aggregate in this keyspace.
|
Collection<AggregateMetadata> |
getAggregates()
Returns the aggregates defined in this keyspace.
|
FunctionMetadata |
getFunction(String name,
Collection<DataType> argumentTypes)
Returns the definition of a function in this keyspace.
|
FunctionMetadata |
getFunction(String name,
DataType... argumentTypes)
Returns the definition of a function in this keyspace.
|
Collection<FunctionMetadata> |
getFunctions()
Returns the functions defined in this keyspace.
|
MaterializedViewMetadata |
getMaterializedView(String name)
Returns the metadata for a materialized view contained in this keyspace.
|
Collection<MaterializedViewMetadata> |
getMaterializedViews()
Returns the materialized views defined in this keyspace.
|
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 MaterializedViewMetadata getMaterializedView(String name)
name
- the name of materialized view to retrievename
if it exists in this keyspace,
null
otherwise.public Collection<MaterializedViewMetadata> getMaterializedViews()
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 FunctionMetadata getFunction(String name, Collection<DataType> argumentTypes)
name
- the name of the function.argumentTypes
- the types of the function's arguments.null
otherwise.public FunctionMetadata getFunction(String name, DataType... argumentTypes)
name
- the name of the function.argumentTypes
- the types of the function's arguments.null
otherwise.public Collection<FunctionMetadata> getFunctions()
public AggregateMetadata getAggregate(String name, Collection<DataType> argumentTypes)
name
- the name of the aggregate.argumentTypes
- the types of the aggregate's arguments.null
otherwise.public AggregateMetadata getAggregate(String name, DataType... argumentTypes)
name
- the name of the aggregate.argumentTypes
- the types of the aggregate's arguments.null
otherwise.public Collection<AggregateMetadata> getAggregates()
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()
Copyright © 2012–2017. All rights reserved.