persistence

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStoreFactory

type DataStoreFactory interface {
	// Close closes the factory
	Close()
	// NewTaskStore returns a new task store
	NewTaskStore() (p.TaskStore, error)
	// NewShardStore returns a new shard store
	NewShardStore() (p.ShardStore, error)
	// NewHistoryV2Store returns a new historyV2 store
	NewHistoryV2Store() (p.HistoryStore, error)
	// NewMetadataStore returns a new metadata store
	NewMetadataStore() (p.MetadataStore, error)
	// NewExecutionStore returns an execution store for given shardID
	NewExecutionStore(shardID int) (p.ExecutionStore, error)
	// NewVisibilityStore returns a new visibility store
	NewVisibilityStore() (p.VisibilityStore, error)
	NewQueue(queueType common.QueueType) (p.Queue, error)
}

DataStoreFactory is a low level interface to be implemented by a datastore Examples of datastores are cassandra, mysql etc

type Datastore

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

Datastore represents a datastore

type Factory

type Factory interface {
	// Close the factory
	Close()
	// NewTaskManager returns a new task manager
	NewTaskManager() (p.TaskManager, error)
	// NewShardManager returns a new shard manager
	NewShardManager() (p.ShardManager, error)
	// NewHistoryV2Manager returns a new historyV2 manager
	NewHistoryV2Manager() (p.HistoryManager, error)
	// NewMetadataManager returns a new metadata manager
	NewMetadataManager() (p.MetadataManager, error)
	// NewExecutionManager returns a new execution manager for a given shardID
	NewExecutionManager(shardID int) (p.ExecutionManager, error)
	// NewVisibilityManager returns a new visibility manager
	NewVisibilityManager() (p.VisibilityManager, error)
	// NewDomainReplicationQueue returns a new queue for domain replication
	NewDomainReplicationQueue() (p.DomainReplicationQueue, error)
}

Factory defines the interface for any implementation that can vend persistence layer objects backed by a datastore. The actual datastore is implementation detail hidden behind this interface

func New

func New(
	cfg *config.Persistence,
	clusterName string,
	metricsClient metrics.Client,
	logger log.Logger,
) Factory

New returns an implementation of factory that vends persistence objects based on specified configuration. This factory takes as input a config.Persistence object which specifies the datastore to be used for a given type of object. This config also contains config for individual datastores themselves.

The objects returned by this factory enforce ratelimit and maxconns according to given configuration. In addition, all objects will emit metrics automatically

Jump to

Keyboard shortcuts

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