incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <william...@gmail.com>
Subject Re: [11/12] git commit: allow blur to start if no commands file found
Date Wed, 29 Oct 2014 11:17:21 GMT
On Wed, Oct 29, 2014 at 12:10 AM,  <aavenoso@apache.org> 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 <andrew.va@gmail.com>
> Authored: Wed Oct 29 00:07:01 2014 -0400
> Committer: Andrew Avenoso <andrew.va@gmail.com>
> 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

Mime
View raw message