public class FileMonitoringFunction extends Object implements SourceFunction<org.apache.flink.api.java.tuple.Tuple3<String,Long,Long>>
| Modifier and Type | Class and Description |
|---|---|
static class |
FileMonitoringFunction.WatchType |
SourceFunction.SourceContext<T>| Constructor and Description |
|---|
FileMonitoringFunction(String path,
long interval,
FileMonitoringFunction.WatchType watchType) |
public FileMonitoringFunction(String path, long interval, FileMonitoringFunction.WatchType watchType)
public void run(SourceFunction.SourceContext<org.apache.flink.api.java.tuple.Tuple3<String,Long,Long>> ctx) throws Exception
SourceFunctionCollector parameter to emit
elements. Sources that implement
Checkpointed must lock on the
checkpoint lock (using a synchronized block) before updating internal state and/or emitting
elements. Also, the update of state and emission of elements must happen in the same
synchronized block.public void cancel()
SourceFunctionSourceFunction.run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T>) method. You need to ensure that the source will break out of this loop. This
can be achieved by having a volatile field "isRunning" that is checked in the loop and that
is set to false in this method.cancel in interface SourceFunction<org.apache.flink.api.java.tuple.Tuple3<String,Long,Long>>Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.