public interface IHdfsFile
| 限定符和类型 | 方法和说明 |
|---|---|
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 iSource,
String path)
文件下载器
|
IDownloader |
getLogDownloader(ISourceDTO iSource,
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)
按位置写入
|
FileStatus getStatus(ISourceDTO source, String location)
source - location - ExceptionIDownloader getLogDownloader(ISourceDTO iSource, SqlQueryDTO queryDTO)
iSource - queryDTO - ExceptionIDownloader getFileDownloader(ISourceDTO iSource, String path)
iSource - path - Exceptionboolean downloadFileFromHdfs(ISourceDTO source, String remotePath, String localDir)
source - remotePath - localDir - Exceptionboolean uploadLocalFileToHdfs(ISourceDTO source, String localFilePath, String remotePath)
source - localFilePath - remotePath - Exceptionboolean uploadInputStreamToHdfs(ISourceDTO source, byte[] bytes, String remotePath)
source - bytes - remotePath - Exceptionboolean createDir(ISourceDTO source, String remotePath, Short permission)
source - remotePath - permission - Exceptionboolean isFileExist(ISourceDTO source, String remotePath)
source - remotePath - Exceptionboolean checkAndDelete(ISourceDTO source, String remotePath)
source - remotePath - Exceptionboolean delete(ISourceDTO source, String remotePath, boolean recursive)
source - 数据源信息remotePath - 目标路径recursive - 是否递归删除Exceptionlong getDirSize(ISourceDTO source, String remotePath)
source - remotePath - Exceptionboolean deleteFiles(ISourceDTO source, List<String> fileNames)
source - fileNames - Exceptionboolean isDirExist(ISourceDTO source, String remotePath)
source - remotePath - Exceptionboolean setPermission(ISourceDTO source, String remotePath, String mode)
source - remotePath - mode - Exceptionboolean rename(ISourceDTO source, String src, String dist)
source - src - dist - Exceptionboolean copyFile(ISourceDTO source, String src, String dist, boolean isOverwrite)
source - src - dist - isOverwrite - Exceptionboolean copyDirector(ISourceDTO source, String src, String dist)
source - 数据源信息src - 原路径dist - 目标路径Exceptionboolean fileMerge(ISourceDTO source, String src, String mergePath, FileFormat fileFormat, Long maxCombinedFileSize, Long needCombineFileSizeLimit)
source - 数据源信息src - 合并路径mergePath - 目标路径fileFormat - 文件类型 : text、orc、parquet FileFormatmaxCombinedFileSize - 合并后的文件大小needCombineFileSizeLimit - 小文件的最大值,超过此阈值的小文件不会合并ExceptionList<FileStatus> listStatus(ISourceDTO source, String remotePath)
source - remotePath - ExceptionList<String> listAllFilePath(ISourceDTO source, String remotePath)
source - remotePath - ExceptionList<FileStatus> listAllFiles(ISourceDTO source, String remotePath, boolean isIterate)
source - remotePath - isIterate - 是否递归Exceptionboolean copyToLocal(ISourceDTO source, String srcPath, String dstPath)
source - srcPath - dstPath - Exceptionboolean copyFromLocal(ISourceDTO source, String srcPath, String dstPath, boolean overwrite)
source - srcPath - dstPath - overwrite - 是否重写ExceptionIDownloader getDownloaderByFormat(ISourceDTO source, String tableLocation, List<String> columnNames, String fieldDelimiter, String fileFormat)
source - tableLocation - fieldDelimiter - fileFormat - ExceptionList<ColumnMetaDTO> getColumnList(ISourceDTO source, SqlQueryDTO queryDTO, String fileFormat)
source - queryDTO - fileFormat - Exceptionint writeByPos(ISourceDTO source, HdfsWriterDTO hdfsWriterDTO)
source - hdfsWriterDTO - Exceptionint writeByName(ISourceDTO source, HdfsWriterDTO hdfsWriterDTO)
source - hdfsWriterDTO - ExceptionList<HDFSContentSummary> getContentSummary(ISourceDTO source, List<String> hdfsDirPaths)
source - 数据源信息hdfsDirPaths - hdfs上文件路径集合HDFSContentSummary getContentSummary(ISourceDTO source, String hdfsDirPath)
source - 数据源信息hdfsDirPath - hdfs上文件路径Copyright © 2022. All rights reserved.