Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A26E811DB6 for ; Wed, 17 Sep 2014 17:12:37 +0000 (UTC) Received: (qmail 19659 invoked by uid 500); 17 Sep 2014 17:12:37 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 19622 invoked by uid 500); 17 Sep 2014 17:12:37 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 19611 invoked by uid 99); 17 Sep 2014 17:12:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 17:12:37 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 17 Sep 2014 17:12:35 +0000 Received: (qmail 17414 invoked by uid 99); 17 Sep 2014 17:12:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 17:12:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F2A00A18DBA; Wed, 17 Sep 2014 17:12:14 +0000 (UTC) From: sjcorbett To: dev@brooklyn.incubator.apache.org Reply-To: dev@brooklyn.incubator.apache.org Message-ID: Subject: [GitHub] incubator-brooklyn pull request: BROOKLYN-49: Catalogue persistenc... Content-Type: text/plain Date: Wed, 17 Sep 2014 17:12:14 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org 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: ``` file://~/.m2/repository/io/brooklyn/clocker/brooklyn-clocker-docker/0.6.0-SNAPSHOT/brooklyn-clocker-docker-0.6.0-SNAPSHOT.jar ... ``` 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: ``` ``` 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 Date: 2014-09-17T16:53:33Z FileBasedObjectStore excludes (vim) swp files commit 1238bab8cc74fa424199931d9cc05508c87e7900 Author: Sam Corbett Date: 2014-09-16T17:45:33Z Format CampYamlLiteTest properly commit 5212980b855cee69f3eb2a1c0418490d96742ce8 Author: Sam Corbett Date: 2014-09-11T15:07:47Z BROOKLYN-49: Catalogue persistence * CatalogItem extends BrooklynObject. Deprecates CatalogItem.getName in favour of getDisplayName. * Adds reset(Collection) 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. ---