You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by David Medinets <da...@gmail.com> on 2012/09/06 04:20:32 UTC

ExportTable.isReady - alternative to for loop?

This is the code I am looking at:

    // TODO look for walogs
    for (Entry<Key,Value> entry : metaScanner) {
      return 500;
    }

    return 0;

FindBugs complains that entry is unused. Does it make sense to replace
that code with:

  return metaScanner.iterator().hasNext() ? 500 : 0;

Re: ExportTable.isReady - alternative to for loop?

Posted by Christopher Tubbs <ct...@gmail.com>.
I've already patched that. It just hasn't been committed.
See: https://issues.apache.org/jira/browse/ACCUMULO-456
Patch: https://issues.apache.org/jira/secure/attachment/12543936/ACCUMULO-456-4.patch

On Wed, Sep 5, 2012 at 10:20 PM, David Medinets
<da...@gmail.com> wrote:
> This is the code I am looking at:
>
>     // TODO look for walogs
>     for (Entry<Key,Value> entry : metaScanner) {
>       return 500;
>     }
>
>     return 0;
>
> FindBugs complains that entry is unused. Does it make sense to replace
> that code with:
>
>   return metaScanner.iterator().hasNext() ? 500 : 0;