Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E81617DFE for ; Fri, 10 Oct 2014 19:16:34 +0000 (UTC) Received: (qmail 19963 invoked by uid 500); 10 Oct 2014 19:16:34 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 19932 invoked by uid 500); 10 Oct 2014 19:16:34 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 19756 invoked by uid 99); 10 Oct 2014 19:16:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 19:16:34 +0000 Date: Fri, 10 Oct 2014 19:16:34 +0000 (UTC) From: "Josh Elser (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (ACCUMULO-3223) DefaultLoadBalancer allows a NPE just to catch it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Josh Elser created ACCUMULO-3223: ------------------------------------ Summary: 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.6.1, 1.5.2 Reporter: Josh Elser Assignee: Josh Elser Priority: Trivial Fix For: 1.5.3, 1.6.2, 1.7.0 {{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 onlineTabletsForTable = onlineTablets.get(table); try { if (onlineTabletsForTable == null) { onlineTabletsForTable = new HashMap(); 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)