You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/07 09:50:01 UTC
[jira] [Commented] (BROOKLYN-519) Persisting yaml blueprint with
$brooklyn:entitySpec stores all configs
[ https://issues.apache.org/jira/browse/BROOKLYN-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077892#comment-16077892 ]
ASF GitHub Bot commented on BROOKLYN-519:
-----------------------------------------
GitHub user bostko opened a pull request:
https://github.com/apache/brooklyn-server/pull/757
[WIP] BROOKLYN-519 no BasicSpecParameter serialization
BasicSpecParameters are only consumed in API
and no need to keep them or keep their state.
- TODO rebind tests
- TODO test deserialization of a catalog item with
brooklyn.parameters in it.
- Long term TODO - not serializing SpecParameters.
(Will need bigger discussion in Apache Brooklyn mailing list)
Two ways to do that is either by using @XStreamOmitField or
by setting AbstractBrooklynObjectSpec#parameters transient.
However `transient' change besides not serializing parameters
it also do not deserialize the parameters field which cause a backward compatibility problem.
Backward compatibility with transient parameters
reproduceable in test `org.apache.brooklyn.entity.group.EntitySpecRebindTest`.
Causing problem with class object references deserialization, see https://x-stream.github.io/graphs.html
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bostko/brooklyn-server serialize-basic-parameters
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/757.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 #757
----
commit 968764765b82f034d21e908bb60e26dfd685e722
Author: Valentin Aitken <bo...@gmail.com>
Date: 2017-07-05T15:43:34Z
BROOKLYN-519 no BasicSpecParameter serialization
BasicSpecParameters are only consumed in API
and no need to keep them or keep their state.
- TODO rebind tests
- TODO test deserialization of a catalog item with
brooklyn.parameters in it.
- TODO not serializing SpecParameters.
Two ways to do that is either by using @XStreamOmitField or
by setting AbstractBrooklynObjectSpec#parameters transient.
However `transient' change besides not serializing parameters
it also do not deserialize the parameters field which cause a backward compatibility problem.
Backward compatibility with transient parameters
reproduceable in test org.apache.brooklyn.entity.group.EntitySpecRebindTest.
Causing problem with class object references deserialization, see https://x-stream.github.io/graphs.html
----
> Persisting yaml blueprint with $brooklyn:entitySpec stores all configs
> ----------------------------------------------------------------------
>
> Key: BROOKLYN-519
> URL: https://issues.apache.org/jira/browse/BROOKLYN-519
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Valentin Aitken
>
> Scenario:
> # Deploy the blueprint:
> {noformat}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
> brooklyn.config:
> childSpec:
> $brooklyn:entitySpec:
> - type: brooklyn.entity.group.DynamicCluster
> {noformat}
> # Inspect persistence
> {noformat}
> <childSpec>
> <org.apache.brooklyn.api.entity.EntitySpec>
> <type>org.apache.brooklyn.entity.group.DynamicCluster</type>
> <catalogItemIdSearchPath class="MutableSet"/>
> <tags class="MutableSet"/>
> <parameters class="ImmutableList">
> <org.apache.brooklyn.core.objs.BasicSpecParameter>
> <label>cluster.initial.quorumSize</label>
> <pinned>false</pinned>
> <configKey class="configKey">
> <name>cluster.initial.quorumSize</name>
> <type>java.lang.Integer</type>
> <description>Initial cluster quorum size - number of initial nodes that must have been successfully started to report success (if < 0, then use value of INITIAL_SIZE)</description>
> <defaultValue class="int">-1</defaultValue>
> <reconfigurable>false</reconfigurable>
> <constraint class="com.google.common.base.Predicates$ObjectPredicate">ALWAYS_TRUE</constraint>
> </configKey>
> </org.apache.brooklyn.core.objs.BasicSpecParameter>
> <org.apache.brooklyn.core.objs.BasicSpecParameter>
> <label>cluster.initial.size</label>
> <pinned>false</pinned>
> <configKey class="configKey">
> <name>cluster.initial.size</name>
> .....
> </configKey>
> </org.apache.brooklyn.core.objs.BasicSpecParameter>
> ...
> </parameters>
> </org.apache.brooklyn.api.entity.EntitySpec>
> </childSpec>
> {noformat}
> Result:
> Persisting entity which has $brooklyn:entitySpec config stores all spec configs in {{<parameters>}} section.
> Concern:
> Persisting all config keys can lead to persistence problems when changing config keys of a type.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)