varlog

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package varlog is a generated GoMock package.

Package varlog is a generated GoMock package.

Package varlog is a generated GoMock package.

Package varlog is a generated GoMock package.

Package varlog is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed      = errors.New("client: closed")
	ErrCallTimeout = errors.New("client: call timeout")
)

Functions

This section is empty.

Types

type Admin

type Admin interface {

	// GetStorageNode returns the metadata of the storage node specified by the argument snid.
	// If the admin server does not check the heartbeat of the storage node
	// yet, some fields are zero values, for instance, LastHeartbeatTime,
	// and Storages, Status, and StartTime of StorageNodeMetadataDescriptor.
	// It returns the ErrNotExist if the storage node does not exist.
	// It returns the ErrUnavailable if the cluster metadata cannot be
	// fetched from the metadata repository.
	GetStorageNode(ctx context.Context, snid types.StorageNodeID, opts ...AdminCallOption) (*admpb.StorageNodeMetadata, error)
	// ListStorageNodes returns a list of storage node metadata.
	// If the admin server does not check the heartbeat of the storage node
	// yet, some fields are zero values, for instance, LastHeartbeatTime,
	// and Storages, Status, and StartTime of StorageNodeMetadataDescriptor.
	// It returns the ErrUnavailable if the cluster metadata cannot be fetched from the metadata repository.
	//
	// Note that it should return an empty slice rather than nil to encode
	// to an empty array in JSON if no storage node exists in the cluster.
	ListStorageNodes(ctx context.Context, opts ...AdminCallOption) ([]admpb.StorageNodeMetadata, error)
	// GetStorageNodes returns a map of StorageNodeIDs and their addresses.
	// If the admin server does not check the heartbeat of the storage node
	// yet, some fields are zero values, for instance, LastHeartbeatTime,
	// and Storages, Status, and StartTime of StorageNodeMetadataDescriptor.
	// It returns the ErrUnavailable if the cluster metadata cannot be fetched from the metadata repository.
	//
	// Deprecated: Use ListStorageNodes.
	GetStorageNodes(ctx context.Context, opts ...AdminCallOption) (map[types.StorageNodeID]admpb.StorageNodeMetadata, error)
	// AddStorageNode registers a storage node, whose ID and address are
	// the argument snid and addr respectively, to the cluster.
	// It is okay to call AddStorageNode more than one time to add the same
	// storage node.
	// Once the storage node is registered, the pair of snid and addr
	// should not be changed.
	AddStorageNode(ctx context.Context, snid types.StorageNodeID, addr string, opts ...AdminCallOption) (*admpb.StorageNodeMetadata, error)
	// UnregisterStorageNode unregisters a storage node identified by the
	// argument snid from the cluster.
	// It is okay to unregister not existed storage node.
	// If the storage node still has running log stream replicas, it
	// returns an error.
	UnregisterStorageNode(ctx context.Context, snid types.StorageNodeID, opts ...AdminCallOption) error

	// GetTopic returns the metadata of the topic specified by the argument
	// tpid.
	// It returns the ErrNotExist error if the topic does not exist.
	// If the admin could not fetch cluster metadata, it returns an error,
	// and users can retry this RPC.
	GetTopic(ctx context.Context, tpid types.TopicID, opts ...AdminCallOption) (*varlogpb.TopicDescriptor, error)
	// ListTopics returns a list of all topics in the cluster.
	//
	// Note that it should return an empty slice rather than nil to encode
	// to an empty array in JSON if no topic exists in the cluster.
	ListTopics(ctx context.Context, opts ...AdminCallOption) ([]varlogpb.TopicDescriptor, error)
	// AddTopic adds a new topic and returns its metadata including a
	// unique topid ID.
	// It returns an error if rejected by the metadata repository due to
	// redundant topic ID or something else, and users can retry this RPC.
	AddTopic(ctx context.Context, opts ...AdminCallOption) (*varlogpb.TopicDescriptor, error)
	// UnregisterTopic removes a topic identified by the argument tpid from
	// the cluster.
	// It is okay to delete not existed topic.
	// It returns an error if it tries to delete the topic which has active
	// log streams.
	// If the admin could not fetch cluster metadata, it returns an error,
	// and users can retry this RPC.
	UnregisterTopic(ctx context.Context, tpid types.TopicID, opts ...AdminCallOption) error

	// GetLogStream returns metadata of log stream specified by the argument tpid and lsid.
	// It returns an error if there is no topic or log stream.
	GetLogStream(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, opts ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)
	// ListLogStreams returns a list of log streams belonging to the topic
	// tpid.
	//
	// Note that it should return an empty slice rather than nil to encode
	// to an empty array in JSON if no log stream exists in the topic.
	ListLogStreams(ctx context.Context, tpid types.TopicID, opts ...AdminCallOption) ([]varlogpb.LogStreamDescriptor, error)
	// DescribeTopic returns detailed metadata of the topic.
	// Deprecated: Use ListLogStreams.
	DescribeTopic(ctx context.Context, topicID types.TopicID, opts ...AdminCallOption) (*admpb.DescribeTopicResponse, error)
	// AddLogStream adds a new log stream to the topic tpid.
	// It returns the error code ResourceExhausted if the number of log streams
	// is reached the upper limit.
	//
	// The admin server chooses proper replicas if the argument replicas are empty.
	// Otherwise, if the argument replicas are defined, the admin server
	// creates a new log stream with the given configuration by the
	// argument replicas. Each
	// `proto/varlogpb.(ReplicaDescriptor).StorageNodePath` in the argument
	// replicas should be set. In this case, the following conditions
	// should be satisfied:
	// - The number of replicas should be equal to the replication factor.
	// - Each storage node for each replica should exist.
	// - The log stream, which tries to add,  should not exist.
	//
	// Internally, it waits for the log stream for being sealed and unsealed.
	AddLogStream(ctx context.Context, tpid types.TopicID, replicas []*varlogpb.ReplicaDescriptor, opts ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)
	// UpdateLogStream changes replicas of the log stream.
	// This method swaps two replicas - the argument poppedReplica and
	// pushedReplica. The poppedReplica is the old replica that belonged to
	// the log stream, however, pushedReplica is the new replica to be
	// added to the log stream. Note that
	// `proto/varlogpb.(ReplicaDescriptor).StorageNodePath` in the
	// poppedReplica and pushedReplica should be set.
	UpdateLogStream(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, poppedReplica varlogpb.ReplicaDescriptor, pushedReplica varlogpb.ReplicaDescriptor, opts ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)
	// UnregisterLogStream unregisters a log stream from the cluster.
	UnregisterLogStream(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, opts ...AdminCallOption) error

	// RemoveLogStreamReplica removes a log stream replica from the storage
	// node.
	RemoveLogStreamReplica(ctx context.Context, snid types.StorageNodeID, tpid types.TopicID, lsid types.LogStreamID, opts ...AdminCallOption) error

	// Seal seals the log stream identified by the argument tpid and lsid.
	Seal(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, opts ...AdminCallOption) (*admpb.SealResponse, error)
	// Unseal unseals the log stream identified by the argument tpid and
	// lsid.
	Unseal(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, opts ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)
	// Sync copies logs of the log stream identified by the argument tpid
	// and lsid from the source storage node to the destination storage
	// node.
	Sync(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID, srcid, dstid types.StorageNodeID, opts ...AdminCallOption) (*snpb.SyncStatus, error)
	// Trim deletes logs whose GLSNs are less than or equal to the argument
	// lastGLSN.
	// Note that the return type of this method can be changed soon.
	Trim(ctx context.Context, tpid types.TopicID, lastGLSN types.GLSN, opts ...AdminCallOption) (map[types.LogStreamID]map[types.StorageNodeID]error, error)

	GetMetadataRepositoryNode(ctx context.Context, nid types.NodeID, opts ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error)
	ListMetadataRepositoryNodes(ctx context.Context, opts ...AdminCallOption) ([]varlogpb.MetadataRepositoryNode, error)
	// GetMRMembers returns metadata repositories of the cluster.
	GetMRMembers(ctx context.Context, opts ...AdminCallOption) (*admpb.GetMRMembersResponse, error)
	AddMetadataRepositoryNode(ctx context.Context, raftURL, rpcAddr string, opts ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error)
	// AddMRPeer registers a new metadata repository to the cluster.
	AddMRPeer(ctx context.Context, raftURL, rpcAddr string, opts ...AdminCallOption) (types.NodeID, error)
	DeleteMetadataRepositoryNode(ctx context.Context, nid types.NodeID, opts ...AdminCallOption) error
	// RemoveMRPeer unregisters the metadata repository from the cluster.
	RemoveMRPeer(ctx context.Context, raftURL string, opts ...AdminCallOption) error

	// Close closes a connection to the admin server.
	// Once this method is called, the Client can't be used anymore.
	Close() error
}

Admin provides various methods to manage the varlog cluster.

func NewAdmin

func NewAdmin(ctx context.Context, addr string, opts ...AdminOption) (Admin, error)

NewAdmin creates Admin that connects to admin server by using the argument addr.

type AdminCallOption added in v0.3.1

type AdminCallOption interface {
	// contains filtered or unexported methods
}

AdminCallOption configures the RPC calls to the admin.

func WithTimeout added in v0.3.1

func WithTimeout(timeout time.Duration) AdminCallOption

WithTimeout sets the timeout of the call. It sets context timeout based on the parent context given to each method. The default timeout configured when a client is created is overridden by the timeout option given to each method.

type AdminOption added in v0.3.1

type AdminOption interface {
	// contains filtered or unexported methods
}

AdminOption configures the admin client.

func WithDefaultAdminCallOptions added in v0.3.1

func WithDefaultAdminCallOptions(opts ...AdminCallOption) AdminOption

WithDefaultAdminCallOptions sets the default AdminCallOptions for all RPC calls over the connection.

type Allowlist

type Allowlist interface {
	GetAll(topicID types.TopicID) []types.LogStreamID
	Pick(topicID types.TopicID) (types.LogStreamID, bool)
	Deny(topicID types.TopicID, logStreamID types.LogStreamID)
	Contains(topicID types.TopicID, logStreamID types.LogStreamID) bool
}

Allowlist represents selectable log streams.

type AppendOption

type AppendOption interface {
	// contains filtered or unexported methods
}

func WithAllowedLogStreams added in v0.5.0

func WithAllowedLogStreams(logStreams map[types.LogStreamID]struct{}) AppendOption

func WithRetryCount

func WithRetryCount(retryCount int) AppendOption

type AppendResult

type AppendResult struct {
	Metadata []varlogpb.LogEntryMeta
	Err      error
}

type BatchCallback added in v0.14.0

type BatchCallback func([]varlogpb.LogEntryMeta, error)

BatchCallback is a callback function to notify the result of AppendBatch.

type Log

type Log interface {
	io.Closer

	Append(ctx context.Context, topicID types.TopicID, data [][]byte, opts ...AppendOption) AppendResult

	// AppendTo writes a list of data to the log stream identified by the topicID and
	// logStreamID arguments.
	// This method returns an AppendResult that contains a list of metadata for each log entry
	// and an error if partial failures occur.
	// The length of the metadata list can be less than or equal to the number of data since
	// metadata for failed operations is not included in the metadata list.
	AppendTo(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID, data [][]byte, opts ...AppendOption) AppendResult

	Subscribe(ctx context.Context, topicID types.TopicID, begin types.GLSN, end types.GLSN, onNextFunc OnNext, opts ...SubscribeOption) (SubscribeCloser, error)

	SubscribeTo(ctx context.Context, topicID types.TopicID, logStreamID types.LogStreamID, begin, end types.LLSN, opts ...SubscribeOption) Subscriber

	Trim(ctx context.Context, topicID types.TopicID, until types.GLSN, opts TrimOption) error

	// PeekLogStream returns the log sequence numbers at the first and the
	// last. It fetches the metadata for each replica of a log stream lsid
	// concurrently and takes a result from either appendable or sealed
	// replica. If none of the replicas' statuses is either appendable or
	// sealed, it returns an error.
	PeekLogStream(ctx context.Context, tpid types.TopicID, lsid types.LogStreamID) (first varlogpb.LogSequenceNumber, last varlogpb.LogSequenceNumber, err error)

	// NewLogStreamAppender returns a new LogStreamAppender.
	NewLogStreamAppender(tpid types.TopicID, lsid types.LogStreamID, opts ...LogStreamAppenderOption) (LogStreamAppender, error)

	// AppendableLogStreams returns all writable log streams belonging to the
	// topic specified by the argument tpid.
	AppendableLogStreams(tpid types.TopicID) map[types.LogStreamID]struct{}
}

Log is a log interface with thread-safety. Many goroutines can share the same varlog object.

func Open

func Open(ctx context.Context, clusterID types.ClusterID, mrAddrs []string, opts ...Option) (Log, error)

Open creates new logs or opens an already created logs.

type LogStreamAppender added in v0.14.0

type LogStreamAppender interface {
	// AppendBatch appends dataBatch to the given log stream asynchronously.
	// Users can call this method without being blocked until the pipeline of
	// the LogStreamAppender is full. If the pipeline of the LogStreamAppender
	// is already full, it may become blocked. However, the process will
	// continue once a response is received from the storage node. A long block
	// duration with a configured WithCallTimeout can cause ErrCallTimeout to
	// occur.
	//
	// On completion of AppendBatch, the argument callback provided by users
	// will be invoked. All callback functions registered to the same
	// LogStreamAppender will be called by the same goroutine sequentially.
	// Therefore, the callback should be lightweight. If heavy work is
	// necessary for the callback, it would be better to use separate worker
	// goroutines.
	// Once the stream in the LogStreamAppender is either done or broken, the
	// AppendBatch returns an error. It returns an ErrClosed when the
	// LogStreamAppender is closed and an ErrCallTimeout when the call timeout
	// expires.
	//
	// It is safe to have multiple goroutines calling AppendBatch
	// simultaneously, but the order between them is not guaranteed.
	AppendBatch(dataBatch [][]byte, callback BatchCallback) error

	// Close closes the LogStreamAppender client. Once the client is closed,
	// calling AppendBatch will fail immediately. If AppendBatch still waits
	// for room of pipeline, Close will be blocked. It also waits for all
	// pending callbacks to be called.
	Close()
}

LogStreamAppender is a client only to be able to append to a particular log stream.

type LogStreamAppenderOption added in v0.14.0

type LogStreamAppenderOption interface {
	// contains filtered or unexported methods
}

LogStreamAppenderOption configures a LogStreamAppender.

func WithCallTimeout added in v0.14.0

func WithCallTimeout(callTimeout time.Duration) LogStreamAppenderOption

WithCallTimeout configures a timeout for each AppendBatch call. If the timeout has elapsed, the AppendBatch and callback functions may result in an ErrCallTimeout error.

ErrCallTimeout may be returned in the following scenarios: - Waiting for the pipeline too long since it is full. - Sending RPC requests to the varlog is blocked for too long. - Receiving RPC response from the varlog is blocked too long. - User codes for callback take time too long.

func WithDefaultBatchCallback added in v0.14.0

func WithDefaultBatchCallback(defaultBatchCallback BatchCallback) LogStreamAppenderOption

WithDefaultBatchCallback sets the default callback function. The default callback function can be overridden by the argument callback of the AppendBatch method.

func WithPipelineSize added in v0.14.0

func WithPipelineSize(pipelineSize int) LogStreamAppenderOption

WithPipelineSize sets request pipeline size. The default pipeline size is two. Any value below one will be set to one, and any above eight will be limited to eight.

type LogStreamSelector

type LogStreamSelector interface {
	Select(topicID types.TopicID) (types.LogStreamID, bool)
	GetAll(topicID types.TopicID) []types.LogStreamID
}

LogStreamSelector is the interface that wraps the Select method.

Select selects a log stream, but if there is no log stream to choose it returns false. GetAll returns all log streams belonging to the topic specified by the argument topicID.

type MetadataRefresher

type MetadataRefresher interface {
	Refresh(context.Context)
	Metadata() *varlogpb.MetadataDescriptor
	Close() error
}

type MockAdmin

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

MockAdmin is a mock of Admin interface.

func NewMockAdmin

func NewMockAdmin(ctrl *gomock.Controller) *MockAdmin

NewMockAdmin creates a new mock instance.

func (*MockAdmin) AddLogStream

AddLogStream mocks base method.

func (*MockAdmin) AddMRPeer

func (m *MockAdmin) AddMRPeer(arg0 context.Context, arg1, arg2 string, arg3 ...AdminCallOption) (types.NodeID, error)

AddMRPeer mocks base method.

func (*MockAdmin) AddMetadataRepositoryNode

func (m *MockAdmin) AddMetadataRepositoryNode(arg0 context.Context, arg1, arg2 string, arg3 ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error)

AddMetadataRepositoryNode mocks base method.

func (*MockAdmin) AddStorageNode

func (m *MockAdmin) AddStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 string, arg3 ...AdminCallOption) (*admpb.StorageNodeMetadata, error)

AddStorageNode mocks base method.

func (*MockAdmin) AddTopic

func (m *MockAdmin) AddTopic(arg0 context.Context, arg1 ...AdminCallOption) (*varlogpb.TopicDescriptor, error)

AddTopic mocks base method.

func (*MockAdmin) Close

func (m *MockAdmin) Close() error

Close mocks base method.

func (*MockAdmin) DeleteMetadataRepositoryNode

func (m *MockAdmin) DeleteMetadataRepositoryNode(arg0 context.Context, arg1 types.NodeID, arg2 ...AdminCallOption) error

DeleteMetadataRepositoryNode mocks base method.

func (*MockAdmin) DescribeTopic

func (m *MockAdmin) DescribeTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) (*admpb.DescribeTopicResponse, error)

DescribeTopic mocks base method.

func (*MockAdmin) EXPECT

func (m *MockAdmin) EXPECT() *MockAdminMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAdmin) GetLogStream

func (m *MockAdmin) GetLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)

GetLogStream mocks base method.

func (*MockAdmin) GetMRMembers

func (m *MockAdmin) GetMRMembers(arg0 context.Context, arg1 ...AdminCallOption) (*admpb.GetMRMembersResponse, error)

GetMRMembers mocks base method.

func (*MockAdmin) GetMetadataRepositoryNode

func (m *MockAdmin) GetMetadataRepositoryNode(arg0 context.Context, arg1 types.NodeID, arg2 ...AdminCallOption) (*varlogpb.MetadataRepositoryNode, error)

GetMetadataRepositoryNode mocks base method.

func (*MockAdmin) GetStorageNode

func (m *MockAdmin) GetStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 ...AdminCallOption) (*admpb.StorageNodeMetadata, error)

GetStorageNode mocks base method.

func (*MockAdmin) GetStorageNodes

func (m *MockAdmin) GetStorageNodes(arg0 context.Context, arg1 ...AdminCallOption) (map[types.StorageNodeID]admpb.StorageNodeMetadata, error)

GetStorageNodes mocks base method.

func (*MockAdmin) GetTopic

func (m *MockAdmin) GetTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) (*varlogpb.TopicDescriptor, error)

GetTopic mocks base method.

func (*MockAdmin) ListLogStreams

func (m *MockAdmin) ListLogStreams(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) ([]varlogpb.LogStreamDescriptor, error)

ListLogStreams mocks base method.

func (*MockAdmin) ListMetadataRepositoryNodes

func (m *MockAdmin) ListMetadataRepositoryNodes(arg0 context.Context, arg1 ...AdminCallOption) ([]varlogpb.MetadataRepositoryNode, error)

ListMetadataRepositoryNodes mocks base method.

func (*MockAdmin) ListStorageNodes

func (m *MockAdmin) ListStorageNodes(arg0 context.Context, arg1 ...AdminCallOption) ([]admpb.StorageNodeMetadata, error)

ListStorageNodes mocks base method.

func (*MockAdmin) ListTopics

func (m *MockAdmin) ListTopics(arg0 context.Context, arg1 ...AdminCallOption) ([]varlogpb.TopicDescriptor, error)

ListTopics mocks base method.

func (*MockAdmin) RemoveLogStreamReplica

func (m *MockAdmin) RemoveLogStreamReplica(arg0 context.Context, arg1 types.StorageNodeID, arg2 types.TopicID, arg3 types.LogStreamID, arg4 ...AdminCallOption) error

RemoveLogStreamReplica mocks base method.

func (*MockAdmin) RemoveMRPeer

func (m *MockAdmin) RemoveMRPeer(arg0 context.Context, arg1 string, arg2 ...AdminCallOption) error

RemoveMRPeer mocks base method.

func (*MockAdmin) Seal

Seal mocks base method.

func (*MockAdmin) Sync

func (m *MockAdmin) Sync(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 types.StorageNodeID, arg5 ...AdminCallOption) (*snpb.SyncStatus, error)

Sync mocks base method.

func (*MockAdmin) Trim

Trim mocks base method.

func (*MockAdmin) UnregisterLogStream

func (m *MockAdmin) UnregisterLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 ...AdminCallOption) error

UnregisterLogStream mocks base method.

func (*MockAdmin) UnregisterStorageNode

func (m *MockAdmin) UnregisterStorageNode(arg0 context.Context, arg1 types.StorageNodeID, arg2 ...AdminCallOption) error

UnregisterStorageNode mocks base method.

func (*MockAdmin) UnregisterTopic

func (m *MockAdmin) UnregisterTopic(arg0 context.Context, arg1 types.TopicID, arg2 ...AdminCallOption) error

UnregisterTopic mocks base method.

func (*MockAdmin) Unseal

Unseal mocks base method.

func (*MockAdmin) UpdateLogStream

func (m *MockAdmin) UpdateLogStream(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 varlogpb.ReplicaDescriptor, arg5 ...AdminCallOption) (*varlogpb.LogStreamDescriptor, error)

UpdateLogStream mocks base method.

type MockAdminMockRecorder

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

MockAdminMockRecorder is the mock recorder for MockAdmin.

func (*MockAdminMockRecorder) AddLogStream

func (mr *MockAdminMockRecorder) AddLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

AddLogStream indicates an expected call of AddLogStream.

func (*MockAdminMockRecorder) AddMRPeer

