public class SFTPSpout
extends org.thales.punch.libraries.storm.api.BaseInputNode
Downloaded files are stored in a temporary directory where the topology has been executed.
Regex should be the same as used in unix system when searching for files.
It is expected to use another node to download the desired files...
Note by design, we consider this node to be used in a batch-like topology.
Although the client by design makes it easy to have a 'streaming behavior'
{
version: "6.0"
type: punchline
runtime: storm
dag: [
{
type: sftp_input
component: input
settings: {
cleanup: false
download_path: /tmp/toto
download_ignore_suffix: ".complete"
download_add_suffix: ".nm4"
consumer_mode: last_committed
sftp_settings: {
sftp.ssh.host: server3.com
sftp.ssh.auth.user: user
sftp.ssh.auth.pass: pass
sftp.ssh.file.name_regex: "*.complete"
sftp.ssh.scan_directories: [
SAISData
]
}
checkpoint_settings: {
checkpoint.application_runtime_id: sftp_application_id_test
checkpoint.es_index_prefix: jonathan_tenant-test-
checkpoint.es_nodes: [
{
host: localhost
}
]
}
}
publish: [
{
stream: files
fields: [
meta
]
}
]
subscribe: [
]
}
{
type: punchlet_node
component: stdout
settings: {
punchlet_code: "{ print(root); }"
}
subscribe: [
{
stream: files
component: input
}
]
publish: [
{
stream: files
fields: [
meta
]
}
]
}
]
}
| Modifier and Type | Field and Description |
|---|---|
static String |
CHECKPOINT_APPLICATION_RUNTIME_ID |
static String |
CHECKPOINT_ES_INDEX_PREFIX |
static String |
CHECKPOINT_ES_NODES |
| Constructor and Description |
|---|
SFTPSpout(org.thales.punch.libraries.storm.api.NodeSettings nodeSettings,
org.thales.punch.settings.api.ISettingsMap sftpSettingsMap,
boolean withCleanUp,
String downloadFilePath,
String downloadIgnoreSuffix,
String downloadAddSuffix,
org.thales.punch.settings.api.ISettingsMap checkpointSettings,
String consumeMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
ack(Object msgId)
commit will be done only if all emitted data have been ack
If at least one emitted file is not ack, this topology will fail
|
void |
close() |
void |
fail(Object msgId) |
void |
nextTuple() |
void |
open(Map conf,
org.apache.storm.task.TopologyContext context,
org.apache.storm.spout.SpoutOutputCollector collector) |
deactivate, declareOutputFields, getPublishedStreams, regulate, sendLatencyRecordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final String CHECKPOINT_APPLICATION_RUNTIME_ID
public static final String CHECKPOINT_ES_INDEX_PREFIX
public static final String CHECKPOINT_ES_NODES
public SFTPSpout(org.thales.punch.libraries.storm.api.NodeSettings nodeSettings,
org.thales.punch.settings.api.ISettingsMap sftpSettingsMap,
boolean withCleanUp,
String downloadFilePath,
String downloadIgnoreSuffix,
String downloadAddSuffix,
org.thales.punch.settings.api.ISettingsMap checkpointSettings,
String consumeMode)
public void nextTuple()
public void open(Map conf, org.apache.storm.task.TopologyContext context, org.apache.storm.spout.SpoutOutputCollector collector)
open in interface org.apache.storm.spout.ISpoutopen in class org.thales.punch.libraries.storm.api.BaseInputNodepublic void ack(Object msgId)
ack in interface org.apache.storm.spout.ISpoutack in class org.thales.punch.libraries.storm.api.BaseInputNodepublic void fail(Object msgId)
fail in interface org.apache.storm.spout.ISpoutfail in class org.thales.punch.libraries.storm.api.BaseInputNodepublic void close()
close in interface org.apache.storm.spout.ISpoutclose in class org.thales.punch.libraries.storm.api.BaseInputNodeCopyright © 2023. All rights reserved.