Documentation ¶
Index ¶
- Constants
- Variables
- type AlterTableBuilder
- type BagType
- func (ct BagType) CQLDef() string
- func (ct BagType) CQLHolder() string
- func (ct BagType) CQLPretty(query string, value []interface{}) (string, int)
- func (st BagType) CQLType() gocql.TypeInfo
- func (ct BagType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (ct BagType) Indexable() bool
- func (ct BagType) Name() string
- type CQLFeature
- type ColumnDef
- type Columns
- type CounterType
- func (ct CounterType) CQLDef() string
- func (ct CounterType) CQLHolder() string
- func (ct CounterType) CQLPretty(query string, value []interface{}) (string, int)
- func (ct CounterType) CQLType() gocql.TypeInfo
- func (ct CounterType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (ct CounterType) Indexable() bool
- func (ct CounterType) Name() string
- type DistributionFunc
- type Generator
- type GeneratorConfig
- type IndexDef
- type Keyspace
- type MapType
- func (mt MapType) CQLDef() string
- func (mt MapType) CQLHolder() string
- func (mt MapType) CQLPretty(query string, value []interface{}) (string, int)
- func (st MapType) CQLType() gocql.TypeInfo
- func (mt MapType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (mt MapType) Indexable() bool
- func (mt MapType) Name() string
- type MaterializedView
- type Partition
- type PartitionRangeConfig
- type RoutingKeyCreator
- type Schema
- func (s *Schema) GenCheckStmt(t *Table, g *Generator, r *rand.Rand, p PartitionRangeConfig) *Stmt
- func (s *Schema) GenDDLStmt(t *Table, r *rand.Rand, p PartitionRangeConfig, sc *SchemaConfig) ([]*Stmt, func(), error)
- func (s *Schema) GenDeleteRows(t *Table, g *Generator, r *rand.Rand, p PartitionRangeConfig) (*Stmt, error)
- func (s *Schema) GenInsertJsonStmt(t *Table, g *Generator, r *rand.Rand, p PartitionRangeConfig) (*Stmt, error)
- func (s *Schema) GenInsertStmt(t *Table, g *Generator, r *rand.Rand, p PartitionRangeConfig) (*Stmt, error)
- func (s *Schema) GenMutateStmt(t *Table, g *Generator, r *rand.Rand, p PartitionRangeConfig, deletes bool) (*Stmt, error)
- func (s *Schema) GetCreateKeyspaces() (string, string)
- func (s *Schema) GetCreateSchema() []string
- func (s *Schema) GetDropSchema() []string
- type SchemaBuilder
- type SchemaConfig
- func (sc *SchemaConfig) GetMaxClusteringKeys() int
- func (sc *SchemaConfig) GetMaxColumns() int
- func (sc *SchemaConfig) GetMaxPartitionKeys() int
- func (sc *SchemaConfig) GetMaxTables() int
- func (sc *SchemaConfig) GetMinClusteringKeys() int
- func (sc *SchemaConfig) GetMinColumns() int
- func (sc *SchemaConfig) GetMinPartitionKeys() int
- func (sc *SchemaConfig) Valid() error
- type SimpleType
- func (st SimpleType) CQLDef() string
- func (st SimpleType) CQLHolder() string
- func (st SimpleType) CQLPretty(query string, value []interface{}) (string, int)
- func (st SimpleType) CQLType() gocql.TypeInfo
- func (st SimpleType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (st SimpleType) Indexable() bool
- func (st SimpleType) Name() string
- type StatementType
- type Stmt
- type Table
- type TokenIndex
- type TupleType
- func (tt TupleType) CQLDef() string
- func (tt TupleType) CQLHolder() string
- func (tt TupleType) CQLPretty(query string, value []interface{}) (string, int)
- func (st TupleType) CQLType() gocql.TypeInfo
- func (tt TupleType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (st TupleType) Indexable() bool
- func (tt TupleType) Name() string
- type Type
- type UDTType
- func (tt UDTType) CQLDef() string
- func (tt UDTType) CQLHolder() string
- func (tt UDTType) CQLPretty(query string, value []interface{}) (string, int)
- func (st UDTType) CQLType() gocql.TypeInfo
- func (tt UDTType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
- func (tt UDTType) Indexable() bool
- func (tt UDTType) Name() string
- type Value
- type ValueWithToken
Constants ¶
const ( TYPE_ASCII = SimpleType("ascii") TYPE_BIGINT = SimpleType("bigint") TYPE_BLOB = SimpleType("blob") TYPE_BOOLEAN = SimpleType("boolean") TYPE_DATE = SimpleType("date") TYPE_DECIMAL = SimpleType("decimal") TYPE_DOUBLE = SimpleType("double") TYPE_DURATION = SimpleType("duration") TYPE_FLOAT = SimpleType("float") TYPE_INET = SimpleType("inet") TYPE_INT = SimpleType("int") TYPE_SMALLINT = SimpleType("smallint") TYPE_TEXT = SimpleType("text") TYPE_TIME = SimpleType("time") TYPE_TIMESTAMP = SimpleType("timestamp") TYPE_TIMEUUID = SimpleType("timeuuid") TYPE_TINYINT = SimpleType("tinyint") TYPE_UUID = SimpleType("uuid") TYPE_VARCHAR = SimpleType("varchar") TYPE_VARINT = SimpleType("varint") )
Variables ¶
var ( SchemaConfigInvalidPK = errors.New("max number of partition keys must be bigger than min number of partition keys") SchemaConfigInvalidCK = errors.New("max number of clustering keys must be bigger than min number of clustering keys") SchemaConfigInvalidCols = errors.New("max number of columns must be bigger than min number of columns") )
Functions ¶
This section is empty.
Types ¶
type AlterTableBuilder ¶
type AlterTableBuilder struct {
// contains filtered or unexported fields
}
func (*AlterTableBuilder) ToCql ¶
func (atb *AlterTableBuilder) ToCql() (string, []string)
type BagType ¶
type BagType struct { Kind string `json:"kind"` // We need to differentiate between sets and lists Type SimpleType `json:"type"` Frozen bool `json:"frozen"` }
type CQLFeature ¶
type CQLFeature int
const ( CQL_FEATURE_BASIC CQLFeature = iota + 1 CQL_FEATURE_NORMAL CQL_FEATURE_ALL KnownIssuesJsonWithTuples = "https://github.com/scylladb/scylla/issues/3708" )
type ColumnDef ¶
func (*ColumnDef) UnmarshalJSON ¶
type CounterType ¶
type CounterType struct {
Value int64
}
func (CounterType) CQLDef ¶
func (ct CounterType) CQLDef() string
func (CounterType) CQLHolder ¶
func (ct CounterType) CQLHolder() string
func (CounterType) CQLPretty ¶
func (ct CounterType) CQLPretty(query string, value []interface{}) (string, int)
func (CounterType) CQLType ¶
func (ct CounterType) CQLType() gocql.TypeInfo
func (CounterType) GenValue ¶
func (ct CounterType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
func (CounterType) Indexable ¶
func (ct CounterType) Indexable() bool
func (CounterType) Name ¶
func (ct CounterType) Name() string
type DistributionFunc ¶
type DistributionFunc func() TokenIndex
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func (Generator) Get ¶
func (g Generator) Get() (ValueWithToken, bool)
func (Generator) GetOld ¶
func (g Generator) GetOld() (ValueWithToken, bool)
GetOld returns a previously used value and token or a new if the old queue is empty.
func (*Generator) GiveOld ¶
func (g *Generator) GiveOld(v ValueWithToken)
GiveOld returns the supplied value for later reuse unless the value is empty in which case it removes the corresponding token from the in-flight tracking.
type GeneratorConfig ¶
type GeneratorConfig struct { PartitionsRangeConfig PartitionRangeConfig PartitionsCount uint64 PartitionsDistributionFunc DistributionFunc Seed uint64 PkUsedBufferSize uint64 }
type Keyspace ¶
type Keyspace struct { Name string `json:"name"` Replication *replication.Replication `json:"replication"` OracleReplication *replication.Replication `json:"oracle_replication"` }
type MapType ¶
type MapType struct { KeyType SimpleType `json:"key_type"` ValueType SimpleType `json:"value_type"` Frozen bool `json:"frozen"` }
type MaterializedView ¶
type PartitionRangeConfig ¶
type RoutingKeyCreator ¶
type RoutingKeyCreator struct {
// contains filtered or unexported fields
}
func (*RoutingKeyCreator) CreateRoutingKey ¶
func (rc *RoutingKeyCreator) CreateRoutingKey(table *Table, values []interface{}) ([]byte, error)
type Schema ¶
func GenSchema ¶
func GenSchema(sc SchemaConfig) *Schema
func (*Schema) GenCheckStmt ¶
func (*Schema) GenDDLStmt ¶
func (s *Schema) GenDDLStmt(t *Table, r *rand.Rand, p PartitionRangeConfig, sc *SchemaConfig) ([]*Stmt, func(), error)
func (*Schema) GenDeleteRows ¶
func (*Schema) GenInsertJsonStmt ¶
func (*Schema) GenInsertStmt ¶
func (*Schema) GenMutateStmt ¶
func (*Schema) GetCreateKeyspaces ¶ added in v1.6.5
func (*Schema) GetCreateSchema ¶
func (*Schema) GetDropSchema ¶
type SchemaBuilder ¶
type SchemaBuilder interface { Keyspace(Keyspace) SchemaBuilder Table(*Table) SchemaBuilder Build() *Schema }
func NewSchemaBuilder ¶
func NewSchemaBuilder() SchemaBuilder
type SchemaConfig ¶
type SchemaConfig struct { ReplicationStrategy *replication.Replication OracleReplicationStrategy *replication.Replication TableOptions []tableopts.Option MaxTables int MaxPartitionKeys int MinPartitionKeys int MaxClusteringKeys int MinClusteringKeys int MaxColumns int MinColumns int MaxUDTParts int MaxTupleParts int MaxBlobLength int MaxStringLength int MinBlobLength int MinStringLength int UseCounters bool UseLWT bool CQLFeature CQLFeature AsyncObjectStabilizationAttempts int AsyncObjectStabilizationDelay time.Duration }
func (*SchemaConfig) GetMaxClusteringKeys ¶
func (sc *SchemaConfig) GetMaxClusteringKeys() int
func (*SchemaConfig) GetMaxColumns ¶
func (sc *SchemaConfig) GetMaxColumns() int
func (*SchemaConfig) GetMaxPartitionKeys ¶
func (sc *SchemaConfig) GetMaxPartitionKeys() int
func (*SchemaConfig) GetMaxTables ¶
func (sc *SchemaConfig) GetMaxTables() int
func (*SchemaConfig) GetMinClusteringKeys ¶
func (sc *SchemaConfig) GetMinClusteringKeys() int
func (*SchemaConfig) GetMinColumns ¶
func (sc *SchemaConfig) GetMinColumns() int
func (*SchemaConfig) GetMinPartitionKeys ¶
func (sc *SchemaConfig) GetMinPartitionKeys() int
func (*SchemaConfig) Valid ¶
func (sc *SchemaConfig) Valid() error
type SimpleType ¶
type SimpleType string
func (SimpleType) CQLDef ¶
func (st SimpleType) CQLDef() string
func (SimpleType) CQLHolder ¶
func (st SimpleType) CQLHolder() string
func (SimpleType) CQLPretty ¶
func (st SimpleType) CQLPretty(query string, value []interface{}) (string, int)
func (SimpleType) CQLType ¶
func (st SimpleType) CQLType() gocql.TypeInfo
func (SimpleType) GenValue ¶
func (st SimpleType) GenValue(r *rand.Rand, p PartitionRangeConfig) []interface{}
func (SimpleType) Indexable ¶
func (st SimpleType) Indexable() bool
func (SimpleType) Name ¶
func (st SimpleType) Name() string
type StatementType ¶
type StatementType uint8
const ( SelectStatementType StatementType = iota SelectRangeStatementType SelectByIndexStatementType SelectFromMaterializedViewStatementType DeleteStatementType InsertStatement AlterColumnStatementType DropColumnStatementType )
func (StatementType) PossibleAsyncOperation ¶
func (st StatementType) PossibleAsyncOperation() bool
type Stmt ¶
type Stmt struct { Query qb.Builder Values func() (uint64, []interface{}) Types []Type QueryType StatementType }
type Table ¶
type Table struct { Name string `json:"name"` PartitionKeys Columns `json:"partition_keys"` ClusteringKeys Columns `json:"clustering_keys"` Columns Columns `json:"columns"` Indexes []IndexDef `json:"indexes,omitempty"` MaterializedViews []MaterializedView `json:"materialized_views,omitempty"` KnownIssues map[string]bool `json:"known_issues"` TableOptions []string `json:"table_options,omitempty"` // contains filtered or unexported fields }
func (*Table) GetCreateTable ¶
func (*Table) GetCreateTypes ¶
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 generator. If the generator 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.
type TupleType ¶
type TupleType struct { Types []SimpleType `json:"types"` Frozen bool `json:"frozen"` }
type UDTType ¶
type UDTType struct { Types map[string]SimpleType `json:"types"` TypeName string `json:"type_name"` Frozen bool `json:"frozen"` }