Class ReductionCheckedDataWriter<C>
- java.lang.Object
-
- org.apache.solr.analytics.stream.reservation.write.ReductionDataWriter<C>
-
- org.apache.solr.analytics.stream.reservation.write.ReductionCheckedDataWriter<C>
-
- Direct Known Subclasses:
BooleanCheckedDataWriter,DoubleCheckedDataWriter,FloatCheckedDataWriter,IntCheckedDataWriter,LongCheckedDataWriter,StringCheckedDataWriter
public abstract class ReductionCheckedDataWriter<C> extends ReductionDataWriter<C>
Abstract class to manage the extraction and writing of data to aDataOutputstream. The data being written may not exist, so the writer first writes whether the data exists before writing the data.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.analytics.stream.reservation.write.ReductionDataWriter
extractor, output
-
-
Constructor Summary
Constructors Constructor Description ReductionCheckedDataWriter(DataOutput output, C extractor, BooleanSupplier existsSupplier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcheckedWrite()Write a piece of data, retrieved from the extractor, to the output stream.voidwrite()Write a piece of data, retrieved from the extractor, to the output stream.
-
-
-
Constructor Detail
-
ReductionCheckedDataWriter
public ReductionCheckedDataWriter(DataOutput output, C extractor, BooleanSupplier existsSupplier)
-
-
Method Detail
-
write
public void write() throws IOExceptionWrite a piece of data, retrieved from the extractor, to the output stream.
First writes whether the data exists, then if it does exists writes the data.- Specified by:
writein classReductionDataWriter<C>- Throws:
IOException- if an exception occurs while writing to the output stream
-
checkedWrite
protected abstract void checkedWrite() throws IOExceptionWrite a piece of data, retrieved from the extractor, to the output stream.
The data being written is guaranteed to exist.- Throws:
IOException- if an exception occurs while writing to the output stream
-
-