HDFS—protocol

org.apache.hadoop.hdfs.protocol 包内类:

  • AlreadyBeingCreatedException.java
  • The exception that happens when you ask to create a file that already is being created, but is not closed yet.
  • 当要求创建一个正在被创建且没有被关闭的文件会抛出这样的错误
  • Block.java
  • A Block is a Hadoop FS primitive, identified by a long.
  • Block 是Hadoop FS 的基元,由long 型定义

 

  • BlockListAsLongs.java
  • This class provides an interface for accessing list of blocks that has been implemented as long[]. This class is usefull for block report. Rather than send block reports as a Block[] we can send it as a long[].
  • 这个类提供了一个long[] 类型的借口用于访问一组数据块,这个类在DataNode 向NameNode 汇报块时有用。

 

  • BlockLocalPathInfo.java
  • A block and the full path information to the block data file and the metadata file stored on the local file system.
  • 本地数据块和它在本地元数据的全路径。(0.20.0 版本无,故删除)

 

  • ClientDatanodeProtocol.java
  • An client-datanode protocol for block recovery
  • 继承VersionedProtocol 的一个接口,用于块恢复。

 

  • ClientProtocol.java
  • ClientProtocol is used by user code via  {@link org.apache.hadoop.hdfs.DistributedFileSystem} class to communicate  with the NameNode.  User code can manipulate the directory namespace,  as well as open/close file streams, etc.
  • ClientProtocol 是Client 端通过org.apache.hadoop.hdfs.DistributedFileSystem 类打开、关闭文件流操作的目录名字空间的

 

  • DatanodeID.java
  • DatanodeID is composed of the data node name (hostname:portNumber) and the data storage ID, which it currently represents.
  • DatanodeID 由数据节点名称(主机名:端口号)和数据存储ID

 

  • DatanodeInfo.java
  • DatanodeInfo represents the status of a DataNode. This object is used for communication in the Datanode Protocol and the Client Protocol.
  • DatanodeInfo 代表DataNode 的状态。这个对象是用来在Datanode Protocol 和Client Protocol中进行通信的。

 

  • DataTransferProtocol
  • The Client transfers data to/from datanode using a streaming protocol.
  • 定义了一些public static final byte 变量,用于Client 流式数据传输协议。

 

  • FSConstants.java 接口
  • Some handy constants
  • 常用的变量。(每次最小写入5 个数据块,路径长度最多8k,深度最深1k)

 

  • LocatedBlock.java
  • A LocatedBlock is a pair of Block, DatanodeInfo[] objects. It tells where to find a Block.
  • LocatedBlock 是一组Block,DatanodeInfo[] 对象集合,通过它可以找到一个块(关于块,参考

 

  • LocatedBlocks.java
  • Collection of blocks with their locations and the file length.
  • 通过LocatedBlock.java 或者一组数据块的位置和文件长度。

 

  • QuotaExceededException 继承IOException
  • The message for the exception specifies the directory where the quota was violated and actual quotas.
  • 消息指出异常目录和实际限制

 

  • UnregisteredDatanodeException
  • This exception is thrown when a datanode that has not previously registered is trying to access the name node.
  • 这个异常是为了应对没有在NameNode 上注册的数据节点要进入NameNode 时抛出的异常,比如其他hadoop 集群部署。

 

org.apache.hadoop.hdfs.protocol

UML 图:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据