|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.dfs.DataNode
public class 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.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
DataNode(Configuration conf,
String datadir)
Create the DataNode given a configuration and a dataDir. |
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 org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public DataNode(Configuration conf, String datadir) throws IOException
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()
toString
in class Object
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 |