Author: cutting
Date: Mon Apr 25 13:32:22 2005
New Revision: 164639

URL: http://svn.apache.org/viewcvs?rev=164639&view=rev
Log:
Permit non-default data directory.  Patch from Piotr Kosiorowski.

Modified:
    incubator/nutch/trunk/src/java/org/apache/nutch/ndfs/NDFS.java

Modified: incubator/nutch/trunk/src/java/org/apache/nutch/ndfs/NDFS.java
URL: 
http://svn.apache.org/viewcvs/incubator/nutch/trunk/src/java/org/apache/nutch/ndfs/NDFS.java?rev=164639&r1=164638&r2=164639&view=diff
==============================================================================
--- incubator/nutch/trunk/src/java/org/apache/nutch/ndfs/NDFS.java (original)
+++ incubator/nutch/trunk/src/java/org/apache/nutch/ndfs/NDFS.java Mon Apr 25 
13:32:22 2005
@@ -411,14 +411,12 @@
         Vector receivedBlockList = new Vector();
 
         /**
-         * Create using configured defaults.
+         * Create using configured defaults and dataDir.
          */
-        public DataNode() throws IOException {
-          this(InetAddress.getLocalHost().getHostName(),
-               new File(NutchConf.get().get("ndfs.data.dir",
-                                            "/tmp/nutch/data/name")),
-               createSocketAddr
-               (NutchConf.get().get("fs.default.name", "local")));
+        public DataNode(String dataDir) throws IOException {
+            this(InetAddress.getLocalHost().getHostName(), new File(dataDir),
+                    createSocketAddr(NutchConf.get().get("fs.default.name",
+                            "local")));
         }
 
         /**
@@ -911,7 +909,14 @@
         /**
          */
         public static void main(String argv[]) throws IOException {
-            DataNode datanode = new DataNode();
+            String dataDir = NutchConf.get().get("ndfs.data.dir",
+                    "/tmp/nutch/data/name");
+            if (argv.length > 0){
+                dataDir=argv[0];
+            } 
+            LOG.info("Using ["+dataDir+"] directory for data storage.");
+            
+            DataNode datanode = new DataNode(dataDir);
             while (true) {
                 try {
                     datanode.offerService();




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nutch-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to