Documentation
¶
Index ¶
- Constants
- Variables
- func Uint32ToBytes(i uint32) []byte
- func Uint64ToBytes(i uint64) []byte
- type Index
- type MetaBlob
- type Needle
- type Payload
- type Server
- type StorageNodeInfo
- type Store
- func (s *Store) Close()
- func (s *Store) DeleteNeedle(n *Needle)
- func (s *Store) IsReadOnly() bool
- func (s *Store) Join(nodeName string, nodeGossipAddr string, nodeGossipPort int, peerAddrs []string) error
- func (s *Store) Open(createIfNotExists bool) error
- func (s *Store) ReadID(ID uint64) (*Needle, error)
- func (s *Store) ReadNeedleAt(offset int64) (*Needle, error)
- func (s *Store) ReadNeedleWithOffsetAndSize(offset int64, size uint32) (*Needle, error)
- func (s *Store) SetReadOnly() error
- func (s *Store) SetStoreID(ID string)
- func (s *Store) WriteNeedle(n *Needle, needSync bool) (int64, uint32, error)
- type StoreConfig
- type StoreNodeDelegate
Constants ¶
View Source
const ( MetaBlobSize = 2 + 8 + 4 + 64 Padding = 8 )
View Source
const ( DefaultStoreVer = 1 DefaultStoreSize = 100 * 1024 * 1024 * 1024 // 100GB )
View Source
const (
NEEDLE_FLAG_DELETE = 1 << iota
)
View Source
const (
STORE_FLAG_READ_ONLY = 1 << iota
)
Variables ¶
View Source
var (
STORE_MAGIC = []byte{'\xc4', '\xc4'}
)
Functions ¶
func Uint32ToBytes ¶
func Uint64ToBytes ¶
Types ¶
type Needle ¶
func (*Needle) FromPayload ¶
payload: | id (8bytes) | data size (4 bytes) | data | checksum (4bytes)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type StorageNodeInfo ¶
type Store ¶
type Store struct {
MetaBlob
// contains filtered or unexported fields
}
func NewStoreWithIDAndConfig ¶
func NewStoreWithIDAndConfig(ID string, cfg *StoreConfig) *Store
func (*Store) DeleteNeedle ¶
func (*Store) IsReadOnly ¶
func (*Store) ReadNeedleWithOffsetAndSize ¶
func (*Store) SetReadOnly ¶
func (*Store) SetStoreID ¶
type StoreConfig ¶
func NewDefaultStoreConfig ¶
func NewDefaultStoreConfig() *StoreConfig
type StoreNodeDelegate ¶
type StoreNodeDelegate struct {
Info *StorageNodeInfo
}
func (*StoreNodeDelegate) GetBroadcasts ¶
func (d *StoreNodeDelegate) GetBroadcasts(overhead, limit int) [][]byte
func (*StoreNodeDelegate) LocalState ¶
func (d *StoreNodeDelegate) LocalState(join bool) []byte
func (*StoreNodeDelegate) MergeRemoteState ¶
func (d *StoreNodeDelegate) MergeRemoteState(buf []byte, join bool)
func (*StoreNodeDelegate) NodeMeta ¶
func (d *StoreNodeDelegate) NodeMeta(limit int) []byte
func (*StoreNodeDelegate) NotifyMsg ¶
func (d *StoreNodeDelegate) NotifyMsg([]byte)
Click to show internal directories.
Click to hide internal directories.