Documentation ¶
Index ¶
- Variables
- func BackendNameToTypeId(backendName string) (backendType, backendId string)
- func LoadConfiguration(config *util.ViperProxy)
- func LoadFromPbStorageBackends(storageBackends []*master_pb.StorageBackend)
- func ToPbStorageBackends() (backends []*master_pb.StorageBackend)
- type BackendStorage
- type BackendStorageFactory
- type BackendStorageFile
- type DiskFile
- func (df *DiskFile) Close() error
- func (df *DiskFile) GetStat() (datSize int64, modTime time.Time, err error)
- func (df *DiskFile) Name() string
- func (df *DiskFile) ReadAt(p []byte, off int64) (n int, err error)
- func (df *DiskFile) Sync() error
- func (df *DiskFile) Truncate(off int64) error
- func (df *DiskFile) Write(p []byte) (n int, err error)
- func (df *DiskFile) WriteAt(p []byte, off int64) (n int, err error)
- type Properties
- type StorageType
- type StringProperties
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BackendStorageFactories = make(map[StorageType]BackendStorageFactory) BackendStorages = make(map[string]BackendStorage) )
Functions ¶
func BackendNameToTypeId ¶
func LoadConfiguration ¶
func LoadConfiguration(config *util.ViperProxy)
used by master to load remote storage configurations
func LoadFromPbStorageBackends ¶
func LoadFromPbStorageBackends(storageBackends []*master_pb.StorageBackend)
used by volume server to receive remote storage configurations from master
func ToPbStorageBackends ¶
func ToPbStorageBackends() (backends []*master_pb.StorageBackend)
Types ¶
type BackendStorage ¶
type BackendStorage interface { ToProperties() map[string]string NewStorageFile(key string, tierInfo *volume_server_pb.VolumeInfo) 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 BackendStorageFactory ¶
type BackendStorageFactory interface { StorageType() StorageType BuildStorage(configuration StringProperties, configPrefix string, id string) (BackendStorage, error) }
type BackendStorageFile ¶
type BackendStorageFile interface { io.ReaderAt io.WriterAt Truncate(off int64) error io.Closer GetStat() (datSize int64, modTime time.Time, err error) Name() string Sync() error }
func CreateVolumeFile ¶
func CreateVolumeFile(fileName string, preallocate int64, memoryMapSizeMB uint32) (BackendStorageFile, error)
type Properties ¶
type Properties struct {
// contains filtered or unexported fields
}
func (*Properties) GetString ¶
func (p *Properties) GetString(key string) string
type StorageType ¶
type StorageType string
type StringProperties ¶
Click to show internal directories.
Click to hide internal directories.