session

package
v0.10.3-0...-930112e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

Session Package

session package contains the worker manager/nodes abstraction for datanodes and indexnodes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataNodeCreatorFunc

type DataNodeCreatorFunc func(ctx context.Context, addr string, nodeID int64) (types.DataNodeClient, error)

type DataNodeManager

type DataNodeManager interface {
	AddSession(node *NodeInfo)
	DeleteSession(node *NodeInfo)
	GetSessionIDs() []int64
	GetSessions() []*Session
	GetSession(int64) (*Session, bool)

	Flush(ctx context.Context, nodeID int64, req *datapb.FlushSegmentsRequest)
	FlushChannels(ctx context.Context, nodeID int64, req *datapb.FlushChannelsRequest) error
	Compaction(ctx context.Context, nodeID int64, plan *datapb.CompactionPlan) error
	SyncSegments(ctx context.Context, nodeID int64, req *datapb.SyncSegmentsRequest) error
	GetCompactionPlanResult(nodeID int64, planID int64) (*datapb.CompactionPlanResult, error)
	GetCompactionPlansResults() (map[int64]*typeutil.Pair[int64, *datapb.CompactionPlanResult], error)
	NotifyChannelOperation(ctx context.Context, nodeID int64, req *datapb.ChannelOperationsRequest) error
	CheckChannelOperationProgress(ctx context.Context, nodeID int64, info *datapb.ChannelWatchInfo) (*datapb.ChannelOperationProgressResponse, error)
	PreImport(nodeID int64, in *datapb.PreImportRequest) error
	ImportV2(nodeID int64, in *datapb.ImportRequest) error
	QueryPreImport(nodeID int64, in *datapb.QueryPreImportRequest) (*datapb.QueryPreImportResponse, error)
	QueryImport(nodeID int64, in *datapb.QueryImportRequest) (*datapb.QueryImportResponse, error)
	DropImport(nodeID int64, in *datapb.DropImportRequest) error
	CheckHealth(ctx context.Context) error
	QuerySlot(nodeID int64) (*datapb.QuerySlotResponse, error)
	DropCompactionPlan(nodeID int64, req *datapb.DropCompactionPlanRequest) error
	Close()
}

DataNodeManager is the interface for datanode session manager.

type DataNodeManagerImpl

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

DataNodeManagerImpl provides the grpc interfaces of cluster

func NewDataNodeManagerImpl

func NewDataNodeManagerImpl(options ...SessionOpt) *DataNodeManagerImpl

NewDataNodeManagerImpl creates a new NewDataNodeManagerImpl

func (*DataNodeManagerImpl) AddSession

func (c *DataNodeManagerImpl) AddSession(node *NodeInfo)

AddSession creates a new session

func (*DataNodeManagerImpl) CheckChannelOperationProgress

func (c *DataNodeManagerImpl) CheckChannelOperationProgress(ctx context.Context, nodeID int64, info *datapb.ChannelWatchInfo) (*datapb.ChannelOperationProgressResponse, error)

func (*DataNodeManagerImpl) CheckHealth

func (c *DataNodeManagerImpl) CheckHealth(ctx context.Context) error

func (*DataNodeManagerImpl) Close

func (c *DataNodeManagerImpl) Close()

Close release sessions

func (*DataNodeManagerImpl) Compaction

func (c *DataNodeManagerImpl) Compaction(ctx context.Context, nodeID int64, plan *datapb.CompactionPlan) error

Compaction is a grpc interface. It will send request to DataNode with provided `nodeID` synchronously.

func (*DataNodeManagerImpl) DeleteSession

func (c *DataNodeManagerImpl) DeleteSession(node *NodeInfo)

DeleteSession removes the node session

func (*DataNodeManagerImpl) DropCompactionPlan

func (c *DataNodeManagerImpl) DropCompactionPlan(nodeID int64, req *datapb.DropCompactionPlanRequest) error

func (*DataNodeManagerImpl) DropImport

func (c *DataNodeManagerImpl) DropImport(nodeID int64, in *datapb.DropImportRequest) error

func (*DataNodeManagerImpl) Flush

Flush is a grpc interface. It will send req to nodeID asynchronously

func (*DataNodeManagerImpl) FlushChannels

func (c *DataNodeManagerImpl) FlushChannels(ctx context.Context, nodeID int64, req *datapb.FlushChannelsRequest) error

func (*DataNodeManagerImpl) GetCompactionPlanResult

func (c *DataNodeManagerImpl) GetCompactionPlanResult(nodeID int64, planID int64) (*datapb.CompactionPlanResult, error)

