Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.druid.data.input.InputSplit;
import org.apache.druid.data.input.SplitHintSpec;
import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.utils.CollectionUtils;
import org.apache.druid.utils.Streams;

Expand All @@ -56,6 +57,8 @@

public class LocalInputSource extends AbstractInputSource implements SplittableInputSource<List<File>>
{
private static final Logger log = new Logger(LocalInputSource.class);

@Nullable
private final File baseDir;
@Nullable
Expand Down Expand Up @@ -151,11 +154,17 @@ private Iterator<File> getDirectoryListingIterator()
)
);
}
return FileUtils.iterateFiles(
Iterator<File> fileIterator = FileUtils.iterateFiles(
baseDir.getAbsoluteFile(),
fileFilter,
TrueFileFilter.INSTANCE
);
if (!fileIterator.hasNext()) {
// base dir & filter are guaranteed to be non-null here
// (by construction and non-null check of baseDir a few lines above):
log.info("Local inputSource filter [%s] for base dir [%s] did not match any files", filter, baseDir);
}
Comment thread
loquisgon marked this conversation as resolved.
return fileIterator;
}
}

Expand Down