Back to godoc.org

Package host

v0.8.6
Latest Go to latest

The latest major version is .

Published: Aug 27, 2019 | License: MIT | Module: github.com/h7kanna/cadence

Index

Variables

var TestFlags struct {
	EnableEventsV2        bool
	FrontendAddr          string
	PersistenceType       string
	TestClusterConfigFile string
}

TestFlags contains the feature flags for integration tests

func CreateESClient

func CreateESClient(s suite.Suite, url string) *elastic.Client

CreateESClient create ElasticSearch client for test

func CreateIndex

func CreateIndex(s suite.Suite, esClient *elastic.Client, indexName string)

CreateIndex create test index

func DeleteIndex

func DeleteIndex(s suite.Suite, esClient *elastic.Client, indexName string)

DeleteIndex delete test index

func PutIndexTemplate

func PutIndexTemplate(s suite.Suite, esClient *elastic.Client, templateConfigFile, templateName string)

PutIndexTemplate put index template for test

type AdminClient

type AdminClient interface {
	adminserviceclient.Interface
}

AdminClient is the interface exposed by admin service client

func NewAdminClient

func NewAdminClient(d *yarpc.Dispatcher) AdminClient

NewAdminClient creates a client to cadence admin client

type ArchiverBase

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

ArchiverBase is a base struct for archiver provider being used in integration tests

type Cadence

type Cadence interface {
	Start() error
	Stop()
	GetAdminClient() adminserviceclient.Interface
	GetFrontendClient() workflowserviceclient.Interface
	FrontendAddress() string
	GetFrontendService() service.Service
}

Cadence hosts all of cadence services in one process

func NewCadence

func NewCadence(params *CadenceParams) Cadence

NewCadence returns an instance that hosts full cadence in one process

type CadenceParams

type CadenceParams struct {
	ClusterMetadata               cluster.Metadata
	PersistenceConfig             config.Persistence
	DispatcherProvider            client.DispatcherProvider
	MessagingClient               messaging.Client
	MetadataMgr                   persistence.MetadataManager
	MetadataMgrV2                 persistence.MetadataManager
	ShardMgr                      persistence.ShardManager
	HistoryMgr                    persistence.HistoryManager
	HistoryV2Mgr                  persistence.HistoryV2Manager
	ExecutionMgrFactory           persistence.ExecutionManagerFactory
	TaskMgr                       persistence.TaskManager
	VisibilityMgr                 persistence.VisibilityManager
	Logger                        log.Logger
	ClusterNo                     int
	EnableEventsV2                bool
	ArchiverMetadata              carchiver.ArchivalMetadata
	ArchiverProvider              provider.ArchiverProvider
	EnableReadHistoryFromArchival bool
	HistoryConfig                 *HistoryConfig
	ESConfig                      *elasticsearch.Config
	ESClient                      elasticsearch.Client
	WorkerConfig                  *WorkerConfig
}

CadenceParams contains everything needed to bootstrap Cadence

type FrontendClient

type FrontendClient interface {
	workflowserviceclient.Interface
}

FrontendClient is the interface exposed by frontend service client

func NewFrontendClient

func NewFrontendClient(d *yarpc.Dispatcher) FrontendClient

NewFrontendClient creates a client to cadence frontend client

type HistoryConfig

type HistoryConfig struct {
	NumHistoryShards       int
	NumHistoryHosts        int
	HistoryCountLimitError int
	HistoryCountLimitWarn  int
}

HistoryConfig contains configs for history service

type IntegrationBase

type IntegrationBase struct {
	suite.Suite

	Logger log.Logger
	// contains filtered or unexported fields
}

IntegrationBase is a base struct for integration tests

type MessagingClientConfig

type MessagingClientConfig struct {
	UseMock     bool
	KafkaConfig *messaging.KafkaConfig
}

MessagingClientConfig is the config for messaging config

type TaskPoller

type TaskPoller struct {
	Engine                              FrontendClient
	Domain                              string
	TaskList                            *workflow.TaskList
	StickyTaskList                      *workflow.TaskList
	StickyScheduleToStartTimeoutSeconds *int32
	Identity                            string
	DecisionHandler                     decisionTaskHandler
	ActivityHandler                     activityTaskHandler
	QueryHandler                        queryHandler
	Logger                              log.Logger
	T                                   *testing.T
}

TaskPoller is used in integration tests to poll decision or activity tasks

func (*TaskPoller) HandlePartialDecision

