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 0F376200CB1 for ; Sat, 10 Jun 2017 00:32:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0DAC1160BD4; Fri, 9 Jun 2017 22:32:26 +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 558B1160BCA for ; Sat, 10 Jun 2017 00:32:25 +0200 (CEST) Received: (qmail 49442 invoked by uid 500); 9 Jun 2017 22:32:24 -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 49433 invoked by uid 99); 9 Jun 2017 22:32:24 -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; Fri, 09 Jun 2017 22:32:24 +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 22BE71A07E0 for ; Fri, 9 Jun 2017 22:32:24 +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-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 wI9_kTE1mFrT for ; Fri, 9 Jun 2017 22:32:23 +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 3673F5FD21 for ; Fri, 9 Jun 2017 22:32:23 +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 C6400E0630 for ; Fri, 9 Jun 2017 22:32:20 +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 B5C1D21938 for ; Fri, 9 Jun 2017 22:32:18 +0000 (UTC) Date: Fri, 9 Jun 2017 22:32:18 +0000 (UTC) From: "Dan Smith (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-393) FunctionContext should provide a Cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 09 Jun 2017 22:32:26 -0000 [ https://issues.apache.org/jira/browse/GEODE-393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045139#comment-16045139 ] Dan Smith commented on GEODE-393: --------------------------------- It might be fairly easy to add tests for this to FunctionServiceBase to see if the cache can be obtained in all of the different ways of executing the function. > FunctionContext should provide a Cache > -------------------------------------- > > Key: GEODE-393 > URL: https://issues.apache.org/jira/browse/GEODE-393 > Project: Geode > Issue Type: Improvement > Components: functions > Reporter: Dan Smith > Assignee: Dan Smith > Labels: starter > > FunctionContext has methods to get the arguments to the function and the result sender, but there is no way to get the Cache or DistributedSystem. > This means pretty much any function will need to statically look up the cache using CacheFactory.getAnyInstance(). While that works, it makes it impossible to write unit tests for functions by passing in a mock cache. > Note that onRegion functions are provided a RegionFunctionContext, which does provide these functions with a means to look up the cache, but not all functions are applied to a region. -- This message was sent by Atlassian JIRA (v6.3.15#6346)