func (*DataNodeManagerImpl) GetCompactionPlansResults

func (c *DataNodeManagerImpl) GetCompactionPlansResults() (map[int64]*typeutil.Pair[int64, *datapb.CompactionPlanResult], error)

GetCompactionPlansResults returns map[planID]*pair[nodeID, *CompactionPlanResults]

func (*DataNodeManagerImpl) GetSession

func (c *DataNodeManagerImpl) GetSession(nodeID int64) (*Session, bool)

GetSession return a Session related to nodeID

func (*DataNodeManagerImpl) GetSessionIDs

func (c *DataNodeManagerImpl) GetSessionIDs() []int64

GetSessionIDs returns IDs of all live DataNodes.

func (*DataNodeManagerImpl) GetSessions

func (c *DataNodeManagerImpl) GetSessions() []*Session

GetSessions gets all node sessions

func (*DataNodeManagerImpl) ImportV2

func (c *DataNodeManagerImpl) ImportV2(nodeID int64, in *datapb.ImportRequest) error

func (*DataNodeManagerImpl) NotifyChannelOperation

func (c *DataNodeManagerImpl) NotifyChannelOperation(ctx context.Context, nodeID int64, req *datapb.ChannelOperationsRequest) error

func (*DataNodeManagerImpl) PreImport

func (c *DataNodeManagerImpl) PreImport(nodeID int64, in *datapb.PreImportRequest) error

func (*DataNodeManagerImpl) QueryImport

func (*DataNodeManagerImpl) QueryPreImport

func (*DataNodeManagerImpl) QuerySlot

func (c *DataNodeManagerImpl) QuerySlot(nodeID int64) (*datapb.QuerySlotResponse, error)

func (*DataNodeManagerImpl) SyncSegments

func (c *DataNodeManagerImpl) SyncSegments(ctx context.Context, nodeID int64, req *datapb.SyncSegmentsRequest) error

SyncSegments is a grpc interface. It will send request to DataNode with provided `nodeID` synchronously.

type IndexNodeCreatorFunc

type IndexNodeCreatorFunc func(ctx context.Context, addr string, nodeID int64) (types.IndexNodeClient, error)

type IndexNodeManager

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

IndexNodeManager is used to manage the client of IndexNode.

func NewNodeManager

func NewNodeManager(ctx context.Context, indexNodeCreator IndexNodeCreatorFunc) *IndexNodeManager

NewNodeManager is used to create a new IndexNodeManager.

func (*IndexNodeManager) AddNode

func (nm *IndexNodeManager) AddNode(nodeID typeutil.UniqueID, address string) error

AddNode adds the client of IndexNode.

func (*IndexNodeManager) ClientSupportDisk

func (nm *IndexNodeManager) ClientSupportDisk() bool

func (*IndexNodeManager) GetAllClients

func (nm *IndexNodeManager) GetAllClients() map[typeutil.UniqueID]types.IndexNodeClient

func (*IndexNodeManager) GetClientByID

func (nm *IndexNodeManager) GetClientByID(nodeID typeutil.UniqueID) (types.IndexNodeClient, bool)

func (*IndexNodeManager) PickClient

func (*IndexNodeManager) RemoveNode

func (nm *IndexNodeManager) RemoveNode(nodeID typeutil.UniqueID)

RemoveNode removes the unused client of IndexNode.

func (*IndexNodeManager) SetClient

func (nm *IndexNodeManager) SetClient(nodeID typeutil.UniqueID, client types.IndexNodeClient)

SetClient sets IndexNode client to node manager.

func (*IndexNodeManager) StoppingNode

func (nm *IndexNodeManager) StoppingNode(nodeID typeutil.UniqueID)

type MockDataNodeManager

type MockDataNodeManager struct {
	mock.Mock
}

MockDataNodeManager is an autogenerated mock type for the DataNodeManager type

func NewMockDataNodeManager

func NewMockDataNodeManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDataNodeManager

NewMockDataNodeManager creates a new instance of MockDataNodeManager. 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 (*MockDataNodeManager) AddSession

func (_m *MockDataNodeManager) AddSession(node *NodeInfo)

AddSession provides a mock function with given fields: node

func (*MockDataNodeManager) CheckChannelOperationProgress

func (_m *MockDataNodeManager) CheckChannelOperationProgress(ctx context.Context, nodeID int64, info *datapb.ChannelWatchInfo) (*datapb.ChannelOperationProgressResponse, error)