func (p *TaskPoller) HandlePartialDecision(response *workflow.PollForDecisionTaskResponse) (
	*workflow.RespondDecisionTaskCompletedResponse, error)

HandlePartialDecision for decision task

func (*TaskPoller) PollAndProcessActivityTask

func (p *TaskPoller) PollAndProcessActivityTask(dropTask bool) error

PollAndProcessActivityTask for activity tasks

func (*TaskPoller) PollAndProcessActivityTaskWithID

func (p *TaskPoller) PollAndProcessActivityTaskWithID(dropTask bool) error

PollAndProcessActivityTaskWithID is similar to PollAndProcessActivityTask but using RespondActivityTask...ByID

func (*TaskPoller) PollAndProcessDecisionTask

func (p *TaskPoller) PollAndProcessDecisionTask(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)

PollAndProcessDecisionTask for decision tasks

func (*TaskPoller) PollAndProcessDecisionTaskWithAttempt

func (p *TaskPoller) PollAndProcessDecisionTaskWithAttempt(dumpHistory bool, dropTask bool,
	pollStickyTaskList bool, respondStickyTaskList bool, decisionAttempt int64) (isQueryTask bool, err error)

PollAndProcessDecisionTaskWithAttempt for decision tasks

func (*TaskPoller) PollAndProcessDecisionTaskWithAttemptAndRetry

func (p *TaskPoller) PollAndProcessDecisionTaskWithAttemptAndRetry(dumpHistory bool, dropTask bool,
	pollStickyTaskList bool, respondStickyTaskList bool, decisionAttempt int64, retryCount int) (isQueryTask bool, err error)

PollAndProcessDecisionTaskWithAttemptAndRetry for decision tasks

func (*TaskPoller) PollAndProcessDecisionTaskWithAttemptAndRetryAndForceNewDecision

func (p *TaskPoller) PollAndProcessDecisionTaskWithAttemptAndRetryAndForceNewDecision(dumpHistory bool, dropTask bool,
	pollStickyTaskList bool, respondStickyTaskList bool, decisionAttempt int64, retryCount int, forceCreateNewDecision bool) (isQueryTask bool, newTask *workflow.RespondDecisionTaskCompletedResponse, err error)

PollAndProcessDecisionTaskWithAttemptAndRetryAndForceNewDecision for decision tasks

func (*TaskPoller) PollAndProcessDecisionTaskWithSticky

func (p *TaskPoller) PollAndProcessDecisionTaskWithSticky(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)

PollAndProcessDecisionTaskWithSticky for decision tasks

func (*TaskPoller) PollAndProcessDecisionTaskWithoutRetry

func (p *TaskPoller) PollAndProcessDecisionTaskWithoutRetry(dumpHistory bool, dropTask bool) (isQueryTask bool, err error)

PollAndProcessDecisionTaskWithoutRetry for decision tasks

type TestCluster

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

TestCluster is a base struct for integration tests

func NewCluster

func NewCluster(options *TestClusterConfig, logger log.Logger) (*TestCluster, error)

NewCluster creates and sets up the test cluster

func (*TestCluster) GetAdminClient

func (tc *TestCluster) GetAdminClient() AdminClient

GetAdminClient returns an admin client from the test cluster

func (*TestCluster) GetFrontendClient

func (tc *TestCluster) GetFrontendClient() FrontendClient

GetFrontendClient returns a frontend client from the test cluster

func (*TestCluster) TearDownCluster

func (tc *TestCluster) TearDownCluster()

TearDownCluster tears down the test cluster

type TestClusterConfig

type TestClusterConfig struct {
	FrontendAddress       string
	EnableEventsV2        bool
	EnableArchival        bool
	IsMasterCluster       bool
	ClusterNo             int
	ClusterMetadata       config.ClusterMetadata
	MessagingClientConfig *MessagingClientConfig
	Persistence           persistencetests.TestBaseOptions
	HistoryConfig         *HistoryConfig
	ESConfig              elasticsearch.Config
	WorkerConfig          *WorkerConfig
}

TestClusterConfig are config for a test cluster

func GetTestClusterConfig

func GetTestClusterConfig(configFile string) (*TestClusterConfig, error)

GetTestClusterConfig return test cluster config

type WorkerConfig

type WorkerConfig struct {
	EnableArchiver   bool
	EnableIndexer    bool
	EnableReplicator bool
}

WorkerConfig is the config for enabling/disabling cadence worker

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier