caozhiyuan / FastDFSNetCore

FastDFS Async Client
Apache License 2.0
65 stars 23 forks source link

FastDFSClient.DownloadFileAsync为什么要包含storagenode参数? #16

Closed andy65007 closed 5 years ago

andy65007 commented 5 years ago

理论上下载之需要指定“group1/M00/.../file.ext”这个key即可。你的示例代码Program.cs中hardcode了group1,不便于理解;而且参数filename没有包含group部分,可能在多个group的分布式存储环境中会出错。比如按照FastDFS的默认逻辑,增加了多个group后,FastDFS会采用负载均衡的策略,取空间大的group返回给getstoragenode函数,而download接口由调用者指定group可能会导致调用者指定到错误的group而使downloadfile失败。不知我说清楚没?请留言

caozhiyuan commented 5 years ago

参考一下 java客户端实现 https://github.com/happyfish100/fastdfs-client-java

andy65007 commented 5 years ago

我先看看啊

andy65007 commented 5 years ago

没看明白。应该是有它的优点,可以通过组对不同类型文件进行分类