Package org.apache.storm.hdfs.bolt
Class AbstractHdfsBolt
java.lang.Object
org.apache.storm.topology.base.BaseComponent
org.apache.storm.topology.base.BaseRichBolt
org.apache.storm.hdfs.bolt.AbstractHdfsBolt
- All Implemented Interfaces:
Serializable,IBolt,IComponent,IRichBolt
- Direct Known Subclasses:
AvroGenericRecordBolt,HdfsBolt,SequenceFileBolt
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OutputCollectorprotected Stringprotected FileNameFormatprotected Integerprotected org.apache.hadoop.fs.FileSystemprotected Stringprotected org.apache.hadoop.conf.Configurationprotected Integerprotected longprotected Partitionerprotected List<RotationAction>protected FileRotationPolicyprotected Timerprotected SyncPolicyprotected Integerprotected Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()voiddeclareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) protected abstract voiddoPrepare(Map<String, Object> conf, TopologyContext topologyContext, OutputCollector collector) final voidprotected org.apache.hadoop.fs.PathgetBasePathForNextFile(Tuple tuple) protected abstract StringgetWriterKey(Tuple tuple) protected abstract WritermakeNewWriter(org.apache.hadoop.fs.Path path, Tuple tuple) final voidprepare(Map<String, Object> conf, TopologyContext topologyContext, OutputCollector collector) Marked as final to prevent override.protected voidrotateOutputFile(Writer writer)
-
Field Details
-
writers
-
rotationCounterMap
-
rotationActions
-
collector
-
fs
protected transient org.apache.hadoop.fs.FileSystem fs -
syncPolicy
-
rotationPolicy
-
fileNameFormat
-
fsUrl
-
configKey
-
writeLock
-
rotationTimer
-
offset
protected long offset -
fileRetryCount
-
tickTupleInterval
-
maxOpenFiles
-
partitioner
-
hdfsConfig
protected transient org.apache.hadoop.conf.Configuration hdfsConfig
-
-
Constructor Details
-
AbstractHdfsBolt
public AbstractHdfsBolt()
-
-
Method Details
-
rotateOutputFile
- Throws:
IOException
-
prepare
public final void prepare(Map<String, Object> conf, TopologyContext topologyContext, OutputCollector collector) Marked as final to prevent override. Subclasses should implement the doPrepare() method. -
execute
-
getComponentConfiguration
- Specified by:
getComponentConfigurationin interfaceIComponent- Overrides:
getComponentConfigurationin classBaseComponent
-
declareOutputFields
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceIBolt- Overrides:
cleanupin classBaseRichBolt
-
getBasePathForNextFile
-
doPrepare
protected abstract void doPrepare(Map<String, Object> conf, TopologyContext topologyContext, OutputCollector collector) throws IOException- Throws:
IOException
-
getWriterKey
-
makeNewWriter
protected abstract Writer makeNewWriter(org.apache.hadoop.fs.Path path, Tuple tuple) throws IOException - Throws:
IOException
-