You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by grkvlt <gi...@git.apache.org> on 2014/12/03 16:08:35 UTC
[GitHub] incubator-brooklyn pull request: Fix the DynamicMultiGroup rebind ...
GitHub user grkvlt opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/372
Fix the DynamicMultiGroup rebind actions
- Store bucket mappings in an attribute
- Restart feed in the `rebind` method
- Use public class instead of anonymous for function
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/grkvlt/incubator-brooklyn fix/dynamic-multigroup-rebind
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/372.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 #372
----
commit edfe1219e5715ff0f282cf6fdf7e6c9a63f28c76
Author: Andrew Kennedy <gr...@apache.org>
Date: 2014-12-03T15:06:26Z
Fix the DynamicMultiGroup rebind actions
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Fix the DynamicMultiGroup rebind ...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/372#discussion_r21237483
--- Diff: core/src/main/java/brooklyn/entity/group/DynamicMultiGroupImpl.java ---
@@ -74,13 +88,16 @@ public String apply(@Nullable Entity input) {
return bucketFromAttribute(sensor, null);
}
- private Map<String, BasicGroup> buckets = Maps.newHashMap();
- private volatile FunctionFeed rescan;
+ private transient FunctionFeed rescan;
@Override
public void init() {
super.init();
+ setAttribute(BUCKETS, MutableMap.<String, BasicGroup>of());
+ connectScanner();
+ }
+ private void connectScanner() {
Long interval = getConfig(RESCAN_INTERVAL);
if (interval != null && interval > 0L) {
rescan = FunctionFeed.builder()
--- End diff --
It's also possible to call `addFeed(FunctionFeed.builder()...)` in `init()`. By calling `addFeed`, it means the feed will be persisted, so it doesn't need to be called in `rebind()`. However, note the existing function feed's `.callable` would not be serializable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---