|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.dfs.DataNode
DataNode is a class (and program) that stores a set of blocks for a DFS deployment. A single deployment can have one or many DataNodes. Each DataNode communicates regularly with a single NameNode. It also communicates with client code and other DataNodes from time to time. DataNodes store a series of named blocks. The DataNode allows client code to read these blocks, or to write new block data. The DataNode may also, in response to instructions from its NameNode, delete blocks or copy blocks to/from other DataNodes. The DataNode maintains just one critical table: block-> stream of bytes (of BLOCK_SIZE or less) This info is stored on a local disk. The DataNode reports the table's contents to the NameNode upon startup and every so often afterwards. DataNodes spend their lives in an endless loop of asking the NameNode for something to do. A NameNode cannot connect to a DataNode directly; a NameNode simply returns values from functions invoked by a DataNode. DataNodes maintain an open server socket so that client code or other DataNodes can read/write data. The host/port for this server is reported to the NameNode, which then sends that information to clients or other DataNodes that might be interested.
Constructor Summary | |
DataNode(Configuration conf,
String datadir)
Create the DataNode given a configuration and a dataDir. |
|
DataNode(String machineName,
File datadir,
InetSocketAddress nameNodeAddr,
Configuration conf)
A DataNode can also be created with configuration information explicitly given. |
Method Summary | |
static InetSocketAddress |
createSocketAddr(String s)
Util method to build socket addr from string |
String |
getNamenode()
Return the namenode's identifier |
static void |
main(String[] args)
|
void |
offerService()
Main loop for the DataNode. |
void |
run()
No matter what kind of exception we get, keep retrying to offerService(). |
static void |
run(Configuration conf)
Start datanode daemons. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Logger LOG
public static final int BLOCK_SIZE
public static final int MIN_BLOCKS_FOR_WRITE
public static final long WRITE_COMPLETE
public static final byte OP_ERROR
public static final byte OP_HEARTBEAT
public static final byte OP_BLOCKRECEIVED
public static final byte OP_BLOCKREPORT
public static final byte OP_TRANSFERDATA
public static final byte OP_CLIENT_OPEN
public static final byte OP_CLIENT_STARTFILE
public static final byte OP_CLIENT_ADDBLOCK
public static final byte OP_CLIENT_RENAMETO
public static final byte OP_CLIENT_DELETE
public static final byte OP_CLIENT_COMPLETEFILE
public static final byte OP_CLIENT_LISTING
public static final byte OP_CLIENT_OBTAINLOCK
public static final byte OP_CLIENT_RELEASELOCK
public static final byte OP_CLIENT_EXISTS
public static final byte OP_CLIENT_ISDIR
public static final byte OP_CLIENT_MKDIRS
public static final byte OP_CLIENT_RENEW_LEASE
public static final byte OP_CLIENT_ABANDONBLOCK
public static final byte OP_CLIENT_RAWSTATS
public static final byte OP_CLIENT_DATANODEREPORT
public static final byte OP_CLIENT_DATANODE_HINTS
public static final byte OP_ACK
public static final byte OP_TRANSFERBLOCKS
public static final byte OP_INVALIDATE_BLOCKS
public static final byte OP_FAILURE
public static final byte OP_CLIENT_OPEN_ACK
public static final byte OP_CLIENT_STARTFILE_ACK
public static final byte OP_CLIENT_ADDBLOCK_ACK
public static final byte OP_CLIENT_RENAMETO_ACK
public static final byte OP_CLIENT_DELETE_ACK
public static final byte OP_CLIENT_COMPLETEFILE_ACK
public static final byte OP_CLIENT_TRYAGAIN
public static final byte OP_CLIENT_LISTING_ACK
public static final byte OP_CLIENT_OBTAINLOCK_ACK
public static final byte OP_CLIENT_RELEASELOCK_ACK
public static final byte OP_CLIENT_EXISTS_ACK
public static final byte OP_CLIENT_ISDIR_ACK
public static final byte OP_CLIENT_MKDIRS_ACK
public static final byte OP_CLIENT_RENEW_LEASE_ACK
public static final byte OP_CLIENT_ABANDONBLOCK_ACK
public static final byte OP_CLIENT_RAWSTATS_ACK
public static final byte OP_CLIENT_DATANODEREPORT_ACK
public static final byte OP_CLIENT_DATANODE_HINTS_ACK
public static final byte OP_WRITE_BLOCK
public static final byte OP_READ_BLOCK
public static final byte OP_READSKIP_BLOCK
public static final byte RUNLENGTH_ENCODING
public static final byte CHUNKED_ENCODING
public static final int OPERATION_FAILED
public static final int STILL_WAITING
public static final int COMPLETE_SUCCESS
public static final long HEARTBEAT_INTERVAL
public static final long EXPIRE_INTERVAL
public static final long BLOCKREPORT_INTERVAL
public static final long DATANODE_STARTUP_PERIOD
public static final long LEASE_PERIOD
public static final int READ_TIMEOUT
public static final int BUFFER_SIZE
Constructor Detail |
public DataNode(Configuration conf, String datadir) throws IOException
public DataNode(String machineName, File datadir, InetSocketAddress nameNodeAddr, Configuration conf) throws IOException
Method Detail |
public static InetSocketAddress createSocketAddr(String s) throws IOException
IOException
public String getNamenode()
public void offerService() throws Exception
Exception
public void run()
run
in interface Runnable
public static void run(Configuration conf) throws IOException
IOException
public String toString()
public static void main(String[] args) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |