public abstract class Selector
extends java.lang.Object
Selector
is used to convert the data returned by the storage engine into the data requested by the
user. They correspond to the <selector> elements from the select clause.
Since the introduction of aggregation, Selector
s cannot be called anymore by multiple threads
as they have an internal state.
Modifier and Type | Class and Description |
---|---|
static class |
Selector.Factory
A factory for
Selector instances. |
static class |
Selector.InputRow
A row of data that need to be processed by a
Selector |
static class |
Selector.Kind
The
Selector kinds. |
protected static class |
Selector.SelectorDeserializer |
static class |
Selector.Serializer |
Modifier and Type | Field and Description |
---|---|
static Selector.Serializer |
serializer
The
Selector serializer. |
Modifier | Constructor and Description |
---|---|
protected |
Selector(Selector.Kind kind) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addFetchedColumns(ColumnFilter.Builder builder)
Add to the provided builder the column (and potential subselections) to fetch for this
selection.
|
abstract void |
addInput(ProtocolVersion protocolVersion,
Selector.InputRow input)
Add the current value from the specified
ResultSetBuilder . |
abstract java.nio.ByteBuffer |
getOutput(ProtocolVersion protocolVersion)
Returns the selector output.
|
abstract AbstractType<?> |
getType()
Returns the
Selector output type. |
boolean |
isTerminal()
A selector is terminal if it doesn't require any input for it's output to be computed, i.e.
|
Selector.Kind |
kind()
Returns the
Selector kind. |
abstract void |
reset()
Reset the internal state of this
Selector . |
protected abstract void |
serialize(DataOutputPlus out,
int version) |
protected abstract int |
serializedSize(int version) |
protected static int |
sizeOf(AbstractType<?> type) |
void |
validateForGroupBy()
Checks that this selector is valid for GROUP BY clause.
|
protected static void |
writeType(DataOutputPlus out,
AbstractType<?> type) |
public static final Selector.Serializer serializer
Selector
serializer.protected Selector(Selector.Kind kind)
public final Selector.Kind kind()
Selector
kind.Selector
kindpublic abstract void addFetchedColumns(ColumnFilter.Builder builder)
builder
- the builder to add columns and subselections to.public abstract void addInput(ProtocolVersion protocolVersion, Selector.InputRow input)
ResultSetBuilder
.protocolVersion
- protocol version used for serializationinput
- the input rowInvalidRequestException
- if a problem occurs while adding the input rowpublic abstract java.nio.ByteBuffer getOutput(ProtocolVersion protocolVersion) throws InvalidRequestException
protocolVersion
- protocol version used for serializationInvalidRequestException
- if a problem occurs while computing the output valuepublic abstract AbstractType<?> getType()
Selector
output type.Selector
output type.public abstract void reset()
Selector
.public boolean isTerminal()
getOutput(org.apache.cassandra.transport.ProtocolVersion)
result doesn't depend of addInput(org.apache.cassandra.transport.ProtocolVersion, org.apache.cassandra.cql3.selection.Selector.InputRow)
. This is typically the case of a constant value or functions on constant
values.public void validateForGroupBy()
protected abstract int serializedSize(int version)
protected abstract void serialize(DataOutputPlus out, int version) throws java.io.IOException
java.io.IOException
protected static void writeType(DataOutputPlus out, AbstractType<?> type) throws java.io.IOException
java.io.IOException
protected static int sizeOf(AbstractType<?> type)
Copyright © 2009- The Apache Software Foundation