persistence

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 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)
	// NewHistoryStore returns a new history store
	NewHistoryStore() (p.HistoryStore, error)
	// NewHistoryV2Store returns a new historyV2 store
	NewHistoryV2Store() (p.HistoryV2Store, error)
	// NewMetadataStore returns a new metadata store
	NewMetadataStore() (p.MetadataStore, error)
	// NewMetadataStoreV1 returns a metadata store that can talk v1
	NewMetadataStoreV1() (p.MetadataStore, error)
	// NewMetadataStoreV2 returns a metadata store that can talk v2
	NewMetadataStoreV2() (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)
}

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)
	// NewHistoryManager returns a new history manager
	NewHistoryManager() (p.HistoryManager, error)
	// NewHistoryManager returns a new historyV2 manager
	NewHistoryV2Manager() (p.HistoryV2Manager, error)
	// NewMetadataManager returns a new metadata manager that can speak
	// the given version or versions
	NewMetadataManager(version MetadataVersion) (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)
}

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

type MetadataVersion

type MetadataVersion int

MetadataVersion refers to the metadata schema version

const (
	// MetadataV1 refers to metadata schema version 1
	MetadataV1 MetadataVersion = iota + 1
	// MetadataV2 refers to metadata schema version 2
	MetadataV2
	// MetadataV1V2 refers to metadata schema versions 1 and 2
	MetadataV1V2
)

Jump to

Keyboard shortcuts

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