[Swift-commit] r6915 - SwiftApps/Swift-MapRed/swift-t-simple/put-get

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Wed Aug 21 15:17:40 CDT 2013


Author: wozniak
Date: 2013-08-21 15:17:40 -0500 (Wed, 21 Aug 2013)
New Revision: 6915

Modified:
   SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
Log:
Check in for issue #529


Modified: SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift	2013-08-21 20:02:18 UTC (rev 6914)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift	2013-08-21 20:17:40 UTC (rev 6915)
@@ -1,43 +1,65 @@
 
 import io;
 import files;
+import location;
 import string;
 import sys;
 
-
-
 app (file t) list_files(string host, int port)
 {
-  "chirp" "-a" "hostname" (sprintf("%s:%i", host, port)) "ls"
+  "chirp" "-a" "hostname" (sprintf("%s:%i", host, port)) "ls" "/"
           @stdout=t;
 }
 
+app (file o) job(file i)
+{
+  "./job.sh" o i;
+}
+
 main
 {
-/*  string hosts_txt = argv("hosts");
+  string hosts_txt = argv("hosts");
   int port = toint(argv("port"));
 
   string hosts[] = split(read(input(hosts_txt)), "\n");
 
   string filenames[][];
 
+  location L[];
   foreach host,i in hosts
   {
     if (host != "")
     {
+      L[i] = hostmap_one_worker(host);
+    }
+  }
+
+  foreach host,i in hosts
+  {
+    if (host != "")
+    {
       printf("host: %s", host);
-      file t = list_files(host, port);
+      file t<sprintf("contents-%s.txt",host)> = list_files(host, port);
       string s = read(t);
-      string files[] = split(s, " ");
-      // foreach f,j in files
-      // {
-      //   if (f != "")
-      //   {
-      //     filenames[i][j] = f;
-      //   }
-      // }
+      string files[] = split(s, "\n");
+      foreach f,j in files
+      {
+        if (f != "" && find(f,".log", 0, 20) == -1)
+        {
+          // filenames[i][j] = f;
+
+          string g = replace(f, "f-", "g-", 0);
+          printf("host: %s file: %s %s", host, f, g);
+          file u_in = input_url(f);
+          file u_out<g>;
+          u_out = @location=L[i] job(u_in);
+        }
+      }
     }
   }
-*/
-  sleep(2);
+
+  // foreach d, k in filenames
+  // {
+  //       printf("k: %i", k);
+  // }
 }




More information about the Swift-commit mailing list