namespace

package
v1.26.2-121.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 23 Imported by: 2

Documentation

Overview

Package namespace is a generated GoMock package.

Package namespace is a generated GoMock package.

Package namespace is a generated GoMock package.

Index

Constants

View Source
const (
	// MinRetentionGlobal is a hard limit for the minimun retention duration for global
	// namespaces (to allow time for replication).
	MinRetentionGlobal = 1 * 24 * time.Hour

	// MinRetentionLocal is a hard limit for the minimun retention duration for local
	// namespaces. Allow short values but disallow zero to avoid confusion with
	// interpreting zero as infinite.
	MinRetentionLocal = 1 * time.Hour
)
View Source
const (
	EmptyName Name = ""
	EmptyID   ID   = ""

	// ReplicationPolicyOneCluster indicate that workflows does not need to be replicated
	// applicable to local namespace & global namespace with one cluster
	ReplicationPolicyOneCluster ReplicationPolicy = 0
	// ReplicationPolicyMultiCluster indicate that workflows need to be replicated
	ReplicationPolicyMultiCluster ReplicationPolicy = 1
)

Variables

View Source
var (
	// ErrEmptyNamespaceReplicationTask is the error to indicate empty replication task
	ErrEmptyNamespaceReplicationTask = serviceerror.NewInvalidArgument("empty namespace replication task")
	// ErrInvalidNamespaceOperation is the error to indicate empty namespace operation attribute
	ErrInvalidNamespaceOperation = serviceerror.NewInvalidArgument("invalid namespace operation attribute")
	// ErrInvalidNamespaceID is the error to indicate empty rID attribute
	ErrInvalidNamespaceID = serviceerror.NewInvalidArgument("invalid namespace ID attribute")
	// ErrInvalidNamespaceInfo is the error to indicate empty info attribute
	ErrInvalidNamespaceInfo = serviceerror.NewInvalidArgument("invalid namespace info attribute")
	// ErrInvalidNamespaceConfig is the error to indicate empty config attribute
	ErrInvalidNamespaceConfig = serviceerror.NewInvalidArgument("invalid namespace config attribute")
	// ErrInvalidNamespaceReplicationConfig is the error to indicate empty replication config attribute
	ErrInvalidNamespaceReplicationConfig = serviceerror.NewInvalidArgument("invalid namespace replication config attribute")
	// ErrInvalidNamespaceConfigVersion is the error to indicate empty config version attribute
	ErrInvalidNamespaceConfigVersion = serviceerror.NewInvalidArgument("invalid namespace config version attribute")
	// ErrInvalidNamespaceFailoverVersion is the error to indicate empty failover version attribute
	ErrInvalidNamespaceFailoverVersion = serviceerror.NewInvalidArgument("invalid namespace failover version attribute")
	// ErrInvalidNamespaceState is the error to indicate invalid namespace state
	ErrInvalidNamespaceState = serviceerror.NewInvalidArgument("invalid namespace state attribute")
	// ErrNameUUIDCollision is the error to indicate namespace name / UUID collision
	ErrNameUUIDCollision = serviceerror.NewInvalidArgument("namespace replication encountered name / UUID collision")
)

Functions

func ConvertClusterReplicationConfigFromProto added in v1.20.0

func ConvertClusterReplicationConfigFromProto(
	input []*replicationpb.ClusterReplicationConfig,
) []string

Types

type ArchivalConfigEvent added in v1.20.0

type ArchivalConfigEvent struct {
	DefaultURI string
	URI        string
	State      enumspb.ArchivalState
}

ArchivalConfigEvent represents a change request to archival config state the only restriction placed on events is that defaultURI is not empty state can be nil, enabled, or disabled (nil indicates no update by user is being attempted)

func (*ArchivalConfigEvent) Validate added in v1.20.0

func (e *ArchivalConfigEvent) Validate() error

type ArchivalConfigState added in v1.20.0

type ArchivalConfigState struct {
	State enumspb.ArchivalState
	URI   string
}

