storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: STORM-2324 : Making sure toplogy deployment does not break if resources directory is missing in topology jar. UT fixes
Date Fri, 03 Feb 2017 02:23:43 GMT
Repository: storm
Updated Branches:
  refs/heads/master 2d9543c18 -> e8c390059


STORM-2324 : Making sure toplogy deployment does not break if resources directory is missing
in topology jar. UT fixes


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

Branch: refs/heads/master
Commit: ab430f5efa1b3df26319fef6e85b0944106d7823
Parents: 9947dd1
Author: Roshan Naik <roshan@hortonworks.com>
Authored: Thu Feb 2 16:17:15 2017 -0800
Committer: Roshan Naik <roshan@hortonworks.com>
Committed: Thu Feb 2 16:21:11 2017 -0800

----------------------------------------------------------------------
 .../org/apache/storm/daemon/supervisor/Container.java  | 13 ++++++++++---
 .../apache/storm/daemon/supervisor/ContainerTest.java  |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/ab430f5e/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java
index e370bc4..9f41682 100644
--- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java
+++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java
@@ -414,12 +414,19 @@ public abstract class Container implements Killable {
                 blobFileNames.add(ret);
             }
         }
+        File targetResourcesDir = new File(stormRoot, ConfigUtils.RESOURCES_SUBDIR);
         List<String> resourceFileNames = new ArrayList<>();
-        resourceFileNames.add(ConfigUtils.RESOURCES_SUBDIR);
+        if (targetResourcesDir.exists()) {
+            resourceFileNames.add(ConfigUtils.RESOURCES_SUBDIR);
+        }
         resourceFileNames.addAll(blobFileNames);
+
         LOG.info("Creating symlinks for worker-id: {} storm-id: {} for files({}): {}", _workerId,
_topologyId, resourceFileNames.size(), resourceFileNames);
-        _ops.createSymlink(new File(workerRoot, ConfigUtils.RESOURCES_SUBDIR), 
-                new File(stormRoot, ConfigUtils.RESOURCES_SUBDIR));
+        if(targetResourcesDir.exists()) {
+            _ops.createSymlink(new File(workerRoot, ConfigUtils.RESOURCES_SUBDIR),  targetResourcesDir
);
+        } else {
+            LOG.info("Topology jar for worker-id: {} storm-id: {} does not contain re sources
directory {}." , _workerId, _topologyId, targetResourcesDir.toString() );
+        }
         for (String fileName : blobFileNames) {
             _ops.createSymlink(new File(workerRoot, fileName),
                     new File(stormRoot, fileName));

http://git-wip-us.apache.org/repos/asf/storm/blob/ab430f5e/storm-core/test/jvm/org/apache/storm/daemon/supervisor/ContainerTest.java
----------------------------------------------------------------------
diff --git a/storm-core/test/jvm/org/apache/storm/daemon/supervisor/ContainerTest.java b/storm-core/test/jvm/org/apache/storm/daemon/supervisor/ContainerTest.java
index b1adcd8..b6806c8 100644
--- a/storm-core/test/jvm/org/apache/storm/daemon/supervisor/ContainerTest.java
+++ b/storm-core/test/jvm/org/apache/storm/daemon/supervisor/ContainerTest.java
@@ -216,7 +216,7 @@ public class ContainerTest {
         verify(ops).createSymlink(new File(workerRoot, "artifacts"), workerArtifacts);
         
         //Create links to blobs 
-        verify(ops).createSymlink(new File(workerRoot, "resources"), new File(distRoot, "resources"));
+        verify(ops, never()).createSymlink(new File(workerRoot, "resources"), new File(distRoot,
"resources"));
     }
     
     @Test


Mime
View raw message