Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndFixVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uint64, err error)
- func GenerateDirUuid(dir string) (dirUuidString string, err error)
- func ScanVolumeFile(dirname string, collection string, id needle.VolumeId, ...) (err error)
- func ScanVolumeFileFrom(version needle.Version, datBackend backend.BackendStorageFile, offset int64, ...) (err error)
- func VolumeFileName(dir string, collection string, id int) (fileName string)
- type DiskLocation
- func (l *DiskLocation) CheckDiskSpace()
- func (l *DiskLocation) Close()
- func (l *DiskLocation) CollectEcShards(vid needle.VolumeId, shardFileNames []string) (ecVolume *erasure_coding.EcVolume, found bool)
- func (l *DiskLocation) DeleteCollectionFromDiskLocation(collection string) (e error)
- func (l *DiskLocation) DeleteVolume(vid needle.VolumeId, onlyEmpty bool) error
- func (l *DiskLocation) DestroyEcVolume(vid needle.VolumeId)
- func (l *DiskLocation) EcShardCount() int
- func (l *DiskLocation) FindEcShard(vid needle.VolumeId, shardId erasure_coding.ShardId) (*erasure_coding.EcVolumeShard, bool)
- func (l *DiskLocation) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, bool)
- func (l *DiskLocation) FindVolume(vid needle.VolumeId) (*Volume, bool)
- func (l *DiskLocation) LoadEcShard(collection string, vid needle.VolumeId, shardId erasure_coding.ShardId) (err error)
- func (l *DiskLocation) LoadVolume(vid needle.VolumeId, needleMapKind NeedleMapKind) bool
- func (l *DiskLocation) LocateVolume(vid needle.VolumeId) (os.DirEntry, bool)
- func (l *DiskLocation) SetStopping()
- func (l *DiskLocation) SetVolume(vid needle.VolumeId, volume *Volume)
- func (l *DiskLocation) UnUsedSpace(volumeSizeLimit uint64) (unUsedSpace uint64)
- func (l *DiskLocation) UnloadEcShard(vid needle.VolumeId, shardId erasure_coding.ShardId) bool
- func (l *DiskLocation) UnloadVolume(vid needle.VolumeId) error
- func (l *DiskLocation) VolumesLen() int
- type LevelDbNeedleMap
- func (m *LevelDbNeedleMap) Close()
- func (m *LevelDbNeedleMap) Delete(key NeedleId, offset Offset) error
- func (m *LevelDbNeedleMap) Destroy() error
- func (m *LevelDbNeedleMap) DoOffsetLoading(v *Volume, indexFile *os.File, startFrom uint64) (err error)
- func (m *LevelDbNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
- func (nm *LevelDbNeedleMap) IndexFileSize() uint64
- func (m *LevelDbNeedleMap) Put(key NeedleId, offset Offset, size Size) error
- func (nm *LevelDbNeedleMap) ReadIndexEntry(n int64) (key NeedleId, offset Offset, size Size, err error)
- func (nm *LevelDbNeedleMap) Sync() error
- func (m *LevelDbNeedleMap) UpdateNeedleMap(v *Volume, indexFile *os.File, opts *opt.Options, ldbTimeout int64) error
- type MerkleNode
- type MerkleTree
- type NeedleMap
- func (nm *NeedleMap) Close()
- func (nm *NeedleMap) Delete(key NeedleId, offset Offset) error
- func (nm *NeedleMap) Destroy() error
- func (nm *NeedleMap) DoOffsetLoading(v *Volume, indexFile *os.File, startFrom uint64) error
- func (nm *NeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
- func (nm *NeedleMap) IndexFileSize() uint64
- func (nm *NeedleMap) Put(key NeedleId, offset Offset, size Size) error
- func (nm *NeedleMap) ReadIndexEntry(n int64) (key NeedleId, offset Offset, size Size, err error)
- func (nm *NeedleMap) Sync() error
- func (nm *NeedleMap) UpdateNeedleMap(v *Volume, indexFile *os.File, opts *opt.Options, ldbTimeout int64) error
- type NeedleMapKind
- type NeedleMapper
- type ProgressFunc
- type ReadOption
- type SortedFileNeedleMap
- func (m *SortedFileNeedleMap) Close()
- func (m *SortedFileNeedleMap) Delete(key NeedleId, offset Offset) error
- func (m *SortedFileNeedleMap) Destroy() error
- func (m *SortedFileNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
- func (nm *SortedFileNeedleMap) IndexFileSize() uint64
- func (m *SortedFileNeedleMap) Put(key NeedleId, offset Offset, size Size) error
- func (nm *SortedFileNeedleMap) ReadIndexEntry(n int64) (key NeedleId, offset Offset, size Size, err error)
- func (nm *SortedFileNeedleMap) Sync() error
- type Store
- func (s *Store) AddVolume(volumeId needle.VolumeId, collection string, needleMapKind NeedleMapKind, ...) error
- func (s *Store) CheckCompactVolume(volumeId needle.VolumeId) (float64, error)
- func (s *Store) Close()
- func (s *Store) CollectEcShards(vid needle.VolumeId, shardFileNames []string) (ecVolume *erasure_coding.EcVolume, found bool)
- func (s *Store) CollectErasureCodingHeartbeat() *master_pb.Heartbeat
- func (s *Store) CollectHeartbeat() *master_pb.Heartbeat
- func (s *Store) CommitCleanupVolume(vid needle.VolumeId) error
- func (s *Store) CommitCompactVolume(vid needle.VolumeId) (bool, int64, error)
- func (s *Store) CompactVolume(vid needle.VolumeId, preallocate int64, compactionBytePerSecond int64, ...) error
- func (s *Store) ConfigureVolume(i needle.VolumeId, replication string) error
- func (s *Store) DeleteCollection(collection string) (e error)
- func (s *Store) DeleteEcShardNeedle(ecVolume *erasure_coding.EcVolume, n *needle.Needle, cookie types.Cookie) (int64, error)
- func (s *Store) DeleteVolume(i needle.VolumeId, onlyEmpty bool) error
- func (s *Store) DeleteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (Size, error)
- func (s *Store) DestroyEcVolume(vid needle.VolumeId)
- func (s *Store) EcVolumes() (ecVolumes []*erasure_coding.EcVolume)
- func (s *Store) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, bool)
- func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation)
- func (s *Store) GetDataCenter() string
- func (s *Store) GetRack() string
- func (s *Store) GetVolume(i needle.VolumeId) *Volume
- func (s *Store) GetVolumeSizeLimit() uint64
- func (s *Store) HasVolume(i needle.VolumeId) bool
- func (s *Store) LoadNewVolumes()
- func (s *Store) MarkVolumeReadonly(i needle.VolumeId) error
- func (s *Store) MarkVolumeWritable(i needle.VolumeId) error
- func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool)
- func (s *Store) MerkleNode() *MerkleNode
- func (s *Store) MerkleTree() (mt *MerkleTree)
- func (s *Store) MountEcShards(collection string, vid needle.VolumeId, shardId erasure_coding.ShardId) error
- func (s *Store) MountVolume(i needle.VolumeId) error
- func (s *Store) ReadEcShardNeedle(vid needle.VolumeId, n *needle.Needle, onReadSizeFn func(size types.Size)) (int, error)
- func (s *Store) ReadVolumeNeedle(i needle.VolumeId, n *needle.Needle, readOption *ReadOption, ...) (int, error)
- func (s *Store) ReadVolumeNeedleDataInto(i needle.VolumeId, n *needle.Needle, readOption *ReadOption, writer io.Writer, ...) error
- func (s *Store) ReadVolumeNeedleMetaAt(i needle.VolumeId, n *needle.Needle, offset int64, size int32) error
- func (s *Store) SetDataCenter(dataCenter string)
- func (s *Store) SetRack(rack string)
- func (s *Store) SetStopping()
- func (s *Store) SetVolumeSizeLimit(x uint64)
- func (s *Store) String() (str string)
- func (s *Store) UnmountEcShards(vid needle.VolumeId, shardId erasure_coding.ShardId) error
- func (s *Store) UnmountVolume(i needle.VolumeId) error
- func (s *Store) VolumeInfos() (allStats []*VolumeInfo)
- func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle, checkCookie bool, fsync bool) (isUnchanged bool, err error)
- type TempNeedleMapper
- type Volume
- func (v *Volume) BinarySearchByAppendAtNs(sinceNs uint64) (offset Offset, isLast bool, err error)
- func (v *Volume) Close()
- func (v *Volume) CommitCompact() error
- func (v *Volume) Compact(preallocate int64, compactionBytePerSecond int64) error
- func (v *Volume) Compact2(preallocate int64, compactionBytePerSecond int64, progressFn ProgressFunc) error
- func (v *Volume) ContentSize() uint64
- func (v *Volume) DataFileName() (fileName string)
- func (v *Volume) DeletedCount() uint64
- func (v *Volume) DeletedSize() uint64
- func (v *Volume) Destroy(onlyEmpty bool) (err error)
- func (v *Volume) DiskType() types.DiskType
- func (v *Volume) FileCount() uint64
- func (v *Volume) FileName(ext string) (fileName string)
- func (v *Volume) FileStat() (datSize uint64, idxSize uint64, modTime time.Time)
- func (v *Volume) GetVolumeInfo() *volume_server_pb.VolumeInfo
- func (v *Volume) GetVolumeSyncStatus() *volume_server_pb.VolumeSyncStatusResponse
- func (v *Volume) HasRemoteFile() bool
- func (v *Volume) IncrementalBackup(volumeServer pb.ServerAddress, grpcDialOption grpc.DialOption) error
- func (v *Volume) IndexFileName() (fileName string)
- func (v *Volume) IndexFileSize() uint64
- func (v *Volume) IsReadOnly() bool
- func (v *Volume) LoadRemoteFile() error
- func (v *Volume) MaxFileKey() types.NeedleId
- func (v *Volume) MerkleNode() (mn *MerkleNode)
- func (v *Volume) NeedToReplicate() bool
- func (v *Volume) ReadNeedleBlob(offset int64, size Size) ([]byte, error)
- func (v *Volume) RemoteStorageNameKey() (storageName, storageKey string)
- func (v *Volume) SaveVolumeInfo() error
- func (v *Volume) String() string
- func (v *Volume) SyncToDisk()
- func (v *Volume) ToVolumeInformationMessage() (types.NeedleId, *master_pb.VolumeInformationMessage)
- func (v *Volume) Version() needle.Version
- func (v *Volume) WriteNeedleBlob(needleId NeedleId, needleBlob []byte, size Size) error
- type VolumeFileScanner
- type VolumeFileScanner4GenIdx
- type VolumeFileScanner4ReadAll
- type VolumeFileScanner4Vacuum
- type VolumeInfo
Constants ¶
const (
MAX_TTL_VOLUME_REMOVAL_DELAY = 10 // 10 minutes
)
const PagedReadLimit = 1024 * 1024
Variables ¶
var ErrVolumeNotEmpty = fmt.Errorf("volume not empty")
var ErrVolumeNotFound = fmt.Errorf("volume not found")
var ErrorDeleted = errors.New("already deleted")
var ErrorNotFound = errors.New("not found")
var ErrorSizeMismatch = errors.New("size mismatch")
Functions ¶
func GenerateDirUuid ¶
func ScanVolumeFile ¶
func ScanVolumeFile(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapKind, volumeFileScanner VolumeFileScanner) (err error)
func ScanVolumeFileFrom ¶
func ScanVolumeFileFrom(version needle.Version, datBackend backend.BackendStorageFile, offset int64, volumeFileScanner VolumeFileScanner) (err error)
Types ¶
type DiskLocation ¶
type DiskLocation struct { Directory string DirectoryUuid string IdxDirectory string DiskType types.DiskType MaxVolumeCount int32 OriginalMaxVolumeCount int32 MinFreeSpace util.MinFreeSpace // contains filtered or unexported fields }
func NewDiskLocation ¶
func NewDiskLocation(dir string, maxVolumeCount int32, minFreeSpace util.MinFreeSpace, idxDir string, diskType types.DiskType) *DiskLocation
func (*DiskLocation) CheckDiskSpace ¶
func (l *DiskLocation) CheckDiskSpace()
func (*DiskLocation) Close ¶
func (l *DiskLocation) Close()
func (*DiskLocation) CollectEcShards ¶
func (l *DiskLocation) CollectEcShards(vid needle.VolumeId, shardFileNames []string) (ecVolume *erasure_coding.EcVolume, found bool)
func (*DiskLocation) DeleteCollectionFromDiskLocation ¶
func (l *DiskLocation) DeleteCollectionFromDiskLocation(collection string) (e error)
func (*DiskLocation) DeleteVolume ¶
func (l *DiskLocation) DeleteVolume(vid needle.VolumeId, onlyEmpty bool) error
func (*DiskLocation) DestroyEcVolume ¶
func (l *DiskLocation) DestroyEcVolume(vid needle.VolumeId)
func (*DiskLocation) EcShardCount ¶
func (l *DiskLocation) EcShardCount() int
func (*DiskLocation) FindEcShard ¶
func (l *DiskLocation) FindEcShard(vid needle.VolumeId, shardId erasure_coding.ShardId) (*erasure_coding.EcVolumeShard, bool)
func (*DiskLocation) FindEcVolume ¶
func (l *DiskLocation) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, bool)
func (*DiskLocation) FindVolume ¶
func (l *DiskLocation) FindVolume(vid needle.VolumeId) (*Volume, bool)
func (*DiskLocation) LoadEcShard ¶
func (l *DiskLocation) LoadEcShard(collection string, vid needle.VolumeId, shardId erasure_coding.ShardId) (err error)
func (*DiskLocation) LoadVolume ¶
func (l *DiskLocation) LoadVolume(vid needle.VolumeId, needleMapKind NeedleMapKind) bool
func (*DiskLocation) LocateVolume ¶
func (*DiskLocation) SetStopping ¶
func (l *DiskLocation) SetStopping()
func (*DiskLocation) SetVolume ¶
func (l *DiskLocation) SetVolume(vid needle.VolumeId, volume *Volume)
func (*DiskLocation) UnUsedSpace ¶
func (l *DiskLocation) UnUsedSpace(volumeSizeLimit uint64) (unUsedSpace uint64)
func (*DiskLocation) UnloadEcShard ¶
func (l *DiskLocation) UnloadEcShard(vid needle.VolumeId, shardId erasure_coding.ShardId) bool
func (*DiskLocation) UnloadVolume ¶
func (l *DiskLocation) UnloadVolume(vid needle.VolumeId) error
func (*DiskLocation) VolumesLen ¶
func (l *DiskLocation) VolumesLen() int
type LevelDbNeedleMap ¶
type LevelDbNeedleMap struct {
// contains filtered or unexported fields
}
func NewLevelDbNeedleMap ¶
func (*LevelDbNeedleMap) Close ¶
func (m *LevelDbNeedleMap) Close()
func (*LevelDbNeedleMap) Delete ¶
func (m *LevelDbNeedleMap) Delete(key NeedleId, offset Offset) error
func (*LevelDbNeedleMap) Destroy ¶
func (m *LevelDbNeedleMap) Destroy() error
func (*LevelDbNeedleMap) DoOffsetLoading ¶
func (*LevelDbNeedleMap) Get ¶
func (m *LevelDbNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
func (*LevelDbNeedleMap) IndexFileSize ¶
func (nm *LevelDbNeedleMap) IndexFileSize() uint64
func (*LevelDbNeedleMap) Put ¶
func (m *LevelDbNeedleMap) Put(key NeedleId, offset Offset, size Size) error
func (*LevelDbNeedleMap) ReadIndexEntry ¶
func (*LevelDbNeedleMap) UpdateNeedleMap ¶
type MerkleNode ¶
type MerkleNode struct {
// contains filtered or unexported fields
}
func MerkleNodeFromEventTree ¶
func MerkleNodeFromEventTree(e *event_pb.MerkleTree) *MerkleNode
func NewMerkleNode ¶
func NewMerkleNode(value stats.Hash) *MerkleNode
func (*MerkleNode) AddChild ¶
func (n *MerkleNode) AddChild(key string, nn *MerkleNode) bool
func (*MerkleNode) ToString ¶
func (mt *MerkleNode) ToString(indent string) string
func (*MerkleNode) ValidateNode ¶
func (mn *MerkleNode) ValidateNode() bool
func (*MerkleNode) Value ¶
func (mn *MerkleNode) Value() stats.Hash
Value returns the hash value of the MerkleNode. If the `value` field is set (non-nil), this method returns it directly. If `value` is nil, the method computes the hash by aggregating the Blake2b checksums of its children.
The aggregation is performed by iterating over all child nodes and computing the cumulative hash. If a child node is nil, an error is logged using `glog.Error`. The method ensures that the node's hash is always consistent with its children's hashes, facilitating integrity verification in the Merkle tree.
Returns:
stats.Hash: The hash of the node, either precomputed and stored in `value` or computed based on the children's hashes.
type MerkleTree ¶
type MerkleTree struct {
// contains filtered or unexported fields
}
MerkleTree represents a complete Merkle tree with a single root node. The root node can be used to verify the integrity of all data represented by the tree.
func FromProto ¶
func FromProto(e *event_pb.MerkleTree) *MerkleTree
func NewMerkleTree ¶
func NewMerkleTree(root *MerkleNode) *MerkleTree
func (*MerkleTree) RootValue ¶
func (mt *MerkleTree) RootValue() stats.Hash
func (*MerkleTree) ToProto ¶
func (mt *MerkleTree) ToProto() *event_pb.MerkleTree
type NeedleMap ¶
type NeedleMap struct {
// contains filtered or unexported fields
}
func NewCompactNeedleMap ¶
func (*NeedleMap) DoOffsetLoading ¶
func (*NeedleMap) Get ¶
func (nm *NeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
func (*NeedleMap) IndexFileSize ¶
func (nm *NeedleMap) IndexFileSize() uint64
func (*NeedleMap) ReadIndexEntry ¶
type NeedleMapKind ¶
type NeedleMapKind int
const ( NeedleMapInMemory NeedleMapKind = iota NeedleMapLevelDb // small memory footprint, 4MB total, 1 write buffer, 3 block buffer NeedleMapLevelDbMedium // medium memory footprint, 8MB total, 3 write buffer, 5 block buffer NeedleMapLevelDbLarge // large memory footprint, 12MB total, 4write buffer, 8 block buffer )
type NeedleMapper ¶
type NeedleMapper interface { Put(key NeedleId, offset Offset, size Size) error Get(key NeedleId) (element *needle_map.NeedleValue, ok bool) Delete(key NeedleId, offset Offset) error Close() Destroy() error ContentSize() uint64 DeletedSize() uint64 FileCount() int DeletedCount() int MaxFileKey() NeedleId IndexFileSize() uint64 Sync() error ReadIndexEntry(n int64) (key NeedleId, offset Offset, size Size, err error) }
type ProgressFunc ¶
type ReadOption ¶
type ReadOption struct { // request ReadDeleted bool AttemptMetaOnly bool MustMetaOnly bool // response IsMetaOnly bool // read status VolumeRevision uint16 IsOutOfRange bool // whether read over MaxPossibleVolumeSize // If HasSlowRead is set to true: // * read requests and write requests compete for the lock. // * large file read P99 latency on busy sites will go up, due to the need to get locks multiple times. // * write requests will see lower latency. // If HasSlowRead is set to false: // * read requests should complete asap, not blocking other requests. // * write requests may see high latency when downloading large files. HasSlowRead bool // increasing ReadBufferSize can reduce the number of get locks times and shorten read P99 latency. // but will increase memory usage a bit. Use with hasSlowRead normally. ReadBufferSize int }
type SortedFileNeedleMap ¶
type SortedFileNeedleMap struct {
// contains filtered or unexported fields
}
func NewSortedFileNeedleMap ¶
func NewSortedFileNeedleMap(indexBaseFileName string, indexFile *os.File) (m *SortedFileNeedleMap, err error)
func (*SortedFileNeedleMap) Close ¶
func (m *SortedFileNeedleMap) Close()
func (*SortedFileNeedleMap) Delete ¶
func (m *SortedFileNeedleMap) Delete(key NeedleId, offset Offset) error
func (*SortedFileNeedleMap) Destroy ¶
func (m *SortedFileNeedleMap) Destroy() error
func (*SortedFileNeedleMap) Get ¶
func (m *SortedFileNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, ok bool)
func (*SortedFileNeedleMap) IndexFileSize ¶
func (nm *SortedFileNeedleMap) IndexFileSize() uint64
func (*SortedFileNeedleMap) Put ¶
func (m *SortedFileNeedleMap) Put(key NeedleId, offset Offset, size Size) error
func (*SortedFileNeedleMap) ReadIndexEntry ¶
type Store ¶
type Store struct { MasterAddress pb.ServerAddress Ip string Port int GrpcPort int PublicUrl string Locations []*DiskLocation NeedleMapKind NeedleMapKind NewVolumesChan chan master_pb.VolumeShortInformationMessage DeletedVolumesChan chan master_pb.VolumeShortInformationMessage NewEcShardsChan chan master_pb.VolumeEcShardInformationMessage DeletedEcShardsChan chan master_pb.VolumeEcShardInformationMessage // contains filtered or unexported fields }
* A VolumeServer contains one Store
func NewStore ¶
func NewStore(grpcDialOption grpc.DialOption, ip string, port int, grpcPort int, publicUrl string, dirnames []string, maxVolumeCounts []int32, minFreeSpaces []util.MinFreeSpace, idxFolder string, needleMapKind NeedleMapKind, diskTypes []DiskType, ldbTimeout int64) (s *Store)
func (*Store) CheckCompactVolume ¶
func (*Store) CollectEcShards ¶
func (s *Store) CollectEcShards(vid needle.VolumeId, shardFileNames []string) (ecVolume *erasure_coding.EcVolume, found bool)
shardFiles is a list of shard files, which is used to return the shard locations
func (*Store) CollectErasureCodingHeartbeat ¶
func (*Store) CollectHeartbeat ¶
func (*Store) CommitCompactVolume ¶
func (*Store) CompactVolume ¶
func (*Store) ConfigureVolume ¶
func (*Store) DeleteCollection ¶
func (*Store) DeleteEcShardNeedle ¶
func (*Store) DeleteVolumeNeedle ¶
func (*Store) DestroyEcVolume ¶
func (*Store) EcVolumes ¶
func (s *Store) EcVolumes() (ecVolumes []*erasure_coding.EcVolume)
func (*Store) FindEcVolume ¶
func (*Store) FindFreeLocation ¶
func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation)
func (*Store) GetDataCenter ¶
func (*Store) GetVolumeSizeLimit ¶
func (*Store) LoadNewVolumes ¶
func (s *Store) LoadNewVolumes()
func (*Store) MaybeAdjustVolumeMax ¶
func (*Store) MerkleNode ¶
func (s *Store) MerkleNode() *MerkleNode
func (*Store) MerkleTree ¶
func (s *Store) MerkleTree() (mt *MerkleTree)
func (*Store) MountEcShards ¶
func (*Store) ReadEcShardNeedle ¶
func (*Store) ReadVolumeNeedle ¶
func (*Store) ReadVolumeNeedleDataInto ¶
func (*Store) ReadVolumeNeedleMetaAt ¶
func (*Store) SetDataCenter ¶
func (*Store) SetStopping ¶
func (s *Store) SetStopping()
func (*Store) SetVolumeSizeLimit ¶
func (*Store) UnmountEcShards ¶
func (*Store) VolumeInfos ¶
func (s *Store) VolumeInfos() (allStats []*VolumeInfo)
type TempNeedleMapper ¶
type Volume ¶
type Volume struct { Id needle.VolumeId Collection string DataBackend backend.BackendStorageFile MemoryMapMaxSizeMb uint32 super_block.SuperBlock // contains filtered or unexported fields }
func NewVolume ¶
func NewVolume(dirname string, dirIdx string, collection string, id needle.VolumeId, needleMapKind NeedleMapKind, replicaPlacement *super_block.ReplicaPlacement, ttl *needle.TTL, preallocate int64, memoryMapMaxSizeMb uint32, ldbTimeout int64) (v *Volume, e error)
func (*Volume) BinarySearchByAppendAtNs ¶
on server side
func (*Volume) CommitCompact ¶
func (*Volume) Compact2 ¶
func (v *Volume) Compact2(preallocate int64, compactionBytePerSecond int64, progressFn ProgressFunc) error
compact a volume based on deletions in .idx files
func (*Volume) ContentSize ¶
func (*Volume) DataFileName ¶
func (*Volume) DeletedCount ¶
func (*Volume) DeletedSize ¶
func (*Volume) GetVolumeInfo ¶
func (v *Volume) GetVolumeInfo() *volume_server_pb.VolumeInfo
func (*Volume) GetVolumeSyncStatus ¶
func (v *Volume) GetVolumeSyncStatus() *volume_server_pb.VolumeSyncStatusResponse
func (*Volume) HasRemoteFile ¶
func (*Volume) IncrementalBackup ¶
func (v *Volume) IncrementalBackup(volumeServer pb.ServerAddress, grpcDialOption grpc.DialOption) error
func (*Volume) IndexFileName ¶
func (*Volume) IndexFileSize ¶
func (*Volume) IsReadOnly ¶
func (*Volume) LoadRemoteFile ¶
func (*Volume) MaxFileKey ¶
func (*Volume) MerkleNode ¶
func (v *Volume) MerkleNode() (mn *MerkleNode)
func (*Volume) NeedToReplicate ¶
func (*Volume) ReadNeedleBlob ¶
read fills in Needle content by looking up n.Id from NeedleMapper
func (*Volume) RemoteStorageNameKey ¶
func (*Volume) SaveVolumeInfo ¶
func (*Volume) SyncToDisk ¶
func (v *Volume) SyncToDisk()
func (*Volume) ToVolumeInformationMessage ¶
func (v *Volume) ToVolumeInformationMessage() (types.NeedleId, *master_pb.VolumeInformationMessage)
func (*Volume) WriteNeedleBlob ¶
type VolumeFileScanner ¶
type VolumeFileScanner interface { VisitSuperBlock(super_block.SuperBlock) error ReadNeedleBody() bool VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error }
type VolumeFileScanner4GenIdx ¶
type VolumeFileScanner4GenIdx struct {
// contains filtered or unexported fields
}
generate the volume idx
func (*VolumeFileScanner4GenIdx) ReadNeedleBody ¶
func (scanner *VolumeFileScanner4GenIdx) ReadNeedleBody() bool
func (*VolumeFileScanner4GenIdx) VisitNeedle ¶
func (*VolumeFileScanner4GenIdx) VisitSuperBlock ¶
func (scanner *VolumeFileScanner4GenIdx) VisitSuperBlock(superBlock super_block.SuperBlock) error
type VolumeFileScanner4ReadAll ¶
type VolumeFileScanner4ReadAll struct { Stream volume_server_pb.VolumeServer_ReadAllNeedlesServer V *Volume }
func (*VolumeFileScanner4ReadAll) ReadNeedleBody ¶
func (scanner *VolumeFileScanner4ReadAll) ReadNeedleBody() bool
func (*VolumeFileScanner4ReadAll) VisitNeedle ¶
func (*VolumeFileScanner4ReadAll) VisitSuperBlock ¶
func (scanner *VolumeFileScanner4ReadAll) VisitSuperBlock(superBlock super_block.SuperBlock) error
type VolumeFileScanner4Vacuum ¶
type VolumeFileScanner4Vacuum struct {
// contains filtered or unexported fields
}
func (*VolumeFileScanner4Vacuum) ReadNeedleBody ¶
func (scanner *VolumeFileScanner4Vacuum) ReadNeedleBody() bool
func (*VolumeFileScanner4Vacuum) VisitNeedle ¶
func (*VolumeFileScanner4Vacuum) VisitSuperBlock ¶
func (scanner *VolumeFileScanner4Vacuum) VisitSuperBlock(superBlock super_block.SuperBlock) error
type VolumeInfo ¶
type VolumeInfo struct { Id needle.VolumeId Size uint64 ReplicaPlacement *super_block.ReplicaPlacement Ttl *needle.TTL DiskType string Collection string Version needle.Version FileCount int DeleteCount int DeletedByteCount uint64 ReadOnly bool CompactRevision uint32 ModifiedAtSecond int64 RemoteStorageName string RemoteStorageKey string }
func NewVolumeInfo ¶
func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err error)
func NewVolumeInfoFromShort ¶
func NewVolumeInfoFromShort(m *master_pb.VolumeShortInformationMessage) (vi VolumeInfo, err error)
func (VolumeInfo) IsRemote ¶
func (vi VolumeInfo) IsRemote() bool
func (VolumeInfo) String ¶
func (vi VolumeInfo) String() string
func (VolumeInfo) ToVolumeInformationMessage ¶
func (vi VolumeInfo) ToVolumeInformationMessage() *master_pb.VolumeInformationMessage
Source Files ¶
- disk_location.go
- disk_location_ec.go
- merkle_node.go
- merkle_tree.go
- needle_map.go
- needle_map_leveldb.go
- needle_map_memory.go
- needle_map_metric.go
- needle_map_sorted_file.go
- store.go
- store_ec.go
- store_ec_delete.go
- store_vacuum.go
- volume.go
- volume_backup.go
- volume_checking.go
- volume_info.go
- volume_loading.go
- volume_read.go
- volume_read_all.go
- volume_super_block.go
- volume_tier.go
- volume_vacuum.go
- volume_write.go