Documentation ¶
Index ¶
- Variables
- func CheckCompatibleVersion(cfg config.Cassandra, r resolver.ServiceResolver, expectedVersion string) error
- func CreateCassandraKeyspace(s gocql.Session, keyspace string, replicas int, overwrite bool, ...) (err error)
- func DropCassandraKeyspace(s gocql.Session, keyspace string, logger log.Logger) (err error)
- func GetTaskTTL(expireTime *time.Time) int64
- func NewExecutionStore(session gocql.Session, logger log.Logger) p.ExecutionStore
- func VerifyCompatibleVersion(cfg config.Persistence, r resolver.ServiceResolver, checkVisibility bool) error
- type Factory
- func (f *Factory) Close()
- func (f *Factory) NewClusterMetadataStore() (p.ClusterMetadataStore, error)
- func (f *Factory) NewExecutionStore() (p.ExecutionStore, error)
- func (f *Factory) NewMetadataStore() (p.MetadataStore, error)
- func (f *Factory) NewQueue(queueType p.QueueType) (p.Queue, error)
- func (f *Factory) NewShardStore() (p.ShardStore, error)
- func (f *Factory) NewTaskStore() (p.TaskStore, error)
- type FieldNotFoundError
- type PersistedTypeMismatchError
- type SchemaVersionReader
- type TestCluster
- func (s *TestCluster) Config() config.Persistence
- func (s *TestCluster) CreateDatabase()
- func (s *TestCluster) CreateSession(keyspace string)
- func (s *TestCluster) DatabaseName() string
- func (s *TestCluster) DropDatabase()
- func (s *TestCluster) LoadSchema(schemaFile string)
- func (s *TestCluster) SetupTestDatabase()
- func (s *TestCluster) TearDownTestDatabase()
Constants ¶
This section is empty.
Variables ¶
var (
ErrGetSchemaVersion = errors.New("failed to get current schema version from cassandra")
)
Functions ¶
func CheckCompatibleVersion ¶ added in v1.12.0
func CheckCompatibleVersion( cfg config.Cassandra, r resolver.ServiceResolver, expectedVersion string, ) error
CheckCompatibleVersion check the version compatibility
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 ¶
DropCassandraKeyspace drops the given keyspace, if it exists
func GetTaskTTL ¶ added in v0.27.0
func NewExecutionStore ¶ added in v1.12.0
NewExecutionStore is used to create an instance of workflowExecutionManager implementation
func VerifyCompatibleVersion ¶ added in v1.5.7
func VerifyCompatibleVersion( cfg config.Persistence, r resolver.ServiceResolver, checkVisibility bool, ) error
VerifyCompatibleVersion ensures that the installed version of temporal and visibility keyspaces is greater than or equal to the expected version. In most cases, the versions should match. However if after a schema upgrade there is a code rollback, the code version (expected version) would fall lower than the actual version in cassandra.
Types ¶
type Factory ¶
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 data stores that are backed by cassandra
func NewFactoryFromSession ¶ added in v1.12.0
func NewFactoryFromSession( cfg config.Cassandra, clusterName string, logger log.Logger, session gocql.Session, ) *Factory
NewFactoryFromSession returns an instance of a factory object from the given session.
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() (p.ExecutionStore, error)
NewExecutionStore returns an ExecutionStore for a given shardID
func (*Factory) NewMetadataStore ¶
func (f *Factory) NewMetadataStore() (p.MetadataStore, error)
NewMetadataStore returns a metadata store that understands only v2
func (*Factory) NewShardStore ¶
func (f *Factory) NewShardStore() (p.ShardStore, error)
NewShardStore returns a new shard 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
func (f PersistedTypeMismatchError) Error() string
type SchemaVersionReader ¶ added in v1.5.7
type SchemaVersionReader struct {
// contains filtered or unexported fields
}
func NewSchemaVersionReader ¶ added in v1.5.7
func NewSchemaVersionReader(session gocql.Session) *SchemaVersionReader
func (*SchemaVersionReader) ReadSchemaVersion ¶ added in v1.5.7
func (svr *SchemaVersionReader) ReadSchemaVersion(keyspace string) (string, error)
ReadSchemaVersion returns the current schema version for the Keyspace
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, faultInjection *config.FaultInjection, 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( keyspace string, )
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(schemaFile string)
LoadSchema 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