Class Selector.Factory
java.lang.Object
org.apache.cassandra.cql3.selection.Selector.Factory
- Direct Known Subclasses:
SimpleSelector.SimpleSelectorFactory
- Enclosing class:
- Selector
A factory for
Selector instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddColumnMapping(SelectionColumnMapping mapping, ColumnSpecification resultsColumn) Record a mapping between the ColumnDefinitions that are used by the selector instances created by this factory and a column in the ResultSet.Metadata returned with a query.voidaddFunctionsTo(List<Function> functions) protected abstract StringReturns the name of the column corresponding to the output value of the selector instances created by this factory.Returns the column specification corresponding to the output value of the selector instances created by this factory.protected abstract AbstractType<?>Returns the type of the values returned by the selector instances created by this factory.booleanChecks if this factory creates selectors instances that creates aggregates.booleanChecks if this factory createsmaxwritetimeselector instances.booleanChecks if this factory createsSelectors that simply return a column value.booleanisSimpleSelectorFactoryFor(int index) Checks if this factory createsSelectors that simply return the specified column.booleanChecks if this factory createsTTLselectors instances.booleanChecks if this factory createswritetimeselectors instances.abstract SelectornewInstance(QueryOptions options) Creates a newSelectorinstance.
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
addFunctionsTo
-
getColumnSpecification
Returns the column specification corresponding to the output value of the selector instances created by this factory.- Parameters:
table- the table meta data- Returns:
- a column specification
-
newInstance
Creates a newSelectorinstance.- Parameters:
options- the options of the query for which the instance is created (some selector depends on the bound values in particular).- Returns:
- a new
Selectorinstance
-
isAggregateSelectorFactory
public boolean isAggregateSelectorFactory()Checks if this factory creates selectors instances that creates aggregates.- Returns:
trueif this factory creates selectors instances that creates aggregates,falseotherwise
-
isWritetimeSelectorFactory
public boolean isWritetimeSelectorFactory()Checks if this factory createswritetimeselectors instances.- Returns:
trueif this factory createswritetimeselectors instances,falseotherwise
-
isMaxWritetimeSelectorFactory
public boolean isMaxWritetimeSelectorFactory()Checks if this factory createsmaxwritetimeselector instances.- Returns:
trueif this factory createsmaxwritetimeselectors instances,falseotherwise
-
isTTLSelectorFactory
public boolean isTTLSelectorFactory()Checks if this factory createsTTLselectors instances.- Returns:
trueif this factory createsTTLselectors instances,falseotherwise
-
isSimpleSelectorFactory
public boolean isSimpleSelectorFactory()Checks if this factory createsSelectors that simply return a column value.- Returns:
trueif this factory createsSelectors that simply return a column value,falseotherwise.
-
isSimpleSelectorFactoryFor
public boolean isSimpleSelectorFactoryFor(int index) Checks if this factory createsSelectors that simply return the specified column.- Parameters:
index- the column index- Returns:
trueif this factory createsSelectors that simply return the specified column,falseotherwise.
-
getColumnName
Returns the name of the column corresponding to the output value of the selector instances created by this factory.- Returns:
- a column name
-
getReturnType
Returns the type of the values returned by the selector instances created by this factory.- Returns:
- the selector output type
-
addColumnMapping
protected abstract void addColumnMapping(SelectionColumnMapping mapping, ColumnSpecification resultsColumn) Record a mapping between the ColumnDefinitions that are used by the selector instances created by this factory and a column in the ResultSet.Metadata returned with a query. In most cases, this is likely to be a 1:1 mapping, but some selector instances may utilise multiple columns (or none at all) to produce a value (i.e. functions).- Parameters:
mapping- the instance of the column mapping belonging to the current query's SelectionresultsColumn- the column in the ResultSet.Metadata to which the ColumnDefinitions used by the Selector are to be mapped
-