Documentation
¶
Index ¶
- Variables
- func RecordMetrics(start time.Time, funcName string)
- type DeleteHandler
- type GRPCClient
- func (c *GRPCClient) Close() error
- func (c *GRPCClient) Delete(docs []*index.Document, opts ...grpc.CallOption) (*index.UpdateResult, error)
- func (c *GRPCClient) Get(doc *index.Document, opts ...grpc.CallOption) (*index.Document, error)
- func (c *GRPCClient) GetCluster(opts ...grpc.CallOption) (*raft.Cluster, error)
- func (c *GRPCClient) GetIndexStats(opts ...grpc.CallOption) (*index.Stats, error)
- func (c *GRPCClient) GetNode(opts ...grpc.CallOption) (*raft.Node, error)
- func (c *GRPCClient) Index(docs []*index.Document, opts ...grpc.CallOption) (*index.UpdateResult, error)
- func (c *GRPCClient) Join(node *raft.Node, opts ...grpc.CallOption) error
- func (c *GRPCClient) Leave(node *raft.Node, opts ...grpc.CallOption) error
- func (c *GRPCClient) Search(searchRequest *bleve.SearchRequest, opts ...grpc.CallOption) (*bleve.SearchResult, error)
- func (c *GRPCClient) Snapshot(opts ...grpc.CallOption) error
- type GRPCServer
- type GRPCService
- func (s *GRPCService) Delete(stream index.Index_DeleteServer) error
- func (s *GRPCService) Get(ctx context.Context, req *index.Document) (*index.Document, error)
- func (s *GRPCService) GetCluster(ctx context.Context, req *empty.Empty) (*raft.Cluster, error)
- func (s *GRPCService) GetNode(ctx context.Context, req *empty.Empty) (*raft.Node, error)
- func (s *GRPCService) GetStats(ctx context.Context, req *empty.Empty) (*index.Stats, error)
- func (s *GRPCService) Index(stream index.Index_IndexServer) error
- func (s *GRPCService) Join(ctx context.Context, req *raft.Node) (*empty.Empty, error)
- func (s *GRPCService) Leave(ctx context.Context, req *raft.Node) (*empty.Empty, error)
- func (s *GRPCService) Search(ctx context.Context, req *index.SearchRequest) (*index.SearchResponse, error)
- func (s *GRPCService) Snapshot(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
- type GetHandler
- type HTTPServer
- type Index
- func (b *Index) Close() error
- func (b *Index) Delete(id string) error
- func (b *Index) Get(id string) (map[string]interface{}, error)
- func (b *Index) Index(id string, fields map[string]interface{}) error
- func (b *Index) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (b *Index) SnapshotItems() <-chan *pbindex.Document
- func (b *Index) Stats() (map[string]interface{}, error)
- type IndexFSMSnapshot
- type IndexHandler
- type RaftFSM
- func (f *RaftFSM) Apply(l *raft.Log) interface{}
- func (f *RaftFSM) Close() error
- func (f *RaftFSM) Get(id string) (map[string]interface{}, error)
- func (f *RaftFSM) GetMetadata(nodeId string) (*blastraft.Node, error)
- func (f *RaftFSM) Restore(rc io.ReadCloser) error
- func (f *RaftFSM) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (f *RaftFSM) Snapshot() (raft.FSMSnapshot, error)
- func (f *RaftFSM) Stats() (map[string]interface{}, error)
- type RaftServer
- func (s *RaftServer) Delete(docs []*index.Document) (*index.UpdateResult, error)
- func (s *RaftServer) Get(doc *index.Document) (*index.Document, error)
- func (s *RaftServer) GetCluster() (*blastraft.Cluster, error)
- func (s *RaftServer) GetNode() (*blastraft.Node, error)
- func (s *RaftServer) Index(docs []*index.Document) (*index.UpdateResult, error)
- func (s *RaftServer) Join(node *blastraft.Node) error
- func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)
- func (s *RaftServer) LeaderID(timeout time.Duration) (raft.ServerID, error)
- func (s *RaftServer) Leave(node *blastraft.Node) error
- func (s *RaftServer) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (s *RaftServer) Snapshot() error
- func (s *RaftServer) Start() error
- func (s *RaftServer) Stats() (*index.Stats, error)
- func (s *RaftServer) Stop() error
- func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
- type RootHandler
- type SearchHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DurationSeconds = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: namespace, Subsystem: subsystem, Name: "duration_seconds", Help: "The index operation durations in seconds.", }, []string{ "func", }, ) OperationsTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: namespace, Subsystem: subsystem, Name: "operations_total", Help: "The number of index operations.", }, []string{ "func", }, ) )
Functions ¶
func RecordMetrics ¶
Types ¶
type DeleteHandler ¶
type DeleteHandler struct {
// contains filtered or unexported fields
}
func NewDeleteHandler ¶
func NewDeleteHandler(client *GRPCClient, logger *log.Logger) *DeleteHandler
func (*DeleteHandler) ServeHTTP ¶
func (h *DeleteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(grpcAddr string) (*GRPCClient, error)
func (*GRPCClient) Close ¶
func (c *GRPCClient) Close() error
func (*GRPCClient) Delete ¶
func (c *GRPCClient) Delete(docs []*index.Document, opts ...grpc.CallOption) (*index.UpdateResult, error)
func (*GRPCClient) Get ¶
func (c *GRPCClient) Get(doc *index.Document, opts ...grpc.CallOption) (*index.Document, error)
func (*GRPCClient) GetCluster ¶
func (c *GRPCClient) GetCluster(opts ...grpc.CallOption) (*raft.Cluster, error)
func (*GRPCClient) GetIndexStats ¶ added in v0.5.0
func (c *GRPCClient) GetIndexStats(opts ...grpc.CallOption) (*index.Stats, error)
func (*GRPCClient) GetNode ¶
func (c *GRPCClient) GetNode(opts ...grpc.CallOption) (*raft.Node, error)
func (*GRPCClient) Index ¶
func (c *GRPCClient) Index(docs []*index.Document, opts ...grpc.CallOption) (*index.UpdateResult, error)
func (*GRPCClient) Join ¶
func (c *GRPCClient) Join(node *raft.Node, opts ...grpc.CallOption) error
func (*GRPCClient) Leave ¶
func (c *GRPCClient) Leave(node *raft.Node, opts ...grpc.CallOption) error
func (*GRPCClient) Search ¶
func (c *GRPCClient) Search(searchRequest *bleve.SearchRequest, opts ...grpc.CallOption) (*bleve.SearchResult, error)
func (*GRPCClient) Snapshot ¶
func (c *GRPCClient) Snapshot(opts ...grpc.CallOption) error
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
func NewGRPCServer ¶
func NewGRPCServer(grpcAddr string, service *GRPCService, logger *log.Logger) (*GRPCServer, error)
func (*GRPCServer) Start ¶
func (s *GRPCServer) Start() error
func (*GRPCServer) Stop ¶
func (s *GRPCServer) Stop() error
type GRPCService ¶
type GRPCService struct {
// contains filtered or unexported fields
}
func NewGRPCService ¶
func NewGRPCService(store *RaftServer, logger *log.Logger) (*GRPCService, error)
func (*GRPCService) Delete ¶
func (s *GRPCService) Delete(stream index.Index_DeleteServer) error
func (*GRPCService) GetCluster ¶
func (*GRPCService) Index ¶
func (s *GRPCService) Index(stream index.Index_IndexServer) error
func (*GRPCService) Search ¶
func (s *GRPCService) Search(ctx context.Context, req *index.SearchRequest) (*index.SearchResponse, error)
type GetHandler ¶
type GetHandler struct {
// contains filtered or unexported fields
}
func NewGetHandler ¶
func NewGetHandler(client *GRPCClient, logger *log.Logger) *GetHandler
func (*GetHandler) ServeHTTP ¶
func (h *GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(httpAddr string, grpcClient *GRPCClient, logger *log.Logger, httpLogger *log.Logger) (*HTTPServer, error)
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() error
func (*HTTPServer) Stop ¶
func (s *HTTPServer) Stop() error
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) Search ¶
func (b *Index) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*Index) SnapshotItems ¶
type IndexFSMSnapshot ¶
type IndexFSMSnapshot struct {
// contains filtered or unexported fields
}
func (*IndexFSMSnapshot) Persist ¶
func (f *IndexFSMSnapshot) Persist(sink raft.SnapshotSink) error
func (*IndexFSMSnapshot) Release ¶
func (f *IndexFSMSnapshot) Release()
type IndexHandler ¶
type IndexHandler struct {
// contains filtered or unexported fields
}
func NewIndexHandler ¶
func NewIndexHandler(client *GRPCClient, logger *log.Logger) *IndexHandler
func (*IndexHandler) ServeHTTP ¶
func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RaftFSM ¶
type RaftFSM struct {
// contains filtered or unexported fields
}
func NewRaftFSM ¶
func (*RaftFSM) Search ¶
func (f *RaftFSM) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
type RaftServer ¶
func NewRaftServer ¶
func NewRaftServer(node *blastraft.Node, bootstrap bool, indexMapping *mapping.IndexMappingImpl, indexStorageType string, logger *log.Logger) (*RaftServer, error)
func (*RaftServer) Delete ¶
func (s *RaftServer) Delete(docs []*index.Document) (*index.UpdateResult, error)
func (*RaftServer) GetCluster ¶
func (s *RaftServer) GetCluster() (*blastraft.Cluster, error)
func (*RaftServer) Index ¶
func (s *RaftServer) Index(docs []*index.Document) (*index.UpdateResult, error)
func (*RaftServer) LeaderAddress ¶
func (s *RaftServer) LeaderAddress(timeout time.Duration) (raft.ServerAddress, error)
func (*RaftServer) Search ¶
func (s *RaftServer) Search(request *bleve.SearchRequest) (*bleve.SearchResult, error)
func (*RaftServer) Snapshot ¶
func (s *RaftServer) Snapshot() error
func (*RaftServer) Start ¶
func (s *RaftServer) Start() error
func (*RaftServer) Stop ¶
func (s *RaftServer) Stop() error
func (*RaftServer) WaitForDetectLeader ¶
func (s *RaftServer) WaitForDetectLeader(timeout time.Duration) error
type RootHandler ¶
type RootHandler struct {
// contains filtered or unexported fields
}
func NewRootHandler ¶
func NewRootHandler(logger *log.Logger) *RootHandler
func (*RootHandler) ServeHTTP ¶
func (h *RootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SearchHandler ¶
type SearchHandler struct {
// contains filtered or unexported fields
}
func NewSearchHandler ¶
func NewSearchHandler(client *GRPCClient, logger *log.Logger) *SearchHandler
func (*SearchHandler) ServeHTTP ¶
func (h *SearchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.