resource

package
Version: v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

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

Impl contains all common resources shared across frontend / matching / history / worker

func New

func New(
	params *service.BootstrapParams,
	serviceName string,
	resourceConfig *config.ResourceConfig,
) (impl *Impl, retError error)

New create a new resource containing common dependencies

func (*Impl) GetArchivalMetadata

func (h *Impl) GetArchivalMetadata() archiver.ArchivalMetadata

GetArchivalMetadata return archival metadata

func (*Impl) GetArchiverProvider

func (h *Impl) GetArchiverProvider() provider.ArchiverProvider

GetArchiverProvider return archival provider

func (*Impl) GetBlobstoreClient added in v0.13.0

func (h *Impl) GetBlobstoreClient() blobstore.Client

GetBlobstoreClient returns blobstore client

func (*Impl) GetClientBean

func (h *Impl) GetClientBean() client.Bean

GetClientBean return RPC client bean

func (*Impl) GetClusterMetadata

func (h *Impl) GetClusterMetadata() cluster.Metadata

GetClusterMetadata return cluster metadata

func (*Impl) GetDispatcher

func (h *Impl) GetDispatcher() *yarpc.Dispatcher

GetDispatcher return YARPC dispatcher, used for registering handlers

func (*Impl) GetDomainCache

func (h *Impl) GetDomainCache() cache.DomainCache

GetDomainCache return domain cache

func (*Impl) GetDomainManager added in v0.22.0

func (h *Impl) GetDomainManager() persistence.DomainManager

GetMetadataManager return metadata manager

func (*Impl) GetDomainMetricsScopeCache added in v0.14.0

func (h *Impl) GetDomainMetricsScopeCache() cache.DomainMetricsScopeCache

GetDomainMetricsScopeCache return domainMetricsScope cache

func (*Impl) GetDomainReplicationQueue

func (h *Impl) GetDomainReplicationQueue() domain.ReplicationQueue

GetDomainReplicationQueue return domain replication queue

func (*Impl) GetExecutionManager

func (h *Impl) GetExecutionManager(
	shardID int,
) (persistence.ExecutionManager, error)

GetExecutionManager return execution manager for given shard ID

func (*Impl) GetFrontendClient

func (h *Impl) GetFrontendClient() frontend.Client

GetFrontendClient return frontend client with retry policy

func (*Impl) GetFrontendRawClient

func (h *Impl) GetFrontendRawClient() frontend.Client

GetFrontendRawClient return frontend client without retry policy

func (*Impl) GetFrontendServiceResolver

func (h *Impl) GetFrontendServiceResolver() membership.ServiceResolver

GetFrontendServiceResolver return frontend service resolver

func (*Impl) GetHistoryClient

func (h *Impl) GetHistoryClient() history.Client

GetHistoryClient return history client with retry policy

func (*Impl) GetHistoryManager

func (h *Impl) GetHistoryManager() persistence.HistoryManager

GetHistoryManager return history manager

func (*Impl) GetHistoryRawClient

func (h *Impl) GetHistoryRawClient() history.Client

GetHistoryRawClient return history client without retry policy

func (*Impl) GetHistoryServiceResolver

func (h *Impl) GetHistoryServiceResolver() membership.ServiceResolver

GetHistoryServiceResolver return history service resolver

func (*Impl) GetHostInfo

func (h *Impl) GetHostInfo() *membership.HostInfo

GetHostInfo return host info

func (*Impl) GetHostName

func (h *Impl) GetHostName() string

GetHostName return host name

func (*Impl) GetLogger

func (h *Impl) GetLogger() log.Logger

GetLogger return logger

func (*Impl) GetMatchingClient

func (h *Impl) GetMatchingClient() matching.Client

GetMatchingClient return matching client with retry policy

func (*Impl) GetMatchingRawClient

func (h *Impl) GetMatchingRawClient() matching.Client

GetMatchingRawClient return matching client without retry policy

func (*Impl) GetMatchingServiceResolver

func (h *Impl) GetMatchingServiceResolver() membership.ServiceResolver

GetMatchingServiceResolver return matching service resolver

func (*Impl) GetMembershipMonitor

