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 10CBB200D48 for ; Wed, 29 Nov 2017 20:38:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0F4F5160C16; Wed, 29 Nov 2017 19:38: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 561CF160C04 for ; Wed, 29 Nov 2017 20:38:06 +0100 (CET) Received: (qmail 17099 invoked by uid 500); 29 Nov 2017 19:38: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 17090 invoked by uid 99); 29 Nov 2017 19:38: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; Wed, 29 Nov 2017 19:38: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 EB6F21A07A1 for ; Wed, 29 Nov 2017 19:38:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id jAkMdFREG-I0 for ; Wed, 29 Nov 2017 19:38:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A086F5F231 for ; Wed, 29 Nov 2017 19:38:03 +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 8408DE0E08 for ; Wed, 29 Nov 2017 19:38: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 DCD9821059 for ; Wed, 29 Nov 2017 19:38:00 +0000 (UTC) Date: Wed, 29 Nov 2017 19:38:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-3645) Update API CacheFactory::create to return cache object MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 29 Nov 2017 19:38:07 -0000 [ https://issues.apache.org/jira/browse/GEODE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16271416#comment-16271416 ] ASF GitHub Bot commented on GEODE-3645: --------------------------------------- dgkimura commented on a change in pull request #159: GEODE-3645: Update CacheFactory::create to return Cache by value URL: https://github.com/apache/geode-native/pull/159#discussion_r153893137 ########## File path: clicache/src/DistributedSystem.cpp ########## @@ -140,9 +140,9 @@ namespace Apache // this we are calling after all .NET initialization required in // each AppDomain - auto nativeptr = native::DistributedSystem::create(mg_name.CharPtr, cache->GetNative().get(), + auto nativeptr = native::DistributedSystem::create(mg_name.CharPtr, config->GetNative()); - nativeptr->connect(); + nativeptr->connect(cache->GetNative().get()); Review comment: This was split because of circular constructor dependency between CacheImpl and DistributedSystem. DistributedSystem uses CacheImpl for StatisticsManager. It worked before when DistributedSystem took a Cache, but we can't do that anymore since Cache may be moved. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org > Update API CacheFactory::create to return cache object > ------------------------------------------------------ > > Key: GEODE-3645 > URL: https://issues.apache.org/jira/browse/GEODE-3645 > Project: Geode > Issue Type: New Feature > Components: native client > Reporter: David Kimura > > As an application developer I want to control the stack vs heap allocation of my cache object. If we change CacheFactory::create to return a cache object then the application user can pick an allocation scheme. This also allows application developers to bypass smart pointer complexity until the developer deems them necessary. > Example: > {noformat} > auto cache = CacheFactory::createFactory().create(); > auto cacheptr = std::make_shared(CacheFactory::createFactory().create()); > {noformat} > Difficulty of implementation is due to Cache/CacheImpl circular dependency. Here are a few examples of various approaches to consider: > https://gist.github.com/pivotal-jbarrett/52ba9ec5de0b494368d1c5282ef188ef > https://gist.github.com/pivotal-jbarrett/c48ffff3f7f41b187f0ed8c80108aa6a > Here are the related email threads of interest: > http://markmail.org/message/in5e337npq5euslh > http://markmail.org/message/lp2rx2rtyblg72fv -- This message was sent by Atlassian JIRA (v6.4.14#64029)