brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-49) Catalogue should be persisted and used when rebinding
Date Wed, 17 Sep 2014 17:12:33 GMT

    [ https://issues.apache.org/jira/browse/BROOKLYN-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14137567#comment-14137567
] 

ASF GitHub Bot commented on BROOKLYN-49:
----------------------------------------

GitHub user sjcorbett opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/175

    BROOKLYN-49: Catalogue persistence

    Brooklyn persists catalogue entries and loads them when rebinding.
    * Most interesting are the changes to `AbstractManagementContext`, `RebindManagerImpl`
and `BasicBrooklynCatalog`.
    * Catalogue persistence tests are in `RebindCatalogItemTest`.
    * See the comments in 5212980 for the interesting bits.
    * Catalog persistence is off by default and enabled with the `--persistCatalog` command
line flag.
    * There is not (currently) an option to enable catalogue persistence but to load the catalogue
from a file. It would be fairly straightforward to add.
    
    Note that most - maybe all - catalogues are currently written like:
    ```
    <catalog>
        <template type="brooklyn.clocker.example.DockerCloud" name="Docker cloud">
            <description>Launches a Docker cloud</description>
            <iconUrl>http://localhost:5642/docker-whale.png</iconUrl>
        </template>
    
        <classpath scan="annotations"> 
            <entry>file://~/.m2/repository/io/brooklyn/clocker/brooklyn-clocker-docker/0.6.0-SNAPSHOT/brooklyn-clocker-docker-0.6.0-SNAPSHOT.jar</entry>
            ...
        </classpath>
    </catalog>
    ```
    The template will be persisted but the classpath will *not*, and thus it will not be possible
to use such entries after Brooklyn has rebinded.
    
    Entries must be written in this format instead:
    ```
        <template name="Entity name" type="com.example.ExampleApp">
            <description>An example application</description>
            <libraries>
                <bundle>file://path/to/bundle.jar</bundle>
            </libraries>
        </template>
    ```
    I've tried to be as thorough as I can, but please review carefully!

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sjcorbett/incubator-brooklyn persist-catalogue

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/175.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 #175
    
----
commit 0c8ce5f8d1564b01777e4f66ef0c87ca15131c6a
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Date:   2014-09-17T16:53:33Z

    FileBasedObjectStore excludes (vim) swp files

commit 1238bab8cc74fa424199931d9cc05508c87e7900
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Date:   2014-09-16T17:45:33Z

    Format CampYamlLiteTest properly

commit 5212980b855cee69f3eb2a1c0418490d96742ce8
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Date:   2014-09-11T15:07:47Z

    BROOKLYN-49: Catalogue persistence
    
    * CatalogItem extends BrooklynObject. Deprecates CatalogItem.getName
    in favour of getDisplayName.
    
    * Adds reset(Collection<CatalogItem>) to BrooklynCatalog interface.
    
    * Adds BrooklynServerConfig.CATALOG_LOAD_MODE config key. If its value is
    LOAD_BROOKLYN_CATALOG_URL then AbstractManagementContext will load the
    catalogue (as previously normal) when its getCatalog method is called.
    Otherwise the management context lets RebindManagerImpl load the catalog
    once persistence files have been loaded. If ther persistence store was
    empty (i.e. the server is starting for the first time) then the catalog
    configured in BROOKLYN_CATALOG_URL is loaded.
    
    * Catalogue item IDs are autogenerated by AbstractBrooklynObject. The
    only exception to this is for YAML blueprints that are posted to the
    server. To maintain backwards compatability, where id and
    registeredTypeName were equivalent, BrooklynCatalog.getCatalogItem is
    modified to also check items' registeredTypeName.
    
    * Catalogue persistence must be enabled on the command line with the
    --persistCatalog flag.

----


> Catalogue should be persisted and used when rebinding
> -----------------------------------------------------
>
>                 Key: BROOKLYN-49
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-49
>             Project: Brooklyn
>          Issue Type: Improvement
>            Reporter: Sam Corbett
>            Assignee: Sam Corbett
>
> Proposal:
> The catalogue, consisting of application templates, entities, policies and 'configuration'
(whose purpose is unknown to me and is unused in general), will be persisted to a `catalog`
directory alongside enrichers, entities, locations, nodes, plane and policies. Location definitions
(that are conceptually linked but are unrelated in code) will be stored too.
> Modes of operation:
> * If persistence if disabled load the default catalogue;
> * If persistence is enabled but there is no persisted catalogue (i.e. the server is running
for the first time) then load the default catalogue;
> * Otherwise load the persisted catalogue. Do _not_ load the default catalogue. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message