Documentation ¶
Index ¶
- Variables
- func GetIPv4ForInterfaceName(ifname string) string
- func GetPKAndHashSum(cmdName string, cmd redcon.Command) (string, []byte, int, error)
- func SLogger() *common.LevelLogger
- func SetLogger(level int32, logger common.Logger)
- type ConfigFile
- type CustomRaftStatus
- type NamespaceNodeConfig
- type RaftProgress
- type RaftStatus
- type Server
- func (s *Server) ApplyRaftReqs(ctx context.Context, reqs *syncerpb.RaftReqs) (*syncerpb.RpcErr, error)
- func (s *Server) DeleteRange(ns string, dtr node.DeleteTableRange) error
- func (s *Server) GetApplySnapStatus(ctx context.Context, req *syncerpb.RaftApplySnapStatusReq) (*syncerpb.RaftApplySnapStatusRsp, error)
- func (s *Server) GetCoord() *datanode_coord.DataCoordinator
- func (s *Server) GetDBStats(leaderOnly bool) map[string]string
- func (s *Server) GetHandleNode(ns string, pk []byte, pkSum int, cmdName string, cmd redcon.Command) (*node.KVNode, error)
- func (s *Server) GetHandler(cmdName string, cmd redcon.Command, kvn *node.KVNode) (common.CommandFunc, redcon.Command, error)
- func (s *Server) GetLogSyncStats(leaderOnly bool, srcClusterName string) []metric.LogSyncStats
- func (s *Server) GetLogSyncStatsInSyncLearner() ([]metric.LogSyncStats, []metric.LogSyncStats)
- func (s *Server) GetMergeHandlers(cmd redcon.Command) (bool, []common.MergeCommandFunc, []redcon.Command, bool, error)
- func (s *Server) GetNamespace(ns string, pk []byte) (*node.NamespaceNode, error)
- func (s *Server) GetNamespaceFromFullName(ns string) *node.NamespaceNode
- func (s *Server) GetNsMgr() *node.NamespaceMgr
- func (s *Server) GetStats(leaderOnly bool, tableDetail bool) metric.ServerStats
- func (s *Server) GetSyncedRaft(ctx context.Context, req *syncerpb.SyncedRaftReq) (*syncerpb.SyncedRaftRsp, error)
- func (s *Server) GetTableStats(leaderOnly bool, table string) map[string]metric.TableStats
- func (s *Server) GetWALDBStats(leaderOnly bool) map[string]map[string]interface{}
- func (s *Server) GetWriteHandler(cmdName string, cmd redcon.Command, kvn *node.KVNode) (common.WriteCommandFunc, redcon.Command, error)
- func (s *Server) InitKVNamespace(id uint64, conf *node.NamespaceConfig, join bool) (*node.NamespaceNode, error)
- func (s *Server) IsPeerRemoved(peerID uint64) bool
- func (s *Server) NotifyApplySnap(ctx context.Context, req *syncerpb.RaftApplySnapReq) (*syncerpb.RpcErr, error)
- func (s *Server) NotifyTransferSnap(ctx context.Context, req *syncerpb.RaftApplySnapReq) (*syncerpb.RpcErr, error)
- func (s *Server) OptimizeDB(ns string, table string)
- func (s *Server) Process(ctx context.Context, m raftpb.Message) error
- func (s *Server) ReportSnapshot(id uint64, gp raftpb.Group, status raft.SnapshotStatus)
- func (s *Server) ReportUnreachable(id uint64, group raftpb.Group)
- func (s *Server) RestartAsStandalone(fullNamespace string) error
- func (s *Server) SaveDBFrom(r io.Reader, msg raftpb.Message) (int64, error)
- func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Server) Start()
- func (s *Server) Stop()
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetIPv4ForInterfaceName ¶
func GetPKAndHashSum ¶ added in v0.8.2
func SLogger ¶
func SLogger() *common.LevelLogger
Types ¶
type ConfigFile ¶
type ConfigFile struct {
ServerConf ServerConfig `json:"server_conf"`
}
type CustomRaftStatus ¶ added in v0.4.3
type CustomRaftStatus struct { ID uint64 `json:"id,omitempty"` Term uint64 `json:"term,omitempty"` Vote uint64 `json:"vote"` Commit uint64 `json:"commit"` Lead uint64 `json:"lead"` RaftState string `json:"raft_state"` Applied uint64 `json:"applied"` Progress map[uint64]RaftProgress `json:"progress,omitempty"` LeadTransferee uint64 `json:"lead_transferee"` }
raft status in raft can not marshal/unmarshal correctly, we redefine it
func (*CustomRaftStatus) Init ¶ added in v0.4.3
func (crs *CustomRaftStatus) Init(s raft.Status)
type NamespaceNodeConfig ¶
type RaftProgress ¶ added in v0.4.3
type RaftStatus ¶
type RaftStatus struct { LeaderInfo *common.MemberInfo `json:"leader_info,omitempty"` Members []*common.MemberInfo `json:"members,omitempty"` Learners []*common.MemberInfo `json:"learners,omitempty"` RaftStat CustomRaftStatus `json:"raft_stat,omitempty"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(conf ServerConfig) *Server
func (*Server) ApplyRaftReqs ¶
func (*Server) DeleteRange ¶ added in v0.3.2
func (s *Server) DeleteRange(ns string, dtr node.DeleteTableRange) error
func (*Server) GetApplySnapStatus ¶
func (s *Server) GetApplySnapStatus(ctx context.Context, req *syncerpb.RaftApplySnapStatusReq) (*syncerpb.RaftApplySnapStatusRsp, error)
func (*Server) GetCoord ¶
func (s *Server) GetCoord() *datanode_coord.DataCoordinator
func (*Server) GetHandleNode ¶ added in v0.8.0
func (*Server) GetHandler ¶
func (*Server) GetLogSyncStats ¶
func (s *Server) GetLogSyncStats(leaderOnly bool, srcClusterName string) []metric.LogSyncStats
func (*Server) GetLogSyncStatsInSyncLearner ¶ added in v0.4.0
func (s *Server) GetLogSyncStatsInSyncLearner() ([]metric.LogSyncStats, []metric.LogSyncStats)
func (*Server) GetMergeHandlers ¶
func (s *Server) GetMergeHandlers(cmd redcon.Command) (bool, []common.MergeCommandFunc, []redcon.Command, bool, error)
get merge handlers and return haswrite, handlers, commands, canconcurrency, error
func (*Server) GetNamespace ¶
func (*Server) GetNamespaceFromFullName ¶
func (s *Server) GetNamespaceFromFullName(ns string) *node.NamespaceNode
func (*Server) GetNsMgr ¶ added in v0.6.3
func (s *Server) GetNsMgr() *node.NamespaceMgr
func (*Server) GetStats ¶
func (s *Server) GetStats(leaderOnly bool, tableDetail bool) metric.ServerStats
func (*Server) GetSyncedRaft ¶
func (s *Server) GetSyncedRaft(ctx context.Context, req *syncerpb.SyncedRaftReq) (*syncerpb.SyncedRaftRsp, error)
func (*Server) GetTableStats ¶ added in v0.4.3
func (*Server) GetWALDBStats ¶ added in v0.6.0
func (*Server) GetWriteHandler ¶ added in v0.8.0
func (*Server) InitKVNamespace ¶
func (s *Server) InitKVNamespace(id uint64, conf *node.NamespaceConfig, join bool) (*node.NamespaceNode, error)
func (*Server) IsPeerRemoved ¶
func (*Server) NotifyApplySnap ¶
func (*Server) NotifyTransferSnap ¶
func (*Server) OptimizeDB ¶
func (*Server) ReportSnapshot ¶
func (*Server) ReportUnreachable ¶
func (*Server) RestartAsStandalone ¶
func (*Server) SaveDBFrom ¶
implement the snapshotter interface for transport
type ServerConfig ¶
type ServerConfig struct { // this cluster id is used for server transport to tell // different global cluster ClusterID string `json:"cluster_id"` EtcdClusterAddresses string `json:"etcd_cluster_addresses"` BroadcastInterface string `json:"broadcast_interface"` BroadcastAddr string `json:"broadcast_addr"` RedisAPIPort int `json:"redis_api_port"` HttpAPIPort int `json:"http_api_port"` GrpcAPIPort int `json:"grpc_api_port"` ProfilePort int `json:"profile_port"` DataDir string `json:"data_dir"` LogDir string `json:"log_dir"` DataRsyncModule string `json:"data_rsync_module"` LocalRaftAddr string `json:"local_raft_addr"` Tags map[string]string `json:"tags"` SyncerWriteOnly bool `json:"syncer_write_only"` SyncerNormalInit bool `json:"syncer_normal_init"` LearnerRole string `json:"learner_role"` RemoteSyncCluster string `json:"remote_sync_cluster"` StateMachineType string `json:"state_machine_type"` RsyncLimit int64 `json:"rsync_limit"` DefaultSnapCount int `json:"default_snap_count"` DefaultSnapCatchup int `json:"default_snap_catchup"` KeepBackup int `json:"keep_backup"` KeepWAL int `json:"keep_wal"` UseRocksWAL bool `json:"use_rocks_wal"` UseRedisV2 bool `json:"use_redis_v2"` ElectionTick int `json:"election_tick"` TickMs int `json:"tick_ms"` // default rocksdb options, can be override by namespace config RocksDBOpts engine.RockOptions `json:"rocksdb_opts"` WALRocksDBOpts engine.RockOptions `json:"wal_rocksdb_opts"` Namespaces []NamespaceNodeConfig `json:"namespaces"` MaxScanJob int32 `json:"max_scan_job"` }
Click to show internal directories.
Click to hide internal directories.