CheckChannelOperationProgress provides a mock function with given fields: ctx, nodeID, info

func (*MockDataNodeManager) CheckHealth

func (_m *MockDataNodeManager) CheckHealth(ctx context.Context) error

CheckHealth provides a mock function with given fields: ctx

func (*MockDataNodeManager) Close

func (_m *MockDataNodeManager) Close()

Close provides a mock function with given fields:

func (*MockDataNodeManager) Compaction

func (_m *MockDataNodeManager) Compaction(ctx context.Context, nodeID int64, plan *datapb.CompactionPlan) error

Compaction provides a mock function with given fields: ctx, nodeID, plan

func (*MockDataNodeManager) DeleteSession

func (_m *MockDataNodeManager) DeleteSession(node *NodeInfo)

DeleteSession provides a mock function with given fields: node

func (*MockDataNodeManager) DropCompactionPlan

func (_m *MockDataNodeManager) DropCompactionPlan(nodeID int64, req *datapb.DropCompactionPlanRequest) error

DropCompactionPlan provides a mock function with given fields: nodeID, req

func (*MockDataNodeManager) DropImport

func (_m *MockDataNodeManager) DropImport(nodeID int64, in *datapb.DropImportRequest) error

DropImport provides a mock function with given fields: nodeID, in

func (*MockDataNodeManager) EXPECT

func (*MockDataNodeManager) Flush

func (_m *MockDataNodeManager) Flush(ctx context.Context, nodeID int64, req *datapb.FlushSegmentsRequest)

Flush provides a mock function with given fields: ctx, nodeID, req

func (*MockDataNodeManager) FlushChannels

func (_m *MockDataNodeManager) FlushChannels(ctx context.Context, nodeID int64, req *datapb.FlushChannelsRequest) error

FlushChannels provides a mock function with given fields: ctx, nodeID, req

func (*MockDataNodeManager) GetCompactionPlanResult

func (_m *MockDataNodeManager) GetCompactionPlanResult(nodeID int64, planID int64) (*datapb.CompactionPlanResult, error)

GetCompactionPlanResult provides a mock function with given fields: nodeID, planID

func (*MockDataNodeManager) GetCompactionPlansResults

func (_m *MockDataNodeManager) GetCompactionPlansResults() (map[int64]*typeutil.Pair[int64, *datapb.CompactionPlanResult], error)

GetCompactionPlansResults provides a mock function with given fields:

func (*MockDataNodeManager) GetSession

func (_m *MockDataNodeManager) GetSession(_a0 int64) (*Session, bool)

GetSession provides a mock function with given fields: _a0

func (*MockDataNodeManager) GetSessionIDs

func (_m *MockDataNodeManager) GetSessionIDs() []int64

GetSessionIDs provides a mock function with given fields:

func (*MockDataNodeManager) GetSessions

func (_m *MockDataNodeManager) GetSessions() []*Session

GetSessions provides a mock function with given fields:

func (*MockDataNodeManager) ImportV2

func (_m *MockDataNodeManager) ImportV2(nodeID int64, in *datapb.ImportRequest) error

ImportV2 provides a mock function with given fields: nodeID, in

func (*MockDataNodeManager) NotifyChannelOperation

func (_m *MockDataNodeManager) NotifyChannelOperation(ctx context.Context, nodeID int64, req *datapb.ChannelOperationsRequest) error

NotifyChannelOperation provides a mock function with given fields: ctx, nodeID, req

func (*MockDataNodeManager) PreImport

func (_m *MockDataNodeManager) PreImport(nodeID int64, in *datapb.PreImportRequest) error

PreImport provides a mock function with given fields: nodeID, in

func (*MockDataNodeManager) QueryImport

QueryImport provides a mock function with given fields: nodeID, in

func (*MockDataNodeManager) QueryPreImport

QueryPreImport provides a mock function with given fields: nodeID, in

func (*MockDataNodeManager) QuerySlot

func (_m *MockDataNodeManager) QuerySlot(nodeID int64) (*datapb.QuerySlotResponse, error)

QuerySlot provides a mock function with given fields: nodeID

func (*MockDataNodeManager) SyncSegments

func (_m *MockDataNodeManager) SyncSegments(ctx context.Context, nodeID int64, req *datapb.SyncSegmentsRequest) error

SyncSegments provides a mock function with given fields: ctx, nodeID, req

type MockDataNodeManager_AddSession_Call

type MockDataNodeManager_AddSession_Call struct {
	*mock.Call
}

MockDataNodeManager_AddSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSession'

