net.nutch.fs
Class NDFSClient

java.lang.Object
  extended bynet.nutch.fs.NDFSClient
All Implemented Interfaces:
FSConstants

public class NDFSClient
extends Object
implements FSConstants

NDFSClient does what's necessary to connect to a Nutch Filesystem and perform basic file tasks.

Author:
Mike Cafarella, Tessa MacDuff

Field Summary
 
Fields inherited from interface net.nutch.fs.FSConstants
BLOCK_SIZE, BLOCKREPORT_INTERVAL, CHUNKED_ENCODING, DATANODE_STARTUP_PERIOD, FILE_COMPLETE_FAILED, FILE_COMPLETE_ONGOING, FILE_COMPLETE_SUCCESS, HEARTBEAT_INTERVAL, OP_ACK, OP_BLOCKRECEIVED, OP_BLOCKREPORT, OP_CLIENT_ADDBLOCK, OP_CLIENT_ADDBLOCK_ACK, OP_CLIENT_COMPLETEFILE, OP_CLIENT_COMPLETEFILE_ACK, OP_CLIENT_DELETE, OP_CLIENT_DELETE_ACK, OP_CLIENT_LISTING, OP_CLIENT_LISTING_ACK, OP_CLIENT_OPEN, OP_CLIENT_OPEN_ACK, OP_CLIENT_RENAMETO, OP_CLIENT_RENAMETO_ACK, OP_CLIENT_STARTFILE, OP_CLIENT_STARTFILE_ACK, OP_CLIENT_TRYAGAIN, OP_ERROR, OP_FAILURE, OP_HEARTBEAT, OP_INVALIDATE_BLOCKS, OP_READ_BLOCK, OP_TRANSFERBLOCKS, OP_TRANSFERDATA, OP_WRITE_BLOCK, RUNLENGTH_ENCODING, SYSTEM_STARTUP_PERIOD
 
Constructor Summary
NDFSClient(InetSocketAddress namenode)
           
 
Method Summary
 OutputStream create(UTF8 src)
          Create an output stream that writes to all the right places.
 boolean delete(UTF8 src)
          Make a direct connection to namenode and manipulate structures there.
 UTF8[] listing(UTF8 src)
           
 InputStream open(UTF8 src)
          Create an input stream that obtains a nodelist from the namenode, and then reads from all the right places.
 boolean rename(UTF8 src, UTF8 dst)
          Make a direct connection to namenode and manipulate structures there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NDFSClient

public NDFSClient(InetSocketAddress namenode)
Method Detail

open

public InputStream open(UTF8 src)
                 throws IOException
Create an input stream that obtains a nodelist from the namenode, and then reads from all the right places. Creates inner subclass of InputStream that does the right out-of-band work.

Throws:
IOException

create

public OutputStream create(UTF8 src)
                    throws IOException
Create an output stream that writes to all the right places. Basically creates instance of inner subclass of OutputStream that handles datanode/namenode negotiation.

Throws:
IOException

rename

public boolean rename(UTF8 src,
                      UTF8 dst)
               throws IOException
Make a direct connection to namenode and manipulate structures there.

Throws:
IOException

delete

public boolean delete(UTF8 src)
               throws IOException
Make a direct connection to namenode and manipulate structures there.

Throws:
IOException

listing

public UTF8[] listing(UTF8 src)
               throws IOException
Throws:
IOException


Copyright © 2004 The Nutch Organization.