public class FileSpoutWatcher extends AbstractFileInput implements org.thales.punch.libraries.storm.api.ISpout
This Spout look for a specified path directory and read any created file in near-realtime.
To use this Spout, set the "watcher" option to "true" in the Spout configuration.
For example, the following configuration will act as a shell command "tail -f" on every file in the '/path/to/directory' folder with a '.log' extension.
{
"type": "file_spout",
"spout_settings": {
"codec": "line",
"watcher": true,
"watcher.process_existing_files": true,
"read_file_from_start": false,
"tail": false,
"path": "/path/to/directory",
"path.regex": ".\*\.log"
},
"storm_settings": {
"component": "filespout",
"publish": [
...
]
}
}
AbstractFileInput.Item
failed, inputQueue, inputQueues, orderedRead, path, pathRegexPattern, processAlreadyExisting, queueSize
Constructor and Description |
---|
FileSpoutWatcher(org.thales.punch.libraries.storm.api.NodeSettings config)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
open(Map stormSettings,
org.apache.storm.task.TopologyContext topologyContext,
org.apache.storm.spout.SpoutOutputCollector collector) |
ack, drainNextLogs, emitNextLine, fail, getListFiles, nextTuple, readOneFile
close, deactivate, declareOutputFields, getPublishedStreams, regulate, sendLatencyRecord
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
registerNextTupleCallback
public FileSpoutWatcher(org.thales.punch.libraries.storm.api.NodeSettings config)
config
- the spout settingspublic void open(Map stormSettings, org.apache.storm.task.TopologyContext topologyContext, org.apache.storm.spout.SpoutOutputCollector collector)
open
in interface org.apache.storm.spout.ISpout
open
in class AbstractFileInput
Copyright © 2022. All rights reserved.