Class Selector.Factory
- java.lang.Object
-
- org.apache.cassandra.cql3.selection.Selector.Factory
-
- Direct Known Subclasses:
SimpleSelector.SimpleSelectorFactory
- Enclosing class:
- Selector
public abstract static class Selector.Factory extends java.lang.ObjectA factory forSelectorinstances.
-
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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(java.util.List<Function> functions)protected abstract java.lang.StringgetColumnName()Returns the name of the column corresponding to the output value of the selector instances created by this factory.ColumnSpecificationgetColumnSpecification(TableMetadata table)Returns the column specification corresponding to the output value of the selector instances created by this factory.protected abstract AbstractType<?>getReturnType()Returns the type of the values returned by the selector instances created by this factory.booleanisAggregateSelectorFactory()Checks if this factory creates selectors instances that creates aggregates.booleanisSimpleSelectorFactory()Checks if this factory createsSelectors that simply return a column value.booleanisSimpleSelectorFactoryFor(int index)Checks if this factory createsSelectors that simply return the specified column.booleanisTTLSelectorFactory()Checks if this factory createsTTLselectors instances.booleanisWritetimeSelectorFactory()Checks if this factory createswritetimeselectors instances.abstract SelectornewInstance(QueryOptions options)Creates a newSelectorinstance.
-
-
-
Method Detail
-
addFunctionsTo
public void addFunctionsTo(java.util.List<Function> functions)
-
getColumnSpecification
public ColumnSpecification getColumnSpecification(TableMetadata table)
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
public abstract Selector newInstance(QueryOptions options)
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
-
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.- Parameters:
index- the column index- 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
protected abstract java.lang.String 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
protected abstract AbstractType<?> 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
-
-