public class AvroGenericRecordBolt extends AbstractHdfsBolt
collector, configKey, fileNameFormat, fileRetryCount, fs, fsUrl, hdfsConfig, maxOpenFiles, offset, partitioner, rotationActions, rotationCounterMap, rotationPolicy, rotationTimer, syncPolicy, tickTupleInterval, writeLock, writers
Constructor and Description |
---|
AvroGenericRecordBolt() |
Modifier and Type | Method and Description |
---|---|
AvroGenericRecordBolt |
addRotationAction(RotationAction action) |
protected void |
doPrepare(Map conf,
TopologyContext topologyContext,
OutputCollector collector) |
protected String |
getWriterKey(Tuple tuple)
AvroGenericRecordBolt must override this method because messages with different schemas cannot be written to the same file.
|
protected AbstractHDFSWriter |
makeNewWriter(org.apache.hadoop.fs.Path path,
Tuple tuple) |
AvroGenericRecordBolt |
withConfigKey(String configKey) |
AvroGenericRecordBolt |
withFileNameFormat(FileNameFormat fileNameFormat) |
AvroGenericRecordBolt |
withFsUrl(String fsUrl) |
AvroGenericRecordBolt |
withMaxOpenFiles(int maxOpenFiles) |
AvroGenericRecordBolt |
withPartitioner(Partitioner partitioner) |
AvroGenericRecordBolt |
withRotationPolicy(FileRotationPolicy rotationPolicy) |
AvroGenericRecordBolt |
withSyncPolicy(SyncPolicy syncPolicy) |
AvroGenericRecordBolt |
withTickTupleIntervalSeconds(int interval) |
cleanup, declareOutputFields, execute, getBasePathForNextFile, getComponentConfiguration, prepare, rotateOutputFile
public AvroGenericRecordBolt withFsUrl(String fsUrl)
public AvroGenericRecordBolt withConfigKey(String configKey)
public AvroGenericRecordBolt withFileNameFormat(FileNameFormat fileNameFormat)
public AvroGenericRecordBolt withSyncPolicy(SyncPolicy syncPolicy)
public AvroGenericRecordBolt withRotationPolicy(FileRotationPolicy rotationPolicy)
public AvroGenericRecordBolt addRotationAction(RotationAction action)
public AvroGenericRecordBolt withTickTupleIntervalSeconds(int interval)
public AvroGenericRecordBolt withMaxOpenFiles(int maxOpenFiles)
public AvroGenericRecordBolt withPartitioner(Partitioner partitioner)
protected void doPrepare(Map conf, TopologyContext topologyContext, OutputCollector collector) throws IOException
doPrepare
in class AbstractHdfsBolt
IOException
protected String getWriterKey(Tuple tuple)
AvroGenericRecordBolt must override this method because messages with different schemas cannot be written to the same file. By treating the complete schema as the “key” AbstractHdfsBolt will associate a different writer for every distinct schema.
getWriterKey
in class AbstractHdfsBolt
protected AbstractHDFSWriter makeNewWriter(org.apache.hadoop.fs.Path path, Tuple tuple) throws IOException
makeNewWriter
in class AbstractHdfsBolt
IOException
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.