[Swift-commit] r8002 - trunk/src/org/griphyn/vdl/util
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Sat Jul 12 02:08:05 CDT 2014
Author: hategan
Date: 2014-07-12 02:08:04 -0500 (Sat, 12 Jul 2014)
New Revision: 8002
Modified:
trunk/src/org/griphyn/vdl/util/ConvertConfig.java
trunk/src/org/griphyn/vdl/util/SwiftConfig.java
Log:
changed the semantics of "local" staging on coasters to be that of "proxy" and removed "proxy". The idea would be to have an option that works universally with a provider that supports staging (currently local and coasters). The meaning of "local" is taken to be "stage files from the site where swift runs"
Modified: trunk/src/org/griphyn/vdl/util/ConvertConfig.java
===================================================================
--- trunk/src/org/griphyn/vdl/util/ConvertConfig.java 2014-07-12 06:41:07 UTC (rev 8001)
+++ trunk/src/org/griphyn/vdl/util/ConvertConfig.java 2014-07-12 07:08:04 UTC (rev 8002)
@@ -119,7 +119,7 @@
}
if (name.equals("use.provider.staging")) {
if (TypeUtil.toBoolean(value)) {
- ps.println("staging: \"provider\"");
+ ps.println("staging: \"local\"");
}
return;
}
@@ -181,7 +181,7 @@
}
}
if (!hasFileService) {
- writeValue(1, "site.*.staging", "proxy", ps);
+ writeValue(1, "site.*.staging", "local", ps);
}
if (bc.hasProperty("workdir")) {
writeValue(1, "site.*.workDirectory", bc.getProperty("workdir"), ps);
Modified: trunk/src/org/griphyn/vdl/util/SwiftConfig.java
===================================================================
--- trunk/src/org/griphyn/vdl/util/SwiftConfig.java 2014-07-12 06:41:07 UTC (rev 8001)
+++ trunk/src/org/griphyn/vdl/util/SwiftConfig.java 2014-07-12 07:08:04 UTC (rev 8002)
@@ -12,7 +12,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -475,29 +474,39 @@
String staging = getString(n);
if (BUILD_CHECK) {
checkValue("site.*.staging",
- "swift", "wrapper", "local", "service-local", "proxy", "shared-fs");
+ "swift", "wrapper", "local", "service-local", "shared-fs");
}
if (staging.equals("swift") || staging.equals("wrapper")) {
sc.setProperty("staging", staging);
}
else if (staging.equals("local")) {
sc.setProperty("staging", "provider");
- sc.setProperty("stagingMethod", "file");
+ if (isCoaster(sc)) {
+ sc.setProperty("stagingMethod", "proxy");
+ }
+ else {
+ sc.setProperty("stagingMethod", "file");
+ }
}
else if (staging.equals("service-local")) {
sc.setProperty("staging", "provider");
sc.setProperty("stagingMethod", "file");
}
- else if (staging.equals("proxy")) {
- sc.setProperty("staging", "provider");
- sc.setProperty("stagingMethod", "proxy");
- }
else if (staging.equals("shared-fs")) {
sc.setProperty("staging", "provider");
sc.setProperty("stagingMethod", "sfs");
}
}
+ private boolean isCoaster(SwiftContact sc) {
+ for (Map.Entry<BoundContact.TypeProviderPair, Service> e : sc.getServices().entrySet()) {
+ if (e.getKey().provider != null && e.getKey().type == Service.EXECUTION) {
+ return e.getKey().provider.startsWith("coaster");
+ }
+ }
+ return false;
+ }
+
private void checkValue(String key, String... values) {
SwiftConfigSchema.Info i = SCHEMA.getInfo(key);
if (i == null) {
More information about the Swift-commit
mailing list