You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by te...@apache.org on 2014/07/28 18:40:08 UTC

git commit: SLIDER-253 Allow update action to modify settings for live cluster

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 3b565ba4d -> f90f4a3bf


SLIDER-253 Allow update action to modify settings for live cluster


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

Branch: refs/heads/develop
Commit: f90f4a3bfe9f365f3bb3a650ac6fbb479c7ebc12
Parents: 3b565ba
Author: tedyu <yu...@gmail.com>
Authored: Mon Jul 28 09:39:57 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Jul 28 09:39:57 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/slider/client/SliderClient.java    | 9 +++++----
 .../org/apache/slider/core/exceptions/ErrorStrings.java     | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/f90f4a3b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index 9deb9c3..40e01bb 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -463,7 +463,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
                                                YarnException,
                                                IOException {
 
-    buildInstanceDefinition(clustername, buildInfo, false);
+    buildInstanceDefinition(clustername, buildInfo, false, false);
     return EXIT_SUCCESS; 
   }
 
@@ -477,7 +477,7 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
    */
   public int actionUpdate(String clustername, AbstractClusterBuildingActionArgs buildInfo) throws
       YarnException, IOException {
-    buildInstanceDefinition(clustername, buildInfo, true);
+    buildInstanceDefinition(clustername, buildInfo, true, true);
     return EXIT_SUCCESS; 
   }
 
@@ -487,17 +487,18 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
    * @param clustername name of the cluster
    * @param buildInfo the arguments needed to build the cluster
    * @param overwrite true if existing cluster directory can be overwritten
+   * @param liveClusterAllowed true if live cluster can be modified
    * @throws YarnException
    * @throws IOException
    */
   
   public void buildInstanceDefinition(String clustername,
-      AbstractClusterBuildingActionArgs buildInfo, boolean overwrite)
+      AbstractClusterBuildingActionArgs buildInfo, boolean overwrite, boolean liveClusterAllowed)
         throws YarnException, IOException {
     // verify that a live cluster isn't there
     SliderUtils.validateClusterName(clustername);
     verifyBindingsDefined();
-    verifyNoLiveClusters(clustername);
+    if (!liveClusterAllowed) verifyNoLiveClusters(clustername);
 
     Configuration conf = getConfig();
     String registryQuorum = lookupZKQuorum();

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/f90f4a3b/slider-core/src/main/java/org/apache/slider/core/exceptions/ErrorStrings.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/core/exceptions/ErrorStrings.java b/slider-core/src/main/java/org/apache/slider/core/exceptions/ErrorStrings.java
index c949c1c..894f19b 100644
--- a/slider-core/src/main/java/org/apache/slider/core/exceptions/ErrorStrings.java
+++ b/slider-core/src/main/java/org/apache/slider/core/exceptions/ErrorStrings.java
@@ -20,7 +20,7 @@ package org.apache.slider.core.exceptions;
 
 public interface ErrorStrings {
   String E_UNSTABLE_CLUSTER = "Unstable Application Instance :";
-  String E_CLUSTER_RUNNING = "Application Instance  lready running";
+  String E_CLUSTER_RUNNING = "Application Instance already running";
   String E_ALREADY_EXISTS = "already exists";
   String PRINTF_E_INSTANCE_ALREADY_EXISTS = "Application Instance \"%s\" already exists and is defined in %s";
   String PRINTF_E_INSTANCE_DIR_ALREADY_EXISTS = "Application Instance dir already exists: %s";