From: adash Date: Tue, 13 Apr 2010 01:43:45 +0000 (+0000) Subject: changes for single threaded Java version of Spider X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1f8ee8c02753977b0b8c77b7d64b16a71304dc07;p=IRC.git changes for single threaded Java version of Spider --- diff --git a/Robust/src/Benchmarks/Recovery/Spider/java/QueryTask.java b/Robust/src/Benchmarks/Recovery/Spider/java/QueryTask.java index 2703a164..a00b4d29 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/java/QueryTask.java +++ b/Robust/src/Benchmarks/Recovery/Spider/java/QueryTask.java @@ -42,12 +42,12 @@ public class QueryTask { workingURL = sb.toString(); title = null; - System.printString("["+lq.getDepth()+"] "); - System.printString("Processing - Hostname : "); - System.printString(hostname); - System.printString(", Path : "); - System.printString(path); - System.printString("\n"); + //System.printString("["+lq.getDepth()+"] "); + //System.printString("Processing - Hostname : "); + //System.printString(hostname); + //System.printString(", Path : "); + //System.printString(path); + //System.printString("\n"); if (isDocument(path)) { lq = (LocalQuery)(todoList.pop()); @@ -134,7 +134,7 @@ public class QueryTask { while (iter.hasNext() == true) { str = ((String)(iter.next())); - System.printString(str + "\n"); + //System.printString(str + "\n"); } } diff --git a/Robust/src/Benchmarks/Recovery/Spider/java/Spider.java b/Robust/src/Benchmarks/Recovery/Spider/java/Spider.java index 46226bd1..b65a9588 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/java/Spider.java +++ b/Robust/src/Benchmarks/Recovery/Spider/java/Spider.java @@ -1,24 +1,26 @@ public class Spider { public static void main(String[] args) { + int NUM_THREADS = 3; int maxDepth = 3; int maxSearchDepth = 10; int i, j; QueryTask qt; + String fm = "www.uci.edu"; String firstmachine; String firstpage; - if ((args.length != 1) && (args.length != 2)) { - System.printString("usage: ./Spider [first page]\n"); - System.exit(0); - } - - firstmachine = new String(args[0]); - if (args.length == 2) { - firstpage = new String(args[1]); - } - else - firstpage = new String("");; + if(args.length != 3) { + System.out.println("./Spider.java master "); + System.exit(0); + } else { + NUM_THREADS = Integer.parseInt(args[0]); + fm = args[1]; + maxDepth = Integer.parseInt(args[2]); + } + + firstmachine = new String(fm); + firstpage = new String("");; HashMap visitedList = new HashMap(500, 0.75f); HashMap results = new HashMap(100, 0.75f);