tier storage: support downloading the remote dat files

This commit is contained in:
Chris Lu
2019-12-25 09:53:13 -08:00
parent 3ebeae0c0b
commit d960b3474a
11 changed files with 775 additions and 256 deletions

View File

@@ -25,6 +25,8 @@ type BackendStorage interface {
ToProperties() map[string]string
NewStorageFile(key string, tierInfo *volume_server_pb.VolumeTierInfo) BackendStorageFile
CopyFile(f *os.File, fn func(progressed int64, percentage float32) error) (key string, size int64, err error)
DownloadFile(fileName string, key string, fn func(progressed int64, percentage float32) error) (size int64, err error)
DeleteFile(key string) (err error)
}
type StringProperties interface {
@@ -41,6 +43,7 @@ var (
BackendStorages = make(map[string]BackendStorage)
)
// used by master to load remote storage configurations
func LoadConfiguration(config *viper.Viper) {
StorageBackendPrefix := "storage.backend"
@@ -70,6 +73,7 @@ func LoadConfiguration(config *viper.Viper) {
}
// used by volume server to receive remote storage configurations from master
func LoadFromPbStorageBackends(storageBackends []*master_pb.StorageBackend) {
for _, storageBackend := range storageBackends {