Updated Branches: refs/heads/apache-blur-0.2 10b263767 -> 5d159cb4f
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/5d159cb4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/5d159cb4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/5d159cb4 Branch: refs/heads/apache-blur-0.2 Commit: 5d159cb4febc9f913e7c38ac6d5b9a2d53aebd4c Parents: 10b2637 Author: Aaron McCurry <[email protected]> Authored: Mon Oct 7 09:15:57 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Mon Oct 7 09:15:57 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/5d159cb4/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();