func (h *Impl) GetMembershipMonitor() membership.Monitor

GetMembershipMonitor return the membership monitor

func (*Impl) GetMessagingClient

func (h *Impl) GetMessagingClient() messaging.Client

GetMessagingClient return messaging client

func (*Impl) GetMetricsClient

func (h *Impl) GetMetricsClient() metrics.Client

GetMetricsClient return metrics client

func (*Impl) GetPayloadSerializer

func (h *Impl) GetPayloadSerializer() persistence.PayloadSerializer

GetPayloadSerializer return binary payload serializer

func (*Impl) GetPersistenceBean

func (h *Impl) GetPersistenceBean() persistenceClient.Bean

GetPersistenceBean return persistence bean

func (*Impl) GetRemoteAdminClient

func (h *Impl) GetRemoteAdminClient(
	cluster string,
) admin.Client

GetRemoteAdminClient return remote admin client for given cluster name

func (*Impl) GetRemoteFrontendClient

func (h *Impl) GetRemoteFrontendClient(
	cluster string,
) frontend.Client

GetRemoteFrontendClient return remote frontend client for given cluster name

func (*Impl) GetSDKClient

func (h *Impl) GetSDKClient() workflowserviceclient.Interface

GetSDKClient return sdk client

func (*Impl) GetServiceName

func (h *Impl) GetServiceName() string

GetServiceName return service name

func (*Impl) GetShardManager

func (h *Impl) GetShardManager() persistence.ShardManager

GetShardManager return shard manager

func (*Impl) GetTaskManager

func (h *Impl) GetTaskManager() persistence.TaskManager

GetTaskManager return task manager

func (*Impl) GetThrottledLogger

func (h *Impl) GetThrottledLogger() log.Logger

GetThrottledLogger return throttled logger

func (*Impl) GetTimeSource

func (h *Impl) GetTimeSource() clock.TimeSource

GetTimeSource return time source

func (*Impl) GetVisibilityManager

func (h *Impl) GetVisibilityManager() persistence.VisibilityManager

GetVisibilityManager return visibility manager

func (*Impl) GetWorkerServiceResolver

func (h *Impl) GetWorkerServiceResolver() membership.ServiceResolver

GetWorkerServiceResolver return worker service resolver

func (*Impl) Start

func (h *Impl) Start()

Start start all resources

func (*Impl) Stop

func (h *Impl) Stop()

Stop stops all resources

type Resource

type Resource interface {
	common.Daemon

	GetServiceName() string
	GetHostName() string
	GetHostInfo() *membership.HostInfo
	GetArchivalMetadata() archiver.ArchivalMetadata
	GetClusterMetadata() cluster.Metadata

	GetDomainCache() cache.DomainCache
	GetDomainMetricsScopeCache() cache.DomainMetricsScopeCache
	GetTimeSource() clock.TimeSource
	GetPayloadSerializer() persistence.PayloadSerializer
	GetMetricsClient() metrics.Client
	GetArchiverProvider() provider.ArchiverProvider
	GetMessagingClient() messaging.Client
	GetBlobstoreClient() blobstore.Client
	GetDomainReplicationQueue() domain.ReplicationQueue

	GetMembershipMonitor() membership.Monitor
	GetFrontendServiceResolver() membership.ServiceResolver
	GetMatchingServiceResolver() membership.ServiceResolver
	GetHistoryServiceResolver() membership.ServiceResolver
	GetWorkerServiceResolver() membership.ServiceResolver

	GetSDKClient() workflowserviceclient.Interface
	GetFrontendRawClient() frontend.Client
	GetFrontendClient() frontend.Client
	GetMatchingRawClient() matching.Client
	GetMatchingClient() matching.Client
	GetHistoryRawClient() history.Client
	GetHistoryClient() history.Client
	GetRemoteAdminClient(cluster string) admin.Client
	GetRemoteFrontendClient(cluster string) frontend.Client
	GetClientBean() client.Bean

	GetDomainManager() persistence.DomainManager
	GetTaskManager() persistence.TaskManager
	GetVisibilityManager() persistence.VisibilityManager
	GetShardManager() persistence.ShardManager
	GetHistoryManager() persistence.HistoryManager
	GetExecutionManager(int) (persistence.ExecutionManager, error)
	GetPersistenceBean() persistenceClient.Bean

	GetLogger() log.Logger
	GetThrottledLogger() log.Logger

	// for registering handlers
	GetDispatcher() *yarpc.Dispatcher
}

