Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalBinary(N *Needle) ([]byte, error)
- type CassandraDirectory
- func (c *CassandraDirectory) Close()
- func (c *CassandraDirectory) Del(vid, nid uint64) (err error)
- func (c *CassandraDirectory) Get(vid, nid uint64) (n *Needle, err error)
- func (c *CassandraDirectory) Has(vid, nid uint64) (has bool)
- func (c *CassandraDirectory) Set(vid, nid uint64, needle *Needle) (err error)
- type ClickHouseDirectory
- func (c *ClickHouseDirectory) Close()
- func (c *ClickHouseDirectory) Del(vid, nid uint64) (err error)
- func (c *ClickHouseDirectory) Get(vid, nid uint64) (n *Needle, err error)
- func (c *ClickHouseDirectory) Has(vid, nid uint64) (has bool)
- func (c *ClickHouseDirectory) Set(vid, nid uint64, needle *Needle) (err error)
- type Directory
- type Iterator
- type LeveldbDirectory
- func (d *LeveldbDirectory) Close()
- func (d *LeveldbDirectory) Del(vid, nid uint64) (err error)
- func (d *LeveldbDirectory) Get(vid, nid uint64) (n *Needle, err error)
- func (d *LeveldbDirectory) Has(vid, nid uint64) (has bool)
- func (d *LeveldbDirectory) Iter() (iter Iterator)
- func (d *LeveldbDirectory) Set(vid, nid uint64, needle *Needle) (err error)
- type LeveldbIterator
- type Needle
- type Volume
- func (v *Volume) GetVolumeSize() uint64
- func (v *Volume) NewFile(id uint64, data *[]byte, fileName string) (needle *Needle, err error)
- func (v *Volume) NewNeedle(id uint64, fileName string, fileSize uint64) (n *Needle, err error)
- func (v *Volume) RemainingSpace() uint64
- func (v *Volume) SetCurrentIndex(currentIndex uint64) (err error)
Constants ¶
View Source
const FixedNeedleSize uint64 = 24
Variables ¶
View Source
var ( DefaultDir string = "/tmp/fs" MaxVolumeSize uint64 = 1 << 36 //64GB VolumeIndexSize uint64 = 8 //每个Volume File用1byte来存储当前的offset的偏移量 )
Functions ¶
func MarshalBinary ¶
Types ¶
type CassandraDirectory ¶
type CassandraDirectory struct {
// contains filtered or unexported fields
}
func NewCassandraDirectory ¶
func NewCassandraDirectory(config *config.Config) (c *CassandraDirectory, err error)
func (*CassandraDirectory) Close ¶
func (c *CassandraDirectory) Close()
func (*CassandraDirectory) Del ¶
func (c *CassandraDirectory) Del(vid, nid uint64) (err error)
func (*CassandraDirectory) Get ¶
func (c *CassandraDirectory) Get(vid, nid uint64) (n *Needle, err error)
func (*CassandraDirectory) Has ¶
func (c *CassandraDirectory) Has(vid, nid uint64) (has bool)
type ClickHouseDirectory ¶
type ClickHouseDirectory struct {
// contains filtered or unexported fields
}
func NewClickHouseDirectory ¶
func NewClickHouseDirectory(config *config.Config) (c *ClickHouseDirectory, err error)
func (*ClickHouseDirectory) Close ¶
func (c *ClickHouseDirectory) Close()
func (*ClickHouseDirectory) Del ¶
func (c *ClickHouseDirectory) Del(vid, nid uint64) (err error)
func (*ClickHouseDirectory) Get ¶
func (c *ClickHouseDirectory) Get(vid, nid uint64) (n *Needle, err error)
func (*ClickHouseDirectory) Has ¶
func (c *ClickHouseDirectory) Has(vid, nid uint64) (has bool)
type LeveldbDirectory ¶
type LeveldbDirectory struct {
// contains filtered or unexported fields
}
func NewLeveldbDirectory ¶
func NewLeveldbDirectory(config *config.Config) (d *LeveldbDirectory, err error)
func (*LeveldbDirectory) Close ¶
func (d *LeveldbDirectory) Close()
func (*LeveldbDirectory) Del ¶
func (d *LeveldbDirectory) Del(vid, nid uint64) (err error)
func (*LeveldbDirectory) Get ¶
func (d *LeveldbDirectory) Get(vid, nid uint64) (n *Needle, err error)
func (*LeveldbDirectory) Has ¶
func (d *LeveldbDirectory) Has(vid, nid uint64) (has bool)
func (*LeveldbDirectory) Iter ¶
func (d *LeveldbDirectory) Iter() (iter Iterator)
type LeveldbIterator ¶
type LeveldbIterator struct {
// contains filtered or unexported fields
}
func (*LeveldbIterator) Next ¶
func (it *LeveldbIterator) Next() (key []byte, exists bool)
func (*LeveldbIterator) Release ¶
func (it *LeveldbIterator) Release()
type Needle ¶
type Needle struct { Id uint64 FileSize uint64 NeedleOffset uint64 FileName string File *os.File CurrentOffset uint64 //当前读写操作的offset }
func UnMarshalBinary ¶
type Volume ¶
type Volume struct { ID uint64 MaxSize uint64 CurrentOffset uint64 //当前最新文件所在的offset Path string File *os.File // Volume File 用一个Byte来存储当前的Offset Writeable bool // contains filtered or unexported fields }
func (*Volume) GetVolumeSize ¶
func (*Volume) RemainingSpace ¶
func (*Volume) SetCurrentIndex ¶
Click to show internal directories.
Click to hide internal directories.