|
||||||||||
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.dfs.FSConstants |
---|
FSConstants.CheckpointStates, FSConstants.DatanodeReportType, FSConstants.NodeType, FSConstants.SafeModeAction, FSConstants.StartupOption, FSConstants.UpgradeAction |
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Method Summary | |
---|---|
static InetSocketAddress |
createSocketAddr(String target)
Deprecated. |
static DataNode |
getDataNode()
Return the DataNode object |
FSDatasetInterface |
getFSDataset()
This method is used for testing. |
String |
getNamenode()
Return the namenode's identifier |
InetSocketAddress |
getNameNodeAddr()
|
InetSocketAddress |
getSelfAddr()
|
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(). |
void |
scheduleBlockReport(long delay)
This methods arranges for the data node to send the block report at the next heartbeat. |
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 |
---|
@Deprecated public static InetSocketAddress createSocketAddr(String target) throws IOException
NetUtils.createSocketAddr(String)
instead.
IOException
public static DataNode getDataNode()
public InetSocketAddress getNameNodeAddr()
public InetSocketAddress getSelfAddr()
public String getNamenode()
public void shutdown()
public void offerService() throws Exception
Exception
public void run()
run
in interface Runnable
public String toString()
toString
in class Object
public void scheduleBlockReport(long delay)
public FSDatasetInterface getFSDataset()
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |