Repository: brooklyn-server
Updated Branches:
  refs/heads/master f8eb654c7 -> b87c20b18


cleanOrphanedState: minor tidies

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

Branch: refs/heads/master
Commit: f2f635704c67b4ff0575e2b0950875a46426a2c1
Parents: f8eb654
Author: Aled Sage <aled.s...@gmail.com>
Authored: Thu Jul 21 09:18:51 2016 +0100
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Thu Jul 21 09:18:51 2016 +0100

----------------------------------------------------------------------
 .../brooklyn/launcher/common/BasicLauncher.java |  2 +-
 .../BrooklynLauncherCleanStateTest.java         |  2 +-
 .../CleanOrphanedLocationsIntegrationTest.java  |  2 +-
 .../main/java/org/apache/brooklyn/cli/Main.java | 21 ++++++++------------
 4 files changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f2f63570/launcher-common/src/main/java/org/apache/brooklyn/launcher/common/BasicLauncher.java
----------------------------------------------------------------------
diff --git 
a/launcher-common/src/main/java/org/apache/brooklyn/launcher/common/BasicLauncher.java
 
b/launcher-common/src/main/java/org/apache/brooklyn/launcher/common/BasicLauncher.java
index e328d61..825e228 100644
--- 
a/launcher-common/src/main/java/org/apache/brooklyn/launcher/common/BasicLauncher.java
+++ 
b/launcher-common/src/main/java/org/apache/brooklyn/launcher/common/BasicLauncher.java
@@ -383,7 +383,7 @@ public class BasicLauncher<T extends BasicLauncher<T>> {
         }
     }
 
-    public void cleanOrphanedLocations(String destinationDir, @Nullable String 
destinationLocationSpec) {
+    public void cleanOrphanedState(String destinationDir, @Nullable String 
destinationLocationSpec) {
         copyPersistedState(destinationDir, destinationLocationSpec, 
DeleteOrphanedStateTransformer.builder().build());
     }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f2f63570/launcher/src/test/java/org/apache/brooklyn/launcher/BrooklynLauncherCleanStateTest.java
----------------------------------------------------------------------
diff --git 
a/launcher/src/test/java/org/apache/brooklyn/launcher/BrooklynLauncherCleanStateTest.java
 
b/launcher/src/test/java/org/apache/brooklyn/launcher/BrooklynLauncherCleanStateTest.java
index 25d23d5..e1979ec 100644
--- 
a/launcher/src/test/java/org/apache/brooklyn/launcher/BrooklynLauncherCleanStateTest.java
+++ 
b/launcher/src/test/java/org/apache/brooklyn/launcher/BrooklynLauncherCleanStateTest.java
@@ -82,7 +82,7 @@ public class BrooklynLauncherCleanStateTest extends 
AbstractBrooklynLauncherRebi
             BrooklynLauncher launcher = newLauncherDefault(PersistMode.AUTO)
                     .highAvailabilityMode(HighAvailabilityMode.MASTER)
                     .webconsole(false);
-            launcher.cleanOrphanedLocations(destination, destinationLocation);
+            launcher.cleanOrphanedState(destination, destinationLocation);
             launcher.terminate();
 
             // Sanity checks (copied from 
BrooklynLauncherRebindTestToFiles#testCopyPersistedState)

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f2f63570/launcher/src/test/java/org/apache/brooklyn/launcher/CleanOrphanedLocationsIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/launcher/src/test/java/org/apache/brooklyn/launcher/CleanOrphanedLocationsIntegrationTest.java
 
b/launcher/src/test/java/org/apache/brooklyn/launcher/CleanOrphanedLocationsIntegrationTest.java
index e59e526..89f677e 100644
--- 
a/launcher/src/test/java/org/apache/brooklyn/launcher/CleanOrphanedLocationsIntegrationTest.java
+++ 
b/launcher/src/test/java/org/apache/brooklyn/launcher/CleanOrphanedLocationsIntegrationTest.java
@@ -191,7 +191,7 @@ public class CleanOrphanedLocationsIntegrationTest {
                 .highAvailabilityMode(HighAvailabilityMode.DISABLED);
 
         try {
-            launcher.cleanOrphanedLocations(destinationDir, null);
+            launcher.cleanOrphanedState(destinationDir, null);
         } catch (Exception e) {
             throw new Exception(e);
         } finally {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f2f63570/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
----------------------------------------------------------------------
diff --git a/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java 
b/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
index 53a7829..140916a 100644
--- a/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
+++ b/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java
@@ -827,8 +827,8 @@ public class Main extends AbstractMain {
         }
     }
 
-    @Command(name = "clean-orphaned-locations", description = "Removes 
existing orphaned locations")
-    public static class CleanOrphanedLocationsCommand extends 
BrooklynCommandCollectingArgs {
+    @Command(name = "clean-orphaned-state", description = "Removes existing 
orphaned persisted state (e.g. locations, policies, enrichers and feeds)")
+    public static class CleanOrphanedStateCommand extends 
BrooklynCommandCollectingArgs {
 
         @Option(name = { "--localBrooklynProperties" }, title = "local 
brooklyn.properties file",
                 description = "local brooklyn.properties file, specific to 
this launch (appending to and overriding global properties)")
@@ -843,29 +843,24 @@ public class Main extends AbstractMain {
         public String persistenceLocation;
 
         @Option(name = { "--destinationDir" }, required = true, title = 
"destination dir",
-                description = "The directory to copy persistence data to 
without orphaned locations")
+                description = "The directory to copy persistence data to, with 
orphaned state removed")
         public String destinationDir;
 
         @Option(name = { "--destinationLocation" }, title = "persistence 
location",
                 description = "The location spec for an object store to copy 
data to")
         public String destinationLocation;
 
-        @Option(name = { "--transformations" }, title = "transformations",
-                description = "local transformations file, to be applied to 
the copy of the data before uploading it")
-        public String transformations;
-
         @Override
         public Void call() throws Exception {
-            checkNotNull(destinationDir, "orphanedReferencesTmpDir");
+            checkNotNull(destinationDir, "destinationDir");
 
             BrooklynLauncher launcher;
             failIfArguments();
 
             try {
-                log.info("Retrieving and copying persisted state to " + 
destinationDir + " without orphaned locations");
-
+                log.info("Retrieving and copying persisted state to " + 
destinationDir + " with orphaned state deleted");
 
-                PersistMode persistMode = PersistMode.AUTO;
+                PersistMode persistMode = PersistMode.REBIND;
                 HighAvailabilityMode highAvailabilityMode = 
HighAvailabilityMode.DISABLED;
 
                 launcher = BrooklynLauncher.newInstance()
@@ -883,7 +878,7 @@ public class Main extends AbstractMain {
             }
 
             try {
-                launcher.cleanOrphanedLocations(destinationDir, 
destinationLocation);
+                launcher.cleanOrphanedState(destinationDir, 
destinationLocation);
             } catch (FatalRuntimeException e) {
                 throw e;
             } catch (Exception e) {
@@ -1007,7 +1002,7 @@ public class Main extends AbstractMain {
                         HelpCommand.class,
                         cliInfoCommand(),
                         GeneratePasswordCommand.class,
-                        CleanOrphanedLocationsCommand.class,
+                        CleanOrphanedStateCommand.class,
                         CopyStateCommand.class,
                         ListAllCommand.class,
                         cliLaunchCommand()

Reply via email to