2 public static void main(String[] args) {
8 GlobalQuery[] currentWorkList;
10 NUM_THREADS = Integer.parseInt(args[0]);
12 GlobalString firstmachine;
13 GlobalString firstpage;
15 int mid[] = new int[NUM_THREADS];
16 mid[0] = (128<<24)|(195<<16)|(136<<8)|162;
17 mid[1] = (128<<24)|(195<<16)|(136<<8)|163;
18 mid[2] = (128<<24)|(195<<16)|(136<<8)|164;
21 firstmachine = global new GlobalString(args[1]);
22 if (args.length == 3) {
23 firstpage = global new GlobalString(args[2]);
26 firstpage = global new GlobalString("");;
28 works = global new Work[NUM_THREADS];
29 qt = global new QueryTask[NUM_THREADS];
30 currentWorkList = global new GlobalQuery[NUM_THREADS];
32 GlobalQuery firstquery = global new GlobalQuery(firstmachine, firstpage);
34 Queue todoList = global new Queue();
35 DistributedHashMap doneList = global new DistributedHashMap(500, 500, 0.75f);
36 DistributedHashMap results = global new DistributedHashMap(100, 100, 0.75f);
38 todoList.push(firstquery);
40 for (i = 0; i < NUM_THREADS; i++) {
41 qt[i] = global new QueryTask(todoList, doneList, maxDepth, results);
42 works[i] = global new Work(qt[i], NUM_THREADS, i, currentWorkList);
45 System.printString("Finished to create Objects\n");
48 for (i = 0; i < NUM_THREADS; i++) {
52 Thread.myStart(tmp, mid[i]);
55 for (i = 0; i < NUM_THREADS; i++) {