accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (ACCUMULO-3223) DefaultLoadBalancer allows a NPE just to catch it
Date Fri, 10 Oct 2014 19:40:35 GMT

     [ https://issues.apache.org/jira/browse/ACCUMULO-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Josh Elser resolved ACCUMULO-3223.
----------------------------------
    Resolution: Fixed

> DefaultLoadBalancer allows a NPE just to catch it
> -------------------------------------------------
>
>                 Key: ACCUMULO-3223
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3223
>             Project: Accumulo
>          Issue Type: Sub-task
>          Components: master
>    Affects Versions: 1.5.2, 1.6.1
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Trivial
>             Fix For: 1.5.3, 1.6.2, 1.7.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {{getOnlineTabletsForTable}} can return null for a couple of different reasons. The try/catch
prevents the NPE from filtering up, but it is a confusing situation that can be re-written
to be more clear. 
> {code:title=DefaultLoadBalancer.java}
>       Map<KeyExtent,TabletStats> onlineTabletsForTable = onlineTablets.get(table);
>       try {
>         if (onlineTabletsForTable == null) {
>           onlineTabletsForTable = new HashMap<KeyExtent,TabletStats>();
>           for (TabletStats stat : getOnlineTabletsForTable(tooMuch.server, table))
>             onlineTabletsForTable.put(new KeyExtent(stat.extent), stat);
>           onlineTablets.put(table, onlineTabletsForTable);
>         }
>       } catch (Exception ex) {
>         log.error("Unable to select a tablet to move", ex);
>         return result;
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message