knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject knox git commit: KNOX-657 - _default Topology Must Redeploy After Restart
Date Wed, 27 Jan 2016 03:26:28 GMT
Repository: knox
Updated Branches:
  refs/heads/master aba0f0b13 -> 2c18dd898


KNOX-657 - _default Topology Must Redeploy After Restart

Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/2c18dd89
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/2c18dd89
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/2c18dd89

Branch: refs/heads/master
Commit: 2c18dd898623e707ac382ab680b2501283ebd722
Parents: aba0f0b
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Tue Jan 26 22:26:05 2016 -0500
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Tue Jan 26 22:26:05 2016 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/gateway/GatewayServer.java     | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/2c18dd89/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
index c191324..21fb9ea 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
@@ -462,16 +462,13 @@ public class GatewayServer {
           File tmp = war.as( ExplodedExporter.class ).exportExploded( deployDir, warDir.getName()
+ ".tmp" );
           tmp.renameTo( warDir );
           internalDeploy( topology, warDir );
-          if (topology.getName().equals(config.getDefaultTopologyName())) {
-            topology.setName("_default");
-            handleCreateDeployment(topology, deployDir);
-            topology.setName(config.getDefaultTopologyName());
-          }
+          handleDefaultTopology(topology, deployDir);
           log.deployedTopology( topology.getName());
         } else {
           auditor.audit( Action.REDEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.UNAVAILABLE
);
           log.redeployingTopology( topology.getName(), warDir.getAbsolutePath() );
           internalDeploy( topology, warDir );
+          handleDefaultTopology(topology, deployDir);
           log.redeployedTopology( topology.getName() );
         }
       } catch( Throwable e ) {
@@ -480,6 +477,14 @@ public class GatewayServer {
       }
     }
 
+    public void handleDefaultTopology(Topology topology, File deployDir) {
+      if (topology.getName().equals(config.getDefaultTopologyName())) {
+        topology.setName("_default");
+        handleCreateDeployment(topology, deployDir);
+        topology.setName(config.getDefaultTopologyName());
+      }
+    }
+
   }
 
   private static File calculateAbsoluteTopologiesDir( GatewayConfig config ) {


Mime
View raw message