1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.archive.access.nutch;
26
27 import org.apache.hadoop.conf.Configuration;
28 import org.apache.hadoop.fs.Path;
29 import org.apache.hadoop.ipc.RPC;
30 import org.apache.nutch.searcher.NutchBean;
31
32 /***
33 * Script to start up a Nutchwax Distributed Searcher.
34 * @author stack
35 * @version $Revision: 1372 $ $Date: 2006-12-15 00:49:38 +0000 (Fri, 15 Dec 2006) $
36 */
37 public class NutchwaxDistributedSearch {
38 public static class Server {
39 private Server() {
40 super();
41 }
42
43 /***
44 * Use to start org.apache.nutch.searcher.DistributedSearch$Server
45 * but with nutchwax configuration mixed in so nutchwax plugins
46 * can be found (and properly configured).
47 */
48 public static void main(String[] args) throws Exception {
49 String usage =
50 "NutchwaxDistributedSearch$Server <port> <index dir>";
51
52 if (args.length == 0 || args.length > 2) {
53 System.err.println(usage);
54 System.exit(-1);
55 }
56
57 int port = Integer.parseInt(args[0]);
58 Path directory = new Path(args[1]);
59
60 Configuration conf = NutchwaxConfiguration.getConfiguration();
61 NutchBean bean = new NutchBean(conf, directory);
62
63 org.apache.hadoop.ipc.Server server = RPC.getServer(bean,
64 "0.0.0.0", port, 10, true, conf);
65 server.start();
66 server.join();
67 }
68 }
69 }