ArchivalConfigState represents the state of archival config the only invalid state is {URI="", state=enabled} once URI is set it is immutable

func NeverEnabledState added in v1.20.0

func NeverEnabledState() *ArchivalConfigState

func (*ArchivalConfigState) GetNextState added in v1.20.0

func (s *ArchivalConfigState) GetNextState(
	e *ArchivalConfigEvent,
	URIValidationFunc func(URI string) error,
) (nextState *ArchivalConfigState, changed bool, err error)

type AttrValidatorImpl

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

AttrValidatorImpl is namespace attr validator

func NewAttrValidator added in v1.20.0

func NewAttrValidator(
	clusterMetadata cluster.Metadata,
) *AttrValidatorImpl

NewAttrValidator create a new namespace attr validator

func (*AttrValidatorImpl) ValidateNamespaceConfig added in v1.20.0

func (d *AttrValidatorImpl) ValidateNamespaceConfig(config *persistencespb.NamespaceConfig) error

func (*AttrValidatorImpl) ValidateNamespaceReplicationConfigForGlobalNamespace added in v1.20.0

func (d *AttrValidatorImpl) ValidateNamespaceReplicationConfigForGlobalNamespace(
	replicationConfig *persistencespb.NamespaceReplicationConfig,
) error

func (*AttrValidatorImpl) ValidateNamespaceReplicationConfigForLocalNamespace added in v1.20.0

func (d *AttrValidatorImpl) ValidateNamespaceReplicationConfigForLocalNamespace(
	replicationConfig *persistencespb.NamespaceReplicationConfig,
) error

type BadBinaryError added in v1.13.0

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

BadBinaryError is an error type carrying additional information about when/why/who configured a given checksum as being bad.

func (BadBinaryError) Checksum added in v1.13.0

func (e BadBinaryError) Checksum() string

Checksum observes the binary checksum that caused this error.

func (BadBinaryError) Created added in v1.13.0

func (e BadBinaryError) Created() time.Time

Created returns the time at which this bad binary was declared to be bad.

func (BadBinaryError) Error added in v1.13.0

func (e BadBinaryError) Error() string

Error returns the reason associated with this bad binary.

func (BadBinaryError) Operator added in v1.13.0

func (e BadBinaryError) Operator() string

Operator returns the operator associated with this bad binary.

func (BadBinaryError) Reason added in v1.13.0

func (e BadBinaryError) Reason() string

Reason returns the reason associated with this bad binary.

type CustomSearchAttributesMapper added in v1.20.0

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

func (*CustomSearchAttributesMapper) FieldToAliasMap added in v1.20.0

func (m *CustomSearchAttributesMapper) FieldToAliasMap() map[string]string

func (*CustomSearchAttributesMapper) GetAlias added in v1.20.0

func (m *CustomSearchAttributesMapper) GetAlias(fieldName string, namespace string) (string, error)

func (*CustomSearchAttributesMapper) GetFieldName added in v1.20.0

func (m *CustomSearchAttributesMapper) GetFieldName(alias string, namespace string) (string, error)

type DLQMessageHandler

type DLQMessageHandler interface {
	Read(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]*replicationspb.ReplicationTask, []byte, error)
	Purge(ctx context.Context, lastMessageID int64) error
	Merge(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)
}

DLQMessageHandler is the interface handles namespace DLQ messages

func NewDLQMessageHandler

func NewDLQMessageHandler(
	replicationHandler ReplicationTaskExecutor,
	namespaceReplicationQueue persistence.NamespaceReplicationQueue,
	logger log.Logger,
) DLQMessageHandler

NewDLQMessageHandler returns a DLQTaskHandler instance

type GetNamespaceOptions added in v1.24.0

type GetNamespaceOptions struct {
	// Setting this disables the readthrough logic, i.e. only looks at the current in-memory
	// registry. This is useful if you want to avoid latency or avoid polluting the negative
	// lookup cache. Note that you may get false negatives (namespace not found) if the
	// namespace was created very recently.
	DisableReadthrough bool
}

