Commit Graph

63 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
Glauber Costa
39ca76fd03 schema: allow for the setting of default time to live
We have been leaving all the setter functions in the schema_builder, which is
usually fine.

The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-13 23:58:03 -04:00
Glauber Costa
5165e8b439 schema: allow for the setting of gc grace period
We have been leaving all the setter functions in the schema_builder, which is
usually fine.

The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.

Most properties are right there in the constructor, but I argue that this one
does not belong there.

Instead, provide a set method so that the system tables which need it can call.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-13 23:30:27 -04:00
Glauber Costa
fe370ec848 schema: read_repair_chance
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
ea17f6d76f schema: max and min index interval
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
aa270a149f schema: compaction strategy
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
b75bd9ef53 schema: add local_repair_chance parameter
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
8218c819a5 schema: access gc_grace_seconds
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
f84148c335 schema: support cf type, and is_super
All CFMetaData has a type, either Standard or Super. Right now, we do not
support Super, but we still would like to query for it, and use that information
to build our schemas.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-10 10:29:02 -04:00
Glauber Costa
9a691503ff add default_validator to schema_builder
We eventually need to wire them all up. This one is needed for describe
keyspaces to work.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-09 00:12:08 -04:00
Calle Wilund
9c4c9eff50 schema: add outstream << op to print column_definition pointers
- since these are typically non-smart.
2015-07-08 10:02:31 +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
89ede1fc00 schema: rename [set, get]_compressor to [set, get]_compressor_params
Compressor type is only a part of the information kept in compressor
parameters and things like schema.get_compressor().get_compressor()
do not look very good.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 17:05:53 +02: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
6845cc0ee5 cql3: propagate compression info to schema and sstables code
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-25 13:33:00 +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
9ea291deb3 schema: Add column_definition::position() helper
Add a position() helper function that returns component index if there
is one and zero if there isn't. This is similar to what
ColumnDefinition.position() does in Origin. We will use this for a table
creation mutation.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 11:18:53 +02:00
Raphael S. Carvalho
d1ed0744f0 schema: add sstable compressor property
The field compressor is about saying which compressor algorithm
must be used in compression of sstable data file.
This is a small step towards compressed sstable data file.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-09 11:18:56 +03: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
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
Glauber Costa
64d1538b7c schema: add filter false positive chance
Add methods to get and manipulate the current bloom filter false positive
chance - this is a per-cf field that lives in CFMetaData for Origin, so we'll
have it in the schema.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-17 12:38:36 +03: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
cae462c534 Merge remote-tracking branch 'dev/penberg/keyspace-merging/v5' from seastar-dev.git
From Pekka:

"This patch series converts LegacySchemaTables keyspace merging code to
C++. After this series, keyspaces are actually created as demonstrated
by the newly added test in cql_query_test.cc."
2015-04-28 18:06:23 +02: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
Pekka Enberg
ce51d476c2 schema.hh: Add schema::comment() accessor
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-04-28 15:49:33 +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
Avi Kivity
65b8b19ca7 Merge branch 'tgrabiec/order-partitions-by-decorated-key' of github.com:cloudius-systems/seastar-dev into db
Use decorated_key in partition maps, from Tomasz:

"Partitions should be ordered using Origin's ordering, which is the natural
ordering of decorated_key. This is achieved by switching column_family's
partition map to use decorated_key instead of a bare partition_key.

This also includes some cleanups."

[avi] trivial adjustments to sstables/keys.cc
2015-04-25 19:22:51 +03:00
Tomasz Grabiec
731a63e371 schema: Embed raw_schema inside schema
Public fields got encapsulated.
2015-04-24 18:01:01 +02:00
Glauber Costa
7677a3423e schema: specify the kind of join we want
If we end up including more than one boost::<>::join, like
boost::range::join and boost::string::join, that will create an ambiguity.

The compiler doesn't like it very much.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-24 10:11:49 -04:00
Tomasz Grabiec
631dad8a29 schema: Add const qualifiers to lookup methods 2015-04-22 17:36:27 +02:00
Tomasz Grabiec
06f198b10c schema: Add id field
It uniquely identifies column_family globally. Will be used for
column_family lookups.
2015-04-15 20:33:48 +02:00
Tomasz Grabiec
f5a45ae6e8 schema: Leave a warning about across core access of schema 2015-04-15 20:33:48 +02:00
Pekka Enberg
28b03772f2 Add schema::set_comment() member function
Needed by the cf_prop_defs class to modify a schema object in the
apply_to_cf_metadata() function.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-03-24 15:04:17 +02:00
Tomasz Grabiec
e738b213ed schema: Fix default copy constructor
Schema has containers which hash pointers to column definitions
embedded in the schema. It's not safe to just copy those, we need to
rehash them using new locations.
2015-03-24 12:06:58 +01:00
Tomasz Grabiec
e3422525c0 Use column_definition via const reference 2015-03-24 12:03:00 +01:00
Tomasz Grabiec
300a9572bd types: De-virtualize tuple_type
tuple_type is for managing our internal representation of keys. It
shares some interface with abstract_type, but the latter is a basis
for types of data stored in cells. tuple_type does not need to hide
behind a virtual interface.

Note: there is a TupleType in Origin, but it serves a different purpose.
2015-03-19 12:55:28 +01:00
Tomasz Grabiec
a8ce730842 schema: Remove partition_key_prefix_type
We don't need it.
2015-03-19 12:55:28 +01:00
Tomasz Grabiec
8912417dd0 cql3: Convert classes from org.cassandra.cql3.selection package 2015-03-11 14:56:10 +01:00
Tomasz Grabiec
baba7c12be schema: Introduce column_definition::component_index() 2015-03-11 14:56:10 +01:00
Tomasz Grabiec
0f1b6b079a schema: Store partition_key_prefix_type
single_column_primary_key_restrictions may generate partition key
prefixes.
2015-03-11 14:56:10 +01:00
Tomasz Grabiec
0612066490 schema: Introduce column_definition::is_regular() 2015-03-11 14:56:10 +01:00