Documentation ¶
Index ¶
- func CreateIndexesForColumn(table *typedef.Table, maxIndexes int) []typedef.IndexDef
- func CreateMaterializedViews(c typedef.Columns, tableName string, ...) []typedef.MaterializedView
- func CreatePartitionKeyValues(table *typedef.Table, r *rand.Rand, g *typedef.PartitionRangeConfig) []interface{}
- func CreatePkColumns(cnt int, prefix string) typedef.Columns
- func GenColumnName(prefix string, idx int) string
- func GenColumnType(numColumns int, sc *typedef.SchemaConfig, r *rand.Rand) typedef.Type
- func GenIndexName(prefix string, idx int) string
- func GenListType(sc *typedef.SchemaConfig, r *rand.Rand) *typedef.BagType
- func GenMapType(sc *typedef.SchemaConfig, r *rand.Rand) *typedef.MapType
- func GenPartitionKeyColumnType(r *rand.Rand) typedef.Type
- func GenPrimaryKeyColumnType(r *rand.Rand) typedef.Type
- func GenSchema(sc typedef.SchemaConfig, seed uint64) *typedef.Schema
- func GenSetType(sc *typedef.SchemaConfig, r *rand.Rand) *typedef.BagType
- func GenSimpleType(_ *typedef.SchemaConfig, r *rand.Rand) typedef.SimpleType
- func GenTupleType(sc *typedef.SchemaConfig, r *rand.Rand) typedef.Type
- func GenUDTType(sc *typedef.SchemaConfig, r *rand.Rand) *typedef.UDTType
- func GetCreateKeyspaces(s *typedef.Schema) (string, string)
- func GetCreateSchema(s *typedef.Schema) []string
- func GetCreateTable(t *typedef.Table, ks typedef.Keyspace) string
- func GetCreateTypes(t *typedef.Table, keyspace typedef.Keyspace) []string
- func GetDropSchema(s *typedef.Schema) []string
- type Config
- type DistributionFunc
- type Generator
- func (g *Generator) FindAndMarkStalePartitions()
- func (g *Generator) Get() *typedef.ValueWithToken
- func (g *Generator) GetOld() *typedef.ValueWithToken
- func (g *Generator) GetPartitionForToken(token TokenIndex) *Partition
- func (g *Generator) GiveOld(v *typedef.ValueWithToken)
- func (g *Generator) GiveOlds(tokens []*typedef.ValueWithToken)
- func (g *Generator) PartitionCount() uint64
- func (g *Generator) ReleaseToken(token uint64)
- func (g *Generator) Start(stopFlag *stop.Flag)
- type GeneratorInterface
- type Generators
- type Partition
- type Partitions
- type TokenIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndexesForColumn ¶
func CreateMaterializedViews ¶ added in v1.8.3
func CreatePartitionKeyValues ¶ added in v1.8.5
func GenColumnName ¶
func GenColumnType ¶
func GenIndexName ¶
func GenListType ¶
func GenMapType ¶
func GenSetType ¶
func GenSimpleType ¶
func GenSimpleType(_ *typedef.SchemaConfig, r *rand.Rand) typedef.SimpleType
func GenTupleType ¶
func GenUDTType ¶
func GetCreateSchema ¶
func GetDropSchema ¶
Types ¶
type Config ¶
type Config struct { PartitionsDistributionFunc DistributionFunc PartitionsRangeConfig typedef.PartitionRangeConfig PartitionsCount uint64 Seed uint64 PkUsedBufferSize uint64 }
type DistributionFunc ¶
type DistributionFunc func() TokenIndex
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func (*Generator) FindAndMarkStalePartitions ¶ added in v1.8.7
func (g *Generator) FindAndMarkStalePartitions()
func (*Generator) Get ¶
func (g *Generator) Get() *typedef.ValueWithToken
func (*Generator) GetOld ¶
func (g *Generator) GetOld() *typedef.ValueWithToken
GetOld returns a previously used value and token or a new if the old queue is empty.
func (*Generator) GetPartitionForToken ¶ added in v1.8.7
func (g *Generator) GetPartitionForToken(token TokenIndex) *Partition
func (*Generator) GiveOld ¶
func (g *Generator) GiveOld(v *typedef.ValueWithToken)
GiveOld returns the supplied value for later reuse unless
func (*Generator) GiveOlds ¶ added in v1.8.7
func (g *Generator) GiveOlds(tokens []*typedef.ValueWithToken)
GiveOlds returns the supplied values for later reuse unless
func (*Generator) PartitionCount ¶
func (*Generator) ReleaseToken ¶
ReleaseToken removes the corresponding token from the in-flight tracking.
type GeneratorInterface ¶
type GeneratorInterface interface { Get() *typedef.ValueWithToken GetOld() *typedef.ValueWithToken GiveOld(_ *typedef.ValueWithToken) GiveOlds(_ []*typedef.ValueWithToken) ReleaseToken(_ uint64) }
type Generators ¶ added in v1.8.5
type Generators []*Generator
func (Generators) StartAll ¶ added in v1.8.5
func (g Generators) StartAll(stopFlag *stop.Flag)
type Partitions ¶ added in v1.8.3
type Partitions []*Partition
func NewPartitions ¶ added in v1.8.5
func NewPartitions(count, pkBufferSize int, wakeUpSignal chan struct{}) Partitions
func (Partitions) CloseAll ¶ added in v1.8.5
func (p Partitions) CloseAll()
type TokenIndex ¶
type TokenIndex uint64
TokenIndex represents the position of a token in the token ring. A token index is translated to a token by a generators. If the generators preserves the exact position, then the token index becomes the token; otherwise token index represents an approximation of the token.
We use a token index approach, because our generators actually generate partition keys, and map them to tokens. The generators, therefore, do not populate the full token ring space. With token index, we can approximate different token distributions from a sparse set of tokens.