Documentation ¶
Overview ¶
delegator package contains the logic of shard delegator.
Index ¶
- type Manager
- type MockManager
- type MockManager_Expecter
- type MockManager_GetWorker_Call
- func (_c *MockManager_GetWorker_Call) Return(_a0 Worker, _a1 error) *MockManager_GetWorker_Call
- func (_c *MockManager_GetWorker_Call) Run(run func(ctx context.Context, nodeID int64)) *MockManager_GetWorker_Call
- func (_c *MockManager_GetWorker_Call) RunAndReturn(run func(context.Context, int64) (Worker, error)) *MockManager_GetWorker_Call
- type MockWorker
- func (_m *MockWorker) Delete(ctx context.Context, req *querypb.DeleteRequest) error
- func (_m *MockWorker) DeleteBatch(ctx context.Context, req *querypb.DeleteBatchRequest) (*querypb.DeleteBatchResponse, error)
- func (_m *MockWorker) EXPECT() *MockWorker_Expecter
- func (_m *MockWorker) GetStatistics(ctx context.Context, req *querypb.GetStatisticsRequest) (*internalpb.GetStatisticsResponse, error)
- func (_m *MockWorker) IsHealthy() bool
- func (_m *MockWorker) LoadSegments(_a0 context.Context, _a1 *querypb.LoadSegmentsRequest) error
- func (_m *MockWorker) QuerySegments(ctx context.Context, req *querypb.QueryRequest) (*internalpb.RetrieveResults, error)
- func (_m *MockWorker) QueryStreamSegments(ctx context.Context, req *querypb.QueryRequest, ...) error
- func (_m *MockWorker) ReleaseSegments(_a0 context.Context, _a1 *querypb.ReleaseSegmentsRequest) error
- func (_m *MockWorker) SearchSegments(ctx context.Context, req *querypb.SearchRequest) (*internalpb.SearchResults, error)
- func (_m *MockWorker) Stop()
- type MockWorker_DeleteBatch_Call
- func (_c *MockWorker_DeleteBatch_Call) Return(_a0 *querypb.DeleteBatchResponse, _a1 error) *MockWorker_DeleteBatch_Call
- func (_c *MockWorker_DeleteBatch_Call) Run(run func(ctx context.Context, req *querypb.DeleteBatchRequest)) *MockWorker_DeleteBatch_Call
- func (_c *MockWorker_DeleteBatch_Call) RunAndReturn(...) *MockWorker_DeleteBatch_Call
- type MockWorker_Delete_Call
- func (_c *MockWorker_Delete_Call) Return(_a0 error) *MockWorker_Delete_Call
- func (_c *MockWorker_Delete_Call) Run(run func(ctx context.Context, req *querypb.DeleteRequest)) *MockWorker_Delete_Call
- func (_c *MockWorker_Delete_Call) RunAndReturn(run func(context.Context, *querypb.DeleteRequest) error) *MockWorker_Delete_Call
- type MockWorker_Expecter
- func (_e *MockWorker_Expecter) Delete(ctx interface{}, req interface{}) *MockWorker_Delete_Call
- func (_e *MockWorker_Expecter) DeleteBatch(ctx interface{}, req interface{}) *MockWorker_DeleteBatch_Call
- func (_e *MockWorker_Expecter) GetStatistics(ctx interface{}, req interface{}) *MockWorker_GetStatistics_Call
- func (_e *MockWorker_Expecter) IsHealthy() *MockWorker_IsHealthy_Call
- func (_e *MockWorker_Expecter) LoadSegments(_a0 interface{}, _a1 interface{}) *MockWorker_LoadSegments_Call
- func (_e *MockWorker_Expecter) QuerySegments(ctx interface{}, req interface{}) *MockWorker_QuerySegments_Call
- func (_e *MockWorker_Expecter) QueryStreamSegments(ctx interface{}, req interface{}, srv interface{}) *MockWorker_QueryStreamSegments_Call
- func (_e *MockWorker_Expecter) ReleaseSegments(_a0 interface{}, _a1 interface{}) *MockWorker_ReleaseSegments_Call
- func (_e *MockWorker_Expecter) SearchSegments(ctx interface{}, req interface{}) *MockWorker_SearchSegments_Call
- func (_e *MockWorker_Expecter) Stop() *MockWorker_Stop_Call
- type MockWorker_GetStatistics_Call
- func (_c *MockWorker_GetStatistics_Call) Return(_a0 *internalpb.GetStatisticsResponse, _a1 error) *MockWorker_GetStatistics_Call
- func (_c *MockWorker_GetStatistics_Call) Run(run func(ctx context.Context, req *querypb.GetStatisticsRequest)) *MockWorker_GetStatistics_Call
- func (_c *MockWorker_GetStatistics_Call) RunAndReturn(...) *MockWorker_GetStatistics_Call
- type MockWorker_IsHealthy_Call
- type MockWorker_LoadSegments_Call
- func (_c *MockWorker_LoadSegments_Call) Return(_a0 error) *MockWorker_LoadSegments_Call
- func (_c *MockWorker_LoadSegments_Call) Run(run func(_a0 context.Context, _a1 *querypb.LoadSegmentsRequest)) *MockWorker_LoadSegments_Call
- func (_c *MockWorker_LoadSegments_Call) RunAndReturn(run func(context.Context, *querypb.LoadSegmentsRequest) error) *MockWorker_LoadSegments_Call
- type MockWorker_QuerySegments_Call
- func (_c *MockWorker_QuerySegments_Call) Return(_a0 *internalpb.RetrieveResults, _a1 error) *MockWorker_QuerySegments_Call
- func (_c *MockWorker_QuerySegments_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest)) *MockWorker_QuerySegments_Call
- func (_c *MockWorker_QuerySegments_Call) RunAndReturn(...) *MockWorker_QuerySegments_Call
- type MockWorker_QueryStreamSegments_Call
- func (_c *MockWorker_QueryStreamSegments_Call) Return(_a0 error) *MockWorker_QueryStreamSegments_Call
- func (_c *MockWorker_QueryStreamSegments_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest, ...)) *MockWorker_QueryStreamSegments_Call
- func (_c *MockWorker_QueryStreamSegments_Call) RunAndReturn(...) *MockWorker_QueryStreamSegments_Call
- type MockWorker_ReleaseSegments_Call
- func (_c *MockWorker_ReleaseSegments_Call) Return(_a0 error) *MockWorker_ReleaseSegments_Call
- func (_c *MockWorker_ReleaseSegments_Call) Run(run func(_a0 context.Context, _a1 *querypb.ReleaseSegmentsRequest)) *MockWorker_ReleaseSegments_Call
- func (_c *MockWorker_ReleaseSegments_Call) RunAndReturn(run func(context.Context, *querypb.ReleaseSegmentsRequest) error) *MockWorker_ReleaseSegments_Call
- type MockWorker_SearchSegments_Call
- func (_c *MockWorker_SearchSegments_Call) Return(_a0 *internalpb.SearchResults, _a1 error) *MockWorker_SearchSegments_Call
- func (_c *MockWorker_SearchSegments_Call) Run(run func(ctx context.Context, req *querypb.SearchRequest)) *MockWorker_SearchSegments_Call
- func (_c *MockWorker_SearchSegments_Call) RunAndReturn(...) *MockWorker_SearchSegments_Call
- type MockWorker_Stop_Call
- type Worker
- type WorkerBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager is the interface for worker manager.
func NewWorkerManager ¶
func NewWorkerManager(builder WorkerBuilder) Manager
type MockManager ¶
MockManager is an autogenerated mock type for the Manager type
func NewMockManager ¶
func NewMockManager(t interface { mock.TestingT Cleanup(func()) }) *MockManager
NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockManager) EXPECT ¶
func (_m *MockManager) EXPECT() *MockManager_Expecter
type MockManager_Expecter ¶
type MockManager_Expecter struct {
// contains filtered or unexported fields
}
func (*MockManager_Expecter) GetWorker ¶
func (_e *MockManager_Expecter) GetWorker(ctx interface{}, nodeID interface{}) *MockManager_GetWorker_Call
GetWorker is a helper method to define mock.On call
- ctx context.Context
- nodeID int64
type MockManager_GetWorker_Call ¶
MockManager_GetWorker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorker'
func (*MockManager_GetWorker_Call) Return ¶
func (_c *MockManager_GetWorker_Call) Return(_a0 Worker, _a1 error) *MockManager_GetWorker_Call
func (*MockManager_GetWorker_Call) Run ¶
func (_c *MockManager_GetWorker_Call) Run(run func(ctx context.Context, nodeID int64)) *MockManager_GetWorker_Call
func (*MockManager_GetWorker_Call) RunAndReturn ¶
func (_c *MockManager_GetWorker_Call) RunAndReturn(run func(context.Context, int64) (Worker, error)) *MockManager_GetWorker_Call
type MockWorker ¶
MockWorker is an autogenerated mock type for the Worker type
func NewMockWorker ¶
func NewMockWorker(t interface { mock.TestingT Cleanup(func()) }) *MockWorker
NewMockWorker creates a new instance of MockWorker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockWorker) Delete ¶
func (_m *MockWorker) Delete(ctx context.Context, req *querypb.DeleteRequest) error
Delete provides a mock function with given fields: ctx, req
func (*MockWorker) DeleteBatch ¶
func (_m *MockWorker) DeleteBatch(ctx context.Context, req *querypb.DeleteBatchRequest) (*querypb.DeleteBatchResponse, error)
DeleteBatch provides a mock function with given fields: ctx, req
func (*MockWorker) EXPECT ¶
func (_m *MockWorker) EXPECT() *MockWorker_Expecter
func (*MockWorker) GetStatistics ¶
func (_m *MockWorker) GetStatistics(ctx context.Context, req *querypb.GetStatisticsRequest) (*internalpb.GetStatisticsResponse, error)
GetStatistics provides a mock function with given fields: ctx, req
func (*MockWorker) IsHealthy ¶
func (_m *MockWorker) IsHealthy() bool
IsHealthy provides a mock function with given fields:
func (*MockWorker) LoadSegments ¶
func (_m *MockWorker) LoadSegments(_a0 context.Context, _a1 *querypb.LoadSegmentsRequest) error
LoadSegments provides a mock function with given fields: _a0, _a1
func (*MockWorker) QuerySegments ¶
func (_m *MockWorker) QuerySegments(ctx context.Context, req *querypb.QueryRequest) (*internalpb.RetrieveResults, error)
QuerySegments provides a mock function with given fields: ctx, req
func (*MockWorker) QueryStreamSegments ¶
func (_m *MockWorker) QueryStreamSegments(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer) error
QueryStreamSegments provides a mock function with given fields: ctx, req, srv
func (*MockWorker) ReleaseSegments ¶
func (_m *MockWorker) ReleaseSegments(_a0 context.Context, _a1 *querypb.ReleaseSegmentsRequest) error
ReleaseSegments provides a mock function with given fields: _a0, _a1
func (*MockWorker) SearchSegments ¶
func (_m *MockWorker) SearchSegments(ctx context.Context, req *querypb.SearchRequest) (*internalpb.SearchResults, error)
SearchSegments provides a mock function with given fields: ctx, req
func (*MockWorker) Stop ¶
func (_m *MockWorker) Stop()
Stop provides a mock function with given fields:
type MockWorker_DeleteBatch_Call ¶
MockWorker_DeleteBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBatch'
func (*MockWorker_DeleteBatch_Call) Return ¶
func (_c *MockWorker_DeleteBatch_Call) Return(_a0 *querypb.DeleteBatchResponse, _a1 error) *MockWorker_DeleteBatch_Call
func (*MockWorker_DeleteBatch_Call) Run ¶
func (_c *MockWorker_DeleteBatch_Call) Run(run func(ctx context.Context, req *querypb.DeleteBatchRequest)) *MockWorker_DeleteBatch_Call
func (*MockWorker_DeleteBatch_Call) RunAndReturn ¶
func (_c *MockWorker_DeleteBatch_Call) RunAndReturn(run func(context.Context, *querypb.DeleteBatchRequest) (*querypb.DeleteBatchResponse, error)) *MockWorker_DeleteBatch_Call
type MockWorker_Delete_Call ¶
MockWorker_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
func (*MockWorker_Delete_Call) Return ¶
func (_c *MockWorker_Delete_Call) Return(_a0 error) *MockWorker_Delete_Call
func (*MockWorker_Delete_Call) Run ¶
func (_c *MockWorker_Delete_Call) Run(run func(ctx context.Context, req *querypb.DeleteRequest)) *MockWorker_Delete_Call
func (*MockWorker_Delete_Call) RunAndReturn ¶
func (_c *MockWorker_Delete_Call) RunAndReturn(run func(context.Context, *querypb.DeleteRequest) error) *MockWorker_Delete_Call
type MockWorker_Expecter ¶
type MockWorker_Expecter struct {
// contains filtered or unexported fields
}
func (*MockWorker_Expecter) Delete ¶
func (_e *MockWorker_Expecter) Delete(ctx interface{}, req interface{}) *MockWorker_Delete_Call
Delete is a helper method to define mock.On call
- ctx context.Context
- req *querypb.DeleteRequest
func (*MockWorker_Expecter) DeleteBatch ¶
func (_e *MockWorker_Expecter) DeleteBatch(ctx interface{}, req interface{}) *MockWorker_DeleteBatch_Call
DeleteBatch is a helper method to define mock.On call
- ctx context.Context
- req *querypb.DeleteBatchRequest
func (*MockWorker_Expecter) GetStatistics ¶
func (_e *MockWorker_Expecter) GetStatistics(ctx interface{}, req interface{}) *MockWorker_GetStatistics_Call
GetStatistics is a helper method to define mock.On call
- ctx context.Context
- req *querypb.GetStatisticsRequest
func (*MockWorker_Expecter) IsHealthy ¶
func (_e *MockWorker_Expecter) IsHealthy() *MockWorker_IsHealthy_Call
IsHealthy is a helper method to define mock.On call
func (*MockWorker_Expecter) LoadSegments ¶
func (_e *MockWorker_Expecter) LoadSegments(_a0 interface{}, _a1 interface{}) *MockWorker_LoadSegments_Call
LoadSegments is a helper method to define mock.On call
- _a0 context.Context
- _a1 *querypb.LoadSegmentsRequest
func (*MockWorker_Expecter) QuerySegments ¶
func (_e *MockWorker_Expecter) QuerySegments(ctx interface{}, req interface{}) *MockWorker_QuerySegments_Call
QuerySegments is a helper method to define mock.On call
- ctx context.Context
- req *querypb.QueryRequest
func (*MockWorker_Expecter) QueryStreamSegments ¶
func (_e *MockWorker_Expecter) QueryStreamSegments(ctx interface{}, req interface{}, srv interface{}) *MockWorker_QueryStreamSegments_Call
QueryStreamSegments is a helper method to define mock.On call
- ctx context.Context
- req *querypb.QueryRequest
- srv streamrpc.QueryStreamServer
func (*MockWorker_Expecter) ReleaseSegments ¶
func (_e *MockWorker_Expecter) ReleaseSegments(_a0 interface{}, _a1 interface{}) *MockWorker_ReleaseSegments_Call
ReleaseSegments is a helper method to define mock.On call
- _a0 context.Context
- _a1 *querypb.ReleaseSegmentsRequest
func (*MockWorker_Expecter) SearchSegments ¶
func (_e *MockWorker_Expecter) SearchSegments(ctx interface{}, req interface{}) *MockWorker_SearchSegments_Call
SearchSegments is a helper method to define mock.On call
- ctx context.Context
- req *querypb.SearchRequest
func (*MockWorker_Expecter) Stop ¶
func (_e *MockWorker_Expecter) Stop() *MockWorker_Stop_Call
Stop is a helper method to define mock.On call
type MockWorker_GetStatistics_Call ¶
MockWorker_GetStatistics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatistics'
func (*MockWorker_GetStatistics_Call) Return ¶
func (_c *MockWorker_GetStatistics_Call) Return(_a0 *internalpb.GetStatisticsResponse, _a1 error) *MockWorker_GetStatistics_Call
func (*MockWorker_GetStatistics_Call) Run ¶
func (_c *MockWorker_GetStatistics_Call) Run(run func(ctx context.Context, req *querypb.GetStatisticsRequest)) *MockWorker_GetStatistics_Call
func (*MockWorker_GetStatistics_Call) RunAndReturn ¶
func (_c *MockWorker_GetStatistics_Call) RunAndReturn(run func(context.Context, *querypb.GetStatisticsRequest) (*internalpb.GetStatisticsResponse, error)) *MockWorker_GetStatistics_Call
type MockWorker_IsHealthy_Call ¶
MockWorker_IsHealthy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsHealthy'
func (*MockWorker_IsHealthy_Call) Return ¶
func (_c *MockWorker_IsHealthy_Call) Return(_a0 bool) *MockWorker_IsHealthy_Call
func (*MockWorker_IsHealthy_Call) Run ¶
func (_c *MockWorker_IsHealthy_Call) Run(run func()) *MockWorker_IsHealthy_Call
func (*MockWorker_IsHealthy_Call) RunAndReturn ¶
func (_c *MockWorker_IsHealthy_Call) RunAndReturn(run func() bool) *MockWorker_IsHealthy_Call
type MockWorker_LoadSegments_Call ¶
MockWorker_LoadSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSegments'
func (*MockWorker_LoadSegments_Call) Return ¶
func (_c *MockWorker_LoadSegments_Call) Return(_a0 error) *MockWorker_LoadSegments_Call
func (*MockWorker_LoadSegments_Call) Run ¶
func (_c *MockWorker_LoadSegments_Call) Run(run func(_a0 context.Context, _a1 *querypb.LoadSegmentsRequest)) *MockWorker_LoadSegments_Call
func (*MockWorker_LoadSegments_Call) RunAndReturn ¶
func (_c *MockWorker_LoadSegments_Call) RunAndReturn(run func(context.Context, *querypb.LoadSegmentsRequest) error) *MockWorker_LoadSegments_Call
type MockWorker_QuerySegments_Call ¶
MockWorker_QuerySegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuerySegments'
func (*MockWorker_QuerySegments_Call) Return ¶
func (_c *MockWorker_QuerySegments_Call) Return(_a0 *internalpb.RetrieveResults, _a1 error) *MockWorker_QuerySegments_Call
func (*MockWorker_QuerySegments_Call) Run ¶
func (_c *MockWorker_QuerySegments_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest)) *MockWorker_QuerySegments_Call
func (*MockWorker_QuerySegments_Call) RunAndReturn ¶
func (_c *MockWorker_QuerySegments_Call) RunAndReturn(run func(context.Context, *querypb.QueryRequest) (*internalpb.RetrieveResults, error)) *MockWorker_QuerySegments_Call
type MockWorker_QueryStreamSegments_Call ¶
MockWorker_QueryStreamSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryStreamSegments'
func (*MockWorker_QueryStreamSegments_Call) Return ¶
func (_c *MockWorker_QueryStreamSegments_Call) Return(_a0 error) *MockWorker_QueryStreamSegments_Call
func (*MockWorker_QueryStreamSegments_Call) Run ¶
func (_c *MockWorker_QueryStreamSegments_Call) Run(run func(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer)) *MockWorker_QueryStreamSegments_Call
func (*MockWorker_QueryStreamSegments_Call) RunAndReturn ¶
func (_c *MockWorker_QueryStreamSegments_Call) RunAndReturn(run func(context.Context, *querypb.QueryRequest, streamrpc.QueryStreamServer) error) *MockWorker_QueryStreamSegments_Call
type MockWorker_ReleaseSegments_Call ¶
MockWorker_ReleaseSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReleaseSegments'
func (*MockWorker_ReleaseSegments_Call) Return ¶
func (_c *MockWorker_ReleaseSegments_Call) Return(_a0 error) *MockWorker_ReleaseSegments_Call
func (*MockWorker_ReleaseSegments_Call) Run ¶
func (_c *MockWorker_ReleaseSegments_Call) Run(run func(_a0 context.Context, _a1 *querypb.ReleaseSegmentsRequest)) *MockWorker_ReleaseSegments_Call
func (*MockWorker_ReleaseSegments_Call) RunAndReturn ¶
func (_c *MockWorker_ReleaseSegments_Call) RunAndReturn(run func(context.Context, *querypb.ReleaseSegmentsRequest) error) *MockWorker_ReleaseSegments_Call
type MockWorker_SearchSegments_Call ¶
MockWorker_SearchSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchSegments'
func (*MockWorker_SearchSegments_Call) Return ¶
func (_c *MockWorker_SearchSegments_Call) Return(_a0 *internalpb.SearchResults, _a1 error) *MockWorker_SearchSegments_Call
func (*MockWorker_SearchSegments_Call) Run ¶
func (_c *MockWorker_SearchSegments_Call) Run(run func(ctx context.Context, req *querypb.SearchRequest)) *MockWorker_SearchSegments_Call
func (*MockWorker_SearchSegments_Call) RunAndReturn ¶
func (_c *MockWorker_SearchSegments_Call) RunAndReturn(run func(context.Context, *querypb.SearchRequest) (*internalpb.SearchResults, error)) *MockWorker_SearchSegments_Call
type MockWorker_Stop_Call ¶
MockWorker_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*MockWorker_Stop_Call) Return ¶
func (_c *MockWorker_Stop_Call) Return() *MockWorker_Stop_Call
func (*MockWorker_Stop_Call) Run ¶
func (_c *MockWorker_Stop_Call) Run(run func()) *MockWorker_Stop_Call
func (*MockWorker_Stop_Call) RunAndReturn ¶
func (_c *MockWorker_Stop_Call) RunAndReturn(run func()) *MockWorker_Stop_Call
type Worker ¶
type Worker interface { LoadSegments(context.Context, *querypb.LoadSegmentsRequest) error ReleaseSegments(context.Context, *querypb.ReleaseSegmentsRequest) error Delete(ctx context.Context, req *querypb.DeleteRequest) error DeleteBatch(ctx context.Context, req *querypb.DeleteBatchRequest) (*querypb.DeleteBatchResponse, error) SearchSegments(ctx context.Context, req *querypb.SearchRequest) (*internalpb.SearchResults, error) QuerySegments(ctx context.Context, req *querypb.QueryRequest) (*internalpb.RetrieveResults, error) QueryStreamSegments(ctx context.Context, req *querypb.QueryRequest, srv streamrpc.QueryStreamServer) error GetStatistics(ctx context.Context, req *querypb.GetStatisticsRequest) (*internalpb.GetStatisticsResponse, error) IsHealthy() bool Stop() }
Worker is the interface definition for querynode worker role.
func NewPoolingRemoteWorker ¶
func NewPoolingRemoteWorker(fn func() (types.QueryNodeClient, error)) (Worker, error)
func NewRemoteWorker ¶
func NewRemoteWorker(client types.QueryNodeClient) Worker
NewRemoteWorker creates a grpcWorker.