seaweedfs java_seaweedfs-java-client
SeaweedFS Client For Java
latest readme
maven version does not update,if you want to use my code, please clone and compile it by yourself.
修复了以下bug:
1.判定leader之前先判断IsLeader,避免当weedfs运行在docker中时,自动更新为docker container虚拟地址的情况
2.在返回值中加入了文件的具体链接。
3.使用HttpClientBuilder.create().build(),防止超时。
maven 版本暂未更新,如果你想使用我的版本,请自行下载并编译。
Original Content
项目更改自weed-client,修复了一下作者原来的部分bug,然后重新打包了。
合并更改部分bug,统一代码样式
Quick Start
Maven
net.anumbrella.seaweedfs
seaweedfs-java-client
0.0.1.RELEASE
Gradle
repositories {
mavenCentral()
}
dependencies {
compile 'net.anumbrella.seaweedfs:seaweedfs-java-client:0.0.1.RELEASE'
}
Create a connection manager
FileSource fileSource = new FileSource();
// SeaweedFS master server host
fileSource.setHost("localhost");
// SeaweedFS master server port
fileSource.setPort(9333);
// Set Connection Timeout
fileSource.setConnectionTimeout(5000);
// Startup manager and listens for the change
fileSource.startup();
Create a file operation template
// Template used with connection manager
FileTemplate template = new FileTemplate(fileSource.getConnection());
//you can decide does it use publicUrl
//if your client server cannot connect to weed server url,example cloud docker weed
//when you start up your weed volume,you must config publicUrl variable
//not recommended for use publicUrl variable, exists security risk
//当你的客户端不能连接weed服务端,例如服务端部署在云端docker,启动的时候必须配置publicUrl参数
//不建议使用publicUrl,存在安全风险
template.setUsingPublicUrl(false);
template.saveFileByStream("filename.doc", someFile);
Create a connection manager with master cluster
How to create a mater cluster and use nginx as load balance
如何创建一个Master集群且使用nginx作为负载均衡
FileSource fileSource = new FileSource();
// SeaweedFS master server host
// SeaweedFS master must be a domain address
fileSource.setHost("weedfsmaster.xxx.com");
// SeaweedFS with master cluster
fileSource.setMasterCluster(true);
// Startup manager and listens for the change
fileSource.startup();
Create a file operation template
// Template used with connection manager
FileTemplate template = new FileTemplate(fileSource.getConnection());
template.saveFileByStream("filename.doc", someFile);
License
The Apache Software License, Version 2.0
Copyright [2017] [Anumbrella]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
seaweedfs java_seaweedfs-java-client相关推荐
- MemCached java client 1.5.1 性能测试
去年,我曾经多 1.3.2 版本的 java client 很不满意,具体见 http://hi.baidu.com/jabber/blog/category/Memcached 今年,它推出了两个新 ...
- [Kerberos] Java client访问kerberos-secured cluster
使用java client访问kerberos-secured cluster,最重要的是先从admin那里拿到可用的keytab文件,用来作认证.接下来就是调整连接的配置.以下先用连接hdfs为例进 ...
- mq 接口 java_Rabbitmq Java Client Api详解
AMQP AMQP协议是一个高级抽象层消息通信协议,RabbitMQ是AMQP协议的实现. 基础概念快速入门 每个rabbitmq-server叫做一个Broker,等着tcp连接进入. 在rabbi ...
- java thrift client_使用thrift的java client调用python server
上面这篇文章的例子是使用java client调用python server中的helloString方法来打印client传输过去的字符串 thrift文件,hello.thrift service ...
- MariaDB Java Client 1.1.0 发布
MariaDB Java Client 1.1.0 发布了,该版本主要是修复数据源 metadata 相关的 bug,以及和 ConnectorJ 不兼容的地方,值得关注的有: 保存和 Connect ...
- (RabbitMQ) Java Client API Guide
欢迎支持笔者新作:<深入理解Kafka:核心设计与实践原理>和<RabbitMQ实战指南>,同时欢迎关注笔者的微信公众号:朱小厮的博客. 本篇翻译的是RabbitMQ官方文档关 ...
- 译:1. RabbitMQ Java Client 之 Hello World
这些教程介绍了使用RabbitMQ创建消息传递应用程序的基础知识.您需要安装RabbitMQ服务器才能完成教程 1. 打造第一个Hello World 程序 RabbitMQ是一个消息代理:它接受和转 ...
- fastdfs java client_GitHub - happyfish100/fastdfs-client-java: FastDFS java client SDK
FastDFS java client SDK FastDFS Java Client API may be copied only under the terms of the BSD licens ...
- java client和servers_“java -server”和“java -client”之间的真正区别?
这实际上与HotSpot和默认选项值 ( Java HotSpot VM选项 )相关联,这些选项在客户端和服务器configuration之间有所不同. 从白皮书( The Java HotSpot ...
- 3、redis之java client环境搭建
JAVA Client环境搭建 POM: <dependency><groupId>redis.clients</groupId><artifactId> ...
最新文章
- WPF xaml中列表依赖属性的定义
- 喜讯,公司换宽屏液晶显示器了
- ps怎么缩放图层大小_【无机纳米材料科研制图——Photoshop 0404】PS排列扫描透射电子显微镜图TEM/STEM...
- HBase 手动 flush 机制梳理
- 三次握手wireshark抓包分析,成功握手和失败握手
- 阿里云专属数据库,重新定义云数据库新形态
- js不用reverse反转数组代码_JavaScript 数组排序
- 第一次执行时没有问题,重复执行会出错、GP循环
- c语言堆栈基本代码入栈出栈_几道和「堆栈、队列」有关的面试算法题
- SpringBootSwagger构建REST API并生成API文档
- C语言递归分形实验-曼德勃罗集
- win8.1计算机开启远程桌面连接不上,Win8.1电脑远程桌面无法连接提示“你的凭据不工作”怎么办...
- Win10如何用命令行查看MD5
- Android平板怎么抠图,Photoshop手机版怎么抠图去背景?
- VS2017 错误	LNK2005
- 牛客网Python笔试技巧、单行多行输入方法以及代码调试技巧
- html div 字体向左自动,在css中怎样设置字体靠左?
- 光模块发射光功率和接收灵敏度介绍
- 从钉钉后台API获取企业通讯录以后,获取每个人的钉钉运动步数
- mysql按时间段统计_mysql按照时间段内 每天统计