Commit Graph

3945 Commits

Author SHA1 Message Date
Asias He
d1889fe7e5 streaming: Convert StreamSummary.java to C++ 2015-06-18 14:55:07 +08:00
Asias He
501eebce39 streaming: Import StreamSummary.java 2015-06-18 14:55:07 +08:00
Asias He
ab76026938 streaming: Convert StreamRequest.java to C++ 2015-06-18 14:55:06 +08:00
Asias He
a41445ac08 streaming: Import StreamRequest.java 2015-06-18 14:55:06 +08:00
Asias He
cde1676274 streaming: Add SESSION_FAILED_MESSAGE handler 2015-06-18 14:55:06 +08:00
Asias He
8170f6ee0a streaming: Add COMPLETE_MESSAGE handler 2015-06-18 14:55:06 +08:00
Asias He
e2b986910b streaming: Add RETRY_MESSAGE handler 2015-06-18 14:55:06 +08:00
Avi Kivity
b0e58486d4 main: set line buffering on stdout
More friendly when teeing stdout to a file.
2015-06-18 09:42:27 +03:00
Tomasz Grabiec
7964be8458 Merge branch 'glommer/summary-fix' from git@github.com:glommer/urchin.git
From Glauber:

"Shlomi found a bug when writing summary files under certain conditions.
The current patchset fixes it, while also performing some generally useful
cleanups."
2015-06-17 16:23:09 +02:00
Tomasz Grabiec
4c22a773e9 Merge branch 'penberg/cql-create-table-static-columns' from seastar-dev.git
From Pekka:

"This series fixes few issues that prevented CQL from instantiating
static columns properly."
2015-06-17 15:40:16 +02:00
Pekka Enberg
6a65b0e684 cql_query_test: Use CQL table with static columns
Use CQL for table creation now that static columns actually work.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:34:22 +03:00
Pekka Enberg
4bb1c049f7 cql3: Fix create_table_statement::raw_statement definition lookup
The column_identifiers are wrapped in shared_ptr<> so use the
appropriate hash and comparison functions for the container.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:34:09 +03:00
Pekka Enberg
765ace5900 cql3: Fix static column set lookups
The column_identifiers are wrapped in shared_ptr<> so use the
appropriate hash and comparison functions for the container.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:34:09 +03:00
Tomasz Grabiec
1767da1162 Merge branch 'penberg/cql-create-table-tests' from seastar-dev.git
From Pekka:

"This series improves the CQL test for 'create table' statement. It
hardens the test_create_statement() test case and converts
create_table() calls to use CQL where possible. Please note that we need
to go through the remaining create_table() call-sites and fix potential
issues in the CQL front-end or schema management code."
2015-06-17 15:24:25 +02:00
Gleb Natapov
a338407e29 make storage_proxy object distributed
storage_proxy holds per cpu state now to track clustering, so it has to
be distributed otherwise smp setup does not work.
2015-06-17 15:14:06 +02:00
Glauber Costa
0dda9e357d sstables: convert assert to exception
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-17 09:09:22 -04:00
Pekka Enberg
fcb18e9550 cql_query_test: Use CQL for table creation where possible
Use CQL for creating tables instead of the low-level in-memory APIs
where possible.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 16:01:36 +03:00
Pekka Enberg
3d9785677a cql_query_test: Verify 'create table' statement operation
Add a require_table_exists() assertion after 'create table' statement is
executed to ensure in-memory schema is updated accordingly.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 15:48:18 +03:00
Pekka Enberg
6f2bf01ae3 cql_test_env: Add require_table_exists() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 15:46:02 +03:00
Pekka Enberg
8345874dda database: Add database::has_schema() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 15:45:45 +03:00
Glauber Costa
1fefd73ed8 sstables: correctly compute number of entries in summary
We are always adding one to the number of entries, but that is incorrect.  If
we have an exact multiple of the sampling rate, then we shouldn't.

This is no longer affecting us as a bug, because we now compute the size after
we seal the file. However, we should still do it right, because we will need
the correct value at some point, if we support changes to the sampling level.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-17 08:44:54 -04:00
Glauber Costa
95c8da8276 tests: test corner case for summary creation
We have recently had a bug where we were messing up with the summary generation
in certain corner cases. In particular, when the number of keys was an exact multiple
of the sampling rate.