Resource is the interface which expose common resources

type Test

type Test struct {
	MetricsScope    tally.TestScope
	ClusterMetadata *cluster.MockMetadata

	DomainCache             *cache.MockDomainCache
	DomainMetricsScopeCache cache.DomainMetricsScopeCache
	DomainReplicationQueue  *domain.MockReplicationQueue
	TimeSource              clock.TimeSource
	PayloadSerializer       persistence.PayloadSerializer
	MetricsClient           metrics.Client
	ArchivalMetadata        *archiver.MockArchivalMetadata
	ArchiverProvider        *provider.MockArchiverProvider
	BlobstoreClient         *blobstore.MockClient

	MembershipMonitor       *membership.MockMonitor
	FrontendServiceResolver *membership.MockServiceResolver
	MatchingServiceResolver *membership.MockServiceResolver
	HistoryServiceResolver  *membership.MockServiceResolver
	WorkerServiceResolver   *membership.MockServiceResolver

	SDKClient            *publicservicetest.MockClient
	FrontendClient       *frontend.MockClient
	MatchingClient       *matching.MockClient
	HistoryClient        *history.MockClient
	RemoteAdminClient    *admin.MockClient
	RemoteFrontendClient *frontend.MockClient
	ClientBean           *client.MockBean

	MetadataMgr     *mocks.MetadataManager
	TaskMgr         *mocks.TaskManager
	VisibilityMgr   *mocks.VisibilityManager
	ShardMgr        *mocks.ShardManager
	HistoryMgr      *mocks.HistoryV2Manager
	ExecutionMgr    *mocks.ExecutionManager
	PersistenceBean *persistenceClient.MockBean

	Logger log.Logger
}

Test is the test implementation used for testing

func NewTest

func NewTest(
	controller *gomock.Controller,
	serviceMetricsIndex metrics.ServiceIdx,
) *Test

NewTest returns a new test resource instance

func (*Test) Finish

func (s *Test) Finish(
	t mock.TestingT,
)

Finish checks whether expectations are met

func (*Test) GetArchivalMetadata

func (s *Test) GetArchivalMetadata() archiver.ArchivalMetadata

GetArchivalMetadata for testing

func (*Test) GetArchiverProvider

func (s *Test) GetArchiverProvider() provider.ArchiverProvider

GetArchiverProvider for testing

func (*Test) GetBlobstoreClient added in v0.13.0

func (s *Test) GetBlobstoreClient() blobstore.Client

GetBlobstoreClient for testing

func (*Test) GetClientBean

func (s *Test) GetClientBean() client.Bean

GetClientBean for testing

func (*Test) GetClusterMetadata

func (s *Test) GetClusterMetadata() cluster.Metadata

GetClusterMetadata for testing

func (*Test) GetDispatcher

func (s *Test) GetDispatcher() *yarpc.Dispatcher

GetDispatcher for testing

func (*Test) GetDomainCache

func (s *Test) GetDomainCache() cache.DomainCache

GetDomainCache for testing

func (*Test) GetDomainManager added in v0.22.0

func (s *Test) GetDomainManager() persistence.DomainManager

GetMetadataManager for testing

func (*Test) GetDomainMetricsScopeCache added in v0.14.0

func (s *Test) GetDomainMetricsScopeCache() cache.DomainMetricsScopeCache

GetDomainMetricsScopeCache for testing

func (*Test) GetDomainReplicationQueue

func (s *Test) GetDomainReplicationQueue() domain.ReplicationQueue

GetDomainReplicationQueue for testing

func (*Test) GetExecutionManager

func (s *Test) GetExecutionManager(
	shardID int,
) (persistence.ExecutionManager, error)

GetExecutionManager for testing

func (*Test) GetFrontendClient

func (s *Test) GetFrontendClient() frontend.Client

