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.Object
A factory forSelector
instances.
-
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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.void
addFunctionsTo(java.util.List<Function> functions)
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.ColumnSpecification
getColumnSpecification(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.boolean
isAggregateSelectorFactory()
Checks if this factory creates selectors instances that creates aggregates.boolean
isMaxWritetimeSelectorFactory()
Checks if this factory createsmaxwritetime
selector instances.boolean
isSimpleSelectorFactory()
Checks if this factory createsSelector
s that simply return a column value.boolean
isSimpleSelectorFactoryFor(int index)
Checks if this factory createsSelector
s that simply return the specified column.boolean
isTTLSelectorFactory()
Checks if this factory createsTTL
selectors instances.boolean
isWritetimeSelectorFactory()
Checks if this factory createswritetime
selectors instances.abstract Selector
newInstance(QueryOptions options)
Creates a newSelector
instance.
-
-
-
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 newSelector
instance.- 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
Selector
instance
-
isAggregateSelectorFactory
public boolean isAggregateSelectorFactory()
Checks if this factory creates selectors instances that creates aggregates.- Returns:
true
if this factory creates selectors instances that creates aggregates,false
otherwise
-
isWritetimeSelectorFactory
public boolean isWritetimeSelectorFactory()
Checks if this factory createswritetime
selectors instances.- Returns:
true
if this factory createswritetime
selectors instances,false
otherwise
-
isMaxWritetimeSelectorFactory
public boolean isMaxWritetimeSelectorFactory()
Checks if this factory createsmaxwritetime
selector instances.- Returns:
true
if this factory createsmaxwritetime
selectors instances,false
otherwise
-
isTTLSelectorFactory
public boolean isTTLSelectorFactory()
Checks if this factory createsTTL
selectors instances.- Returns:
true
if this factory createsTTL
selectors instances,false
otherwise
-
isSimpleSelectorFactory
public boolean isSimpleSelectorFactory()
Checks if this factory createsSelector
s that simply return a column value.- Returns:
true
if this factory createsSelector
s that simply return a column value,false
otherwise.
-
isSimpleSelectorFactoryFor
public boolean isSimpleSelectorFactoryFor(int index)
Checks if this factory createsSelector
s that simply return the specified column.- Parameters:
index
- the column index- Returns:
true
if this factory createsSelector
s that simply return the specified column,false
otherwise.
-
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
-
-