cassandra

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 34 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ProtocolVersion is the protocol version used to communicate with Cassandra cluster
	ProtocolVersion = 4
)
"go.temporal.io/api/serviceerror"

Guidelines for creating new special UUID constants Each UUID should be of the form: E0000000-R000-f000-f000-00000000000x Where x is any hexadecimal value, E represents the entity type valid values are: E = {NamespaceID = 1, WorkflowID = 2, RunID = 3} R represents row type in executions table, valid values are: R = {Shard = 1, Execution = 2, Transfer = 3, Timer = 4, Replication = 5}

Variables

This section is empty.

Functions

func CreateCassandraKeyspace

func CreateCassandraKeyspace(s *gocql.Session, keyspace string, replicas int, overwrite bool, logger log.Logger) (err error)

CreateCassandraKeyspace creates the keyspace using this session for given replica count

func DropCassandraKeyspace

func DropCassandraKeyspace(s *gocql.Session, keyspace string, logger log.Logger) (err error)

DropCassandraKeyspace drops the given keyspace, if it exists

func GetTaskTTL added in v0.27.0

func GetTaskTTL(task *persistencespb.TaskInfo) int64

func NewHistoryV2PersistenceFromSession added in v0.5.0

func NewHistoryV2PersistenceFromSession(
	session *gocql.Session,
	logger log.Logger,
) p.HistoryStore

NewHistoryV2PersistenceFromSession returns new HistoryStore

func NewSession added in v1.6.0

func NewSession(
	cfg config.Cassandra,
	r resolver.ServiceResolver,
) (*gocql.Session, error)

NewSession creates a new cassandra session

func NewWorkflowExecutionPersistence

func NewWorkflowExecutionPersistence(
	shardID int32,
	session *gocql.Session,
	logger log.Logger,
) (p.ExecutionStore, error)

NewWorkflowExecutionPersistence is used to create an instance of workflowExecutionManager implementation

Types

type Factory

type Factory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Factory vends datastore implementations backed by cassandra

func NewFactory

func NewFactory(cfg config.Cassandra, r resolver.ServiceResolver, clusterName string, logger log.Logger) *Factory

NewFactory returns an instance of a factory object which can be used to create datastores that are backed by cassandra

func (*Factory) Close

func (f *Factory) Close()

Close closes the factory

func (*Factory) NewClusterMetadataStore added in v0.27.0

func (f *Factory) NewClusterMetadataStore() (p.ClusterMetadataStore, error)

NewClusterMetadataStore returns a metadata store

func (*Factory) NewExecutionStore

func (f *Factory) NewExecutionStore(shardID int32) (p.ExecutionStore, error)

NewExecutionStore returns an ExecutionStore for a given shardID

func (*Factory) NewHistoryStore

func (f *Factory) NewHistoryStore() (p.HistoryStore, error)

NewHistoryStore returns a new history store

func (*Factory) NewMetadataStore

func (f *Factory) NewMetadataStore() (p.MetadataStore, error)

NewMetadataStore returns a metadata store that understands only v2

func (*Factory) NewQueue added in v0.27.0

func (f *Factory) NewQueue(queueType p.QueueType) (p.Queue, error)

NewQueue returns a new queue backed by cassandra

func (*Factory) NewShardStore

func (f *Factory) NewShardStore() (p.ShardStore, error)

NewShardStore returns a new shard store

func (*Factory) NewTaskStore

func (f *Factory) NewTaskStore() (p.TaskStore, error)

NewTaskStore returns a new task store

func (*Factory) NewVisibilityStore

func (f *Factory) NewVisibilityStore() (p.VisibilityStore, error)

NewVisibilityStore returns a visibility store

type FieldNotFoundError added in v0.27.0

type FieldNotFoundError struct {
	Msg string
}

FieldNotFoundError is an error type returned when an untyped query return does not contain the expected fields.

func (FieldNotFoundError) Error added in v0.27.0

func (f FieldNotFoundError) Error() string

type PersistedTypeMismatchError added in v0.27.0

type PersistedTypeMismatchError struct {
	Msg string
}

PersistedTypeMismatchError is an error type returned when a persisted cassandra value does not match the expected type.

func (PersistedTypeMismatchError) Error added in v0.27.0

type TestCluster

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

TestCluster allows executing cassandra operations in testing.

func NewTestCluster

func NewTestCluster(keyspace, username, password, host string, port int, schemaDir string, logger log.Logger) *TestCluster

NewTestCluster returns a new cassandra test cluster

func (*TestCluster) Config

func (s *TestCluster) Config() config.Persistence

Config returns the persistence config for connecting to this test cluster

func (*TestCluster) CreateDatabase

func (s *TestCluster) CreateDatabase()

CreateDatabase from PersistenceTestCluster interface

func (*TestCluster) CreateSession

func (s *TestCluster) CreateSession()

CreateSession from PersistenceTestCluster interface

func (*TestCluster) DatabaseName

func (s *TestCluster) DatabaseName() string

DatabaseName from PersistenceTestCluster interface

func (*TestCluster) DropDatabase

func (s *TestCluster) DropDatabase()

DropDatabase from PersistenceTestCluster interface

func (*TestCluster) LoadSchema

func (s *TestCluster) LoadSchema(fileNames []string, schemaDir string)

LoadSchema from PersistenceTestCluster interface

func (*TestCluster) LoadVisibilitySchema

func (s *TestCluster) LoadVisibilitySchema(fileNames []string, schemaDir string)

LoadVisibilitySchema from PersistenceTestCluster interface

func (*TestCluster) SetupTestDatabase

func (s *TestCluster) SetupTestDatabase()

SetupTestDatabase from PersistenceTestCluster interface

func (*TestCluster) TearDownTestDatabase

func (s *TestCluster) TearDownTestDatabase()

TearDownTestDatabase from PersistenceTestCluster interface

Jump to

Keyboard shortcuts

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