brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: BROOKLYN-49: Catalogue persistenc...
Date Wed, 17 Sep 2014 17:12:14 GMT
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.

----


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