type ID added in v1.14.0

type ID string

ID is the unique identifier type for a Namespace.

func NewID added in v1.14.0

func NewID() ID

func (ID) IsEmpty added in v1.14.0

func (id ID) IsEmpty() bool

func (ID) String added in v1.14.0

func (id ID) String() string

type MockDLQMessageHandler

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

MockDLQMessageHandler is a mock of DLQMessageHandler interface.

func NewMockDLQMessageHandler

func NewMockDLQMessageHandler(ctrl *gomock.Controller) *MockDLQMessageHandler

NewMockDLQMessageHandler creates a new mock instance.

func (*MockDLQMessageHandler) EXPECT

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

func (*MockDLQMessageHandler) Merge

func (m *MockDLQMessageHandler) Merge(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]byte, error)

Merge mocks base method.

func (*MockDLQMessageHandler) Purge

func (m *MockDLQMessageHandler) Purge(ctx context.Context, lastMessageID int64) error

Purge mocks base method.

func (*MockDLQMessageHandler) Read

func (m *MockDLQMessageHandler) Read(ctx context.Context, lastMessageID int64, pageSize int, pageToken []byte) ([]*repication.ReplicationTask, []byte, error)

Read mocks base method.

type MockDLQMessageHandlerMockRecorder

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

MockDLQMessageHandlerMockRecorder is the mock recorder for MockDLQMessageHandler.

func (*MockDLQMessageHandlerMockRecorder) Merge

func (mr *MockDLQMessageHandlerMockRecorder) Merge(ctx, lastMessageID, pageSize, pageToken any) *gomock.Call

Merge indicates an expected call of Merge.

func (*MockDLQMessageHandlerMockRecorder) Purge

func (mr *MockDLQMessageHandlerMockRecorder) Purge(ctx, lastMessageID any) *gomock.Call

Purge indicates an expected call of Purge.

func (*MockDLQMessageHandlerMockRecorder) Read

func (mr *MockDLQMessageHandlerMockRecorder) Read(ctx, lastMessageID, pageSize, pageToken any) *gomock.Call

Read indicates an expected call of Read.

type MockRegistry added in v1.13.0

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

MockRegistry is a mock of Registry interface.

func NewMockRegistry added in v1.13.0

func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry

NewMockRegistry creates a new mock instance.

func (*MockRegistry) EXPECT added in v1.13.0

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

func (*MockRegistry) GetCacheSize added in v1.13.0

func (m *MockRegistry) GetCacheSize() (int64, int64)

GetCacheSize mocks base method.

func (*MockRegistry) GetCustomSearchAttributesMapper added in v1.21.0

func (m *MockRegistry) GetCustomSearchAttributesMapper(name Name) (CustomSearchAttributesMapper, error)

GetCustomSearchAttributesMapper mocks base method.

func (*MockRegistry) GetNamespace added in v1.13.0

func (m *MockRegistry) GetNamespace(name Name) (*Namespace, error)

GetNamespace mocks base method.

func (*MockRegistry) GetNamespaceByID added in v1.13.0

func (m *MockRegistry) GetNamespaceByID(id ID) (*Namespace, error)

GetNamespaceByID mocks base method.

func (*MockRegistry) GetNamespaceByIDWithOptions added in v1.24.0

func (m *MockRegistry) GetNamespaceByIDWithOptions(id ID, opts GetNamespaceOptions) (*Namespace, error)

GetNamespaceByIDWithOptions mocks base method.

func (*MockRegistry) GetNamespaceID added in v1.13.0

func (m *MockRegistry) GetNamespaceID(name Name) (ID, error)

GetNamespaceID mocks base method.

func (*MockRegistry) GetNamespaceName added in v1.13.0

func (m *MockRegistry) GetNamespaceName(id ID) (Name, error)

GetNamespaceName mocks base method.

func (*MockRegistry) GetNamespaceWithOptions added in v1.24.0

func (m *MockRegistry) GetNamespaceWithOptions(name Name, opts GetNamespaceOptions) (*Namespace, error)