func (*MockDataNodeManager_AddSession_Call) Return

func (*MockDataNodeManager_AddSession_Call) Run

func (*MockDataNodeManager_AddSession_Call) RunAndReturn

type MockDataNodeManager_CheckChannelOperationProgress_Call

type MockDataNodeManager_CheckChannelOperationProgress_Call struct {
	*mock.Call
}

MockDataNodeManager_CheckChannelOperationProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckChannelOperationProgress'

func (*MockDataNodeManager_CheckChannelOperationProgress_Call) Run

type MockDataNodeManager_CheckHealth_Call

type MockDataNodeManager_CheckHealth_Call struct {
	*mock.Call
}

MockDataNodeManager_CheckHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckHealth'

func (*MockDataNodeManager_CheckHealth_Call) Return

func (*MockDataNodeManager_CheckHealth_Call) Run

func (*MockDataNodeManager_CheckHealth_Call) RunAndReturn

type MockDataNodeManager_Close_Call

type MockDataNodeManager_Close_Call struct {
	*mock.Call
}

MockDataNodeManager_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'

func (*MockDataNodeManager_Close_Call) Return

func (*MockDataNodeManager_Close_Call) Run

func (*MockDataNodeManager_Close_Call) RunAndReturn

func (_c *MockDataNodeManager_Close_Call) RunAndReturn(run func()) *MockDataNodeManager_Close_Call

type MockDataNodeManager_Compaction_Call

type MockDataNodeManager_Compaction_Call struct {
	*mock.Call
}

MockDataNodeManager_Compaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Compaction'

func (*MockDataNodeManager_Compaction_Call) Return

func (*MockDataNodeManager_Compaction_Call) Run

func (*MockDataNodeManager_Compaction_Call) RunAndReturn

type MockDataNodeManager_DeleteSession_Call

type MockDataNodeManager_DeleteSession_Call struct {
	*mock.Call
}

MockDataNodeManager_DeleteSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSession'

func (*MockDataNodeManager_DeleteSession_Call) Return

func (*MockDataNodeManager_DeleteSession_Call) Run

func (*MockDataNodeManager_DeleteSession_Call) RunAndReturn

type MockDataNodeManager_DropCompactionPlan_Call

type MockDataNodeManager_DropCompactionPlan_Call struct {
	*mock.Call
}

MockDataNodeManager_DropCompactionPlan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropCompactionPlan'

func (*MockDataNodeManager_DropCompactionPlan_Call) Return

func (*MockDataNodeManager_DropCompactionPlan_Call) Run

func (*MockDataNodeManager_DropCompactionPlan_Call) RunAndReturn

type MockDataNodeManager_DropImport_Call

type MockDataNodeManager_DropImport_Call struct {
	*mock.Call
}

MockDataNodeManager_DropImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropImport'

func (*MockDataNodeManager_DropImport_Call) Return

func (*MockDataNodeManager_DropImport_Call) Run

func (*MockDataNodeManager_DropImport_Call) RunAndReturn

type MockDataNodeManager_Expecter

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

func (*MockDataNodeManager_Expecter) AddSession

func (_e *MockDataNodeManager_Expecter) AddSession(node interface{}) *MockDataNodeManager_AddSession_Call

AddSession is a helper method to define mock.On call

  • node *NodeInfo

func (*MockDataNodeManager_Expecter) CheckChannelOperationProgress

func (_e *MockDataNodeManager_Expecter) CheckChannelOperationProgress(ctx interface{}, nodeID interface{}, info interface{}) *MockDataNodeManager_CheckChannelOperationProgress_Call

CheckChannelOperationProgress is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • info *datapb.ChannelWatchInfo

func (*MockDataNodeManager_Expecter) CheckHealth

func (_e *MockDataNodeManager_Expecter) CheckHealth(ctx interface{}) *MockDataNodeManager_CheckHealth_Call

CheckHealth is a helper method to define mock.On call

  • ctx context.Context

func (*MockDataNodeManager_Expecter) Close

Close is a helper method to define mock.On call

func (*MockDataNodeManager_Expecter) Compaction

func (_e *MockDataNodeManager_Expecter) Compaction(ctx interface{}, nodeID interface{}, plan interface{}) *MockDataNodeManager_Compaction_Call

Compaction is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • plan *datapb.CompactionPlan

func (*MockDataNodeManager_Expecter) DeleteSession

func (_e *MockDataNodeManager_Expecter) DeleteSession(node interface{}) *MockDataNodeManager_DeleteSession_Call

