Documentation ¶
Index ¶
- type Storage
- func (s *Storage) Count(fragmentID uint64) (uint64, error)
- func (s *Storage) Get(fragmentID uint64, gid uint64) (*meta.GlobalTransaction, error)
- func (s *Storage) Load(fragmentID uint64, query meta.Query, ...) error
- func (s *Storage) Lock(resource string, gid uint64, locks ...meta.LockKey) (bool, string, error)
- func (s *Storage) Lockable(resource string, gid uint64, locks ...meta.LockKey) (bool, string, error)
- func (s *Storage) Manual(fragmentID uint64, applyFunc func(*meta.Manual) error) (int, error)
- func (s *Storage) Put(fragmentID uint64, transaction *meta.GlobalTransaction) error
- func (s *Storage) PutManual(fragmentID uint64, manual *meta.Manual) error
- func (s *Storage) Remove(fragmentID uint64, transaction *meta.GlobalTransaction) error
- func (s *Storage) Unlock(resource string, locks ...meta.LockKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage storage using memory, just for testing
func NewStorage ¶
func NewStorage() *Storage
NewStorage returns a transaction storage implementation by memory
func (*Storage) Count ¶
Count returns the count of the active global transaction in storage
func (*Storage) Get ¶
Get returns the global transaction
func (*Storage) Load ¶
func (s *Storage) Load(fragmentID uint64, query meta.Query, applyFunc func(*meta.GlobalTransaction) error) error
Load load all transaction from storage
func (*Storage) Lock ¶
Lock get the lock on the resource If there is conflict, returns false,conflict,nil
func (*Storage) Lockable ¶
func (s *Storage) Lockable(resource string, gid uint64, locks ...meta.LockKey) (bool, string, error)
Lockable returns the key is lockable on resource If there is conflict, returns false,conflict,nil
func (*Storage) Manual ¶
Manual process manual
func (*Storage) Put ¶
func (s *Storage) Put(fragmentID uint64, transaction *meta.GlobalTransaction) error
Put puts the global transaction into storage
func (*Storage) PutManual ¶
PutManual put manual action into storage
Click to show internal directories.
Click to hide internal directories.