|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.dfs.FSConstants |
---|
FSConstants.NodeType, FSConstants.SafeModeAction, FSConstants.StartupOption |
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Method Summary | |
---|---|
static InetSocketAddress |
createSocketAddr(String target)
Util method to build socket addr from either: |
static DataNode |
getDataNode()
Return the DataNode object |
String |
getNamenode()
Return the namenode's identifier |
InetSocketAddress |
getNameNodeAddr()
|
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 DataNode |
run(Configuration conf)
Start datanode daemon. |
void |
shutdown()
Shut down this instance of the datanode. |
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
Method Detail |
---|
public static InetSocketAddress createSocketAddr(String target) throws IOException
IOException
public static DataNode getDataNode()
public InetSocketAddress getNameNodeAddr()
public String getNamenode()
public void shutdown()
public void offerService() throws Exception
Exception
public void run()
run
in interface Runnable
public static DataNode run(Configuration conf) throws IOException
IOException
public String toString()
toString
in class Object
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |