From 0cfbc88018d921b1983160f63c8a2e812ce9cdbb Mon Sep 17 00:00:00 2001 From: jihoonl Date: Tue, 2 Feb 2010 00:35:24 +0000 Subject: [PATCH] well.. --- .../{LookUpService.java => FileSystem.java} | 38 ++++++++++--------- .../Benchmarks/Recovery/FileSystem/dstm.conf | 3 ++ .../Benchmarks/Recovery/FileSystem/makefile | 2 +- .../Recovery/SpamFilter/SpamFilter.java | 2 + .../Benchmarks/Recovery/Spider/QueryTask.java | 10 +++++ .../Benchmarks/Recovery/Spider/Spider.java | 31 ++++++++++++--- .../src/Benchmarks/Recovery/Spider/dstm.conf | 10 ++--- .../src/Benchmarks/Recovery/Spider/makefile | 2 +- Robust/src/Benchmarks/Recovery/bm_args.txt | 2 +- Robust/src/Benchmarks/Recovery/runjava.sh | 2 +- 10 files changed, 70 insertions(+), 32 deletions(-) rename Robust/src/Benchmarks/Recovery/FileSystem/{LookUpService.java => FileSystem.java} (83%) create mode 100644 Robust/src/Benchmarks/Recovery/FileSystem/dstm.conf diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/LookUpService.java b/Robust/src/Benchmarks/Recovery/FileSystem/FileSystem.java similarity index 83% rename from Robust/src/Benchmarks/Recovery/FileSystem/LookUpService.java rename to Robust/src/Benchmarks/Recovery/FileSystem/FileSystem.java index 39333501..d3f7f8f6 100644 --- a/Robust/src/Benchmarks/Recovery/FileSystem/LookUpService.java +++ b/Robust/src/Benchmarks/Recovery/FileSystem/FileSystem.java @@ -1,22 +1,22 @@ /* Usage : - ./LookupService.bin + ./FileSystem.bin */ -public class LookUpService extends Thread { +public class FileSystem extends Thread { DistributedHashMap dir; DistributedHashMap fs; GlobalString inputfile; int mid; - public LookUpService(DistributedHashMap dir, DistributedHashMap fs) { + public FileSystem(DistributedHashMap dir, DistributedHashMap fs) { this.dir = dir; this.fs = fs; } - public LookUpService(DistributedHashMap dir, DistributedHashMap fs, String filename, int mid) { + public FileSystem(DistributedHashMap dir, DistributedHashMap fs, String filename, int mid) { this.dir = dir; this.fs = fs; this.mid = mid; @@ -255,16 +255,20 @@ public class LookUpService extends Thread { filename = args[1]; int[] mid = new int[8]; - mid[0] = (128<<24)|(195<<16)|(180<<8)|21;//dw-2 -// mid[1] = (128<<24)|(195<<16)|(180<<8)|24;//dw-5 +/* mid[0] = (128<<24)|(195<<16)|(180<<8)|21;//dw-2 mid[1] = (128<<24)|(195<<16)|(180<<8)|26;//dw-7 -// mid[0] = (128<<24)|(195<<16)|(136<<8)|165;//dc-4 -// mid[1] = (128<<24)|(195<<16)|(136<<8)|166;//dc-5 -// mid[2] = (128<<24)|(195<<16)|(136<<8)|167;//dc-6 -// mid[3] = (128<<24)|(195<<16)|(136<<8)|168;//dc-7 - - LookUpService[] lus; - LookUpService initLus; +*/ + mid[0] = (128<<24)|(195<<16)|(136<<8)|162;//dc-1 + mid[1] = (128<<24)|(195<<16)|(136<<8)|163;//dc-2 + mid[2] = (128<<24)|(195<<16)|(136<<8)|164;//dc-3 + mid[3] = (128<<24)|(195<<16)|(136<<8)|165;//dc-4 + mid[4] = (128<<24)|(195<<16)|(136<<8)|166;//dc-5 + mid[5] = (128<<24)|(195<<16)|(136<<8)|167;//dc-6 + mid[6] = (128<<24)|(195<<16)|(136<<8)|168;//dc-7 + mid[7] = (128<<24)|(195<<16)|(136<<8)|169;//dc-8 + + FileSystem[] lus; + FileSystem initLus; Work[] works; Transaction[] currentWorkList; // type might be something else @@ -276,16 +280,16 @@ public class LookUpService extends Thread { DistributedHashMap fs = global new DistributedHashMap(500, 500, 0.75f); DistributedHashMap dir = global new DistributedHashMap(500, 500, 0.75f); - initLus = global new LookUpService(dir, fs); + initLus = global new FileSystem(dir, fs); initLus.init(); - lus = global new LookUpService[NUM_THREADS]; + lus = global new FileSystem[NUM_THREADS]; for(int i = 0; i < NUM_THREADS; i++) { - lus[i] = global new LookUpService(initLus.dir, initLus.fs, filename, i); + lus[i] = global new FileSystem(initLus.dir, initLus.fs, filename, i); } } - LookUpService tmp; + FileSystem tmp; /* Start threads */ for(int i = 0; i < NUM_THREADS; i++) { atomic { diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/dstm.conf b/Robust/src/Benchmarks/Recovery/FileSystem/dstm.conf new file mode 100644 index 00000000..74a1e24c --- /dev/null +++ b/Robust/src/Benchmarks/Recovery/FileSystem/dstm.conf @@ -0,0 +1,3 @@ +128.195.180.21 +#128.195.180.24 +128.195.180.26 diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/makefile b/Robust/src/Benchmarks/Recovery/FileSystem/makefile index 260b37a4..07625ee5 100644 --- a/Robust/src/Benchmarks/Recovery/FileSystem/makefile +++ b/Robust/src/Benchmarks/Recovery/FileSystem/makefile @@ -1,4 +1,4 @@ -MAINCLASS=LookUpService +MAINCLASS=FileSystem SRC1=${MAINCLASS}.java FLAGS= -recoverystats -dsm -dsmtask -32bit -recovery -nooptimize -mainclass ${MAINCLASS} default: diff --git a/Robust/src/Benchmarks/Recovery/SpamFilter/SpamFilter.java b/Robust/src/Benchmarks/Recovery/SpamFilter/SpamFilter.java index db426964..32df643f 100644 --- a/Robust/src/Benchmarks/Recovery/SpamFilter/SpamFilter.java +++ b/Robust/src/Benchmarks/Recovery/SpamFilter/SpamFilter.java @@ -113,6 +113,8 @@ public class SpamFilter extends Thread { // Sanity check // System.out.println((i)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails)); System.out.println("\n\n\n I'm Done\n\n\n"); + + RecoveryStat.printRecoveryStat(); } public static void main(String[] args) { diff --git a/Robust/src/Benchmarks/Recovery/Spider/QueryTask.java b/Robust/src/Benchmarks/Recovery/Spider/QueryTask.java index 2cb1145c..34415df8 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/QueryTask.java +++ b/Robust/src/Benchmarks/Recovery/Spider/QueryTask.java @@ -81,6 +81,14 @@ public class QueryTask extends Task { s.close(); } } + + public void output() { + + System.out.println("size = " + results.size()); + + + } + public static boolean isDocument(String str) { int index = str.lastindexOf('.'); @@ -97,6 +105,8 @@ public class QueryTask extends Task { else if ((str.subString(index+1)).equals("docx")) return true; else if ((str.subString(index+1)).equals("mov")) return true; else if ((str.subString(index+1)).equals("flv")) return true; + else if ((str.subString(index+1)).equals("tar")) return true; + else if ((str.subString(index+1)).equals("tgz")) return true; else return false; } return false; diff --git a/Robust/src/Benchmarks/Recovery/Spider/Spider.java b/Robust/src/Benchmarks/Recovery/Spider/Spider.java index e86229ce..b9ec3df8 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/Spider.java +++ b/Robust/src/Benchmarks/Recovery/Spider/Spider.java @@ -1,3 +1,9 @@ +/* +Usage : + ./Spider.java master +*/ + + public class Spider { public static void main(String[] args) { int NUM_THREADS = 3; @@ -7,14 +13,27 @@ public class Spider { Work[] works; QueryTask[] qt; GlobalQuery[] currentWorkList; + String fm = "www.uci.edu"; + String fp = ""; - NUM_THREADS = Integer.parseInt(args[0]); + if(args.length != 4) { + System.out.println("./Spider.java master "); + System.exit(0); + } + else { + NUM_THREADS = Integer.parseInt(args[0]); + fm = args[1]; + fp = args[2]; + maxDepth = Integer.parseInt(args[3]); + } GlobalString firstmachine; GlobalString firstpage; int mid[] = new int[8]; - mid[0] = (128<<24)|(195<<16)|(136<<8)|162; + mid[0] = (128<<24)|(195<<16)|(180<<8)|21; + mid[1] = (128<<24)|(195<<16)|(180<<8)|26; +/* mid[0] = (128<<24)|(195<<16)|(136<<8)|162; mid[1] = (128<<24)|(195<<16)|(136<<8)|163; mid[2] = (128<<24)|(195<<16)|(136<<8)|164; mid[3] = (128<<24)|(195<<16)|(136<<8)|165; @@ -22,15 +41,15 @@ public class Spider { mid[5] = (128<<24)|(195<<16)|(136<<8)|167; mid[6] = (128<<24)|(195<<16)|(136<<8)|168; mid[7] = (128<<24)|(195<<16)|(136<<8)|169; - + */ atomic { - firstmachine = global new GlobalString(args[1]); + firstmachine = global new GlobalString(fm); if (args.length == 3) { - firstpage = global new GlobalString(args[2]); + firstpage = global new GlobalString(fp); } else firstpage = global new GlobalString("");; - + works = global new Work[NUM_THREADS]; qt = global new QueryTask[NUM_THREADS]; currentWorkList = global new GlobalQuery[NUM_THREADS]; diff --git a/Robust/src/Benchmarks/Recovery/Spider/dstm.conf b/Robust/src/Benchmarks/Recovery/Spider/dstm.conf index eff447b8..28d63559 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/dstm.conf +++ b/Robust/src/Benchmarks/Recovery/Spider/dstm.conf @@ -1,6 +1,6 @@ -#128.195.180.21 +128.195.180.21 #128.195.180.24 -#128.195.180.26 -128.195.136.162 -128.195.136.163 -128.195.136.164 +128.195.180.26 +#128.195.136.162 +#128.195.136.163 +#128.195.136.164 diff --git a/Robust/src/Benchmarks/Recovery/Spider/makefile b/Robust/src/Benchmarks/Recovery/Spider/makefile index 8077da54..7bed2f63 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/makefile +++ b/Robust/src/Benchmarks/Recovery/Spider/makefile @@ -3,7 +3,7 @@ SUBCLASS=Query SRC1=${MAINCLASS}.java SRC2=Global${SUBCLASS}.java SRC3=${SUBCLASS}Task.java -FLAGS= -recovery -dsmtask -dsm -32bit -nooptimize -debug -mainclass ${MAINCLASS} +FLAGS= -recoverystats -recovery -dsmtask -dsm -32bit -nooptimize -debug -mainclass ${MAINCLASS} default: ../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC2} ${SRC3} ${SRC1} diff --git a/Robust/src/Benchmarks/Recovery/bm_args.txt b/Robust/src/Benchmarks/Recovery/bm_args.txt index d6512b02..3aa95998 100644 --- a/Robust/src/Benchmarks/Recovery/bm_args.txt +++ b/Robust/src/Benchmarks/Recovery/bm_args.txt @@ -1 +1 @@ -MatrixMultiply:400 80 +FileSystem:data diff --git a/Robust/src/Benchmarks/Recovery/runjava.sh b/Robust/src/Benchmarks/Recovery/runjava.sh index 395ad565..d5e22949 100755 --- a/Robust/src/Benchmarks/Recovery/runjava.sh +++ b/Robust/src/Benchmarks/Recovery/runjava.sh @@ -1,7 +1,7 @@ # !/bin/sh BASEDIR=`pwd` ITERATIONS=10 -WAITTIME=30 +WAITTIME=300 # killClients <# of machines> function killclients { -- 2.34.1