Commit Graph

21 Commits

Author SHA1 Message Date
Paweł Dziepak
54268889a1 schema: allow specifying column component index
The order of columns that belong to partition key or clustering key
needs to be preserved.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-14 19:34:27 +02:00
Pekka Enberg
86d913954a db/legacy_schema_tables: Store CF "is_dense" to system tables
Persist column family's "is_dense" value to system tables. Please note
that we throw an exception if "is_dense" is null upon read. That needs
to be fixed later by inferring the value from other information like
Origin does.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-07 12:36:50 +02:00
Pekka Enberg
c24b7d42ce db/legacy_schema_tables: Store CF key validator in system tables
Store the column family key validator in system tables. Please note that
we derive the validator from CQL partition keys and never actually read
it from the database. This is different from Origin which uses
CompositeType that is both stored and read from the system tables.

Fixes #7.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Tested-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-06 20:33:05 +03:00
Paweł Dziepak
51e3f2bcea cql3: use default compressor if none specified
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 14:17:46 +02:00
Paweł Dziepak
c5e617ea78 schema: add NAME_LENGTH constant
It's probably not the best place for this constant, but that's where
it is in origin.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-23 16:17:45 +02:00
Pekka Enberg
5df4b51589 schema: Add comparison operators for column_definition and schema
Table merging code needs to compare schema_ptrs for equality so add
comparison operators for column_definition and schema classes.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-08 14:42:36 +03:00
Calle Wilund
a234414ae5 Added schema_builder::add_default_index_names
Transposition of CFMetaData.addDefaultIndexNames()
2015-06-03 10:13:53 +02:00
Calle Wilund
71d4f3fb9b Add column_definition::is_on_all_components()
Most likely an incomplete emulation of the origin behaviour, but maybe
sufficient for now.
2015-06-03 10:13:53 +02:00
Calle Wilund
15b8267dab Add thrift_schema and placeholder "has_compound_comparator()"
thrift_schema == place to collect thrift compatibility aspects of
schema definition.
2015-06-03 10:13:53 +02:00
Calle Wilund
3b6fc56cb5 Make schema_builder constructible from schema
* Make schema_builder use schema::raw_schema to ensure it carries the
same info
* Make it constructible from schema to allow modify-replace flows
2015-06-02 11:22:42 +02:00
Calle Wilund
20648b242a Schema: make columns single vector
* Keep all column_definitions in single, sorted vector + offsets for
  specific types
* Make schema constructible from raw_schema
2015-06-02 11:22:42 +02:00
Calle Wilund
138ca9d2cd Add index_info + use in column_definition 2015-06-02 11:22:42 +02:00
Calle Wilund
1d30b85ac6 Unify column_definition::column_kind and ::column_kind enums 2015-06-02 11:22:41 +02:00
Avi Kivity
bc669add40 schema: const correctness
Make schema accessors const, and make schema_ptr refer to a const schema.
2015-05-06 13:52:59 +02:00
Avi Kivity
ab60ed8813 db: s/shared_ptr<abstract_type>/data_type/
Also replace derived types (map_type, collection_type, etc.).

As we'll change data_type's definition, this reduces the number of places
that need to be modified later, and is more readable.
2015-04-29 15:09:04 +03:00
Tomasz Grabiec
ac576bf1dc schema: Remove thrift_schema
It's not used for anything so it only causes confusion.
2015-04-29 10:21:40 +03:00
Tomasz Grabiec
f00f5f39d9 Merge tag 'avi/remedial-collections-2/v1' from seastar-dev.git
Collection support remedial from Avi.
2015-04-28 17:48:07 +02:00
Avi Kivity
372b403258 cql3: implement schema::has_collections() 2015-04-28 18:02:35 +03:00
Avi Kivity
f779c54d75 db: rename tuple_type family to compound_type
tuples already have a meaning in Cassandra and in C++, let's not overload
the word even more.  Use compound, which is the word used in Origin as well.
2015-04-27 12:27:18 +02:00
Tomasz Grabiec
731a63e371 schema: Embed raw_schema inside schema
Public fields got encapsulated.
2015-04-24 18:01:01 +02:00
Tomasz Grabiec
c963821e1d db: Extract schema-specific code to schema.cc 2015-04-23 20:54:12 +02:00