GetNamespaceWithOptions mocks base method.

func (*MockRegistry) GetPingChecks added in v1.19.0

func (m *MockRegistry) GetPingChecks() []pingable.Check

GetPingChecks mocks base method.

func (*MockRegistry) RefreshNamespaceById added in v1.25.0

func (m *MockRegistry) RefreshNamespaceById(namespaceId ID) (*Namespace, error)

RefreshNamespaceById mocks base method.

func (*MockRegistry) RegisterStateChangeCallback added in v1.17.0

func (m *MockRegistry) RegisterStateChangeCallback(key any, cb StateChangeCallbackFn)

RegisterStateChangeCallback mocks base method.

func (*MockRegistry) Start added in v1.13.0

func (m *MockRegistry) Start()

Start mocks base method.

func (*MockRegistry) Stop added in v1.13.0

func (m *MockRegistry) Stop()

Stop mocks base method.

func (*MockRegistry) UnregisterStateChangeCallback added in v1.17.0

func (m *MockRegistry) UnregisterStateChangeCallback(key any)

UnregisterStateChangeCallback mocks base method.

type MockRegistryMockRecorder added in v1.13.0

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

MockRegistryMockRecorder is the mock recorder for MockRegistry.

func (*MockRegistryMockRecorder) GetCacheSize added in v1.13.0

func (mr *MockRegistryMockRecorder) GetCacheSize() *gomock.Call

GetCacheSize indicates an expected call of GetCacheSize.

func (*MockRegistryMockRecorder) GetCustomSearchAttributesMapper added in v1.21.0

func (mr *MockRegistryMockRecorder) GetCustomSearchAttributesMapper(name any) *gomock.Call

GetCustomSearchAttributesMapper indicates an expected call of GetCustomSearchAttributesMapper.

func (*MockRegistryMockRecorder) GetNamespace added in v1.13.0

func (mr *MockRegistryMockRecorder) GetNamespace(name any) *gomock.Call

GetNamespace indicates an expected call of GetNamespace.

func (*MockRegistryMockRecorder) GetNamespaceByID added in v1.13.0

func (mr *MockRegistryMockRecorder) GetNamespaceByID(id any) *gomock.Call

GetNamespaceByID indicates an expected call of GetNamespaceByID.

func (*MockRegistryMockRecorder) GetNamespaceByIDWithOptions added in v1.24.0

func (mr *MockRegistryMockRecorder) GetNamespaceByIDWithOptions(id, opts any) *gomock.Call

GetNamespaceByIDWithOptions indicates an expected call of GetNamespaceByIDWithOptions.

func (*MockRegistryMockRecorder) GetNamespaceID added in v1.13.0

func (mr *MockRegistryMockRecorder) GetNamespaceID(name any) *gomock.Call

GetNamespaceID indicates an expected call of GetNamespaceID.

func (*MockRegistryMockRecorder) GetNamespaceName added in v1.13.0

func (mr *MockRegistryMockRecorder) GetNamespaceName(id any) *gomock.Call

GetNamespaceName indicates an expected call of GetNamespaceName.

func (*MockRegistryMockRecorder) GetNamespaceWithOptions added in v1.24.0

func (mr *MockRegistryMockRecorder) GetNamespaceWithOptions(name, opts any) *gomock.Call

GetNamespaceWithOptions indicates an expected call of GetNamespaceWithOptions.

func (*MockRegistryMockRecorder) GetPingChecks added in v1.19.0

func (mr *MockRegistryMockRecorder) GetPingChecks() *gomock.Call

GetPingChecks indicates an expected call of GetPingChecks.

func (*MockRegistryMockRecorder) RefreshNamespaceById added in v1.25.0

func (mr *MockRegistryMockRecorder) RefreshNamespaceById(namespaceId any) *gomock.Call

RefreshNamespaceById indicates an expected call of RefreshNamespaceById.

func (*MockRegistryMockRecorder) RegisterStateChangeCallback added in v1.17.0

