ps

package
v0.0.0-...-7b3ddb2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportToRpcAdminHandler

func ExportToRpcAdminHandler(server *Server)

func ExportToRpcHandler

func ExportToRpcHandler(server *Server)

Types

type Base

type Base interface {
	Start() error

	// Destroy close partition store if it running currently.
	Close() error

	// Destroy close partition store if it running currently and remove all data file from filesystem.
	Destroy() error

	// GetMeta returns meta information about this store.
	GetPartition() *entity.Partition

	//GetEngine return engine
	GetEngine() engine.Engine

	//space change API
	GetSpace() entity.Space

	// SetSpace
	SetSpace(space *entity.Space)
}

type BatchHandler

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

create update index handler

func (*BatchHandler) Execute

func (wh *BatchHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type ChangeMemberHandler

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

func (*ChangeMemberHandler) Execute

type CreatePartitionHandler

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

func (*CreatePartitionHandler) Execute

type DeleteByQueryHandler

type DeleteByQueryHandler int

deleteByQuery handler

func (*DeleteByQueryHandler) Execute

type DeletePartitionHandler

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

func (*DeletePartitionHandler) Execute

type FlushHandler

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

flush index handler

func (*FlushHandler) Execute

func (wh *FlushHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type ForceMergeHandler

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

forceMerge index handler

func (*ForceMergeHandler) Execute

func (wh *ForceMergeHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type GetDocHandler

type GetDocHandler int

retrieve handler

func (*GetDocHandler) Execute

func (*GetDocHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type GetDocsHandler

type GetDocsHandler int

retrieve handler

func (*GetDocsHandler) Execute

func (*GetDocsHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type InitAdminHandler

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

func (*InitAdminHandler) Execute

func (i *InitAdminHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type InitHandler

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

add context and set timeout if timeout > 0, add store engine , limit request doc num

func (*InitHandler) Execute

func (i *InitHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type IsLiveHandler

type IsLiveHandler int

func (*IsLiveHandler) Execute

func (*IsLiveHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type MSearchHandler

type MSearchHandler int

Msearch handler

func (*MSearchHandler) Execute

func (*MSearchHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type PartitionSizeHandler

type PartitionSizeHandler int

func (*PartitionSizeHandler) Execute

type PartitionStore

type PartitionStore interface {
	Base

	Raft

	UpdateSpace(ctx context.Context, space *entity.Space) error

	GetDocument(ctx context.Context, readLeader bool, docID string) (doc *response.DocResult, err error)

	GetDocuments(ctx context.Context, readLeader bool, docIds []string) (results response.DocResults, err error)

	DeleteByQuery(ctx context.Context, readLeader bool, query *request.SearchRequest) (delCount int, err error)

	Search(ctx context.Context, readLeader bool, query *request.SearchRequest) (result *response.SearchResponse, err error)

	MSearch(ctx context.Context, readLeader bool, query *request.SearchRequest) (result response.SearchResponses, err error)

	//you can use ctx to cancel the stream , when this function returned will close resultChan
	StreamSearch(ctx context.Context, readLeader bool, query *request.SearchRequest, resultChan chan *response.DocResult) error

	Write(ctx context.Context, request *pspb.DocCmd) (result *response.DocResult, err error)

	Flush(ctx context.Context) error
}

type Raft

type Raft interface {
	GetLeader() (entity.NodeID, uint64)

	IsLeader() bool

	GetVersion() uint64

	GetUnreachable(id uint64) []uint64

	ChangeMember(changeType proto.ConfChangeType, server *entity.Server) error
}

type SearchHandler

type SearchHandler int

search handler

func (*SearchHandler) Execute

func (*SearchHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type Server

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

Server partition server

func NewServer

func NewServer(ctx context.Context) *Server

NewServer create server instance

func (*Server) Close

func (s *Server) Close() error

Stop stop server

func (*Server) ClosePartitions

func (s *Server) ClosePartitions()

func (*Server) CreatePartition

func (s *Server) CreatePartition(ctx context.Context, space *entity.Space, pid entity.PartitionID) error

func (*Server) DeletePartition

func (s *Server) DeletePartition(id entity.PartitionID)

func (*Server) GetPartition

func (s *Server) GetPartition(id entity.PartitionID) (partition PartitionStore)

func (*Server) HandleRaftFatalEvent

func (s *Server) HandleRaftFatalEvent(event *raftstore.RaftFatalEvent)

func (*Server) HandleRaftLeaderEvent

func (s *Server) HandleRaftLeaderEvent(event *raftstore.RaftLeaderEvent)

on leader change it will notify master

func (*Server) HandleRaftReplicaEvent

func (s *Server) HandleRaftReplicaEvent(event *raftstore.RaftReplicaEvent)

func (*Server) LoadPartition

func (s *Server) LoadPartition(ctx context.Context, pid entity.PartitionID) (PartitionStore, error)

load partition for in disk

func (*Server) PartitionNum

func (s *Server) PartitionNum() int

func (*Server) Start

func (s *Server) Start() error

Start start server

func (*Server) StartHeartbeatJob

func (s *Server) StartHeartbeatJob()

this job for heartbeat master 1m once

type SetStoreHandler

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

func (*SetStoreHandler) Execute

func (s *SetStoreHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type StatsHandler

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

func (*StatsHandler) Execute

func (sh *StatsHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type StreamSearchHandler

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

search handler

func (*StreamSearchHandler) Execute

func (ssh *StreamSearchHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

type UpdatePartitionHandler

type UpdatePartitionHandler int

func (*UpdatePartitionHandler) Execute

type WriteHandler

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

create update index handler

func (*WriteHandler) Execute

func (wh *WriteHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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