Merged patch series by Piotr Sarna: This series introduces the concept of "computed" column, which represents values not provided directly by the user, but computed on the fly - possibly using other column values. It will be used in the future to implement map value indexing, collection indexing, etc. Right now the only use is the token column for secondary indexes - which is a column computed from the base partition key value. After this series, another one that depends on it and adds map value indexing will be pushed. Tests: unit(dev) Piotr Sarna (14): schema: add computed info to column definition schema: add implementation of computing token column schema: allow marking columns as computed in schema builder service: add computed columns feature view: check for computed columns in view view: remove unused token_for function database: add fixing previous secondary index schemas tests: disable computed columns feature in schema change test tests: add schema change test regeneration comment db: add system_schema.computed_columns docs: init system_schema_keyspace.md with column computations tests: generate new test case for schema change + computed cols index: mark token column as 'computed' when creating mv tests: add checking computed columns in SI column_computation.hh | 63 ++++++++ db/schema_features.hh | 4 +- db/schema_tables.hh | 4 + idl/frozen_schema.idl.hh | 1 + schema.hh | 40 +++++ schema_builder.hh | 4 +- schema_mutations.hh | 18 ++- service/storage_service.hh | 8 + view_info.hh | 2 - database.cc | 6 +- db/schema_tables.cc | 146 ++++++++++++++++-- db/view/view.cc | 46 +++--- index/secondary_index_manager.cc | 2 +- schema.cc | 58 ++++++- schema_mutations.cc | 14 +- service/storage_service.cc | 5 + tests/schema_change_test.cc | 63 ++++++-- tests/secondary_index_test.cc | 28 ++++ docs/system_schema_keyspace.md | 40 +++++ plus about 200 new test sstable files
Scylla
Quick-start
To get the build going quickly, Scylla offers a frozen toolchain which would build and run Scylla using a pre-configured Docker image. Using the frozen toolchain will also isolate all of the installed dependencies in a Docker container. Assuming you have met the toolchain prerequisites, which is running Docker in user mode, building and running is as easy as:
$ ./tools/toolchain/dbuild ./configure.py
$ ./tools/toolchain/dbuild ninja build/release/scylla
$ ./tools/toolchain/dbuild ./build/release/scylla --developer-mode 1
Please see HACKING.md for detailed information on building and developing Scylla.
Note: GCC >= 8.1.1 is required to compile Scylla.
Running Scylla
- Run Scylla
./build/release/scylla
- run Scylla with one CPU and ./tmp as data directory
./build/release/scylla --datadir tmp --commitlog-directory tmp --smp 1
- For more run options:
./build/release/scylla --help
Building Fedora RPM
As a pre-requisite, you need to install Mock on your machine:
# Install mock:
sudo yum install mock
# Add user to the "mock" group:
usermod -a -G mock $USER && newgrp mock
Then, to build an RPM, run:
./dist/redhat/build_rpm.sh
The built RPM is stored in /var/lib/mock/<configuration>/result directory.
For example, on Fedora 21 mock reports the following:
INFO: Done(scylla-server-0.00-1.fc21.src.rpm) Config(default) 20 minutes 7 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-21-x86_64/result
Building Fedora-based Docker image
Build a Docker image with:
cd dist/docker
docker build -t <image-name> .
Run the image with:
docker run -p $(hostname -i):9042:9042 -i -t <image name>