cluster

package
v0.0.0-...-eb53742 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJoin

func DoJoin(addr string, cluster *raft.Raft) error

func GetSlots

func GetSlots(slotStr string) (uint32, uint32, error)

func IsPathExists

func IsPathExists(path string) bool

判断文件夹是否存在

func Join

func Join(conf *config.Config) error

func Mkdir

func Mkdir(path string) error

Types

type GacheFSM

type GacheFSM struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*GacheFSM) Apply

func (m *GacheFSM) Apply(log *raft.Log) interface{}

func (*GacheFSM) Restore

func (m *GacheFSM) Restore(inp io.ReadCloser) error

func (*GacheFSM) Snapshot

func (m *GacheFSM) Snapshot() (raft.FSMSnapshot, error)

type GacheSnapshot

type GacheSnapshot struct {
	// contains filtered or unexported fields
}

func (*GacheSnapshot) Persist

func (m *GacheSnapshot) Persist(sink raft.SnapshotSink) error

func (*GacheSnapshot) Release

func (m *GacheSnapshot) Release()

type RaftReplication

type RaftReplication struct {
	// contains filtered or unexported fields
}

func (*RaftReplication) Apply

func (r *RaftReplication) Apply(cmd []byte, timeout time.Duration) error

func (*RaftReplication) Join

func (r *RaftReplication) Join(addr string) error

func (*RaftReplication) Listen

func (r *RaftReplication) Listen(listener func(bool))

func (*RaftReplication) Shutdown

func (r *RaftReplication) Shutdown() error

type Replication

type Replication interface {
	Apply(cmd []byte, timeout time.Duration) error
	Join(addr string) error
	Listen(listener func(bool))
	Shutdown() error
}

func New

func New(conf *config.Config, db *db.GacheDb, notifyChan chan bool) (Replication, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL