cassandra

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 26 Imported by: 1

README

Using the cassandra schema tool

This package contains the tooling for temporal cassandra operations.

For localhost development

For the very first time run:

make

then run:

make install-schema

to create schema in your cassandra instance.

For production

Create the binaries

  • Run make
  • You should see an executable temporal-cassandra-tool

Do one time database creation and schema setup for a new cluster

This uses Cassandra's SimpleStratagey for replication. For production, we recommend using a replication factor of 3 with NetworkTopologyStrategy.

temporal-cassandra-tool --ep $CASSANDRA_SEEDS create -k $KEYSPACE --rf $RF

See https://www.ecyrd.com/cassandracalculator for an easy way to determine how many nodes and what replication factor you will want to use. Note that Temporal by default uses LOCAL_QUORUM and LOCAL_SERIAL for read and write consistency.

./temporal-cassandra-tool -ep 127.0.0.1 -k temporal setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0
./temporal-cassandra-tool -ep 127.0.0.1 -k temporal update-schema -d ./schema/cassandra/temporal/versioned -- upgrades your schema to the latest version

./temporal-cassandra-tool -ep 127.0.0.1 -k temporal_visibility setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0 for visibility
./temporal-cassandra-tool -ep 127.0.0.1 -k temporal_visibility update-schema -d ./schema/cassandra/visibility/versioned -- upgrades your schema to the latest version for visibility

Update schema as part of a release

You can only upgrade to a new version after the initial setup done above.

./temporal-cassandra-tool -ep 127.0.0.1 -k temporal update-schema -d ./schema/cassandra/temporal/versioned -v x.x    -- executes the upgrade to version x.x

./temporal-cassandra-tool -ep 127.0.0.1 -k temporal_visibility update-schema -d ./schema/cassandra/visibility/versioned -v x.x    -- executes the upgrade to version x.x

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTool

func RunTool(args []string) error

RunTool runs the temporal-cassandra-tool command line tool

Types

type CQLClientConfig added in v0.5.7

type CQLClientConfig struct {
	Hosts    string
	Port     int
	User     string
	Password string
	Keyspace string
	Timeout  int

	Datacenter               string
	Consistency              string
	TLS                      *auth.TLS
	DisableInitialHostLookup bool
	AddressTranslator        *config.CassandraAddressTranslator
	// contains filtered or unexported fields
}

CQLClientConfig contains the configuration for cql client

type CQLClientTestSuite added in v1.20.0

type CQLClientTestSuite struct {
	test.DBTestBase
}

func (*CQLClientTestSuite) SetupSuite added in v1.20.0

func (s *CQLClientTestSuite) SetupSuite()

func (*CQLClientTestSuite) SetupTest added in v1.20.0

func (s *CQLClientTestSuite) SetupTest()

func (*CQLClientTestSuite) TearDownSuite added in v1.20.0

func (s *CQLClientTestSuite) TearDownSuite()

func (*CQLClientTestSuite) TestCQLClient added in v1.20.0

func (s *CQLClientTestSuite) TestCQLClient()

func (*CQLClientTestSuite) TestParseCQLFile added in v1.20.0

func (s *CQLClientTestSuite) TestParseCQLFile()

type SetupSchemaConfig

type SetupSchemaConfig struct {
	CQLClientConfig
	schema.SetupConfig
}

SetupSchemaConfig contains the configuration params needed to setup schema tables

type SetupSchemaTestSuite added in v1.20.0

type SetupSchemaTestSuite struct {
	test.SetupSchemaTestBase
	// contains filtered or unexported fields
}

func (*SetupSchemaTestSuite) SetupSuite added in v1.20.0

func (s *SetupSchemaTestSuite) SetupSuite()

func (*SetupSchemaTestSuite) TearDownSuite added in v1.20.0

func (s *SetupSchemaTestSuite) TearDownSuite()

func (*SetupSchemaTestSuite) TestCreateKeyspace added in v1.20.0

func (s *SetupSchemaTestSuite) TestCreateKeyspace()

func (*SetupSchemaTestSuite) TestSetupSchema added in v1.20.0

func (s *SetupSchemaTestSuite) TestSetupSchema()

type UpdateSchemaTestSuite added in v1.20.0

type UpdateSchemaTestSuite struct {
	test.UpdateSchemaTestBase
}

func (*UpdateSchemaTestSuite) SetupSuite added in v1.20.0

func (s *UpdateSchemaTestSuite) SetupSuite()

func (*UpdateSchemaTestSuite) TearDownSuite added in v1.20.0

func (s *UpdateSchemaTestSuite) TearDownSuite()

func (*UpdateSchemaTestSuite) TestDryrun added in v1.20.0

func (s *UpdateSchemaTestSuite) TestDryrun()

func (*UpdateSchemaTestSuite) TestUpdateSchema added in v1.20.0

func (s *UpdateSchemaTestSuite) TestUpdateSchema()

func (*UpdateSchemaTestSuite) TestVisibilityDryrun added in v1.20.0

func (s *UpdateSchemaTestSuite) TestVisibilityDryrun()

type VersionTestSuite added in v1.20.0

type VersionTestSuite struct {
	*require.Assertions // override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test, not merely log an error
	suite.Suite
}

func (*VersionTestSuite) SetupTest added in v1.20.0

func (s *VersionTestSuite) SetupTest()

func (*VersionTestSuite) TestVerifyCompatibleVersion added in v1.20.0

func (s *VersionTestSuite) TestVerifyCompatibleVersion()

Jump to

Keyboard shortcuts

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