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 differentsDESCRIBEstatements parsed from a CQL statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDescribeStatement.ElementDescribeStatementimplementation used for describe queries for a single schema element.static classDescribeStatement.ListingDescribeStatementimplementation 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 aDescribeStatementforDESCRIBE FUNCTION.static DescribeStatement<SchemaElement>aggregates()Creates aDescribeStatementforDESCRIBE AGGREGATES.voidauthorize(ClientState state)Perform any access verification necessary for the statement.static DescribeStatement<java.util.List<java.lang.Object>>cluster()Creates aDescribeStatementforDESCRIBE 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.ResultMessageexecute(QueryState state, QueryOptions options, Dispatcher.RequestTime requestTime)Execute the statement and return the resulting result or null if there is no result.ResultMessageexecuteLocally(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 aDescribeStatementforDESCRIBE FUNCTION.static DescribeStatement<SchemaElement>functions()Creates aDescribeStatementforDESCRIBE FUNCTIONS.static DescribeStatement<SchemaElement>generic(java.lang.String keyspace, java.lang.String name)Creates aDescribeStatementfor the genericDESCRIBE ....AuditLogContextgetAuditLogContext()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 aDescribeStatementforDESCRIBE INDEX.static DescribeStatement<SchemaElement>keyspace(java.lang.String keyspace, boolean onlyKeyspaceDefinition)Creates aDescribeStatementforDESCRIBE KEYSPACE.static DescribeStatement<SchemaElement>keyspaces()Creates aDescribeStatementforDESCRIBE KEYSPACES.protected abstract java.util.List<ColumnSpecification>metadata(ClientState state)Returns the columns of theResultMetadataCQLStatementprepare(ClientState clientState)static DescribeStatement<SchemaElement>schema(boolean includeSystemKeyspaces)Creates aDescribeStatementforDESCRIBE [FULL] SCHEMA.static DescribeStatement<SchemaElement>table(java.lang.String keyspace, java.lang.String name)Creates aDescribeStatementforDESCRIBE TABLE.static DescribeStatement<SchemaElement>tables()Creates aDescribeStatementforDESCRIBE 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 aDescribeStatementforDESCRIBE TYPE.static DescribeStatement<SchemaElement>types()Creates aDescribeStatementforDESCRIBE TYPES.voidvalidate(ClientState state)Perform additional validation required by the statment.static DescribeStatement<SchemaElement>view(java.lang.String keyspace, java.lang.String name)Creates aDescribeStatementforDESCRIBE MATERIALIZED VIEW.voidwithInternalDetails()-
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:
preparein classCQLStatement.Raw- Throws:
RequestValidationException
-
getBindVariables
public final java.util.List<ColumnSpecification> getBindVariables()
Description copied from interface:CQLStatementReturns all bind variables for the statement- Specified by:
getBindVariablesin interfaceCQLStatement
-
authorize
public final void authorize(ClientState state)
Description copied from interface:CQLStatementPerform any access verification necessary for the statement.- Specified by:
authorizein interfaceCQLStatement- Parameters:
state- the current client state
-
validate
public final void validate(ClientState state)
Description copied from interface:CQLStatementPerform additional validation required by the statment. To be overriden by subclasses if needed.- Specified by:
validatein interfaceCQLStatement- Parameters:
state- the current client state
-
getAuditLogContext
public final AuditLogContext getAuditLogContext()
Description copied from interface:CQLStatementProvides the context needed for audit logging statements.- Specified by:
getAuditLogContextin interfaceCQLStatement
-
execute
public final ResultMessage execute(QueryState state, QueryOptions options, Dispatcher.RequestTime requestTime) throws RequestValidationException, RequestExecutionException
Description copied from interface:CQLStatementExecute the statement and return the resulting result or null if there is no result.- Specified by:
executein interfaceCQLStatement- Parameters:
state- the current query stateoptions- options for this query (consistency, variables, pageSize, ...)requestTime- request enqueue / and start times- Throws:
RequestValidationExceptionRequestExecutionException
-
executeLocally
public ResultMessage executeLocally(QueryState state, QueryOptions options)
Description copied from interface:CQLStatementVariant of execute used for internal query against the system tables, and thus only query the local node.- Specified by:
executeLocallyin 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 aDescribeStatementforDESCRIBE TABLES.
-
types
public static DescribeStatement<SchemaElement> types()
Creates aDescribeStatementforDESCRIBE TYPES.
-
functions
public static DescribeStatement<SchemaElement> functions()
Creates aDescribeStatementforDESCRIBE FUNCTIONS.
-
aggregates
public static DescribeStatement<SchemaElement> aggregates()
Creates aDescribeStatementforDESCRIBE AGGREGATES.
-
keyspaces
public static DescribeStatement<SchemaElement> keyspaces()
Creates aDescribeStatementforDESCRIBE KEYSPACES.
-
schema
public static DescribeStatement<SchemaElement> schema(boolean includeSystemKeyspaces)
Creates aDescribeStatementforDESCRIBE [FULL] SCHEMA.
-
keyspace
public static DescribeStatement<SchemaElement> keyspace(java.lang.String keyspace, boolean onlyKeyspaceDefinition)
Creates aDescribeStatementforDESCRIBE KEYSPACE.
-
table
public static DescribeStatement<SchemaElement> table(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE TABLE.
-
index
public static DescribeStatement<SchemaElement> index(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE INDEX.
-
view
public static DescribeStatement<SchemaElement> view(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE MATERIALIZED VIEW.
-
type
public static DescribeStatement<SchemaElement> type(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE TYPE.
-
function
public static DescribeStatement<SchemaElement> function(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE FUNCTION.
-
aggregate
public static DescribeStatement<SchemaElement> aggregate(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementforDESCRIBE FUNCTION.
-
generic
public static DescribeStatement<SchemaElement> generic(java.lang.String keyspace, java.lang.String name)
Creates aDescribeStatementfor the genericDESCRIBE ....
-
cluster
public static DescribeStatement<java.util.List<java.lang.Object>> cluster()
Creates aDescribeStatementforDESCRIBE CLUSTER.
-
-