Documentation ¶
Index ¶
- Constants
- Variables
- func CreateVolume(host string, port int, vid uint64) error
- func Delete(host string, port int, vid uint64, fid uint64) error
- type Entry
- type HbaseStore
- func (store *HbaseStore) Close() error
- func (store *HbaseStore) Delete(filePath string) error
- func (store *HbaseStore) Get(filePath string) (vid uint64, fid uint64, err error)
- func (store *HbaseStore) GetEntries(filePath string) (Entries []*Entry, err error)
- func (store *HbaseStore) Set(filePath string, vid uint64, fid uint64) error
- type Master
- type MetaCache
- type MetaID
- type MetadataCassandra
- func (c *MetadataCassandra) Close() error
- func (c *MetadataCassandra) Delete(filePath string) error
- func (c *MetadataCassandra) Get(filePath string) (vid, nid uint64, err error)
- func (c *MetadataCassandra) GetEntries(filePath string) (Entries []*Entry, err error)
- func (c *MetadataCassandra) Set(filePath string, vid, nid uint64) error
- type MetadataClickHouse
- func (c *MetadataClickHouse) Close() error
- func (c *MetadataClickHouse) Delete(filePath string) error
- func (c *MetadataClickHouse) Get(filePath string) (vid, nid uint64, err error)
- func (c *MetadataClickHouse) GetEntries(filePath string) (Entries []*Entry, err error)
- func (c *MetadataClickHouse) Set(filePath string, vid, nid uint64) error
- type MetadataLevelDB
- func (m *MetadataLevelDB) Close() error
- func (m *MetadataLevelDB) Delete(filePath string) error
- func (m *MetadataLevelDB) Get(filePath string) (vid, nid uint64, err error)
- func (m *MetadataLevelDB) GetEntries(filePath string) (Entries []*Entry, err error)
- func (m *MetadataLevelDB) Set(filePath string, vid, nid uint64) error
- type MetadataRedis2
- func (m *MetadataRedis2) Close() error
- func (m *MetadataRedis2) Delete(filePath string) error
- func (m *MetadataRedis2) Get(filePath string) (vid, nid uint64, err error)
- func (m *MetadataRedis2) GetEntries(filePath string) (Entries []*Entry, err error)
- func (m *MetadataRedis2) Set(filePath string, vid, nid uint64) error
- type Size
- type StorageStatus
- type VolumeStatus
- func (vs *VolumeStatus) Delete(fid uint64) error
- func (vs *VolumeStatus) GetEntryUrl(fid uint64) string
- func (vs *VolumeStatus) GetFileUrl(fid uint64) string
- func (vs *VolumeStatus) HasEnoughSpace() bool
- func (vs *VolumeStatus) IsWritable(size uint64) bool
- func (vs *VolumeStatus) UploadFile(fid uint64, data *[]byte, fileName string) error
Constants ¶
View Source
const DEFAULT_VOLUME_MAX_FREE_SIZE uint64 = 10 * (1 << 30)
Variables ¶
View Source
var MaxHeartbeatDuration = time.Second * 10 //如果超过这个时间间隔仍然没有心跳认定失联
Functions ¶
Types ¶
type HbaseStore ¶
type HbaseStore struct {
// contains filtered or unexported fields
}
func NewHbaseStore ¶
func NewHbaseStore(config *config.Config) (store *HbaseStore, err error)
func (*HbaseStore) Close ¶
func (store *HbaseStore) Close() error
func (*HbaseStore) Delete ¶
func (store *HbaseStore) Delete(filePath string) error
func (*HbaseStore) Get ¶
func (store *HbaseStore) Get(filePath string) (vid uint64, fid uint64, err error)
func (*HbaseStore) GetEntries ¶
func (store *HbaseStore) GetEntries(filePath string) (Entries []*Entry, err error)
type Master ¶
type Master struct { MasterServer *http.ServeMux MasterHost string MasterPort int StorageStatusList []*StorageStatus // key: volume id value: volume status List VolumeStatusListMap map[uint64][]*VolumeStatus MapMutex sync.RWMutex Metadata metadata //只要现在的Volume少于MaxVolumeNum,就可以一直增加新的Volume MaxVolumeNum int Cache *MetaCache }
type MetadataCassandra ¶
type MetadataCassandra struct {
// contains filtered or unexported fields
}
func NewCassandraMetaStore ¶
func NewCassandraMetaStore(config *config.Config) (c *MetadataCassandra, err error)
func (*MetadataCassandra) Close ¶
func (c *MetadataCassandra) Close() error
func (*MetadataCassandra) Delete ¶
func (c *MetadataCassandra) Delete(filePath string) error
func (*MetadataCassandra) Get ¶
func (c *MetadataCassandra) Get(filePath string) (vid, nid uint64, err error)
func (*MetadataCassandra) GetEntries ¶
func (c *MetadataCassandra) GetEntries(filePath string) (Entries []*Entry, err error)
type MetadataClickHouse ¶
type MetadataClickHouse struct {
// contains filtered or unexported fields
}
func NewClickHouseMetaStore ¶
func NewClickHouseMetaStore(config *config.Config) (c *MetadataClickHouse, err error)
func (*MetadataClickHouse) Close ¶
func (c *MetadataClickHouse) Close() error
func (*MetadataClickHouse) Delete ¶
func (c *MetadataClickHouse) Delete(filePath string) error
func (*MetadataClickHouse) Get ¶
func (c *MetadataClickHouse) Get(filePath string) (vid, nid uint64, err error)
func (*MetadataClickHouse) GetEntries ¶
func (c *MetadataClickHouse) GetEntries(filePath string) (Entries []*Entry, err error)
type MetadataLevelDB ¶
type MetadataLevelDB struct {
// contains filtered or unexported fields
}
func NewLevelDBMetaStore ¶
func NewLevelDBMetaStore(config *config.Config) (m *MetadataLevelDB, err error)
func (*MetadataLevelDB) Close ¶
func (m *MetadataLevelDB) Close() error
func (*MetadataLevelDB) Delete ¶
func (m *MetadataLevelDB) Delete(filePath string) error
func (*MetadataLevelDB) Get ¶
func (m *MetadataLevelDB) Get(filePath string) (vid, nid uint64, err error)
func (*MetadataLevelDB) GetEntries ¶
func (m *MetadataLevelDB) GetEntries(filePath string) (Entries []*Entry, err error)
type MetadataRedis2 ¶
type MetadataRedis2 struct {
// contains filtered or unexported fields
}
func NewRedis2Store ¶
func NewRedis2Store(config *config.Config) (*MetadataRedis2, error)
func (*MetadataRedis2) Close ¶
func (m *MetadataRedis2) Close() error
func (*MetadataRedis2) Delete ¶
func (m *MetadataRedis2) Delete(filePath string) error
func (*MetadataRedis2) Get ¶
func (m *MetadataRedis2) Get(filePath string) (vid, nid uint64, err error)
func (*MetadataRedis2) GetEntries ¶
func (m *MetadataRedis2) GetEntries(filePath string) (Entries []*Entry, err error)
type StorageStatus ¶
type StorageStatus struct { ApiHost string ApiPort int DiskSize uint64 DiskUsed uint64 DiskFree uint64 CanCreateVolume bool VolumeMaxSize uint64 LastHeartbeat time.Time `json:"-"` VStatusList []*VolumeStatus }
func (*StorageStatus) CreateVolume ¶
func (ss *StorageStatus) CreateVolume(volumeId uint64) error
func (*StorageStatus) IsAlive ¶
func (ss *StorageStatus) IsAlive() bool
type VolumeStatus ¶
type VolumeStatus struct { VolumeId uint64 VolumeSize uint64 VolumeMaxFreeSize uint64 Writable bool StoreStatus *StorageStatus `json:"-"` }
func (*VolumeStatus) Delete ¶
func (vs *VolumeStatus) Delete(fid uint64) error
func (*VolumeStatus) GetEntryUrl ¶
func (vs *VolumeStatus) GetEntryUrl(fid uint64) string
func (*VolumeStatus) GetFileUrl ¶
func (vs *VolumeStatus) GetFileUrl(fid uint64) string
func (*VolumeStatus) HasEnoughSpace ¶
func (vs *VolumeStatus) HasEnoughSpace() bool
func (*VolumeStatus) IsWritable ¶
func (vs *VolumeStatus) IsWritable(size uint64) bool
func (*VolumeStatus) UploadFile ¶
func (vs *VolumeStatus) UploadFile(fid uint64, data *[]byte, fileName string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.