1 Star 11 Fork 10

GreaterBuilder/SpringBoot-Components

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

工程简介

springboot整合hdfs实现基本操作

<dependency>
    <groupId>bio.nvwa.boot</groupId>
    <artifactId>hdfs-spring-boot-starter</artifactId>
    <version>1.0.5</version>
</dependency>

上传:http://localhost:8080/hdfs/upload upload

下载:http://localhost:8080/hdfs/download

检测文件是否存在: http://localhost:8080/hdfs/isExist?path=/button/a.txt http://localhost:8080/hdfs/isExist?path=/button/模拟数据.xlsx result

重命名:http://localhost:8080/hdfs/rename rename

删除文件:http://localhost:8080/hdfs/delete delete

启动异常解决:
说明:Hadoop访问windows本地文件系统要求windows上的本地库能正常工作,其中hadoop使用某些windows API来实现类似posix的文件访问权限,这些需要hadoop.dll和winutils.exe来实现 exception

1、下载winutils,地址如下,也就是Springboot-HdfsClient工程目录下的winutils-master.zip https://github.com/steveloughran/winutils
2、解压,选择自己对应的版本,如果没有则选择相近的版本即可,我这里选择hadoop-3.0.0
如下图解压目录 file 3、添加环境变量,注意路径不要写错,也不要多写 env env2 4、重启idea或者eclipse
5、重新启动项目 restart

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/superbutton/SpringBoot-Components.git
git@gitee.com:superbutton/SpringBoot-Components.git
superbutton
SpringBoot-Components
SpringBoot-Components
develop

搜索帮助