[Swift-commit] r2789 - usertools/cio/bin

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Mar 31 13:59:56 CDT 2009


Author: aespinosa
Date: 2009-03-31 13:59:55 -0500 (Tue, 31 Mar 2009)
New Revision: 2789

Removed:
   usertools/cio/bin/toruscp.sh
Modified:
   usertools/cio/bin/hashserver.rb
Log:
Modified hashserver to accept multiple values per key.  HashServer.get now returns a random element node from that list

Modified: usertools/cio/bin/hashserver.rb
===================================================================
--- usertools/cio/bin/hashserver.rb	2009-03-31 02:41:22 UTC (rev 2788)
+++ usertools/cio/bin/hashserver.rb	2009-03-31 18:59:55 UTC (rev 2789)
@@ -6,15 +6,15 @@
   attr_reader :file
 
   def initialize
-    @file = {}
+    @file = Hash.new([])
   end
 
   def put(fname, rank)
-    @file[fname] = rank
+    @file[fname].push(rank)
   end
 
   def get(fname)
-    @file[fname]
+    @file[fname][ rand( @file[fname].size ) ]
   end
 
 end

Deleted: usertools/cio/bin/toruscp.sh
===================================================================
--- usertools/cio/bin/toruscp.sh	2009-03-31 02:41:22 UTC (rev 2788)
+++ usertools/cio/bin/toruscp.sh	2009-03-31 18:59:55 UTC (rev 2789)
@@ -1,18 +0,0 @@
-#!/fuse/bin/bash
-
-if [ -z "$2" ]; then
-    echo "usage: $0 <FileName> <Path>"
-    echo "usage: $0 hello /dev/shm"
-    exit 1
-fi
-
-FILENAME=$1
-FILEPATH=$2
-echo "Full name : $FILENAME"
-FILE=`basename $FILENAME`
-echo "FILE name: $FILENAME"
-RANK=`/home/zzhang/cio/bin/chtget.rb $FILENAME`
-echo "RANK: $RANK"
-IP=`/home/zzhang/cio/bin/ipcal 10.128.0.0 $RANK`
-echo "IP: $IP"
-/home/zzhang/chirp/bin/chirp_get -a address $IP $FILE $FILEPATH/$FILE




More information about the Swift-commit mailing list