-
一、这里首先介绍源码中的四个主要关键类(主要用于用户的hdfs dfs...命令交互实现、数据的读取、数据的写入)
-
-
DFSClient:
-
-
HDFS 客户端(如下是源码DFSClient类中的客户端说明信息,这里简述了使用ClientProtocol去访问NameNode线程以及连接DataNode数据目录去读写数据块);
-
-
DFSClient can connect to a Hadoop Filesystem and perform basic file tasks. It uses the ClientProtocol to communicate with a NameNode daemon, and connects directly to DataNodes to read/write block data;
-
Hadoop DFS users should obtain an instance of DistributedFileSystem, which uses DFSClient to handle filesystem tasks;
-
-
-
DistributedFileSystem
-
-
基于抽象类FileSystem实现的分布式HDFS的实现类,其中包含方法有Open、Read、Close、Create、Append等;
-
也是客户端用户交互的主要类,具体源码说明如下:
-
-
Implementation of the abstract FileSystem for the DFS system. This object is t
-
-
-
源码分析 --- HDFS 数据读、写操作流程和用户指令交互
最新推荐文章于 2022-03-02 08:27:36 发布