Class DescribeStatement<T>
- java.lang.Object
-
- org.apache.cassandra.cql3.CQLStatement.Raw
-
- org.apache.cassandra.cql3.statements.DescribeStatement<T>
-
- All Implemented Interfaces:
CQLStatement
- Direct Known Subclasses:
DescribeStatement.Element
,DescribeStatement.Listing
public abstract class DescribeStatement<T> extends CQLStatement.Raw implements CQLStatement
The differentsDESCRIBE
statements parsed from a CQL statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DescribeStatement.Element
DescribeStatement
implementation used for describe queries for a single schema element.static class
DescribeStatement.Listing
DescribeStatement
implementation used for describe queries that only list elements names.-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.CQLStatement
CQLStatement.Raw, CQLStatement.SingleKeyspaceCqlStatement
-
-
Field Summary
-
Fields inherited from class org.apache.cassandra.cql3.CQLStatement.Raw
bindVariables
-
-
Constructor Summary
Constructors Constructor Description DescribeStatement()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DescribeStatement<SchemaElement>
aggregate(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE FUNCTION
.static DescribeStatement<SchemaElement>
aggregates()
Creates aDescribeStatement
forDESCRIBE AGGREGATES
.void
authorize(ClientState state)
Perform any access verification necessary for the statement.static DescribeStatement<java.util.List<java.lang.Object>>
cluster()
Creates aDescribeStatement
forDESCRIBE CLUSTER
.protected abstract java.util.stream.Stream<? extends T>
describe(ClientState state, Keyspaces keyspaces)
Returns the schema elements that must be part of the output.ResultMessage
execute(QueryState state, QueryOptions options, Dispatcher.RequestTime requestTime)
Execute the statement and return the resulting result or null if there is no result.ResultMessage
executeLocally(QueryState state, QueryOptions options)
Variant of execute used for internal query against the system tables, and thus only query the local node.static DescribeStatement<SchemaElement>
function(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE FUNCTION
.static DescribeStatement<SchemaElement>
functions()
Creates aDescribeStatement
forDESCRIBE FUNCTIONS
.static DescribeStatement<SchemaElement>
generic(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
for the genericDESCRIBE ...
.AuditLogContext
getAuditLogContext()
Provides the context needed for audit logging statements.java.util.List<ColumnSpecification>
getBindVariables()
Returns all bind variables for the statementstatic DescribeStatement<SchemaElement>
index(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE INDEX
.static DescribeStatement<SchemaElement>
keyspace(java.lang.String keyspace, boolean onlyKeyspaceDefinition)
Creates aDescribeStatement
forDESCRIBE KEYSPACE
.static DescribeStatement<SchemaElement>
keyspaces()
Creates aDescribeStatement
forDESCRIBE KEYSPACES
.protected abstract java.util.List<ColumnSpecification>
metadata(ClientState state)
Returns the columns of theResultMetadata
CQLStatement
prepare(ClientState clientState)
static DescribeStatement<SchemaElement>
schema(boolean includeSystemKeyspaces)
Creates aDescribeStatement
forDESCRIBE [FULL] SCHEMA
.static DescribeStatement<SchemaElement>
table(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE TABLE
.static DescribeStatement<SchemaElement>
tables()
Creates aDescribeStatement
forDESCRIBE TABLES
.protected abstract java.util.List<java.nio.ByteBuffer>
toRow(T element, boolean withInternals)
static DescribeStatement<SchemaElement>
type(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE TYPE
.static DescribeStatement<SchemaElement>
types()
Creates aDescribeStatement
forDESCRIBE TYPES
.void
validate(ClientState state)
Perform additional validation required by the statment.static DescribeStatement<SchemaElement>
view(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE MATERIALIZED VIEW
.void
withInternalDetails()
-
Methods inherited from class org.apache.cassandra.cql3.CQLStatement.Raw
setBindVariables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.CQLStatement
getFunctions, getPartitionKeyBindVariableIndexes, hasConditions
-
-
-
-
Method Detail
-
withInternalDetails
public final void withInternalDetails()
-
prepare
public final CQLStatement prepare(ClientState clientState) throws RequestValidationException
- Specified by:
prepare
in classCQLStatement.Raw
- Throws:
RequestValidationException
-
getBindVariables
public final java.util.List<ColumnSpecification> getBindVariables()
Description copied from interface:CQLStatement
Returns all bind variables for the statement- Specified by:
getBindVariables
in interfaceCQLStatement
-
authorize
public final void authorize(ClientState state)
Description copied from interface:CQLStatement
Perform any access verification necessary for the statement.- Specified by:
authorize
in interfaceCQLStatement
- Parameters:
state
- the current client state
-
validate
public final void validate(ClientState state)
Description copied from interface:CQLStatement
Perform additional validation required by the statment. To be overriden by subclasses if needed.- Specified by:
validate
in interfaceCQLStatement
- Parameters:
state
- the current client state
-
getAuditLogContext
public final AuditLogContext getAuditLogContext()
Description copied from interface:CQLStatement
Provides the context needed for audit logging statements.- Specified by:
getAuditLogContext
in interfaceCQLStatement
-
execute
public final ResultMessage execute(QueryState state, QueryOptions options, Dispatcher.RequestTime requestTime) throws RequestValidationException, RequestExecutionException
Description copied from interface:CQLStatement
Execute the statement and return the resulting result or null if there is no result.- Specified by:
execute
in interfaceCQLStatement
- Parameters:
state
- the current query stateoptions
- options for this query (consistency, variables, pageSize, ...)requestTime
- request enqueue / and start times;- Throws:
RequestValidationException
RequestExecutionException
-
executeLocally
public ResultMessage executeLocally(QueryState state, QueryOptions options)
Description copied from interface:CQLStatement
Variant of execute used for internal query against the system tables, and thus only query the local node.- Specified by:
executeLocally
in interfaceCQLStatement
- Parameters:
state
- the current query state
-
metadata
protected abstract java.util.List<ColumnSpecification> metadata(ClientState state)
Returns the columns of theResultMetadata
-
toRow
protected abstract java.util.List<java.nio.ByteBuffer> toRow(T element, boolean withInternals)
-
describe
protected abstract java.util.stream.Stream<? extends T> describe(ClientState state, Keyspaces keyspaces)
Returns the schema elements that must be part of the output.
-
tables
public static DescribeStatement<SchemaElement> tables()
Creates aDescribeStatement
forDESCRIBE TABLES
.
-
types
public static DescribeStatement<SchemaElement> types()
Creates aDescribeStatement
forDESCRIBE TYPES
.
-
functions
public static DescribeStatement<SchemaElement> functions()
Creates aDescribeStatement
forDESCRIBE FUNCTIONS
.
-
aggregates
public static DescribeStatement<SchemaElement> aggregates()
Creates aDescribeStatement
forDESCRIBE AGGREGATES
.
-
keyspaces
public static DescribeStatement<SchemaElement> keyspaces()
Creates aDescribeStatement
forDESCRIBE KEYSPACES
.
-
schema
public static DescribeStatement<SchemaElement> schema(boolean includeSystemKeyspaces)
Creates aDescribeStatement
forDESCRIBE [FULL] SCHEMA
.
-
keyspace
public static DescribeStatement<SchemaElement> keyspace(java.lang.String keyspace, boolean onlyKeyspaceDefinition)
Creates aDescribeStatement
forDESCRIBE KEYSPACE
.
-
table
public static DescribeStatement<SchemaElement> table(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE TABLE
.
-
index
public static DescribeStatement<SchemaElement> index(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE INDEX
.
-
view
public static DescribeStatement<SchemaElement> view(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE MATERIALIZED VIEW
.
-
type
public static DescribeStatement<SchemaElement> type(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE TYPE
.
-
function
public static DescribeStatement<SchemaElement> function(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE FUNCTION
.
-
aggregate
public static DescribeStatement<SchemaElement> aggregate(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
forDESCRIBE FUNCTION
.
-
generic
public static DescribeStatement<SchemaElement> generic(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatement
for the genericDESCRIBE ...
.
-
cluster
public static DescribeStatement<java.util.List<java.lang.Object>> cluster()
Creates aDescribeStatement
forDESCRIBE CLUSTER
.
-
-