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() |
cleanup, declareOutputFields, execute, getBasePathForNextFile, getComponentConfiguration, prepare, rotateOutputFilepublic 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<String,Object> conf, TopologyContext topologyContext, OutputCollector collector) throws IOException
doPrepare in class AbstractHdfsBoltIOExceptionprotected 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 AbstractHdfsBoltprotected AbstractHDFSWriter makeNewWriter(org.apache.hadoop.fs.Path path, Tuple tuple) throws IOException
makeNewWriter in class AbstractHdfsBoltIOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.