Updated Branches: refs/heads/master 42c983384 -> 2a4e90cf4
This should fix the FileNotFoundException that happens sometimes while NRT updates are occuring. Fixed BLUR-244 Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/2a4e90cf Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/2a4e90cf Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/2a4e90cf Branch: refs/heads/master Commit: 2a4e90cf41018ab215a1c687dee57a1b9e338d0e Parents: 42c9833 Author: Aaron McCurry <[email protected]> Authored: Mon Oct 7 09:15:57 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Mon Oct 7 09:16:12 2013 -0400 ---------------------------------------------------------------------- .../org/apache/blur/manager/writer/IndexImporter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2a4e90cf/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java b/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java index d1990c3..cbf5e91 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java +++ b/blur-core/src/main/java/org/apache/blur/manager/writer/IndexImporter.java @@ -38,6 +38,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.io.Text; import org.apache.lucene.index.AtomicReader; import org.apache.lucene.index.AtomicReaderContext; @@ -83,7 +84,15 @@ public class IndexImporter extends TimerTask implements Closeable { Configuration configuration = _shardContext.getTableContext().getConfiguration(); try { FileSystem fileSystem = path.getFileSystem(configuration); - SortedSet<FileStatus> listStatus = sort(fileSystem.listStatus(path)); + SortedSet<FileStatus> listStatus = sort(fileSystem.listStatus(path, new PathFilter() { + @Override + public boolean accept(Path path) { + if (path != null && path.getName().endsWith(".commit")) { + return true; + } + return false; + } + })); List<HdfsDirectory> indexesToImport = new ArrayList<HdfsDirectory>(); for (FileStatus fileStatus : listStatus) { Path file = fileStatus.getPath();
