allow blur to start if no commands file found
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/ef79c773 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/ef79c773 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/ef79c773 Branch: refs/heads/master Commit: ef79c773e2000661d20461f3959154bcb9a6c538 Parents: 414575e Author: Andrew Avenoso <[email protected]> Authored: Wed Oct 29 00:07:01 2014 -0400 Committer: Andrew Avenoso <[email protected]> Committed: Wed Oct 29 00:09:37 2014 -0400 ---------------------------------------------------------------------- .../apache/blur/command/BaseCommandManager.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/ef79c773/blur-core/src/main/java/org/apache/blur/command/BaseCommandManager.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/command/BaseCommandManager.java b/blur-core/src/main/java/org/apache/blur/command/BaseCommandManager.java index ba6d4be..f6dfb9d 100644 --- a/blur-core/src/main/java/org/apache/blur/command/BaseCommandManager.java +++ b/blur-core/src/main/java/org/apache/blur/command/BaseCommandManager.java @@ -167,16 +167,18 @@ public abstract class BaseCommandManager implements Closeable { protected synchronized int loadNewCommandsFromCommandPath() throws IOException { Path path = new Path(_commandPath); FileSystem fileSystem = path.getFileSystem(_configuration); - FileStatus[] listStatus = fileSystem.listStatus(path); int changeCount = 0; - for (FileStatus fileStatus : listStatus) { - BigInteger contentsCheck = checkContents(fileStatus, fileSystem); - Path entryPath = fileStatus.getPath(); - BigInteger currentValue = _commandPathLastChange.get(entryPath); - if (!contentsCheck.equals(currentValue)) { - changeCount++; - loadNewCommand(fileSystem, fileStatus, contentsCheck); - _commandPathLastChange.put(entryPath, contentsCheck); + if(fileSystem.exists(path)) { + FileStatus[] listStatus = fileSystem.listStatus(path); + for (FileStatus fileStatus : listStatus) { + BigInteger contentsCheck = checkContents(fileStatus, fileSystem); + Path entryPath = fileStatus.getPath(); + BigInteger currentValue = _commandPathLastChange.get(entryPath); + if (!contentsCheck.equals(currentValue)) { + changeCount++; + loadNewCommand(fileSystem, fileStatus, contentsCheck); + _commandPathLastChange.put(entryPath, contentsCheck); + } } } return changeCount;
