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:49 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch a79784010 -> fa436e132


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/684d8b53
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/684d8b53
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/684d8b53

Branch: refs/heads/1.x-branch
Commit: 684d8b531cf1a05e5a3b921c39e24e6e4d6d3bab
Parents: 85ac6b8
Author: Roshan Naik <roshan@hortonworks.com>
Authored: Thu Feb 2 15:47:20 2017 -0800
Committer: Roshan Naik <roshan@hortonworks.com>
Committed: Thu Feb 2 15:47:20 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/storm/blob/684d8b53/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 f4eb5e0..3f86b79 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
@@ -410,12 +410,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/684d8b53/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 3f34552..0958d4d 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
@@ -213,9 +213,9 @@ public class ContainerTest {
         
         //Create links to artifacts dir
         verify(ops).createSymlink(new File(workerRoot, "artifacts"), workerArtifacts);
-        
-        //Create links to blobs 
-        verify(ops).createSymlink(new File(workerRoot, "resources"), new File(distRoot, "resources"));
+
+        //Create links to blobs
+        verify(ops, never()).createSymlink(new File(workerRoot, "resources"), new File(distRoot,
"resources"));
     }
     
     @Test


Mime
View raw message