[Swift-commit] r7904 - trunk/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Jun 3 15:38:32 CDT 2014


Author: hategan
Date: 2014-06-03 15:38:32 -0500 (Tue, 03 Jun 2014)
New Revision: 7904

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/GetStagingInfo.java
Log:
allow duplicate files in stage-ins

Modified: trunk/src/org/griphyn/vdl/karajan/lib/GetStagingInfo.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/GetStagingInfo.java	2014-06-03 04:37:24 UTC (rev 7903)
+++ trunk/src/org/griphyn/vdl/karajan/lib/GetStagingInfo.java	2014-06-03 20:38:32 UTC (rev 7904)
@@ -54,9 +54,9 @@
     
     private static class Info {
         Set<String> remoteDirNames = Collections.emptySet();
-        List<AbsFile> inFiles = Collections.emptyList();
-        List<AbsFile> outFiles = Collections.emptyList();
-        List<AbsFile> collectPatterns = Collections.emptyList();
+        Set<AbsFile> inFiles = Collections.emptySet();
+        Set<AbsFile> outFiles = Collections.emptySet();
+        Set<AbsFile> collectPatterns = Collections.emptySet();
     }
 
     @Override
@@ -74,15 +74,13 @@
         catch (HandleOpenException e) {
         	throw new ExecutionException(e.getMessage(), e);
         }
-        ret.add(info.remoteDirNames);
-        ret.add(info.inFiles);
-        ret.add(info.outFiles);
-        ret.add(info.collectPatterns);
+        ret.add(new ArrayList<String>(info.remoteDirNames));
+        ret.add(new ArrayList<AbsFile>(info.inFiles));
+        ret.add(new ArrayList<AbsFile>(info.outFiles));
+        ret.add(new ArrayList<AbsFile>(info.collectPatterns));
         return null;
     }
 
-
-
     private void addPaths(Info info, Collection<DSHandle> vars, boolean out) throws HandleOpenException {
     	for (DSHandle var : vars) {
     	    if (!var.getType().hasMappedComponents()) {
@@ -118,7 +116,7 @@
     }
 
 
-    private List<AbsFile> addOne(AbsFile f, Info info, List<AbsFile> files) {
+    private Set<AbsFile> addOne(AbsFile f, Info info, Set<AbsFile> files) {
         String dir = f.getDirectory();
         if (dir != null) {
             if (info.remoteDirNames.isEmpty()) {
@@ -127,13 +125,12 @@
             info.remoteDirNames.add(remoteDir(f, dir));
         }
         if (files.isEmpty()) {
-            files = new ArrayList<AbsFile>();
+            files = new HashSet<AbsFile>();
         }
         files.add(f);
         return files;
     }
 
-
     private Mapper getMapper(DSHandle var) {
         Mapper m = var.getMapper();
         if (m == null) {
@@ -142,7 +139,6 @@
         return m;
     }
 
-
     private String remoteDir(AbsFile f, String dir) {
         if ("file".equals(f.getProtocol())) {
             return PathUtils.remotePathName(dir);




More information about the Swift-commit mailing list