Add a test case to make sure we never regress on this.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-17 08:44:54 -04:00
Glauber Costa
fbeba60f27 sstables: separate summary creation in two parts
We do a lot more work than we should in prepare_summary. In particular,
in cases where we will create sstables from compression, some of that information
will not be known until later.

This code is also fragile, as exposed by a recent bug, in which we miscalculated
s.header.size, ending up with a completely unusable file.

The scheme proposed in this patch makes sure things like that does not happen,
because we will be generating the header based on what we actually write, and
not based on what we estimate that we will write.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-17 08:29:37 -04:00
Glauber Costa
3b9beb1460 sstables: increment keys_written right after we read it
It is a more common idiom and thus less confusing

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-17 08:27:47 -04:00
Tomasz Grabiec
6fb5cfaab3 Merge branch 'penberg/schema-instantiate-columns/v2' from seastar-dev.git
From Pekka:

"This series updates the table merging code to instantiate columns from
system tables. To do that, the db/marshal/TypeParser class was imported
from Origin and converted to support primitive and collection types to
make CQL test pass."
2015-06-17 12:04:30 +02:00
Pekka Enberg
38187f2e72 db/legacy_schema_tables: Instantiate columns from system tables
Read the system tables and instantiate table columns to in-memory data
structures.

NOTE! We only support one component per partition and clustering key
because there is no way to pass component index to the schema builder.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
5084ce0955 query-result-set.hh: Add result_set_row::has() helper
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
825588ed48 storage_proxy: Make clustering range configurable for query_local()
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
f7f06758a6 types: Fix data type naming
Fix data type naming to follow Origin's conventions so that we can
serialize the names to database.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
0fb6d6f2cb db/marshal: Convert TypeParser to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
506a8f4598 db/marshal: Import TypeParser.java
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
fab1289857 types: Add abstract_type::parse_type() helper
Add a parse_type() function for parsing a serialized type name and
returning a data_type for it. Please note that collection types are
handled elsewhere.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 12:25:18 +03:00
Pekka Enberg
b6c348807c cql3: Add clustering key support to create_table_statement
Add clustering key support to create_table_statement. While at it, add
compound types for partition keys, to unify schema building code for
both partition and clustering keys.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 11:18:53 +02:00
Pekka Enberg
1c45cdcb3b db/legacy_schema_tables: Store column component index
Make sure add_column_to_schema_mutation() also sets "column_index" for a
column that is stored to system tables.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 11:18:53 +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
Avi Kivity
828188e65d Merge "streaming updates" from Asias 2015-06-17 11:55:38 +03:00
Asias He
11df6fafc3 streaming: Add OUTGOING_FILE_MESSAGE handler 2015-06-17 16:08:38 +08:00
Asias He
2abf015d82 streaming: Add PREPARE_MESSAGE handler 2015-06-17 16:08:38 +08:00
Asias He
35e5bb7c72 streaming: Add STREAM_INIT_MESSAGE handler 2015-06-17 16:08:37 +08:00
Asias He
a6950a6d98 streaming: Add init_messaging_service_handler
We will add handlers for streaming related verbs soon.
2015-06-17 16:08:37 +08:00
Asias He
2dd2c8551a messaging_service: Add messageing verb used by streaming 2015-06-17 16:08:37 +08:00
Asias He
ea0b6931b0 streaming: Convert StreamSession.java to C++ 2015-06-17 16:08:37 +08:00
Asias He
0697f6031c streaming: Import StreamSession.java 2015-06-17 16:08:37 +08:00
Avi Kivity
2b282d3553 Merge seastar upstream 2015-06-17 10:55:27 +03:00
Avi Kivity
d0cd81f584 Merge "initial streaming conversion" from Asias 2015-06-17 10:38:43 +03:00
Gleb Natapov
11c58af7b3 cleanup main.cc 2015-06-17 10:35:35 +03:00
Shlomi Livne
4399aaba68 tests: fix bug of not handling stderr pipe in test.py 2015-06-17 09:54:55 +03:00
Glauber Costa
72cc16299c system keyspaces: use existing constant instead of hardcoding keyspace name
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 09:41:57 +03:00
Glauber Costa
e1ba4d8fe1 system_keyspace: don't read from bogus ks
The current code moves ks inside the database, then reads from it.
That's wrong. Make it right.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-17 09:41:50 +03:00
Asias He
6e83f70954 streaming: Convert SessionFailedMessage.java to C++ 2015-06-17 13:37:52 +08:00