You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2014/11/15 01:05:26 UTC

[17/21] incubator-brooklyn git commit: Use supported names for object store

Use supported names for object store

Fixes:
  * Files are now accessible (not 404) from Cyberduck & Softlayer UI
  * There's no longer a phantom folder with the same name as the parent for backups.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/fa7ba6f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/fa7ba6f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/fa7ba6f8

Branch: refs/heads/master
Commit: fa7ba6f838a488ed782d2cacf99a04687a55821f
Parents: 1a4e853
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Fri Nov 14 16:06:45 2014 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Fri Nov 14 17:11:00 2014 +0200

----------------------------------------------------------------------
 .../ManagementPlaneSyncRecordPersisterToObjectStore.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fa7ba6f8/core/src/main/java/brooklyn/management/ha/ManagementPlaneSyncRecordPersisterToObjectStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/management/ha/ManagementPlaneSyncRecordPersisterToObjectStore.java b/core/src/main/java/brooklyn/management/ha/ManagementPlaneSyncRecordPersisterToObjectStore.java
index 55b645c..c481cbe 100644
--- a/core/src/main/java/brooklyn/management/ha/ManagementPlaneSyncRecordPersisterToObjectStore.java
+++ b/core/src/main/java/brooklyn/management/ha/ManagementPlaneSyncRecordPersisterToObjectStore.java
@@ -125,8 +125,16 @@ public class ManagementPlaneSyncRecordPersisterToObjectStore implements Manageme
     protected synchronized void init() {
         if (!started) {
             started = true;
+            //Leading slash causes problems in SL, it's not a correct file name so remove it.
+            //But once removed we can't load the master file from existing persistence stores.
+            //Try to detect if the old file exists, if so use old-style names, otherwise use the correct names.
             masterWriter = new StoreObjectAccessorLocking(objectStore.newAccessor("/master"));
-            changeLogWriter = new StoreObjectAccessorLocking(objectStore.newAccessor("/change.log"));
+            if (masterWriter.get() != null) {
+                changeLogWriter = new StoreObjectAccessorLocking(objectStore.newAccessor("/change.log"));
+            } else {
+                masterWriter = new StoreObjectAccessorLocking(objectStore.newAccessor("master"));
+                changeLogWriter = new StoreObjectAccessorLocking(objectStore.newAccessor("change.log"));
+            }
         }
     }