GetFrontendClient for testing

func (*Test) GetFrontendRawClient

func (s *Test) GetFrontendRawClient() frontend.Client

GetFrontendRawClient for testing

func (*Test) GetFrontendServiceResolver

func (s *Test) GetFrontendServiceResolver() membership.ServiceResolver

GetFrontendServiceResolver for testing

func (*Test) GetHistoryClient

func (s *Test) GetHistoryClient() history.Client

GetHistoryClient for testing

func (*Test) GetHistoryManager

func (s *Test) GetHistoryManager() persistence.HistoryManager

GetHistoryManager for testing

func (*Test) GetHistoryRawClient

func (s *Test) GetHistoryRawClient() history.Client

GetHistoryRawClient for testing

func (*Test) GetHistoryServiceResolver

func (s *Test) GetHistoryServiceResolver() membership.ServiceResolver

GetHistoryServiceResolver for testing

func (*Test) GetHostInfo

func (s *Test) GetHostInfo() *membership.HostInfo

GetHostInfo for testing

func (*Test) GetHostName

func (s *Test) GetHostName() string

GetHostName for testing

func (*Test) GetLogger

func (s *Test) GetLogger() log.Logger

GetLogger for testing

func (*Test) GetMatchingClient

func (s *Test) GetMatchingClient() matching.Client

GetMatchingClient for testing

func (*Test) GetMatchingRawClient

func (s *Test) GetMatchingRawClient() matching.Client

GetMatchingRawClient for testing

func (*Test) GetMatchingServiceResolver

func (s *Test) GetMatchingServiceResolver() membership.ServiceResolver

GetMatchingServiceResolver for testing

func (*Test) GetMembershipMonitor

func (s *Test) GetMembershipMonitor() membership.Monitor

GetMembershipMonitor for testing

func (*Test) GetMessagingClient

func (s *Test) GetMessagingClient() messaging.Client

GetMessagingClient for testing

func (*Test) GetMetricsClient

func (s *Test) GetMetricsClient() metrics.Client

GetMetricsClient for testing

func (*Test) GetPayloadSerializer

func (s *Test) GetPayloadSerializer() persistence.PayloadSerializer

GetPayloadSerializer for testing

func (*Test) GetPersistenceBean

func (s *Test) GetPersistenceBean() persistenceClient.Bean

GetPersistenceBean for testing

func (*Test) GetRemoteAdminClient

func (s *Test) GetRemoteAdminClient(
	cluster string,
) admin.Client

GetRemoteAdminClient for testing

func (*Test) GetRemoteFrontendClient

func (s *Test) GetRemoteFrontendClient(
	cluster string,
) frontend.Client

GetRemoteFrontendClient for testing

func (*Test) GetSDKClient

func (s *Test) GetSDKClient() workflowserviceclient.Interface

GetSDKClient for testing

func (*Test) GetServiceName

func (s *Test) GetServiceName() string

GetServiceName for testing

func (*Test) GetShardManager

func (s *Test) GetShardManager() persistence.ShardManager

GetShardManager for testing

func (*Test) GetTaskManager

func (s *Test) GetTaskManager() persistence.TaskManager

GetTaskManager for testing

func (*Test) GetThrottledLogger

func (s *Test) GetThrottledLogger() log.Logger

GetThrottledLogger for testing

func (*Test) GetTimeSource

func (s *Test) GetTimeSource() clock.TimeSource

GetTimeSource for testing

func (*Test) GetVisibilityManager

func (s *Test) GetVisibilityManager() persistence.VisibilityManager

GetVisibilityManager for testing

func (*Test) GetWorkerServiceResolver

func (s *Test) GetWorkerServiceResolver() membership.ServiceResolver

GetWorkerServiceResolver for testing

func (*Test) Start

func (s *Test) Start()

Start for testing

func (*Test) Stop

func (s *Test) Stop()

Stop for testing

type VisibilityManagerInitializer

type VisibilityManagerInitializer func(
	persistenceBean persistenceClient.Bean,
	logger log.Logger,
) (persistence.VisibilityManager, error)

VisibilityManagerInitializer is the function each service should implement for visibility manager initialization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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