Class JsonStatisticsRecordWriter
java.lang.Object
org.apache.drill.exec.store.JSONBaseStatisticsRecordWriter
org.apache.drill.exec.store.easy.json.JsonStatisticsRecordWriter
- All Implemented Interfaces:
StatisticsRecordCollector
,StatisticsRecordWriter
public class JsonStatisticsRecordWriter
extends JSONBaseStatisticsRecordWriter
implements StatisticsRecordWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.store.JSONBaseStatisticsRecordWriter
JSONBaseStatisticsRecordWriter.BigIntJsonConverter, JSONBaseStatisticsRecordWriter.BitJsonConverter, JSONBaseStatisticsRecordWriter.DateJsonConverter, JSONBaseStatisticsRecordWriter.Decimal18JsonConverter, JSONBaseStatisticsRecordWriter.Decimal28DenseJsonConverter, JSONBaseStatisticsRecordWriter.Decimal28SparseJsonConverter, JSONBaseStatisticsRecordWriter.Decimal38DenseJsonConverter, JSONBaseStatisticsRecordWriter.Decimal38SparseJsonConverter, JSONBaseStatisticsRecordWriter.Decimal9JsonConverter, JSONBaseStatisticsRecordWriter.Float4JsonConverter, JSONBaseStatisticsRecordWriter.Float8JsonConverter, JSONBaseStatisticsRecordWriter.IntervalDayJsonConverter, JSONBaseStatisticsRecordWriter.IntervalJsonConverter, JSONBaseStatisticsRecordWriter.IntervalYearJsonConverter, JSONBaseStatisticsRecordWriter.IntJsonConverter, JSONBaseStatisticsRecordWriter.NullableBigIntJsonConverter, JSONBaseStatisticsRecordWriter.NullableBitJsonConverter, JSONBaseStatisticsRecordWriter.NullableDateJsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal18JsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal28DenseJsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal28SparseJsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal38DenseJsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal38SparseJsonConverter, JSONBaseStatisticsRecordWriter.NullableDecimal9JsonConverter, JSONBaseStatisticsRecordWriter.NullableFloat4JsonConverter, JSONBaseStatisticsRecordWriter.NullableFloat8JsonConverter, JSONBaseStatisticsRecordWriter.NullableIntervalDayJsonConverter, JSONBaseStatisticsRecordWriter.NullableIntervalJsonConverter, JSONBaseStatisticsRecordWriter.NullableIntervalYearJsonConverter, JSONBaseStatisticsRecordWriter.NullableIntJsonConverter, JSONBaseStatisticsRecordWriter.NullableSmallIntJsonConverter, JSONBaseStatisticsRecordWriter.NullableTimeJsonConverter, JSONBaseStatisticsRecordWriter.NullableTimeStampJsonConverter, JSONBaseStatisticsRecordWriter.NullableTinyIntJsonConverter, JSONBaseStatisticsRecordWriter.NullableUInt1JsonConverter, JSONBaseStatisticsRecordWriter.NullableUInt2JsonConverter, JSONBaseStatisticsRecordWriter.NullableUInt4JsonConverter, JSONBaseStatisticsRecordWriter.NullableUInt8JsonConverter, JSONBaseStatisticsRecordWriter.NullableVar16CharJsonConverter, JSONBaseStatisticsRecordWriter.NullableVarBinaryJsonConverter, JSONBaseStatisticsRecordWriter.NullableVarCharJsonConverter, JSONBaseStatisticsRecordWriter.NullableVarDecimalJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedBigIntJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedBitJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDateJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal18JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal28DenseJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal28SparseJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal38DenseJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal38SparseJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedDecimal9JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedFloat4JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedFloat8JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedIntervalDayJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedIntervalJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedIntervalYearJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedIntJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedSmallIntJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedTimeJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedTimeStampJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedTinyIntJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedUInt1JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedUInt2JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedUInt4JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedUInt8JsonConverter, JSONBaseStatisticsRecordWriter.RepeatedVar16CharJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedVarBinaryJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedVarCharJsonConverter, JSONBaseStatisticsRecordWriter.RepeatedVarDecimalJsonConverter, JSONBaseStatisticsRecordWriter.SmallIntJsonConverter, JSONBaseStatisticsRecordWriter.TimeJsonConverter, JSONBaseStatisticsRecordWriter.TimeStampJsonConverter, JSONBaseStatisticsRecordWriter.TinyIntJsonConverter, JSONBaseStatisticsRecordWriter.UInt1JsonConverter, JSONBaseStatisticsRecordWriter.UInt2JsonConverter, JSONBaseStatisticsRecordWriter.UInt4JsonConverter, JSONBaseStatisticsRecordWriter.UInt8JsonConverter, JSONBaseStatisticsRecordWriter.Var16CharJsonConverter, JSONBaseStatisticsRecordWriter.VarBinaryJsonConverter, JSONBaseStatisticsRecordWriter.VarCharJsonConverter, JSONBaseStatisticsRecordWriter.VarDecimalJsonConverter
-
Field Summary
Fields inherited from class org.apache.drill.exec.store.JSONBaseStatisticsRecordWriter
gen, skipNullFields
-
Constructor Summary
ConstructorDescriptionJsonStatisticsRecordWriter
(org.apache.hadoop.conf.Configuration fsConf, FormatPlugin formatPlugin) -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
void
checkForNewPartition
(int index) Check if the writer should start a new partition, and if so, start a new partitionvoid
cleanup()
void
Called after adding all fields in a particular statistics record are added using add{TypeHolder}(fieldId, TypeHolder) methods.void
For a blocking writer, called after processing all the records to flush out the writesgetNewBigIntConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewDateConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewIntConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewNullableBigIntConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewNullableFloat8Converter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewNullableVarBinaryConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.getNewVarCharConverter
(int fieldId, String fieldName, FieldReader reader) Add the field value given invalueHolder
at the given column numberfieldId
.ReturnsDrillStatsTable.TableStatistics
instance with statistics collected using thisStatisticsRecordCollector
.boolean
Returns true if thisStatisticsRecordCollector
has non-empty statistics.void
Initialize the writer.boolean
Returns if the writer is a blocking writer i.e.void
Called before starting writing fields in a record.void
updateSchema
(VectorAccessible batch) Update the schema in RecordWriter.Methods inherited from class org.apache.drill.exec.store.JSONBaseStatisticsRecordWriter
getNewBitConverter, getNewDecimal18Converter, getNewDecimal28DenseConverter, getNewDecimal28SparseConverter, getNewDecimal38DenseConverter, getNewDecimal38SparseConverter, getNewDecimal9Converter, getNewFloat4Converter, getNewFloat8Converter, getNewIntervalConverter, getNewIntervalDayConverter, getNewIntervalYearConverter, getNewNullableBitConverter, getNewNullableDateConverter, getNewNullableDecimal18Converter, getNewNullableDecimal28DenseConverter, getNewNullableDecimal28SparseConverter, getNewNullableDecimal38DenseConverter, getNewNullableDecimal38SparseConverter, getNewNullableDecimal9Converter, getNewNullableFloat4Converter, getNewNullableIntConverter, getNewNullableIntervalConverter, getNewNullableIntervalDayConverter, getNewNullableIntervalYearConverter, getNewNullableSmallIntConverter, getNewNullableTimeConverter, getNewNullableTimeStampConverter, getNewNullableTinyIntConverter, getNewNullableUInt1Converter, getNewNullableUInt2Converter, getNewNullableUInt4Converter, getNewNullableUInt8Converter, getNewNullableVar16CharConverter, getNewNullableVarCharConverter, getNewNullableVarDecimalConverter, getNewRepeatedBigIntConverter, getNewRepeatedBitConverter, getNewRepeatedDateConverter, getNewRepeatedDecimal18Converter, getNewRepeatedDecimal28DenseConverter, getNewRepeatedDecimal28SparseConverter, getNewRepeatedDecimal38DenseConverter, getNewRepeatedDecimal38SparseConverter, getNewRepeatedDecimal9Converter, getNewRepeatedFloat4Converter, getNewRepeatedFloat8Converter, getNewRepeatedIntConverter, getNewRepeatedIntervalConverter, getNewRepeatedIntervalDayConverter, getNewRepeatedIntervalYearConverter, getNewRepeatedSmallIntConverter, getNewRepeatedTimeConverter, getNewRepeatedTimeStampConverter, getNewRepeatedTinyIntConverter, getNewRepeatedUInt1Converter, getNewRepeatedUInt2Converter, getNewRepeatedUInt4Converter, getNewRepeatedUInt8Converter, getNewRepeatedVar16CharConverter, getNewRepeatedVarBinaryConverter, getNewRepeatedVarCharConverter, getNewRepeatedVarDecimalConverter, getNewSmallIntConverter, getNewTimeConverter, getNewTimeStampConverter, getNewTinyIntConverter, getNewUInt1Converter, getNewUInt2Converter, getNewUInt4Converter, getNewUInt8Converter, getNewVar16CharConverter, getNewVarBinaryConverter, getNewVarDecimalConverter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.store.StatisticsRecordCollector
getNewBitConverter, getNewDecimal18Converter, getNewDecimal28DenseConverter, getNewDecimal28SparseConverter, getNewDecimal38DenseConverter, getNewDecimal38SparseConverter, getNewDecimal9Converter, getNewFloat4Converter, getNewFloat8Converter, getNewIntervalConverter, getNewIntervalDayConverter, getNewIntervalYearConverter, getNewNullableBitConverter, getNewNullableDateConverter, getNewNullableDecimal18Converter, getNewNullableDecimal28DenseConverter, getNewNullableDecimal28SparseConverter, getNewNullableDecimal38DenseConverter, getNewNullableDecimal38SparseConverter, getNewNullableDecimal9Converter, getNewNullableFloat4Converter, getNewNullableIntConverter, getNewNullableIntervalConverter, getNewNullableIntervalDayConverter, getNewNullableIntervalYearConverter, getNewNullableSmallIntConverter, getNewNullableTimeConverter, getNewNullableTimeStampConverter, getNewNullableTinyIntConverter, getNewNullableUInt1Converter, getNewNullableUInt2Converter, getNewNullableUInt4Converter, getNewNullableUInt8Converter, getNewNullableVar16CharConverter, getNewNullableVarCharConverter, getNewNullableVarDecimalConverter, getNewRepeatedBigIntConverter, getNewRepeatedBitConverter, getNewRepeatedDateConverter, getNewRepeatedDecimal18Converter, getNewRepeatedDecimal28DenseConverter, getNewRepeatedDecimal28SparseConverter, getNewRepeatedDecimal38DenseConverter, getNewRepeatedDecimal38SparseConverter, getNewRepeatedDecimal9Converter, getNewRepeatedFloat4Converter, getNewRepeatedFloat8Converter, getNewRepeatedIntConverter, getNewRepeatedIntervalConverter, getNewRepeatedIntervalDayConverter, getNewRepeatedIntervalYearConverter, getNewRepeatedSmallIntConverter, getNewRepeatedTimeConverter, getNewRepeatedTimeStampConverter, getNewRepeatedTinyIntConverter, getNewRepeatedUInt1Converter, getNewRepeatedUInt2Converter, getNewRepeatedUInt4Converter, getNewRepeatedUInt8Converter, getNewRepeatedVar16CharConverter, getNewRepeatedVarBinaryConverter, getNewRepeatedVarCharConverter, getNewRepeatedVarDecimalConverter, getNewSmallIntConverter, getNewTimeConverter, getNewTimeStampConverter, getNewTinyIntConverter, getNewUInt1Converter, getNewUInt2Converter, getNewUInt4Converter, getNewUInt8Converter, getNewVar16CharConverter, getNewVarBinaryConverter, getNewVarDecimalConverter
-
Constructor Details
-
JsonStatisticsRecordWriter
public JsonStatisticsRecordWriter(org.apache.hadoop.conf.Configuration fsConf, FormatPlugin formatPlugin)
-
-
Method Details
-
init
Description copied from interface:StatisticsRecordWriter
Initialize the writer.- Specified by:
init
in interfaceStatisticsRecordWriter
- Parameters:
writerOptions
- Contains key, value pair of settings.
-
updateSchema
Description copied from interface:StatisticsRecordWriter
Update the schema in RecordWriter. Called at least once before starting writing the records.- Specified by:
updateSchema
in interfaceStatisticsRecordWriter
-
isBlockingWriter
public boolean isBlockingWriter()Description copied from interface:StatisticsRecordWriter
Returns if the writer is a blocking writer i.e. consumes all input before writing it out- Specified by:
isBlockingWriter
in interfaceStatisticsRecordWriter
- Returns:
- TRUE, if writer is blocking. FALSE, otherwise
-
checkForNewPartition
public void checkForNewPartition(int index) Description copied from interface:StatisticsRecordWriter
Check if the writer should start a new partition, and if so, start a new partition- Specified by:
checkForNewPartition
in interfaceStatisticsRecordWriter
-
getNewBigIntConverter
public EventBasedRecordWriter.FieldConverter getNewBigIntConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewBigIntConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewBigIntConverter
in classJSONBaseStatisticsRecordWriter
-
getNewIntConverter
public EventBasedRecordWriter.FieldConverter getNewIntConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewIntConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewIntConverter
in classJSONBaseStatisticsRecordWriter
-
getNewDateConverter
public EventBasedRecordWriter.FieldConverter getNewDateConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewDateConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewDateConverter
in classJSONBaseStatisticsRecordWriter
-
getNewVarCharConverter
public EventBasedRecordWriter.FieldConverter getNewVarCharConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewVarCharConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewVarCharConverter
in classJSONBaseStatisticsRecordWriter
-
getNewNullableBigIntConverter
public EventBasedRecordWriter.FieldConverter getNewNullableBigIntConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewNullableBigIntConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewNullableBigIntConverter
in classJSONBaseStatisticsRecordWriter
-
getNewNullableVarBinaryConverter
public EventBasedRecordWriter.FieldConverter getNewNullableVarBinaryConverter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewNullableVarBinaryConverter
in interfaceStatisticsRecordCollector
- Overrides:
getNewNullableVarBinaryConverter
in classJSONBaseStatisticsRecordWriter
-
getNewNullableFloat8Converter
public EventBasedRecordWriter.FieldConverter getNewNullableFloat8Converter(int fieldId, String fieldName, FieldReader reader) Description copied from interface:StatisticsRecordCollector
Add the field value given invalueHolder
at the given column numberfieldId
.- Specified by:
getNewNullableFloat8Converter
in interfaceStatisticsRecordCollector
- Overrides:
getNewNullableFloat8Converter
in classJSONBaseStatisticsRecordWriter
-
startStatisticsRecord
public void startStatisticsRecord()Description copied from interface:StatisticsRecordCollector
Called before starting writing fields in a record.- Specified by:
startStatisticsRecord
in interfaceStatisticsRecordCollector
-
endStatisticsRecord
public void endStatisticsRecord()Description copied from interface:StatisticsRecordCollector
Called after adding all fields in a particular statistics record are added using add{TypeHolder}(fieldId, TypeHolder) methods.- Specified by:
endStatisticsRecord
in interfaceStatisticsRecordCollector
-
hasStatistics
public boolean hasStatistics()Description copied from interface:StatisticsRecordCollector
Returns true if thisStatisticsRecordCollector
has non-empty statistics.- Specified by:
hasStatistics
in interfaceStatisticsRecordCollector
- Returns:
- if this
StatisticsRecordCollector
has non-empty statistics
-
getStatistics
Description copied from interface:StatisticsRecordCollector
ReturnsDrillStatsTable.TableStatistics
instance with statistics collected using thisStatisticsRecordCollector
.- Specified by:
getStatistics
in interfaceStatisticsRecordCollector
- Returns:
DrillStatsTable.TableStatistics
instance
-
flushBlockingWriter
Description copied from interface:StatisticsRecordWriter
For a blocking writer, called after processing all the records to flush out the writes- Specified by:
flushBlockingWriter
in interfaceStatisticsRecordWriter
- Throws:
IOException
-
abort
public void abort()- Specified by:
abort
in interfaceStatisticsRecordWriter
-
cleanup
public void cleanup()- Specified by:
cleanup
in interfaceStatisticsRecordWriter
-