use of org.apache.asterix.external.input.stream.LocalFSInputStream in project asterixdb by apache.
the class LocalFSInputStreamFactory method createInputStream.
@Override
public synchronized AsterixInputStream createInputStream(IHyracksTaskContext ctx, int partition) throws HyracksDataException {
if (watcher == null) {
String nodeName = ctx.getJobletContext().getServiceContext().getNodeId();
ArrayList<Path> inputResources = new ArrayList<>();
for (int i = 0; i < inputFileSplits.length; i++) {
if (inputFileSplits[i].getNodeName().equals(nodeName)) {
inputResources.add(inputFileSplits[i].getFile().toPath());
}
}
watcher = new FileSystemWatcher(inputResources, expression, isFeed);
}
return new LocalFSInputStream(watcher);
}
Aggregations