DeleteSession is a helper method to define mock.On call

  • node *NodeInfo

func (*MockDataNodeManager_Expecter) DropCompactionPlan

func (_e *MockDataNodeManager_Expecter) DropCompactionPlan(nodeID interface{}, req interface{}) *MockDataNodeManager_DropCompactionPlan_Call

DropCompactionPlan is a helper method to define mock.On call

  • nodeID int64
  • req *datapb.DropCompactionPlanRequest

func (*MockDataNodeManager_Expecter) DropImport

func (_e *MockDataNodeManager_Expecter) DropImport(nodeID interface{}, in interface{}) *MockDataNodeManager_DropImport_Call

DropImport is a helper method to define mock.On call

  • nodeID int64
  • in *datapb.DropImportRequest

func (*MockDataNodeManager_Expecter) Flush

func (_e *MockDataNodeManager_Expecter) Flush(ctx interface{}, nodeID interface{}, req interface{}) *MockDataNodeManager_Flush_Call

Flush is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • req *datapb.FlushSegmentsRequest

func (*MockDataNodeManager_Expecter) FlushChannels

func (_e *MockDataNodeManager_Expecter) FlushChannels(ctx interface{}, nodeID interface{}, req interface{}) *MockDataNodeManager_FlushChannels_Call

FlushChannels is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • req *datapb.FlushChannelsRequest

func (*MockDataNodeManager_Expecter) GetCompactionPlanResult

func (_e *MockDataNodeManager_Expecter) GetCompactionPlanResult(nodeID interface{}, planID interface{}) *MockDataNodeManager_GetCompactionPlanResult_Call

GetCompactionPlanResult is a helper method to define mock.On call

  • nodeID int64
  • planID int64

func (*MockDataNodeManager_Expecter) GetCompactionPlansResults

GetCompactionPlansResults is a helper method to define mock.On call

func (*MockDataNodeManager_Expecter) GetSession

func (_e *MockDataNodeManager_Expecter) GetSession(_a0 interface{}) *MockDataNodeManager_GetSession_Call

GetSession is a helper method to define mock.On call

  • _a0 int64

func (*MockDataNodeManager_Expecter) GetSessionIDs

GetSessionIDs is a helper method to define mock.On call

func (*MockDataNodeManager_Expecter) GetSessions

GetSessions is a helper method to define mock.On call

func (*MockDataNodeManager_Expecter) ImportV2

func (_e *MockDataNodeManager_Expecter) ImportV2(nodeID interface{}, in interface{}) *MockDataNodeManager_ImportV2_Call

ImportV2 is a helper method to define mock.On call

  • nodeID int64
  • in *datapb.ImportRequest

func (*MockDataNodeManager_Expecter) NotifyChannelOperation

func (_e *MockDataNodeManager_Expecter) NotifyChannelOperation(ctx interface{}, nodeID interface{}, req interface{}) *MockDataNodeManager_NotifyChannelOperation_Call

NotifyChannelOperation is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • req *datapb.ChannelOperationsRequest

func (*MockDataNodeManager_Expecter) PreImport

func (_e *MockDataNodeManager_Expecter) PreImport(nodeID interface{}, in interface{}) *MockDataNodeManager_PreImport_Call

PreImport is a helper method to define mock.On call

  • nodeID int64
  • in *datapb.PreImportRequest

func (*MockDataNodeManager_Expecter) QueryImport

func (_e *MockDataNodeManager_Expecter) QueryImport(nodeID interface{}, in interface{}) *MockDataNodeManager_QueryImport_Call

QueryImport is a helper method to define mock.On call

  • nodeID int64
  • in *datapb.QueryImportRequest

func (*MockDataNodeManager_Expecter) QueryPreImport

func (_e *MockDataNodeManager_Expecter) QueryPreImport(nodeID interface{}, in interface{}) *MockDataNodeManager_QueryPreImport_Call

QueryPreImport is a helper method to define mock.On call

  • nodeID int64
  • in *datapb.QueryPreImportRequest

func (*MockDataNodeManager_Expecter) QuerySlot

func (_e *MockDataNodeManager_Expecter) QuerySlot(nodeID interface{}) *MockDataNodeManager_QuerySlot_Call

QuerySlot is a helper method to define mock.On call

  • nodeID int64

func (*MockDataNodeManager_Expecter) SyncSegments

func (_e *MockDataNodeManager_Expecter) SyncSegments(ctx interface{}, nodeID interface{}, req interface{}) *MockDataNodeManager_SyncSegments_Call

