Commit Graph

53948 Commits

Author SHA1 Message Date
Avi Kivity
c5f8578ca1 Merge "preparations for secondary indexes"
From Calle:

"Yet another reworking of schema/schema_builder interaction.

* schema::raw_schema now has single sorted column vector + offsets
* schema can be constructed from raw_schema
* schema_builder also contains raw_schema
* schema_builder can construct from schema, ensuring all info is kept
* schema_builder->schema via raw_schema"
2015-06-02 12:24:55 +03:00
Pekka Enberg
2a68aefca9 db/legacy_schema_tables: Use sstring as schema results key
There's no need to use decorated_key as schema results map key because
we just convert it back to a keyspace name string. It does, however,
cause problems when trying to pass the results around to different CPUs
so just switch to the sstring type.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-02 12:24:11 +03: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
ee974c9445 shared_ptr: add debug option for detecting copies on wrong cpus
Track the cpu on which the reference count referred to by shared_ptr was
created, and prevent modifying it on the wrong cpu.
2015-06-02 11:22:41 +02:00
Avi Kivity
8bbfa540e5 doc: fix typo in do_until() 2015-06-02 11:22:41 +02:00
Avi Kivity
d91875d20a doc: low-level memory management 2015-06-02 11:22:41 +02:00
Avi Kivity
a77c8905cd doc: disambigute class future from the future documentation module 2015-06-02 11:22:40 +02:00
Avi Kivity
cb0cbff0c8 future: document more future-util functions 2015-06-02 11:22:40 +02:00
Amnon Heiman
7a4a9f37b1 http: Support file transformers
This runs the file transformer on a file before returning the result.

This is used for templating support.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-02 11:22:40 +02:00
Avi Kivity
a09619503e future: fix documentation errors
Noted by Nadav.
2015-06-02 11:22:40 +02:00
Avi Kivity
0877a666c4 doc: add main doxygen page 2015-06-02 11:22:40 +02:00
Avi Kivity
3b7f6f7704 future: user-level documentation 2015-06-02 11:22:39 +02:00
Avi Kivity
ad05d8e6a0 future: separate task class into its own header
tasks are a lower-level concept than future/promise, so move them to their
own header.
2015-06-02 11:22:39 +02:00
Gleb Natapov
ce89b77bba tests: add missing header 2015-06-02 11:22:39 +02:00
Amnon Heiman
b0b494ad7a api: clean up the gossiper API impl
This patch clean up the gossiper implementation by using the new square
bracket operator for path param and by using the general function
container_to_vec.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-02 11:13:15 +03:00
Avi Kivity
06a6a302df Merge "write SSTable statistics component"
From Raphael.

Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-02 10:32:32 +03:00
Raphael S. Carvalho
a9619866bb sstables: add initial support to generation of Statistics file
Statistics file is composed of three types of metadata:
- Validation
- Stats
- Compaction

This patch is adding support to generate the first two types.
Compaction is the hardest one to generate because it depends on
external modules. Anyway, I plan to convert whatever is needed
for us to support Compaction metadata as soon as possible.

Related to Stats metadata, we're filling the fields sstable_level
and repaired_at with default values. sstable_level is related to
compaction, and repaired_at is related to SStable repair.
In addition that we don't support compaction nor SStable repair yet,
those values come from upper layers in Cassandra.

Given the facts mentioned above, Statistics file is being generated
with only Validation and Stats metadata. Its on-disk format is
flexible enough so that a missing metadata won't damage it.
So it's technically possible to proceed without Compaction metadata
by the time being.

For reference:
../io/sstable/MetadataCollector.java
../io/sstable/ColumnStats.java
../io/sstable/format/big/BigTableWriter.java

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
adbe0413a9 sstables: add column name helper
Column name helper is used to manage a list of column names, where
each component is either the max or min of its own position.
It's useful when generating statistics because Stats metadata has
both max_column_names and min_column_names lists.

For reference: ../io/sstable/ColumnNameHelper.java

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
1310e79b98 sstables: convert EstimatedHistogram to C++ and start using it
In addition, this patch also fixes serialization and deserialization of
estimated histogram. Problem was found by reading the respective methods
in origin implementation.

The first element of the array offset is used for both the first and
second element of the array bucket. So given an array bucket of size N,
array offset will be of size N - 1. Our code wasn't handling this.

