Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A52018E7C for ; Tue, 1 Dec 2015 18:24:47 +0000 (UTC) Received: (qmail 97478 invoked by uid 500); 1 Dec 2015 18:24:47 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 97436 invoked by uid 500); 1 Dec 2015 18:24:47 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 97424 invoked by uid 99); 1 Dec 2015 18:24:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2015 18:24:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E30AFE0498; Tue, 1 Dec 2015 18:24:46 +0000 (UTC) From: keith-turner To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: ACCUMULO-4065 Work around TExceptions being... Content-Type: text/plain Message-Id: <20151201182446.E30AFE0498@git1-us-west.apache.org> Date: Tue, 1 Dec 2015 18:24:46 +0000 (UTC) Github user keith-turner commented on a diff in the pull request: https://github.com/apache/accumulo/pull/56#discussion_r46316775 --- Diff: server/base/src/main/java/org/apache/accumulo/server/util/RpcWrapper.java --- @@ -36,20 +42,51 @@ * @since 1.6.1 */ public class RpcWrapper { + private static final Logger log = LoggerFactory.getLogger(RpcWrapper.class); + + public static T service(final T instance, @SuppressWarnings("rawtypes") final Map> processorView) { + // Get a handle on the isOnewayMethod and make it accessible + final Method isOnewayMethod; + try { + isOnewayMethod = ProcessFunction.class.getDeclaredMethod("isOneway"); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Could not access isOneway method", e); + } catch (SecurityException e) { + throw new RuntimeException("Could not access isOneway method", e); + } + isOnewayMethod.setAccessible(true); + + final Set onewayMethods = new HashSet(); + for (@SuppressWarnings("rawtypes") Entry> entry : processorView.entrySet()) { + try { + if ((Boolean) isOnewayMethod.invoke(entry.getValue())) { + onewayMethods.add(entry.getKey()); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } --- End diff -- can we restore isOneWayMethod's accessible settings here? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---