From dev-return-30365-archive-asf-public=cust-asf.ponee.io@geode.apache.org Wed Nov 28 23:53:34 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D2359180658 for ; Wed, 28 Nov 2018 23:53:33 +0100 (CET) Received: (qmail 36658 invoked by uid 500); 28 Nov 2018 22:53:32 -0000 Mailing-List: contact dev-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 dev@geode.apache.org Received: (qmail 36646 invoked by uid 99); 28 Nov 2018 22:53:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2018 22:53:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id CFC2AC0A3B for ; Wed, 28 Nov 2018 22:53:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.999 X-Spam-Level: * X-Spam-Status: No, score=1.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 19hzN64sh5Ek for ; Wed, 28 Nov 2018 22:53:29 +0000 (UTC) Received: from mx0a-00296801.pphosted.com (mx0a-00296801.pphosted.com [148.163.150.38]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4434260D5B for ; Wed, 28 Nov 2018 22:53:29 +0000 (UTC) Received: from pps.filterd (m0114581.ppops.net [127.0.0.1]) by mx0a-00296801.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wASMq2Us017691 for ; Wed, 28 Nov 2018 22:53:22 GMT Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-00296801.pphosted.com with ESMTP id 2p21apg7mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 28 Nov 2018 22:53:22 +0000 Received: by mail-pg1-f197.google.com with SMTP id r16so13050373pgr.15 for ; Wed, 28 Nov 2018 14:53:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=DJE7dLAdh8+RwvYDId3MR+1PzI6BRF16kcrV1w0KpmI=; b=C/rH8E2V+FwQkTDfgxArkde1/+Cvvqs7DSY6ApcQ3efUCtEyo4ps95BS1ztWrO9Boy pXNwJ5F/CUHLA3IfGEHNdpAp5zfcdSqg+GgGIDG9wzqzHj/7fcTORAoSBdsVFwv1IH67 ZbrPXwu1j8cZCdHgdaqTwURO4I+Js4jDuC9ZulC0zu2npYakfk+rvm5HAGloh5vH5AgS lcZUBWw37+BnJSRJ94MqHGZ4zn8RlA4ElO0QJNaw2jwQySgjsfdn/pXRht0uXunHT/Cn D+zwRHdMd51Lg6KAISoO9Rszl1oI8J//IaBdeV3ANklbAiJcij9cT+ZI909z/ILysEKr 6A+Q== X-Gm-Message-State: AA+aEWYXN1CdtU4x3+BczD3Gx284VgYmjYLg5GSroIYHacVHkHcQv/eT 9DqcBubGYi5GO4Fs97iqsl4QdPVW5dsVr2AeIX6criayUI+pzRqwS4pJgLYXdMgBj9xrxsMJKYC 8FPhAzDXWsHqDs2NVn+YgMvcg2tJqp3SarBKue6A= X-Received: by 2002:a63:c503:: with SMTP id f3mr33976023pgd.431.1543445601194; Wed, 28 Nov 2018 14:53:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/X55gtyy8FazkwGBY67UW9KG04vY2v1UNMO814Yd9BeUDalAhz122zmstSVJ4dylsN0DrEXsw== X-Received: by 2002:a63:c503:: with SMTP id f3mr33976010pgd.431.1543445600864; Wed, 28 Nov 2018 14:53:20 -0800 (PST) Received: from [10.118.33.157] (50-203-225-134-static.hfc.comcastbusiness.net. [50.203.225.134]) by smtp.gmail.com with ESMTPSA id o7sm11114230pfb.34.2018.11.28.14.53.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 14:53:20 -0800 (PST) From: Jacob Barrett Content-Type: multipart/alternative; boundary="Apple-Mail=_CDCB1882-E0B1-47EC-8476-3A27EA138FF5" Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: First Iteration on Java Module Support Message-Id: Date: Wed, 28 Nov 2018 14:53:19 -0800 To: dev@geode.apache.org X-Mailer: Apple Mail (2.3445.101.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-28_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=931 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280197 --Apple-Mail=_CDCB1882-E0B1-47EC-8476-3A27EA138FF5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 All, We started iterating on a solution for supporting Java modules based = applications linking to Geode as a module dependency. Now before you go, = "but why didn=E2=80=99t you do X?=E2=80=9D, let=E2=80=99s set some = ground rules here. The initial goal was to get *a* solution, not the = best solution, for linking and using basic client features, like get, = put, query, cq, function execution, and serialization. To that end = PR-2911 (https://github.com/apache/geode/pull/2911 = ) provides a solution. It = produces a fat jar containing a set of classes that make up the features = stated in our goal. It presents itself as a module using automatic = naming in the manifest as =E2=80=98org.apache.geode'. The corresponding = POM includes all the the same dependencies that geode-core had so that = an application can just depend on this new module artifact and get all = the dependent modules as well. You can see how this plays out in a = simple =E2=80=9CHello World=E2=80=9D application at = https://github.com/pivotal-jbarrett/geode-example-java-11 = .=20 Why the fat jar? If you make the application require =E2=80=98geode.core=E2= =80=99 (automatic name for geode-core.jar) then you immediately fail to = compile with split package errors on =E2=80=98org.apache.shiro=E2=80=99 = dependencies. Shiro lacks a Java modules update (see scary Shiro = comments below). Ignoring the Shiro issues, by commenting it out, we = then hit the split package issues discussed in earlier discussions. A = fat jar, which includes =E2=80=98geode-core=E2=80=99, =E2=80=98geode-cq=E2= =80=99, and =E2=80=98shiro-core', solves this issue. The downside, = besides another jar, is that Shiro is implicitly exported from our fat = jar and this can cause issues if the application is also using Shiro = (not likely given all the Shiro issues below). What=E2=80=99s wrong with Shiro? It is effectively a dead project. The = last several board reports are copy and paste. The reports all indicate = stalled interest on mailing lists. The last release was May of 2017 and = since then has only had a handful of commits and activity. The last = release, 1.4.0, actually worsened the split package issues and all PRs = posted to fix it have gone unmerged. Shiro is required to be on the = client class path so that we can load one of our classes that ultimately = doesn=E2=80=99t even use Shiro. We could do a better job here so that we = don=E2=80=99t have to leak Shiro onto the client class path.=20 So what=E2=80=99s next? We are going to experiment with other solutions: - Fat module with module-info.java to hide Shiro and other internals - Requires that we find a way to compile classes for Java 8 and = modules-info with Java 9+. - Existing jars as automatic modules - Need to get Shiro out of the client class path and only into the = server runtime class path. - Correct split packages in geode-core and geode-cq - Existing jars as modules with module-info - All the requirements of "Existing jars as automatic modules=E2=80=9D. - Requires that we find a way to compile classes for Java 8 and = modules-info with Java 9+. We would love any input on the current state of this iteration as well = as any hints at other things we should try. In the mean time a review = and acceptance of this PR helps move us forward in the modules = direction.=20 Thanks, Jake --Apple-Mail=_CDCB1882-E0B1-47EC-8476-3A27EA138FF5--