Documentation ¶
Index ¶
- func ExportToRpcAdminHandler(server *Server)
- func ExportToRpcHandler(server *Server)
- type Base
- type BatchHandler
- type ChangeMemberHandler
- type CreatePartitionHandler
- type DeleteByQueryHandler
- type DeletePartitionHandler
- type DeleteReplicaHandler
- type FlushHandler
- type ForceMergeHandler
- type GetDocHandler
- type GetDocsHandler
- type InitAdminHandler
- type InitHandler
- type IsLiveHandler
- type MSearchForIDsHandler
- type MSearchHandler
- type MSearchIDsHandler
- type MSearchNewHandler
- type PartitionInfoHandler
- type PartitionStore
- type Raft
- type SearchHandler
- type Server
- func (s *Server) Close() error
- func (s *Server) ClosePartitions()
- func (s *Server) CreatePartition(ctx context.Context, space *entity.Space, pid entity.PartitionID) error
- func (s *Server) DeletePartition(id entity.PartitionID)
- func (s *Server) DeleteReplica(id entity.PartitionID)
- func (s *Server) GetPartition(id entity.PartitionID) (partition PartitionStore)
- func (s *Server) HandleRaftFatalEvent(event *raftstore.RaftFatalEvent)
- func (s *Server) HandleRaftLeaderEvent(event *raftstore.RaftLeaderEvent)
- func (s *Server) HandleRaftReplicaEvent(event *raftstore.RaftReplicaEvent)
- func (s *Server) LoadPartition(ctx context.Context, pid entity.PartitionID) (PartitionStore, error)
- func (s *Server) PartitionNum() int
- func (s *Server) RangePartition(fun func(entity.PartitionID, PartitionStore))
- func (s *Server) Start() error
- func (s *Server) StartHeartbeatJob()
- type SetStoreHandler
- type StatsHandler
- type StreamSearchHandler
- type UpdatePartitionHandler
- type WriteHandler
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 ¶
func (ch *ChangeMemberHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type CreatePartitionHandler ¶
type CreatePartitionHandler struct {
// contains filtered or unexported fields
}
func (*CreatePartitionHandler) Execute ¶
func (c *CreatePartitionHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type DeleteByQueryHandler ¶
type DeleteByQueryHandler int
deleteByQuery handler
func (*DeleteByQueryHandler) Execute ¶
func (*DeleteByQueryHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type DeletePartitionHandler ¶
type DeletePartitionHandler struct {
// contains filtered or unexported fields
}
func (*DeletePartitionHandler) Execute ¶
func (d *DeletePartitionHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type DeleteReplicaHandler ¶
type DeleteReplicaHandler struct {
// contains filtered or unexported fields
}
func (*DeleteReplicaHandler) Execute ¶
func (d *DeleteReplicaHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
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 MSearchForIDsHandler ¶
type MSearchForIDsHandler int
func (*MSearchForIDsHandler) Execute ¶
func (*MSearchForIDsHandler) 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 MSearchIDsHandler ¶
type MSearchIDsHandler int
func (*MSearchIDsHandler) Execute ¶
func (*MSearchIDsHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type MSearchNewHandler ¶
type MSearchNewHandler int
func (*MSearchNewHandler) Execute ¶
func (*MSearchNewHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
type PartitionInfoHandler ¶
type PartitionInfoHandler struct {
// contains filtered or unexported fields
}
func (*PartitionInfoHandler) Execute ¶
func (pih *PartitionInfoHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) (err error)
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) MSearchNew(ctx context.Context, readLeader bool, query *request.SearchRequest) (result *response.SearchResponse, err error) MSearchIDs(ctx context.Context, readLeader bool, query *request.SearchRequest) (result *response.SearchResponse, err error) MSearchForIDs(ctx context.Context, readLeader bool, query *request.SearchRequest) (result []byte, 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 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 (*Server) ClosePartitions ¶
func (s *Server) ClosePartitions()
func (*Server) CreatePartition ¶
func (*Server) DeletePartition ¶
func (s *Server) DeletePartition(id entity.PartitionID)
func (*Server) DeleteReplica ¶
func (s *Server) DeleteReplica(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 (*Server) RangePartition ¶
func (s *Server) RangePartition(fun func(entity.PartitionID, PartitionStore))
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 ¶
func (*UpdatePartitionHandler) Execute(req *handler.RpcRequest, resp *handler.RpcResponse) error
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.