func (mr *MockRegistryMockRecorder) RegisterStateChangeCallback(key, cb any) *gomock.Call

RegisterStateChangeCallback indicates an expected call of RegisterStateChangeCallback.

func (*MockRegistryMockRecorder) Start added in v1.13.0

func (mr *MockRegistryMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockRegistryMockRecorder) Stop added in v1.13.0

func (mr *MockRegistryMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

func (*MockRegistryMockRecorder) UnregisterStateChangeCallback added in v1.17.0

func (mr *MockRegistryMockRecorder) UnregisterStateChangeCallback(key any) *gomock.Call

UnregisterStateChangeCallback indicates an expected call of UnregisterStateChangeCallback.

type MockReplicationTaskExecutor

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

MockReplicationTaskExecutor is a mock of ReplicationTaskExecutor interface.

func NewMockReplicationTaskExecutor

func NewMockReplicationTaskExecutor(ctrl *gomock.Controller) *MockReplicationTaskExecutor

NewMockReplicationTaskExecutor creates a new mock instance.

func (*MockReplicationTaskExecutor) EXPECT

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

func (*MockReplicationTaskExecutor) Execute

Execute mocks base method.

type MockReplicationTaskExecutorMockRecorder

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

MockReplicationTaskExecutorMockRecorder is the mock recorder for MockReplicationTaskExecutor.

func (*MockReplicationTaskExecutorMockRecorder) Execute

func (mr *MockReplicationTaskExecutorMockRecorder) Execute(ctx, task any) *gomock.Call

Execute indicates an expected call of Execute.

type Mutation added in v1.13.0

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

Mutation changes a Namespace "in-flight" during a Clone operation.

func WithActiveCluster added in v1.13.0

func WithActiveCluster(name string) Mutation

WithActiveCluster assigns the active cluster to a Namespace during a Clone operation.

func WithBadBinary added in v1.13.0

func WithBadBinary(chksum string) Mutation

WithBadBinary adds a bad binary checksum to a Namespace during a Clone operation.

func WithData added in v1.13.0

func WithData(key, value string) Mutation

WithData adds a key-value pair to a Namespace during a Clone operation.

func WithGlobalFlag added in v1.13.0

func WithGlobalFlag(b bool) Mutation

WithGlobalFlag sets whether or not this Namespace is global.

func WithID added in v1.13.0

func WithID(id string) Mutation

WithID assigns the ID to a Namespace during a Clone operation.

func WithRetention added in v1.13.0

func WithRetention(dur *durationpb.Duration) Mutation

WithRetention assigns the retention duration to a Namespace during a Clone operation.

type Name added in v1.14.0

type Name string

Name is a user-supplied nickname for a Namespace.

func (Name) IsEmpty added in v1.14.0

func (n Name) IsEmpty() bool

func (Name) String added in v1.14.0

func (n Name) String() string

type Namespace added in v1.13.0

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

Namespace contains the info and config for a namespace

func FromAdminClientApiResponse added in v1.23.0

func FromAdminClientApiResponse(response *adminservice.GetNamespaceResponse) *Namespace

func FromPersistentState added in v1.13.0

func FromPersistentState(record *persistence.GetNamespaceResponse) *Namespace

func NewGlobalNamespaceForTest added in v1.13.0

func NewGlobalNamespaceForTest(
	info *persistencespb.NamespaceInfo,
	config *persistencespb.NamespaceConfig,
	repConfig *persistencespb.NamespaceReplicationConfig,
	failoverVersion int64,
) *Namespace

newGlobalNamespaceForTest returns an entry with test data

func NewLocalNamespaceForTest added in v1.13.0

func NewLocalNamespaceForTest(
	info *persistencespb.NamespaceInfo,
	config *persistencespb.NamespaceConfig,
	targetCluster string,
) *Namespace

NewLocalNamespaceForTest returns an entry with test data

func NewNamespaceForTest added in v1.13.0

func NewNamespaceForTest(
	info *persistencespb.NamespaceInfo,
	config *persistencespb.NamespaceConfig,
	isGlobalNamespace bool,
	repConfig *persistencespb.NamespaceReplicationConfig,
	failoverVersion int64,
) *Namespace

NewNamespaceForTest returns an entry with test data

func (*Namespace) ActiveClusterName added in v1.13.0

func (ns *Namespace) ActiveClusterName() string

ActiveClusterName observes the name of the cluster that is currently active for this namspace.

func (*Namespace) ActiveInCluster added in v1.13.0

func (ns *Namespace) ActiveInCluster(clusterName string) bool

ActiveInCluster returns whether the namespace is active, i.e. non global namespace or global namespace which active cluster is the provided cluster

func (*Namespace) Clone added in v1.13.0

func (ns *Namespace) Clone(ms ...Mutation) *Namespace

func (*Namespace) ClusterNames added in v1.13.0

func (ns *Namespace) ClusterNames() []string

ClusterNames observes the names of the clusters to which this namespace is replicated.

func (*Namespace) ConfigVersion added in v1.13.0

func (ns *Namespace) ConfigVersion() int64

ConfigVersion return the namespace config version

func (*Namespace) CustomSearchAttributesMapper added in v1.20.0

func (ns *Namespace) CustomSearchAttributesMapper() CustomSearchAttributesMapper

func (*Namespace) FailoverHistory added in v1.25.0

func (ns *Namespace) FailoverHistory() []*replication.FailoverStatus

FailoverHistory returns the a copy of failover history for this namespace.

func (*Namespace) FailoverNotificationVersion added in v1.13.0

func (ns *Namespace) FailoverNotificationVersion() int64

FailoverNotificationVersion return the global notification version of when failover happened

func (*Namespace) FailoverVersion added in v1.13.0

func (ns *Namespace) FailoverVersion() int64

FailoverVersion return the namespace failover version

func (*Namespace) GetCustomData added in v1.16.2

func (ns *Namespace) GetCustomData(key string) string

func (*Namespace) HistoryArchivalState added in v1.13.0

func (ns *Namespace) HistoryArchivalState() ArchivalConfigState

HistoryArchivalState observes the history archive configuration (state and URI) for this namespace.

func (*Namespace) ID added in v1.13.0

func (ns *Namespace) ID() ID

ID observes this namespace's permanent unique identifier in string form.

func (*Namespace) IsGlobalNamespace added in v1.13.0

func (ns *Namespace) IsGlobalNamespace() bool

IsGlobalNamespace returns whether the namespace is a global namespace. Being a global namespace doesn't necessarily mean that there are multiple registered clusters for it, only that it has a failover version. To determine whether operations should be replicated for a namespace, see ReplicationPolicy.

func (*Namespace) IsOnCluster added in v1.20.0

func (ns *Namespace) IsOnCluster(clusterName string) bool

IsOnCluster returns true is namespace is registered on cluster otherwise false.

func (*Namespace) Name added in v1.13.0

func (ns *Namespace) Name() Name

Name observes this namespace's configured name.

func (*Namespace) NotificationVersion added in v1.13.0

func (ns *Namespace) NotificationVersion() int64

NotificationVersion return the global notification version of when namespace changed

func (*Namespace) ReplicationPolicy added in v1.13.0

func (ns *Namespace) ReplicationPolicy() ReplicationPolicy

ReplicationPolicy return the derived workflow replication policy

func (*Namespace) ReplicationState added in v1.14.0

func (ns *Namespace) ReplicationState() enumspb.ReplicationState

func (*Namespace) Retention added in v1.13.0

func (ns *Namespace) Retention() time.Duration

Retention returns retention duration for this namespace.

func (*Namespace) State added in v1.14.0

func (ns *Namespace) State() enumspb.NamespaceState

func (*Namespace) VerifyBinaryChecksum added in v1.13.0

func (ns *Namespace) VerifyBinaryChecksum(cksum string) error

VerifyBinaryChecksum returns an error if the provided checksum is one of this namespace's configured bad binary checksums. The returned error (if any) will be unwrappable as BadBinaryError.

func (*Namespace) VisibilityArchivalState added in v1.13.0

func (ns *Namespace) VisibilityArchivalState() ArchivalConfigState

VisibilityArchivalState observes the visibility archive configuration (state and URI) for this namespace.

type Namespaces added in v1.13.0

type Namespaces []*Namespace

Namespaces is a *Namespace slice

type PretendAsLocalNamespace added in v1.15.0

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

func NewPretendAsLocalNamespace added in v1.15.0

func NewPretendAsLocalNamespace(
	localClusterName string,
) PretendAsLocalNamespace

NewPretendAsLocalNamespace create a Mutation which update namespace replication config as if this namespace is local

type Registry added in v1.13.0

type Registry interface {
	pingable.Pingable
	GetNamespace(name Name) (*Namespace, error)
	GetNamespaceWithOptions(name Name, opts GetNamespaceOptions) (*Namespace, error)
	GetNamespaceByID(id ID) (*Namespace, error)
	RefreshNamespaceById(namespaceId ID) (*Namespace, error)
	GetNamespaceByIDWithOptions(id ID, opts GetNamespaceOptions) (*Namespace, error)
	GetNamespaceID(name Name) (ID, error)
	GetNamespaceName(id ID) (Name, error)
	GetCacheSize() (sizeOfCacheByName int64, sizeOfCacheByID int64)
	// Registers callback for namespace state changes.
	// StateChangeCallbackFn will be invoked for a new/deleted namespace or namespace that has
	// State, ReplicationState, ActiveCluster, or isGlobalNamespace config changed.
	RegisterStateChangeCallback(key any, cb StateChangeCallbackFn)
	UnregisterStateChangeCallback(key any)
	// GetCustomSearchAttributesMapper is a temporary solution to be able to get search attributes
	// with from persistence if forceSearchAttributesCacheRefreshOnRead is true.
	GetCustomSearchAttributesMapper(name Name) (CustomSearchAttributesMapper, error)
	Start()
	Stop()
}

Registry provides access to Namespace objects by name or by ID.

type ReplicationPolicy added in v1.13.0

type ReplicationPolicy int

ReplicationPolicy is the namespace's replication policy, derived from namespace's replication config

type ReplicationTaskExecutor

type ReplicationTaskExecutor interface {
	Execute(ctx context.Context, task *replicationspb.NamespaceTaskAttributes) error
}

ReplicationTaskExecutor is the interface for executing namespace replication tasks

func NewReplicationTaskExecutor

func NewReplicationTaskExecutor(
	currentCluster string,
	metadataManagerV2 persistence.MetadataManager,
	logger log.Logger,
) ReplicationTaskExecutor

NewReplicationTaskExecutor creates a new instance of namespace replicator

type Replicator

type Replicator interface {
	HandleTransmissionTask(
		ctx context.Context,
		namespaceOperation enumsspb.NamespaceOperation,
		info *persistencespb.NamespaceInfo,
		config *persistencespb.NamespaceConfig,
		replicationConfig *persistencespb.NamespaceReplicationConfig,
		replicationClusterListUpdated bool,
		configVersion int64,
		failoverVersion int64,
		isGlobalNamespace bool,
		failoverHistoy []*persistencespb.FailoverStatus,
	) error
}

Replicator is the interface which can replicate the namespace

func NewNamespaceReplicator

func NewNamespaceReplicator(
	namespaceReplicationQueue persistence.NamespaceReplicationQueue,
	logger log.Logger,
) Replicator

NewNamespaceReplicator create a new instance of namespace replicator

type StateChangeCallbackFn added in v1.17.0

type StateChangeCallbackFn func(ns *Namespace, deletedFromDb bool)

StateChangeCallbackFn can be registered to be called on any namespace state change or addition/removal from database, plus once for all namespaces after registration. There is no guarantee about when these are called.

Directories

Path Synopsis
Package nsregistry is a generated GoMock package.
Package nsregistry is a generated GoMock package.

Jump to

Keyboard shortcuts

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