SyncSegments is a helper method to define mock.On call

  • ctx context.Context
  • nodeID int64
  • req *datapb.SyncSegmentsRequest

type MockDataNodeManager_FlushChannels_Call

type MockDataNodeManager_FlushChannels_Call struct {
	*mock.Call
}

MockDataNodeManager_FlushChannels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FlushChannels'

func (*MockDataNodeManager_FlushChannels_Call) Return

func (*MockDataNodeManager_FlushChannels_Call) Run

func (*MockDataNodeManager_FlushChannels_Call) RunAndReturn

type MockDataNodeManager_Flush_Call

type MockDataNodeManager_Flush_Call struct {
	*mock.Call
}

MockDataNodeManager_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush'

func (*MockDataNodeManager_Flush_Call) Return

func (*MockDataNodeManager_Flush_Call) Run

func (*MockDataNodeManager_Flush_Call) RunAndReturn

type MockDataNodeManager_GetCompactionPlanResult_Call

type MockDataNodeManager_GetCompactionPlanResult_Call struct {
	*mock.Call
}

MockDataNodeManager_GetCompactionPlanResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCompactionPlanResult'

func (*MockDataNodeManager_GetCompactionPlanResult_Call) Return

func (*MockDataNodeManager_GetCompactionPlanResult_Call) Run

func (*MockDataNodeManager_GetCompactionPlanResult_Call) RunAndReturn

type MockDataNodeManager_GetCompactionPlansResults_Call

type MockDataNodeManager_GetCompactionPlansResults_Call struct {
	*mock.Call
}

MockDataNodeManager_GetCompactionPlansResults_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCompactionPlansResults'

func (*MockDataNodeManager_GetCompactionPlansResults_Call) Return

func (*MockDataNodeManager_GetCompactionPlansResults_Call) Run

func (*MockDataNodeManager_GetCompactionPlansResults_Call) RunAndReturn

type MockDataNodeManager_GetSessionIDs_Call

type MockDataNodeManager_GetSessionIDs_Call struct {
	*mock.Call
}

MockDataNodeManager_GetSessionIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessionIDs'

func (*MockDataNodeManager_GetSessionIDs_Call) Return

func (*MockDataNodeManager_GetSessionIDs_Call) Run

func (*MockDataNodeManager_GetSessionIDs_Call) RunAndReturn

type MockDataNodeManager_GetSession_Call

type MockDataNodeManager_GetSession_Call struct {
	*mock.Call
}

MockDataNodeManager_GetSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSession'

func (*MockDataNodeManager_GetSession_Call) Return

func (*MockDataNodeManager_GetSession_Call) Run

func (*MockDataNodeManager_GetSession_Call) RunAndReturn

type MockDataNodeManager_GetSessions_Call

type MockDataNodeManager_GetSessions_Call struct {
	*mock.Call
}

MockDataNodeManager_GetSessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessions'

func (*MockDataNodeManager_GetSessions_Call) Return

func (*MockDataNodeManager_GetSessions_Call) Run

func (*MockDataNodeManager_GetSessions_Call) RunAndReturn

type MockDataNodeManager_ImportV2_Call

type MockDataNodeManager_ImportV2_Call struct {
	*mock.Call
}

MockDataNodeManager_ImportV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImportV2'

func (*MockDataNodeManager_ImportV2_Call) Return

func (*MockDataNodeManager_ImportV2_Call) Run

func (*MockDataNodeManager_ImportV2_Call) RunAndReturn

type MockDataNodeManager_NotifyChannelOperation_Call

type MockDataNodeManager_NotifyChannelOperation_Call struct {
	*mock.Call
}

MockDataNodeManager_NotifyChannelOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyChannelOperation'

func (*MockDataNodeManager_NotifyChannelOperation_Call) Return

func (*MockDataNodeManager_NotifyChannelOperation_Call) Run

type MockDataNodeManager_PreImport_Call

type MockDataNodeManager_PreImport_Call struct {
	*mock.Call
}

MockDataNodeManager_PreImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PreImport'

func (*MockDataNodeManager_PreImport_Call) Return

func (*MockDataNodeManager_PreImport_Call) Run

func (*MockDataNodeManager_PreImport_Call) RunAndReturn

type MockDataNodeManager_QueryImport_Call

type MockDataNodeManager_QueryImport_Call struct {
	*mock.Call
}

MockDataNodeManager_QueryImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryImport'

func (*MockDataNodeManager_QueryImport_Call) Return

