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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Dec 4 11:11:56 CST 2008


Author: hategan
Date: 2008-12-04 11:11:54 -0600 (Thu, 04 Dec 2008)
New Revision: 2357

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/JobConstraints.java
Log:
pass list of required files

Modified: trunk/src/org/griphyn/vdl/karajan/lib/JobConstraints.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/JobConstraints.java	2008-12-04 15:45:08 UTC (rev 2356)
+++ trunk/src/org/griphyn/vdl/karajan/lib/JobConstraints.java	2008-12-04 17:11:54 UTC (rev 2357)
@@ -9,19 +9,32 @@
 import org.globus.cog.karajan.util.TypeUtil;
 import org.globus.cog.karajan.workflow.ExecutionException;
 import org.griphyn.vdl.util.FQN;
+import java.util.Collection;
+import org.griphyn.vdl.karajan.lib.cache.CacheMapAdapter;
 
 public class JobConstraints extends VDLFunction {
 	public static final Arg A_TR = new Arg.Positional("tr");
-
+	public static final Arg STAGE_IN = new Arg.Optional("stagein");
+	
 	static {
-		setArguments(JobConstraints.class, new Arg[] { A_TR });
+		setArguments(JobConstraints.class, new Arg[] { A_TR, STAGE_IN });
 	}
+	
+	private static final String[] STRING_ARRAY = new String[0];
 
 	public Object function(VariableStack stack) throws ExecutionException {
 		String tr = TypeUtil.toString(A_TR.getValue(stack));
+		String[] filenames = null;
+		if (STAGE_IN.isPresent(stack)) {
+			filenames = (String[]) ((Collection) STAGE_IN.getValue(stack)).toArray(STRING_ARRAY);
+		}
 		TaskConstraints tc = new TaskConstraints();
 		tc.addConstraint("tr", tr);
 		tc.addConstraint("trfqn", new FQN(tr));
+		if (filenames != null) {
+			tc.addConstraint("filenames", filenames);
+			tc.addConstraint("filecache", new CacheMapAdapter(CacheFunction.getCache(stack)));
+		}
 		return tc;
 	}
 }




More information about the Swift-commit mailing list