org.apache.cassandra.cql3.selection

## Class Selector

- java.lang.Object
- - org.apache.cassandra.cql3.selection.Selector

Direct Known Subclasses:
  SimpleSelector, TermSelector

    public abstract class Selector
    extends java.lang.Object

A `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.

### Nested Class Summary

Nested Classes
`static class` `Selector.Factory` A factory for `Selector` instances.

### Constructor Summary

Constructors
Constructor and Description
`Selector()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract void` `addInput(ProtocolVersion protocolVersion, Selection.ResultSetBuilder rs)` 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` `isAggregate()` Checks if this `Selector` is creating aggregates.
`abstract void` `reset()` Reset the internal state of this `Selector`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Selector

    public Selector()

### Method Detail

#### addInput

    public abstract void addInput(ProtocolVersion protocolVersion,
                                  Selection.ResultSetBuilder rs)
                           throws InvalidRequestException

Add the current value from the specified `ResultSetBuilder`.

Parameters:
  `protocolVersion` - protocol version used for serialization
  `rs` - the `ResultSetBuilder`
Throws:
  `InvalidRequestException` - if a problem occurs while add the input value

#### getOutput

    public abstract java.nio.ByteBuffer getOutput(ProtocolVersion protocolVersion)
                                           throws InvalidRequestException

Returns the selector output.

Parameters:
  `protocolVersion` - protocol version used for serialization
Returns:
  the selector output
Throws:
  `InvalidRequestException` - if a problem occurs while computing the output value

#### getType

    public abstract AbstractType<?> getType()

Returns the `Selector` output type.

Returns:
  the `Selector` output type.

#### isAggregate

    public boolean isAggregate()

Checks if this `Selector` is creating aggregates.

Returns:
  `true` if this `Selector` is creating aggregates `false` otherwise.

#### reset

    public abstract void reset()

Reset the internal state of this `Selector`.