func (*MockDataNodeManager_QueryImport_Call) Run

func (*MockDataNodeManager_QueryImport_Call) RunAndReturn

type MockDataNodeManager_QueryPreImport_Call

type MockDataNodeManager_QueryPreImport_Call struct {
	*mock.Call
}

MockDataNodeManager_QueryPreImport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryPreImport'

func (*MockDataNodeManager_QueryPreImport_Call) Return

func (*MockDataNodeManager_QueryPreImport_Call) Run

type MockDataNodeManager_QuerySlot_Call

type MockDataNodeManager_QuerySlot_Call struct {
	*mock.Call
}

MockDataNodeManager_QuerySlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuerySlot'

func (*MockDataNodeManager_QuerySlot_Call) Return

func (*MockDataNodeManager_QuerySlot_Call) Run

func (*MockDataNodeManager_QuerySlot_Call) RunAndReturn

type MockDataNodeManager_SyncSegments_Call

type MockDataNodeManager_SyncSegments_Call struct {
	*mock.Call
}

MockDataNodeManager_SyncSegments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncSegments'

func (*MockDataNodeManager_SyncSegments_Call) Return

func (*MockDataNodeManager_SyncSegments_Call) Run

func (*MockDataNodeManager_SyncSegments_Call) RunAndReturn

type MockWorkerManager

type MockWorkerManager struct {
	mock.Mock
}

MockWorkerManager is an autogenerated mock type for the WorkerManager type

func NewMockWorkerManager

func NewMockWorkerManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockWorkerManager

NewMockWorkerManager creates a new instance of MockWorkerManager. 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 (*MockWorkerManager) AddNode

func (_m *MockWorkerManager) AddNode(nodeID int64, address string) error

AddNode provides a mock function with given fields: nodeID, address

func (*MockWorkerManager) ClientSupportDisk

func (_m *MockWorkerManager) ClientSupportDisk() bool

ClientSupportDisk provides a mock function with given fields:

func (*MockWorkerManager) EXPECT

func (*MockWorkerManager) GetAllClients

func (_m *MockWorkerManager) GetAllClients() map[int64]types.IndexNodeClient

GetAllClients provides a mock function with given fields:

func (*MockWorkerManager) GetClientByID

func (_m *MockWorkerManager) GetClientByID(nodeID int64) (types.IndexNodeClient, bool)

GetClientByID provides a mock function with given fields: nodeID

func (*MockWorkerManager) PickClient

func (_m *MockWorkerManager) PickClient() (int64, types.IndexNodeClient)

PickClient provides a mock function with given fields:

func (*MockWorkerManager) RemoveNode

func (_m *MockWorkerManager) RemoveNode(nodeID int64)

RemoveNode provides a mock function with given fields: nodeID

func (*MockWorkerManager) StoppingNode

func (_m *MockWorkerManager) StoppingNode(nodeID int64)

StoppingNode provides a mock function with given fields: nodeID

type MockWorkerManager_AddNode_Call

type MockWorkerManager_AddNode_Call struct {
	*mock.Call
}

MockWorkerManager_AddNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddNode'

func (*MockWorkerManager_AddNode_Call) Return

func (*MockWorkerManager_AddNode_Call) Run

func (_c *MockWorkerManager_AddNode_Call) Run(run func(nodeID int64, address string)) *MockWorkerManager_AddNode_Call

func (*MockWorkerManager_AddNode_Call) RunAndReturn

type MockWorkerManager_ClientSupportDisk_Call

type MockWorkerManager_ClientSupportDisk_Call struct {
	*mock.Call
}

MockWorkerManager_ClientSupportDisk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientSupportDisk'

func (*MockWorkerManager_ClientSupportDisk_Call) Return

func (*MockWorkerManager_ClientSupportDisk_Call) Run

func (*MockWorkerManager_ClientSupportDisk_Call) RunAndReturn

type MockWorkerManager_Expecter

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

func (*MockWorkerManager_Expecter) AddNode

func (_e *MockWorkerManager_Expecter) AddNode(nodeID interface{}, address interface{}) *MockWorkerManager_AddNode_Call

AddNode is a helper method to define mock.On call

  • nodeID int64
  • address string

func (*MockWorkerManager_Expecter) ClientSupportDisk

ClientSupportDisk is a helper method to define mock.On call

func (*MockWorkerManager_Expecter) GetAllClients

GetAllClients is a helper method to define mock.On call

func (*MockWorkerManager_Expecter) GetClientByID

