Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 385CE200D70 for ; Fri, 22 Dec 2017 06:30:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 36FDC160C2B; Fri, 22 Dec 2017 05:30:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B8CA160C2E for ; Fri, 22 Dec 2017 06:30:03 +0100 (CET) Received: (qmail 4413 invoked by uid 500); 22 Dec 2017 05:30:02 -0000 Mailing-List: contact commits-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 commits@accumulo.apache.org Received: (qmail 4393 invoked by uid 99); 22 Dec 2017 05:30:02 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Dec 2017 05:30:02 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 9F5D684BAE; Fri, 22 Dec 2017 05:29:59 +0000 (UTC) Date: Fri, 22 Dec 2017 05:30:03 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] 02/03: ACCUMULO-4774 Use lambda for ConditionalWriter's ThreadFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: ctubbsii@apache.org In-Reply-To: <151392059865.7108.144108914062667892@gitbox.apache.org> References: <151392059865.7108.144108914062667892@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 15b00dff60782579e5a7febc90cbabb80e3b7b9a X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171222052959.9F5D684BAE@gitbox.apache.org> archived-at: Fri, 22 Dec 2017 05:30:04 -0000 This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/accumulo.git commit 15b00dff60782579e5a7febc90cbabb80e3b7b9a Author: Christopher Tubbs AuthorDate: Fri Dec 22 00:17:47 2017 -0500 ACCUMULO-4774 Use lambda for ConditionalWriter's ThreadFactory --- .../core/client/impl/ConditionalWriterImpl.java | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java index dbefc28..22d8a1b 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java @@ -37,7 +37,6 @@ import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -97,18 +96,11 @@ import org.slf4j.LoggerFactory; class ConditionalWriterImpl implements ConditionalWriter { - private static class CleanupThreadFactory implements ThreadFactory { - - @Override - public Thread newThread(Runnable r) { - Thread t = new Thread(r, "Conditional Writer Cleanup Thread "); - t.setDaemon(true); - return t; - } - } - - private static ThreadPoolExecutor cleanupThreadPool = new ThreadPoolExecutor(1, 1, 3, TimeUnit.SECONDS, new LinkedBlockingQueue(), - new CleanupThreadFactory()); + private static ThreadPoolExecutor cleanupThreadPool = new ThreadPoolExecutor(1, 1, 3, TimeUnit.SECONDS, new LinkedBlockingQueue(), r -> { + Thread t = new Thread(r, "Conditional Writer Cleanup Thread"); + t.setDaemon(true); + return t; + }); static { cleanupThreadPool.allowCoreThreadTimeOut(true); @@ -627,8 +619,8 @@ class ConditionalWriterImpl implements ConditionalWriter { queueRetry(ignored, location); } catch (ThriftSecurityException tse) { - AccumuloSecurityException ase = new AccumuloSecurityException(context.getCredentials().getPrincipal(), tse.getCode(), Tables.getPrintableTableInfoFromId( - context.getInstance(), tableId), tse); + AccumuloSecurityException ase = new AccumuloSecurityException(context.getCredentials().getPrincipal(), tse.getCode(), + Tables.getPrintableTableInfoFromId(context.getInstance(), tableId), tse); queueException(location, cmidToCm, ase); } catch (TTransportException e) { locator.invalidateCache(context.getInstance(), location.toString()); -- To stop receiving notification emails like this one, please contact "commits@accumulo.apache.org" .