|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.conf.Configured 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.CheckpointStates, FSConstants.DatanodeReportType, FSConstants.NodeType, FSConstants.SafeModeAction, FSConstants.StartupOption, FSConstants.UpgradeAction |
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
static long |
versionID
3: added a finalize parameter to updateBlock |
static long |
versionID
1: start of time |
Method Summary | |
---|---|
static InetSocketAddress |
createSocketAddr(String target)
Deprecated. |
org.apache.hadoop.dfs.BlockMetaDataInfo |
getBlockMetaDataInfo(org.apache.hadoop.dfs.Block block)
|
static DataNode |
getDataNode()
Return the DataNode object |
FSDatasetInterface |
getFSDataset()
This method is used for testing. |
String |
getNamenode()
Return the namenode's identifier |
InetSocketAddress |
getNameNodeAddr()
|
long |
getProtocolVersion(String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
InetSocketAddress |
getSelfAddr()
|
static void |
main(String[] args)
|
void |
offerService()
Main loop for the DataNode. |
org.apache.hadoop.dfs.Block |
recoverBlock(org.apache.hadoop.dfs.Block block,
DatanodeInfo[] targets)
Start generation-stamp recovery for specified block |
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()
|
void |
updateBlock(org.apache.hadoop.dfs.Block oldblock,
org.apache.hadoop.dfs.Block newblock,
boolean finalize)
Update the block to the new generation stamp and length. |
Methods inherited from class org.apache.hadoop.conf.Configured |
---|
getConf, setConf |
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
public static final long versionID
public static final long versionID
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)
public org.apache.hadoop.dfs.BlockMetaDataInfo getBlockMetaDataInfo(org.apache.hadoop.dfs.Block block) throws IOException
IOException
public void updateBlock(org.apache.hadoop.dfs.Block oldblock, org.apache.hadoop.dfs.Block newblock, boolean finalize) throws IOException
IOException
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaks
IOException
public org.apache.hadoop.dfs.Block recoverBlock(org.apache.hadoop.dfs.Block block, DatanodeInfo[] targets) throws IOException
block
- the specified block
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |