server

package
v0.0.0-...-16dfdc2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerConfig

type ServerConfig struct {

	// VDL Admin Listener
	AdminListenerAddress string

	// client listener address
	ClientListenerAddress string

	// metrics listener address
	MetricsListenerAddress string

	// vdl server name, one vdl server have only one server name
	ServerName string

	// currently rocksdb dir
	StableStoreDir string

	// Millisecond for raft heartbeat
	HeartbeatMs time.Duration
	//Millisecond for idle connections timeout
	ConnectionsMaxIdle time.Duration
	// HeartbeatTick is 1, ElectionTicks is N times than HeartbeatTick
	ElectionTicks int
	//glog dir
	GlogDir string
	//glog level
	Debug bool
	//alarm script path
	AlarmScriptPath string
}

func (*ServerConfig) ValidateServerConfig

func (conf *ServerConfig) ValidateServerConfig() error

type VDLServer

type VDLServer struct {

	// listen url for admin
	AdminListener *listener

	// listen url for metrics
	MetricsListener *listener

	//server config
	ServerConfig *ServerConfig

	//Runtime config
	RuntimeConfig      *runtimeconfig.RuntimeConfig
	RuntimeConfigStore *runtimeconfig.RuntimeConfigStore

	//persistent for membership/voted id/etc..
	StableStore stablestore.StableStore

	// server id, which is generate random
	ServerID int32

	// chan for shutdown
	ShutdownCh chan struct{}

	// is new server
	IsNewServer bool

	// wait group for shutdown
	Wg sync.WaitGroup
	// contains filtered or unexported fields
}
var (
	VDLServerGlobal *VDLServer
)

func NewVDLServer

func NewVDLServer(conf *ServerConfig, metricsConfig *metricsserver.MetricsServerConfig) (*VDLServer, error)

func (*VDLServer) AddRaftGroup

func (l *VDLServer) AddRaftGroup(groupName string, conf *raftgroup.GroupConfig) (newGroup *raftgroup.RaftGroup, err error)

func (*VDLServer) GetAllLogStreamNames

func (l *VDLServer) GetAllLogStreamNames() []string

func (*VDLServer) GetLogStreamWrapper

func (l *VDLServer) GetLogStreamWrapper(groupName string) (raftgroup.LogStreamWrapper, error)

func (*VDLServer) GetRaftGroup

func (l *VDLServer) GetRaftGroup(groupName string) (*raftgroup.RaftGroup, error)

func (*VDLServer) GetRuntimeConfig

func (l *VDLServer) GetRuntimeConfig() *runtimeconfig.RuntimeConfig

func (*VDLServer) GetRuntimeConfigStore

func (l *VDLServer) GetRuntimeConfigStore() *runtimeconfig.RuntimeConfigStore

func (*VDLServer) Serve

func (l *VDLServer) Serve() error

wait until stop

func (*VDLServer) Start

func (l *VDLServer) Start() (err error)

func (*VDLServer) Stop

func (l *VDLServer) Stop()

stop should be call from kill signal or stop cmd

Directories

Path Synopsis
adminapi
apipb
Package apipb is a generated protocol buffer package.
Package apipb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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