SLIDER-149 add PersistencePolicy

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

Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry
Commit: c5fb4f040bd0727426405815a6aba8542c07aa2d
Parents: 4cbc9fe
Author: Steve Loughran <ste...@apache.org>
Authored: Fri Aug 29 17:49:03 2014 +0100
Committer: Steve Loughran <ste...@apache.org>
Committed: Fri Aug 29 17:49:03 2014 +0100

----------------------------------------------------------------------
 .../org/apache/slider/server/appmaster/SliderAppMaster.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/c5fb4f04/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
----------------------------------------------------------------------
diff --git 
a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
 
b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
index a2545ab..e80a362 100644
--- 
a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
+++ 
b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
@@ -53,6 +53,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.exceptions.YarnException;
 import org.apache.hadoop.yarn.ipc.YarnRPC;
 import 
org.apache.hadoop.yarn.registry.client.services.RegistryOperationsService;
+import org.apache.hadoop.yarn.registry.client.types.PersistencePolicies;
 import org.apache.hadoop.yarn.registry.client.types.ServiceRecord;
 import org.apache.hadoop.yarn.registry.client.binding.RegistryTypeUtils;
 import 
org.apache.hadoop.yarn.registry.server.services.ResourceManagerRegistryService;
@@ -165,9 +166,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.ReentrantLock;
 
-import static 
org.apache.slider.server.appmaster.web.rest.RestPaths.WS_AGENT_CONTEXT_ROOT;
-import static 
org.apache.slider.server.appmaster.web.rest.RestPaths.WS_CONTEXT_ROOT;
-
 /**
  * This is the AM, which directly implements the callbacks from the AM and NM
  */
@@ -989,7 +987,7 @@ public class SliderAppMaster extends 
AbstractSliderLaunchedService
 
   /**
    * Handler for {@link RegisterComponentInstance action}
-   * Register/re-register a component (that is already in the app state
+   * Register/re-register an ephemeral container that is already in the app 
state
    * @param id the component
    * @param description
    */
@@ -1004,7 +1002,8 @@ public class SliderAppMaster extends 
AbstractSliderLaunchedService
     String cid = RegistryTypeUtils.yarnIdToDnsId(id.toString());
     ServiceRecord container = new ServiceRecord(
         cid,
-        description);
+        description,
+        PersistencePolicies.EPHEMERAL);
     try {
       yarnRegistryOperations.putComponent(cid, container, true);
     } catch (IOException e) {

Reply via email to