use of com.dtstack.dtcenter.loader.client.IHdfsFile in project Taier by DTStack.
the class HdfsOperator method setPermission.
public static void setPermission(Map<String, Object> conf, Map<String, Object> kerberos, String path, String mode) {
HdfsSourceDTO sourceDTO = getSourceDTO(conf, kerberos);
IHdfsFile hdfsClient = ClientCache.getHdfs(DataSourceType.HDFS.getVal());
hdfsClient.setPermission(sourceDTO, path, mode);
}
use of com.dtstack.dtcenter.loader.client.IHdfsFile in project Taier by DTStack.
the class HdfsOperator method downloadFileFromHDFS.
/**
* 从HDFS上下载文件或文件夹到本地
*
* @throws IOException
*/
public static void downloadFileFromHDFS(Map<String, Object> conf, Map<String, Object> kerberos, String remotePath, String localDir) {
HdfsSourceDTO sourceDTO = getSourceDTO(conf, kerberos);
IHdfsFile hdfsClient = ClientCache.getHdfs(DataSourceType.HDFS.getPluginName());
hdfsClient.downloadFileFromHdfs(sourceDTO, remotePath, localDir);
}
use of com.dtstack.dtcenter.loader.client.IHdfsFile in project Taier by DTStack.
the class HdfsOperator method copyFile.
public static void copyFile(Map<String, Object> conf, Map<String, Object> kerberos, String src, String dist, boolean overwrite) {
HdfsSourceDTO sourceDTO = getSourceDTO(conf, kerberos);
IHdfsFile hdfsClient = ClientCache.getHdfs(DataSourceType.HDFS.getVal());
hdfsClient.copyFile(sourceDTO, src, dist, overwrite);
}
use of com.dtstack.dtcenter.loader.client.IHdfsFile in project Taier by DTStack.
the class HdfsOperator method listAllFilePath.
public static List<String> listAllFilePath(Map<String, Object> conf, Map<String, Object> kerberos, String parentSrc) {
HdfsSourceDTO sourceDTO = getSourceDTO(conf, kerberos);
IHdfsFile hdfsClient = ClientCache.getHdfs(DataSourceType.HDFS.getVal());
return hdfsClient.listAllFilePath(sourceDTO, parentSrc);
}
use of com.dtstack.dtcenter.loader.client.IHdfsFile in project Taier by DTStack.
the class HdfsOperator method delete.
/**
* 直接删除hdfs上文件
* @param conf hadoop文件
* @param kerberos kerberos文件
* @param remotePath hdfs路径
* @param recursive 是否递归删除
* @return 删除结果
* @throws Exception 异常
*/
public static boolean delete(Map<String, Object> conf, Map<String, Object> kerberos, String remotePath, boolean recursive) {
HdfsSourceDTO sourceDTO = getSourceDTO(conf, kerberos);
IHdfsFile hdfsClient = ClientCache.getHdfs(DataSourceType.HDFS.getVal());
return hdfsClient.delete(sourceDTO, remotePath, recursive);
}
Aggregations