func (mr *MockAdminMockRecorder) AddMRPeer(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

AddMRPeer indicates an expected call of AddMRPeer.

func (*MockAdminMockRecorder) AddMetadataRepositoryNode

func (mr *MockAdminMockRecorder) AddMetadataRepositoryNode(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

AddMetadataRepositoryNode indicates an expected call of AddMetadataRepositoryNode.

func (*MockAdminMockRecorder) AddStorageNode

func (mr *MockAdminMockRecorder) AddStorageNode(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

AddStorageNode indicates an expected call of AddStorageNode.

func (*MockAdminMockRecorder) AddTopic

func (mr *MockAdminMockRecorder) AddTopic(arg0 any, arg1 ...any) *gomock.Call

AddTopic indicates an expected call of AddTopic.

func (*MockAdminMockRecorder) Close

func (mr *MockAdminMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockAdminMockRecorder) DeleteMetadataRepositoryNode

func (mr *MockAdminMockRecorder) DeleteMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call

DeleteMetadataRepositoryNode indicates an expected call of DeleteMetadataRepositoryNode.

func (*MockAdminMockRecorder) DescribeTopic

func (mr *MockAdminMockRecorder) DescribeTopic(arg0, arg1 any, arg2 ...any) *gomock.Call

DescribeTopic indicates an expected call of DescribeTopic.

func (*MockAdminMockRecorder) GetLogStream

func (mr *MockAdminMockRecorder) GetLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

GetLogStream indicates an expected call of GetLogStream.

func (*MockAdminMockRecorder) GetMRMembers

func (mr *MockAdminMockRecorder) GetMRMembers(arg0 any, arg1 ...any) *gomock.Call

GetMRMembers indicates an expected call of GetMRMembers.

func (*MockAdminMockRecorder) GetMetadataRepositoryNode

func (mr *MockAdminMockRecorder) GetMetadataRepositoryNode(arg0, arg1 any, arg2 ...any) *gomock.Call

GetMetadataRepositoryNode indicates an expected call of GetMetadataRepositoryNode.

func (*MockAdminMockRecorder) GetStorageNode

func (mr *MockAdminMockRecorder) GetStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call

GetStorageNode indicates an expected call of GetStorageNode.

func (*MockAdminMockRecorder) GetStorageNodes

func (mr *MockAdminMockRecorder) GetStorageNodes(arg0 any, arg1 ...any) *gomock.Call

GetStorageNodes indicates an expected call of GetStorageNodes.

func (*MockAdminMockRecorder) GetTopic

func (mr *MockAdminMockRecorder) GetTopic(arg0, arg1 any, arg2 ...any) *gomock.Call

GetTopic indicates an expected call of GetTopic.

func (*MockAdminMockRecorder) ListLogStreams

func (mr *MockAdminMockRecorder) ListLogStreams(arg0, arg1 any, arg2 ...any) *gomock.Call

ListLogStreams indicates an expected call of ListLogStreams.

func (*MockAdminMockRecorder) ListMetadataRepositoryNodes

func (mr *MockAdminMockRecorder) ListMetadataRepositoryNodes(arg0 any, arg1 ...any) *gomock.Call

ListMetadataRepositoryNodes indicates an expected call of ListMetadataRepositoryNodes.

func (*MockAdminMockRecorder) ListStorageNodes

func (mr *MockAdminMockRecorder) ListStorageNodes(arg0 any, arg1 ...any) *gomock.Call

ListStorageNodes indicates an expected call of ListStorageNodes.

func (*MockAdminMockRecorder) ListTopics

func (mr *MockAdminMockRecorder) ListTopics(arg0 any, arg1 ...any) *gomock.Call

ListTopics indicates an expected call of ListTopics.

func (*MockAdminMockRecorder) RemoveLogStreamReplica

func (mr *MockAdminMockRecorder) RemoveLogStreamReplica(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call

RemoveLogStreamReplica indicates an expected call of RemoveLogStreamReplica.

func (*MockAdminMockRecorder) RemoveMRPeer

func (mr *MockAdminMockRecorder) RemoveMRPeer(arg0, arg1 any, arg2 ...any) *gomock.Call

RemoveMRPeer indicates an expected call of RemoveMRPeer.

func (*MockAdminMockRecorder) Seal

func (mr *MockAdminMockRecorder) Seal(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

Seal indicates an expected call of Seal.

func (*MockAdminMockRecorder) Sync

func (mr *MockAdminMockRecorder) Sync(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call

Sync indicates an expected call of Sync.

func (*MockAdminMockRecorder) Trim

func (mr *MockAdminMockRecorder) Trim(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

Trim indicates an expected call of Trim.

func (*MockAdminMockRecorder) UnregisterLogStream

func (mr *MockAdminMockRecorder) UnregisterLogStream(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

UnregisterLogStream indicates an expected call of UnregisterLogStream.

func (*MockAdminMockRecorder) UnregisterStorageNode

func (mr *MockAdminMockRecorder) UnregisterStorageNode(arg0, arg1 any, arg2 ...any) *gomock.Call

UnregisterStorageNode indicates an expected call of UnregisterStorageNode.

func (*MockAdminMockRecorder) UnregisterTopic

func (mr *MockAdminMockRecorder) UnregisterTopic(arg0, arg1 any, arg2 ...any) *gomock.Call

UnregisterTopic indicates an expected call of UnregisterTopic.

func (*MockAdminMockRecorder) Unseal

func (mr *MockAdminMockRecorder) Unseal(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

Unseal indicates an expected call of Unseal.

func (*MockAdminMockRecorder) UpdateLogStream

func (mr *MockAdminMockRecorder) UpdateLogStream(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call

UpdateLogStream indicates an expected call of UpdateLogStream.

type MockLog

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

MockLog is a mock of Log interface.

func NewMockLog

func NewMockLog(ctrl *gomock.Controller) *MockLog

NewMockLog creates a new mock instance.

func (*MockLog) Append

func (m *MockLog) Append(arg0 context.Context, arg1 types.TopicID, arg2 [][]byte, arg3 ...AppendOption) AppendResult

Append mocks base method.

func (*MockLog) AppendTo

func (m *MockLog) AppendTo(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3 [][]byte, arg4 ...AppendOption) AppendResult

AppendTo mocks base method.

func (*MockLog) AppendableLogStreams added in v0.14.1

func (m *MockLog) AppendableLogStreams(arg0 types.TopicID) map[types.LogStreamID]struct{}

AppendableLogStreams mocks base method.

func (*MockLog) Close

func (m *MockLog) Close() error

Close mocks base method.

func (*MockLog) EXPECT

func (m *MockLog) EXPECT() *MockLogMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLog) NewLogStreamAppender added in v0.14.0

func (m *MockLog) NewLogStreamAppender(arg0 types.TopicID, arg1 types.LogStreamID, arg2 ...LogStreamAppenderOption) (LogStreamAppender, error)

NewLogStreamAppender mocks base method.

func (*MockLog) PeekLogStream added in v0.8.1

PeekLogStream mocks base method.

func (*MockLog) Subscribe

func (m *MockLog) Subscribe(arg0 context.Context, arg1 types.TopicID, arg2, arg3 types.GLSN, arg4 OnNext, arg5 ...SubscribeOption) (SubscribeCloser, error)

Subscribe mocks base method.

func (*MockLog) SubscribeTo

func (m *MockLog) SubscribeTo(arg0 context.Context, arg1 types.TopicID, arg2 types.LogStreamID, arg3, arg4 types.LLSN, arg5 ...SubscribeOption) Subscriber

SubscribeTo mocks base method.

func (*MockLog) Trim

func (m *MockLog) Trim(arg0 context.Context, arg1 types.TopicID, arg2 types.GLSN, arg3 TrimOption) error

Trim mocks base method.

type MockLogMockRecorder

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

MockLogMockRecorder is the mock recorder for MockLog.

func (*MockLogMockRecorder) Append

func (mr *MockLogMockRecorder) Append(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

Append indicates an expected call of Append.

func (*MockLogMockRecorder) AppendTo

func (mr *MockLogMockRecorder) AppendTo(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call

AppendTo indicates an expected call of AppendTo.

func (*MockLogMockRecorder) AppendableLogStreams added in v0.14.1

func (mr *MockLogMockRecorder) AppendableLogStreams(arg0 any) *gomock.Call

AppendableLogStreams indicates an expected call of AppendableLogStreams.

func (*MockLogMockRecorder) Close

func (mr *MockLogMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockLogMockRecorder) NewLogStreamAppender added in v0.14.0

func (mr *MockLogMockRecorder) NewLogStreamAppender(arg0, arg1 any, arg2 ...any) *gomock.Call

NewLogStreamAppender indicates an expected call of NewLogStreamAppender.

func (*MockLogMockRecorder) PeekLogStream added in v0.8.1

func (mr *MockLogMockRecorder) PeekLogStream(arg0, arg1, arg2 any) *gomock.Call

PeekLogStream indicates an expected call of PeekLogStream.

func (*MockLogMockRecorder) Subscribe

func (mr *MockLogMockRecorder) Subscribe(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call

Subscribe indicates an expected call of Subscribe.

func (*MockLogMockRecorder) SubscribeTo

func (mr *MockLogMockRecorder) SubscribeTo(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call

SubscribeTo indicates an expected call of SubscribeTo.

func (*MockLogMockRecorder) Trim

func (mr *MockLogMockRecorder) Trim(arg0, arg1, arg2, arg3 any) *gomock.Call

Trim indicates an expected call of Trim.

type MockLogStreamAppender added in v0.15.0

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

MockLogStreamAppender is a mock of LogStreamAppender interface.

func NewMockLogStreamAppender added in v0.15.0

func NewMockLogStreamAppender(ctrl *gomock.Controller) *MockLogStreamAppender

NewMockLogStreamAppender creates a new mock instance.

func (*MockLogStreamAppender) AppendBatch added in v0.15.0

func (m *MockLogStreamAppender) AppendBatch(arg0 [][]byte, arg1 BatchCallback) error

AppendBatch mocks base method.

func (*MockLogStreamAppender) Close added in v0.15.0

func (m *MockLogStreamAppender) Close()

Close mocks base method.

func (*MockLogStreamAppender) EXPECT added in v0.15.0

EXPECT returns an object that allows the caller to indicate expected use.

type MockLogStreamAppenderMockRecorder added in v0.15.0

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

MockLogStreamAppenderMockRecorder is the mock recorder for MockLogStreamAppender.

func (*MockLogStreamAppenderMockRecorder) AppendBatch added in v0.15.0

func (mr *MockLogStreamAppenderMockRecorder) AppendBatch(arg0, arg1 any) *gomock.Call

AppendBatch indicates an expected call of AppendBatch.

func (*MockLogStreamAppenderMockRecorder) Close added in v0.15.0

Close indicates an expected call of Close.

type MockMetadataRefresher

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

MockMetadataRefresher is a mock of MetadataRefresher interface.

func NewMockMetadataRefresher

func NewMockMetadataRefresher(ctrl *gomock.Controller) *MockMetadataRefresher

NewMockMetadataRefresher creates a new mock instance.

func (*MockMetadataRefresher) Close

func (m *MockMetadataRefresher) Close() error

Close mocks base method.

func (*MockMetadataRefresher) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMetadataRefresher) Metadata

Metadata mocks base method.

func (*MockMetadataRefresher) Refresh

func (m *MockMetadataRefresher) Refresh(arg0 context.Context)

Refresh mocks base method.

type MockMetadataRefresherMockRecorder

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

MockMetadataRefresherMockRecorder is the mock recorder for MockMetadataRefresher.

func (*MockMetadataRefresherMockRecorder) Close

Close indicates an expected call of Close.

func (*MockMetadataRefresherMockRecorder) Metadata

Metadata indicates an expected call of Metadata.

func (*MockMetadataRefresherMockRecorder) Refresh

func (mr *MockMetadataRefresherMockRecorder) Refresh(arg0 any) *gomock.Call

Refresh indicates an expected call of Refresh.

type MockRenewableReplicasRetriever

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

MockRenewableReplicasRetriever is a mock of RenewableReplicasRetriever interface.

func NewMockRenewableReplicasRetriever

func NewMockRenewableReplicasRetriever(ctrl *gomock.Controller) *MockRenewableReplicasRetriever

NewMockRenewableReplicasRetriever creates a new mock instance.

func (*MockRenewableReplicasRetriever) All

All mocks base method.

func (*MockRenewableReplicasRetriever) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRenewableReplicasRetriever) Renew

Renew mocks base method.

func (*MockRenewableReplicasRetriever) Retrieve

Retrieve mocks base method.

type MockRenewableReplicasRetrieverMockRecorder

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

MockRenewableReplicasRetrieverMockRecorder is the mock recorder for MockRenewableReplicasRetriever.

func (*MockRenewableReplicasRetrieverMockRecorder) All

All indicates an expected call of All.

func (*MockRenewableReplicasRetrieverMockRecorder) Renew

Renew indicates an expected call of Renew.

func (*MockRenewableReplicasRetrieverMockRecorder) Retrieve

func (mr *MockRenewableReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 any) *gomock.Call

Retrieve indicates an expected call of Retrieve.

type MockReplicasRetriever

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

MockReplicasRetriever is a mock of ReplicasRetriever interface.

func NewMockReplicasRetriever

func NewMockReplicasRetriever(ctrl *gomock.Controller) *MockReplicasRetriever

NewMockReplicasRetriever creates a new mock instance.

func (*MockReplicasRetriever) All

All mocks base method.

func (*MockReplicasRetriever) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockReplicasRetriever) Retrieve

Retrieve mocks base method.

type MockReplicasRetrieverMockRecorder

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

MockReplicasRetrieverMockRecorder is the mock recorder for MockReplicasRetriever.

func (*MockReplicasRetrieverMockRecorder) All

All indicates an expected call of All.

func (*MockReplicasRetrieverMockRecorder) Retrieve

func (mr *MockReplicasRetrieverMockRecorder) Retrieve(arg0, arg1 any) *gomock.Call

Retrieve indicates an expected call of Retrieve.

type OnNext

type OnNext func(logEntry varlogpb.LogEntry, err error)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithDenyTTL

func WithDenyTTL(denyTTL time.Duration) Option

func WithExpireDenyInterval

func WithExpireDenyInterval(interval time.Duration) Option

func WithGRPCDialOptions

func WithGRPCDialOptions(grpcDialOptions ...grpc.DialOption) Option

WithGRPCDialOptions sets the grpc dial options. See `google.golang.org/grpc.DialOption`.

func WithGRPCInitialConnWindowSize added in v0.14.0

func WithGRPCInitialConnWindowSize(bytes int32) Option

WithGRPCInitialConnWindowSize sets the initial window size on a connection. Internally, it calls `google.golang.org/grpc.WithInitialConnWindowSize`.

func WithGRPCInitialWindowSize added in v0.14.0

func WithGRPCInitialWindowSize(bytes int32) Option

WithGRPCInitialWindowSize sets the initial window size on a stream. Internally, it calls `google.golang.org/grpc.WithInitialWindowSize`.

func WithGRPCReadBufferSize added in v0.14.0

func WithGRPCReadBufferSize(bytes int) Option

WithGRPCReadBufferSize sets the size of the gRPC read buffer. Internally, it calls `google.golang.org/grpc.WithReadBufferSize`.

func WithGRPCWriteBufferSize added in v0.14.0

func WithGRPCWriteBufferSize(bytes int) Option

WithGRPCWriteBufferSize sets the size of the gRPC write buffer. Internally, it calls `google.golang.org/grpc.WithWriteBufferSize`.

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMRConnectorCallTimeout

func WithMRConnectorCallTimeout(timeout time.Duration) Option

func WithMRConnectorConnTimeout

func WithMRConnectorConnTimeout(timeout time.Duration) Option

func WithMetadataRefreshInterval

func WithMetadataRefreshInterval(interval time.Duration) Option

func WithMetadataRefreshTimeout

func WithMetadataRefreshTimeout(timeout time.Duration) Option

func WithOpenTimeout

func WithOpenTimeout(timeout time.Duration) Option

type PriorityQueue

type PriorityQueue []PriorityQueueItem

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type PriorityQueueItem

type PriorityQueueItem interface {
	Priority() uint64
}

type Renewable

type Renewable interface {
	Renew(metadata *varlogpb.MetadataDescriptor)
}

type RenewableAllowlist

type RenewableAllowlist interface {
	Allowlist
	Renewable
	io.Closer
}

RenewableAllowlist expands Allowlist and it provides Renew method to update allowlist.

type RenewableReplicasRetriever

type RenewableReplicasRetriever interface {
	ReplicasRetriever
	Renewable
}

type ReplicasRetriever

type ReplicasRetriever interface {
	Retrieve(topicID types.TopicID, logStreamID types.LogStreamID) ([]varlogpb.LogStreamReplica, bool)
	All(topicID types.TopicID) map[types.LogStreamID][]varlogpb.LogStreamReplica
}

ReplicasRetriever is the interface that wraps the Retrieve method.

Retrieve searches replicas belongs to the log stream.

type SubscribeCloser

type SubscribeCloser func()

type SubscribeOption

type SubscribeOption interface {
	// contains filtered or unexported methods
}

func WithSubscribeTimeout

func WithSubscribeTimeout(timeout time.Duration) SubscribeOption

type Subscriber

type Subscriber interface {
	Next() (varlogpb.LogEntry, error)
	io.Closer
}

type TrimOption

type TrimOption struct {
}

Directories

Path Synopsis
x

Jump to

Keyboard shortcuts

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