factory

package module
v0.0.0-...-3d1347b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeConfig

func MakeConfig(nodeName string, shardName string, gossipAddress string, eventDelegate memberlist.EventDelegate, delegate memberlist.Delegate) *memberlist.Config

func NewBadger

func NewBadger(logDir string, inMem bool) (*badger.DB, error)

func NewMemberList

func NewMemberList(config *memberlist.Config, rootNode string) *memberlist.Memberlist

func NewRaft

func NewRaft(myID, myAddress string, fsm raft.FSM, raftDir string, inMem bool) (*raft.Raft, *transport.Manager, error)

func SetupServer

func SetupServer(jetConfig *JetConfig)

Types

type BadgerLogStore

type BadgerLogStore struct {
	LogStore *badger.DB
}

func (BadgerLogStore) DeleteRange

func (b BadgerLogStore) DeleteRange(min, max uint64) error

func (BadgerLogStore) FirstIndex

func (b BadgerLogStore) FirstIndex() (uint64, error)

func (BadgerLogStore) Get

func (b BadgerLogStore) Get(key []byte) ([]byte, error)

func (BadgerLogStore) GetLog

func (b BadgerLogStore) GetLog(index uint64, log *raft.Log) error

func (BadgerLogStore) GetUint64

func (b BadgerLogStore) GetUint64(key []byte) (uint64, error)

func (BadgerLogStore) LastIndex

func (b BadgerLogStore) LastIndex() (uint64, error)

func (BadgerLogStore) Set

func (b BadgerLogStore) Set(key []byte, val []byte) error

func (BadgerLogStore) SetUint64

func (b BadgerLogStore) SetUint64(key []byte, val uint64) error

func (BadgerLogStore) StoreLog

func (b BadgerLogStore) StoreLog(log *raft.Log) error

func (BadgerLogStore) StoreLogs

func (b BadgerLogStore) StoreLogs(logs []*raft.Log) error

type JetConfig

type JetConfig struct {
	HostAddr      string
	BadgerDir     string
	RaftDir       string
	GlobalAdr     string
	NodeName      string
	GossipAddress string
	RootNode      string
	Server        chan *Server
	ShardId       string
	InMemory      bool
}

type Server

type Server struct {
	Raft       *raft.Raft
	Grpc       *grpc.Server
	MemberList *memberlist.Memberlist
}

func (*Server) Kill

func (s *Server) Kill()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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