| 构造器和说明 |
|---|
HdfsFileProxy(IHdfsFile targetClient) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkAndDelete(ISourceDTO source,
String remotePath)
文件检测并删除
|
boolean |
copyDirector(ISourceDTO source,
String src,
String dist)
复制文件夹
|
boolean |
copyFile(ISourceDTO source,
String src,
String dist,
boolean isOverwrite)
复制文件
|
boolean |
copyFromLocal(ISourceDTO source,
String srcPath,
String dstPath,
boolean overwrite)
从本地copy到hdfs
|
boolean |
copyToLocal(ISourceDTO source,
String srcPath,
String dstPath)
从hdfs copy文件到本地
|
boolean |
createDir(ISourceDTO source,
String remotePath,
Short permission)
创建 HDFS 路径
|
boolean |
delete(ISourceDTO source,
String remotePath,
boolean recursive)
直接删除目标路径文件
|
boolean |
deleteFiles(ISourceDTO source,
List<String> fileNames)
删除文件
|
boolean |
downloadFileFromHdfs(ISourceDTO source,
String remotePath,
String localDir)
从 HDFS 上下载文件或文件夹到本地
|
boolean |
fileMerge(ISourceDTO source,
String src,
String mergePath,
FileFormat fileFormat,
Long maxCombinedFileSize,
Long needCombineFileSizeLimit)
合并小文件
|
List<ColumnMetaDTO> |
getColumnList(ISourceDTO source,
SqlQueryDTO queryDTO,
String fileFormat)
获取hdfs上存储文件的字段信息
|
List<HDFSContentSummary> |
getContentSummary(ISourceDTO source,
List<String> hdfsDirPaths)
批量统计文件夹内容摘要,包括文件的数量,文件夹的数量,文件变动时间,以及这个文件夹的占用存储等内容
|
HDFSContentSummary |
getContentSummary(ISourceDTO source,
String hdfsDirPath)
统计文件夹内容摘要,包括文件的数量,文件夹的数量,文件变动时间,以及这个文件夹的占用存储等内容
|
long |
getDirSize(ISourceDTO source,
String remotePath)
获取路径文件大小
|
IDownloader |
getDownloaderByFormat(ISourceDTO source,
String tableLocation,
List<String> columnNames,
String fieldDelimiter,
String fileFormat)
根据文件格式获取对应的downlaoder
|
IDownloader |
getFileDownloader(ISourceDTO source,
String path)
文件下载器
|
IDownloader |
getLogDownloader(ISourceDTO source,
SqlQueryDTO queryDTO)
日志下载器
|
FileStatus |
getStatus(ISourceDTO source,
String location)
获取 HDFS 对应地址文件信息
|
boolean |
isDirExist(ISourceDTO source,
String remotePath)
路径目录是否存在
|
boolean |
isFileExist(ISourceDTO source,
String remotePath)
路径文件是否存在
|
List<String> |
listAllFilePath(ISourceDTO source,
String remotePath)
获取目录下所有文件
|
List<FileStatus> |
listAllFiles(ISourceDTO source,
String remotePath,
boolean isIterate)
获取目录下所有文件的属性集
|
List<FileStatus> |
listStatus(ISourceDTO source,
String remotePath)
获取目录或者文件的属性
|
boolean |
rename(ISourceDTO source,
String src,
String dist)
重命名
|
boolean |
setPermission(ISourceDTO source,
String remotePath,
String mode)
设置路径权限
|
boolean |
uploadInputStreamToHdfs(ISourceDTO source,
byte[] bytes,
String remotePath)
上传字节流到 HDFS
|
boolean |
uploadLocalFileToHdfs(ISourceDTO source,
String localFilePath,
String remotePath)
上传文件到 HDFS
|
int |
writeByName(ISourceDTO source,
HdfsWriterDTO hdfsWriterDTO)
从文件中读取行,根据提供的分隔符号分割,再根据提供的hdfs分隔符合并,写入hdfs
---需要根据column信息判断导入的数据是否符合要求
|
int |
writeByPos(ISourceDTO source,
HdfsWriterDTO hdfsWriterDTO)
按位置写入
|
public HdfsFileProxy(IHdfsFile targetClient)
public FileStatus getStatus(ISourceDTO source, String location)
IHdfsFilepublic IDownloader getLogDownloader(ISourceDTO source, SqlQueryDTO queryDTO)
IHdfsFilegetLogDownloader 在接口中 IHdfsFilepublic IDownloader getFileDownloader(ISourceDTO source, String path)
IHdfsFilegetFileDownloader 在接口中 IHdfsFilepublic boolean downloadFileFromHdfs(ISourceDTO source, String remotePath, String localDir)
IHdfsFiledownloadFileFromHdfs 在接口中 IHdfsFilepublic boolean uploadLocalFileToHdfs(ISourceDTO source, String localFilePath, String remotePath)
IHdfsFileuploadLocalFileToHdfs 在接口中 IHdfsFilepublic boolean uploadInputStreamToHdfs(ISourceDTO source, byte[] bytes, String remotePath)
IHdfsFileuploadInputStreamToHdfs 在接口中 IHdfsFilepublic boolean createDir(ISourceDTO source, String remotePath, Short permission)
IHdfsFilepublic boolean isFileExist(ISourceDTO source, String remotePath)
IHdfsFileisFileExist 在接口中 IHdfsFilepublic boolean checkAndDelete(ISourceDTO source, String remotePath)
IHdfsFilecheckAndDelete 在接口中 IHdfsFilepublic boolean delete(ISourceDTO source, String remotePath, boolean recursive)
IHdfsFilepublic long getDirSize(ISourceDTO source, String remotePath)
IHdfsFilegetDirSize 在接口中 IHdfsFilepublic boolean deleteFiles(ISourceDTO source, List<String> fileNames)
IHdfsFiledeleteFiles 在接口中 IHdfsFilepublic boolean isDirExist(ISourceDTO source, String remotePath)
IHdfsFileisDirExist 在接口中 IHdfsFilepublic boolean setPermission(ISourceDTO source, String remotePath, String mode)
IHdfsFilesetPermission 在接口中 IHdfsFilepublic boolean rename(ISourceDTO source, String src, String dist)
IHdfsFilepublic boolean copyFile(ISourceDTO source, String src, String dist, boolean isOverwrite)
IHdfsFilepublic boolean copyDirector(ISourceDTO source, String src, String dist)
IHdfsFilecopyDirector 在接口中 IHdfsFilesource - 数据源信息src - 原路径dist - 目标路径public boolean fileMerge(ISourceDTO source, String src, String mergePath, FileFormat fileFormat, Long maxCombinedFileSize, Long needCombineFileSizeLimit)
IHdfsFilefileMerge 在接口中 IHdfsFilesource - 数据源信息src - 合并路径mergePath - 目标路径fileFormat - 文件类型 : text、orc、parquet FileFormatmaxCombinedFileSize - 合并后的文件大小needCombineFileSizeLimit - 小文件的最大值,超过此阈值的小文件不会合并public List<FileStatus> listStatus(ISourceDTO source, String remotePath)
IHdfsFilelistStatus 在接口中 IHdfsFilepublic List<String> listAllFilePath(ISourceDTO source, String remotePath)
IHdfsFilelistAllFilePath 在接口中 IHdfsFilepublic List<FileStatus> listAllFiles(ISourceDTO source, String remotePath, boolean isIterate)
IHdfsFilelistAllFiles 在接口中 IHdfsFileisIterate - 是否递归public boolean copyToLocal(ISourceDTO source, String srcPath, String dstPath)
IHdfsFilecopyToLocal 在接口中 IHdfsFilepublic boolean copyFromLocal(ISourceDTO source, String srcPath, String dstPath, boolean overwrite)
IHdfsFilecopyFromLocal 在接口中 IHdfsFileoverwrite - 是否重写public IDownloader getDownloaderByFormat(ISourceDTO source, String tableLocation, List<String> columnNames, String fieldDelimiter, String fileFormat)
IHdfsFilegetDownloaderByFormat 在接口中 IHdfsFilepublic List<ColumnMetaDTO> getColumnList(ISourceDTO source, SqlQueryDTO queryDTO, String fileFormat)
IHdfsFilegetColumnList 在接口中 IHdfsFilepublic int writeByPos(ISourceDTO source, HdfsWriterDTO hdfsWriterDTO)
IHdfsFilewriteByPos 在接口中 IHdfsFilepublic int writeByName(ISourceDTO source, HdfsWriterDTO hdfsWriterDTO)
IHdfsFilewriteByName 在接口中 IHdfsFilepublic List<HDFSContentSummary> getContentSummary(ISourceDTO source, List<String> hdfsDirPaths)
IHdfsFilegetContentSummary 在接口中 IHdfsFilesource - 数据源信息hdfsDirPaths - hdfs上文件路径集合public HDFSContentSummary getContentSummary(ISourceDTO source, String hdfsDirPath)
IHdfsFilegetContentSummary 在接口中 IHdfsFilesource - 数据源信息hdfsDirPath - hdfs上文件路径Copyright © 2022. All rights reserved.