I couldn't get the shard server to not start with the command path not being set. I am testing on a mac. I have added some logging and for the default directory ($BLUR_HOME/commands) to be created if it's missing and if it can't be created then it should run with auto pickup of new commands disabled.
Aaron On Wed, Oct 29, 2014 at 7:17 AM, Tim Williams <[email protected]> wrote: > On Wed, Oct 29, 2014 at 12:10 AM, <[email protected]> wrote: > > 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/feature_update_jetty > > 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); > > + } > > I agree with the intent here but I'm wondering if it should be > addressed further up so we don't waste a timer task checking it all > the time? Also, if it got this far, it means they *attempted* to set > it so we should probably give at least a WARN about the path? > > Thanks, > --tim >
