brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Add multiple items to catalog wit...
Date Tue, 14 Apr 2015 14:46:59 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/585#discussion_r28333207
  
    --- Diff: core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---
    @@ -664,10 +858,28 @@ private DeploymentPlan makePlanFromYaml(String yaml) {
         }
     
         @Override
    +    public List<? extends CatalogItem<?,?>> addItems(String yaml) {
    +        return addItems(yaml, false);
    +    }
    +
    +    @Override
         public CatalogItem<?,?> addItem(String yaml, boolean forceUpdate) {
    +        return Iterables.getOnlyElement(addItems(yaml, forceUpdate));
    +    }
    +    
    +    @Override
    +    public List<? extends CatalogItem<?,?>> addItems(String yaml, boolean
forceUpdate) {
             log.debug("Adding manual catalog item to "+mgmt+": "+yaml);
             checkNotNull(yaml, "yaml");
    -        CatalogItemDtoAbstract<?,?> itemDto = getAbstractCatalogItem(yaml);
    +        List<CatalogItemDtoAbstract<?, ?>> result = addAbstractCatalogItems(yaml,
forceUpdate);
    +        // previously we did this here, but now we do it on each item, in case #2 refers
to #1
    --- End diff --
    
    I see where you are coming from, but when combined with the "don't overwrite existing
items" default behaviour users will have hard time testing and developing catalog items blueprints
if addition is not atomic.


---
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.
---

Mime
View raw message