[
https://issues.apache.org/jira/browse/GEODE-393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052492#comment-16052492
]
ASF GitHub Bot commented on GEODE-393:
--------------------------------------
GitHub user DivineEnder opened a pull request:
https://github.com/apache/geode/pull/589
GEODE-393: Providing cache for FunctionContext
Added the ability to pass a Cache to a function context as well as tests to
check for this.
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in
the commit message?
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and
submit an update to your PR as soon as possible. If you need help, please
send an
email to [email protected].
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DivineEnder/geode feature/GEODE-393
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/geode/pull/589.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #589
----
commit ec1047c56ebc9f92e7b521bd765286fbed09af59
Author: David Anuta <[email protected]>
Date: 2017-06-16T23:05:24Z
GEODE-393: Providing cache for FunctionContext
Added the ability to pass a Cache to a function context as well as tests to
check for this.
----
> 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: David Anuta
> 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.4.14#64029)