func (_e *MockWorkerManager_Expecter) GetClientByID(nodeID interface{}) *MockWorkerManager_GetClientByID_Call

GetClientByID is a helper method to define mock.On call

  • nodeID int64

func (*MockWorkerManager_Expecter) PickClient

PickClient is a helper method to define mock.On call

func (*MockWorkerManager_Expecter) RemoveNode

func (_e *MockWorkerManager_Expecter) RemoveNode(nodeID interface{}) *MockWorkerManager_RemoveNode_Call

RemoveNode is a helper method to define mock.On call

  • nodeID int64

func (*MockWorkerManager_Expecter) StoppingNode

func (_e *MockWorkerManager_Expecter) StoppingNode(nodeID interface{}) *MockWorkerManager_StoppingNode_Call

StoppingNode is a helper method to define mock.On call

  • nodeID int64

type MockWorkerManager_GetAllClients_Call

type MockWorkerManager_GetAllClients_Call struct {
	*mock.Call
}

MockWorkerManager_GetAllClients_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllClients'

func (*MockWorkerManager_GetAllClients_Call) Return

func (*MockWorkerManager_GetAllClients_Call) Run

func (*MockWorkerManager_GetAllClients_Call) RunAndReturn

type MockWorkerManager_GetClientByID_Call

type MockWorkerManager_GetClientByID_Call struct {
	*mock.Call
}

MockWorkerManager_GetClientByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClientByID'

func (*MockWorkerManager_GetClientByID_Call) Return

func (*MockWorkerManager_GetClientByID_Call) Run

func (*MockWorkerManager_GetClientByID_Call) RunAndReturn

type MockWorkerManager_PickClient_Call

type MockWorkerManager_PickClient_Call struct {
	*mock.Call
}

MockWorkerManager_PickClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PickClient'

func (*MockWorkerManager_PickClient_Call) Return

func (*MockWorkerManager_PickClient_Call) Run

func (*MockWorkerManager_PickClient_Call) RunAndReturn

type MockWorkerManager_RemoveNode_Call

type MockWorkerManager_RemoveNode_Call struct {
	*mock.Call
}

MockWorkerManager_RemoveNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveNode'

func (*MockWorkerManager_RemoveNode_Call) Return

func (*MockWorkerManager_RemoveNode_Call) Run

func (*MockWorkerManager_RemoveNode_Call) RunAndReturn

type MockWorkerManager_StoppingNode_Call

type MockWorkerManager_StoppingNode_Call struct {
	*mock.Call
}

MockWorkerManager_StoppingNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoppingNode'

func (*MockWorkerManager_StoppingNode_Call) Return

func (*MockWorkerManager_StoppingNode_Call) Run

func (*MockWorkerManager_StoppingNode_Call) RunAndReturn

type NodeInfo

type NodeInfo struct {
	NodeID   int64
	Address  string
	IsLegacy bool
}

NodeInfo contains node base info

type Session

type Session struct {
	lock.Mutex
	// contains filtered or unexported fields
}

Session contains session info of a node

func NewSession

func NewSession(info *NodeInfo, creator DataNodeCreatorFunc) *Session

NewSession creates a new session

func (*Session) Address

func (n *Session) Address() string

Address returns address of session internal node info. If internal info is nil, return empty string instead.

func (*Session) Dispose

func (n *Session) Dispose()

Dispose releases client connection

func (*Session) GetOrCreateClient

func (n *Session) GetOrCreateClient(ctx context.Context) (types.DataNodeClient, error)

GetOrCreateClient gets or creates a new client for session

func (*Session) NodeID

func (n *Session) NodeID() int64

NodeID returns node id for session. If internal info is nil, return -1 instead.

type SessionOpt

type SessionOpt func(c *DataNodeManagerImpl)

SessionOpt provides a way to set params in SessionManagerImpl

func WithDataNodeCreator

func WithDataNodeCreator(creator DataNodeCreatorFunc) SessionOpt

type WorkerManager

type WorkerManager interface {
	AddNode(nodeID typeutil.UniqueID, address string) error
	RemoveNode(nodeID typeutil.UniqueID)
	StoppingNode(nodeID typeutil.UniqueID)
	PickClient() (typeutil.UniqueID, types.IndexNodeClient)
	ClientSupportDisk() bool
	GetAllClients() map[typeutil.UniqueID]types.IndexNodeClient
	GetClientByID(nodeID typeutil.UniqueID) (types.IndexNodeClient, bool)
}

Jump to

Keyboard shortcuts

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