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 30016200D19 for ; Thu, 21 Sep 2017 18:22:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2E7121609B8; Thu, 21 Sep 2017 16:22:07 +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 71D3D1609E4 for ; Thu, 21 Sep 2017 18:22:06 +0200 (CEST) Received: (qmail 44593 invoked by uid 500); 21 Sep 2017 16:22:05 -0000 Mailing-List: contact issues-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list issues@geode.apache.org Received: (qmail 44525 invoked by uid 99); 21 Sep 2017 16:22:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Sep 2017 16:22:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 231DD1A4801 for ; Thu, 21 Sep 2017 16:22:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GAAfNQkqTM8U for ; Thu, 21 Sep 2017 16:22:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0332A5F3FE for ; Thu, 21 Sep 2017 16:22:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6B185E0A29 for ; Thu, 21 Sep 2017 16:22:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 170CC241D9 for ; Thu, 21 Sep 2017 16:22:01 +0000 (UTC) Date: Thu, 21 Sep 2017 16:22:01 +0000 (UTC) From: "Fred Krone (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-2727) optimize new 1.8 ConcurrentMap default methods on Region MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 21 Sep 2017 16:22:07 -0000 [ https://issues.apache.org/jira/browse/GEODE-2727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16175032#comment-16175032 ] Fred Krone commented on GEODE-2727: ----------------------------------- [~dschneider] we should pick this up again > optimize new 1.8 ConcurrentMap default methods on Region > -------------------------------------------------------- > > Key: GEODE-2727 > URL: https://issues.apache.org/jira/browse/GEODE-2727 > Project: Geode > Issue Type: Improvement > Components: regions > Reporter: Darrel Schneider > Labels: region_interface, storage_2 > > FRED: I can now edit this! > In JDK 1.8 ConcurrentMap added the following default methods to the interface: > getOrDefault > computeIfAbsent > computeIfPresent > compute > merge > foreach > replaceAll > All of the default implementations of these methods have issues with get returning null when the key actually exists. So they do not support invalid region entries. > The other problem with all of them (except getOrDefault) is that they will make multiple round trips when done from a proxy. In a distributed environment we should implement these to send the lambda to the primary so that the entire operation can be done with one message and while the RegionEntry is locked. > This would require that the lambda parameter by serializable which would be consistent with what we do for other parameters to Region methods (for example "put"). > From a performance point of view "foreach" and "replaceAll" are the worst since they bring back to whoever is executing the method all the keys and values from the entire cluster. > It is also worth considering how the operations behave in a geode transaction. -- This message was sent by Atlassian JIRA (v6.4.14#64029)