Class SerializedStorage<T>
- java.lang.Object
-
- org.apache.druid.query.aggregation.SerializedStorage<T>
-
- Type Parameters:
T
-
public class SerializedStorage<T> extends Object
simple utility class useful for when multiple passes of input are needed for encoding (e.g. delta or dictionary encoding). This allows objects to be serialized to some temporary storage and iterated over for final processing.
-
-
Constructor Summary
Constructors Constructor Description SerializedStorage(WriteOutBytes writeOutBytes, StagedSerde<T> serde)
SerializedStorage(WriteOutBytes writeOutBytes, StagedSerde<T> serde, int chunkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IOIterator<T>
iterator()
Generates an iterator over everything that has been stored.int
numStored()
void
store(T value)
-
-
-
Constructor Detail
-
SerializedStorage
public SerializedStorage(WriteOutBytes writeOutBytes, StagedSerde<T> serde)
-
SerializedStorage
public SerializedStorage(WriteOutBytes writeOutBytes, StagedSerde<T> serde, int chunkSize)
-
-
Method Detail
-
store
public void store(@Nullable T value) throws IOException
- Throws:
IOException
-
numStored
public int numStored()
-
iterator
public IOIterator<T> iterator() throws IOException
Generates an iterator over everything that has been stored. Also signifies the end of storing objects. iterator() can be called multiple times if needed, but after iterator() is called, store() can no longer be called.- Returns:
- an iterator
- Throws:
IOException
- on failure
-
-