The new representation of estimated histogram provides us with methods
needed for writing the component Statistics.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
797a853248 sstables: Import EstimatedHistogram.java
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
05f2bfbe77 sstables: convert StreamingHistogram to C++ and start using it
This step was important to extend streaming_histogram with methods
needed for writing the SSTable component Statistics.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
fd49c49c2f sstables: Import StreamingHistogram.java
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
53a26a5966 sstables: move disk_* types to a header
That's needed to avoid circular dependencies of header files.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Raphael S. Carvalho
6ae4476427 sstables: collect validation metadata
Validation metadata stores partitioner name and bloom filter chance.
Cassandra gets the partitioner name by getting a object of the class
itself and getting its canonical name.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-02 10:32:12 +03:00
Avi Kivity
a580bb8000 Merge "write sstables crc and digest files"
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-02 10:05:32 +03:00
Avi Kivity
c96e3834c2 Merge seastar upstream 2015-06-01 19:02:01 +03:00
Avi Kivity
db46ced43c cql3: fix shared_ptr misuse in select_statement
A shared_ptr is mutable, so it must be thread_local, not static.
2015-06-01 17:34:00 +02:00
Avi Kivity
750543fc04 cql3: fix shared_ptr misuse in modification_statement
A shared_ptr is mutable, so it must be thread_local, not static.
2015-06-01 17:31:57 +02:00
Raphael S. Carvalho
ddd5ad559e sstables: add initial support to generation of Digest file
Digest file stores adler checksum of data file converted into a
string. Testcase is added.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-01 12:25:02 -03:00
Raphael S. Carvalho
bdd3fe61c5 sstables: add initial support to generation of CRC component
CRC component is composed of chunk size, and a vector of checksums
for each chunk (at most chunk size bytes) composing the data file.
The implementation is about computing the checksum every time the
output stream of data file gets written. A write to output stream
may cross the chunk boundary, so that must be handled properly.
Note that CRC component will only be created if compression isn't
being used.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-01 12:25:01 -03:00
Avi Kivity
606368f6f6 shared_ptr: add debug option for detecting copies on wrong cpus
Track the cpu on which the reference count referred to by shared_ptr was
created, and prevent modifying it on the wrong cpu.
2015-06-01 18:18:52 +03:00
Avi Kivity
b261bc9f42 cql3: fix shared_ptr misuse in cql3::constants
Global shared_ptrs are mutable, so make them shared_local.
2015-06-01 17:18:46 +02:00
Avi Kivity
b2ca316516 storage_proxy: fix shared_ptr misuse in query_local()
Instead of using do_with(), we open-code it and do it badly, dropping
the reference count on the remote shard.

Fix by dropping the reference count on the local core.
2015-06-01 17:18:35 +02:00
Calle Wilund
0729580f84 Separate replay_position into its own header
Less include bloat...

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-06-01 14:17:43 +03:00
Avi Kivity
b0abe9230b doc: fix typo in do_until() 2015-06-01 11:37:42 +03:00
Avi Kivity
23d874f786 doc: low-level memory management 2015-06-01 11:35:37 +03:00
Gleb Natapov
fc176415f1 remove leftovers from db/serializer.hh 2015-06-01 09:31:58 +02:00
Avi Kivity
34f18d1847 Merge "token bootstrap"
Token bootstrap, from Asias.
2015-06-01 09:55:24 +03:00
Asias He
05939af7c7 token_metadata: Move update_host_id to source file 2015-06-01 11:33:11 +08:00
Asias He
40bf00bdb1 storage_service: Move some code to source file 2015-06-01 11:24:39 +08:00
Asias He
4c23121b47 token_metadata: Add helper to print debug info for _token_metadata 2015-06-01 11:24:39 +08:00
Asias He
7d39ca0b4a storage_service: Insert local host_id to _token_metadata.
This is how host_id is generated for each and every node.
We will learn other host_id of other node through gossip.
2015-06-01 11:24:39 +08:00
Asias He
3b4c233f55 system_keyspace: Add get_local_host_id and set_local_host_id 2015-06-01 11:24:39 +08:00
Asias He
6bffee5e11 token_metadata: Add update_host_id
Use std::unordered_map instead of boost:bimap. std::unordered_map is
much much easier to use. It is a premature optimization to user bimap.
We can iterate the map to check if host_id is unique. Modification of
host_id is not a frequent or performance sensitive operation anyway.
2015-06-01 11:24:38 +08:00
Asias He
e908c6a7ed UUID: Add default constructor
Needed by std::map operator[].
2015-06-01 11:24:38 +08:00
Asias He
291690d745 storage_service: Rename getRingDelay to get_ring_delay 2015-06-01 11:24:38 +08:00
Asias He
0acf306ccf storage_service: Implement on_change 2015-06-01 11:24:38 +08:00