Commit Graph

428 Commits

Author SHA1 Message Date
Asias He
1828019d60 streaming: Convert StreamManager.java to C++ 2015-07-14 20:41:14 +08:00
Asias He
85d9204d0e streaming: Drop connection_handler
stream_session::stream_session(inet_address peer_, inet_address connecting_,
    int index_, bool keep_ss_table_level_)
    : peer(peer_)
    , connecting(connecting_)
    , conn_handler(shared_from_this())

Calling shared_from_this() inside stream_session's constructor is
problematic. I got

   Exiting on unhandled exception of type 'std::bad_weak_ptr': bad_weak_ptr

exceptions, with

   auto session = std::make_shared<stream_session>(peer, connecting, size, _keep_ss_table_level)

Also, the logic in connection_handler is not very useful for us. The
sending and receiving of messages are handled using messaging_service.
There is no need to add another layer.
2015-07-14 20:41:14 +08:00
Asias He
14ae9e66ae streaming: Use shared_ptr to track back to stream_session
I tried our lw_shared_ptr, the compiler complained endless usage of
incomplete type stream_session. I can not include stream_session.hh
everywhere due to circular dependency.

For now, I'm using std::shared_ptr which works fine.
2015-07-14 20:41:14 +08:00
Avi Kivity
1072a960e7 build: avoid false positive warning on gcc 5
Maybe-uninitialized, but maybe it is?  No thanks.
2015-07-12 20:55:49 +03:00
Avi Kivity
7684f2f541 Merge "Add ByteOrderedPartitioner" from Paweł
This patch series adds partial implementation of ByteOrderedPartitioner
and allows choosing it in configuration file.
While ByteOrderedPartitioner is generally not recommended it is used by
some tests in DTEST due to its order guarantees.
2015-07-12 16:20:19 +03:00
Tomasz Grabiec
6f5c00c515 tests: Add test for mutation queries 2015-07-12 12:54:38 +02:00
Tomasz Grabiec
9bea6aa0a3 db: Introduce mutation query interface
Mutation query differs from data query in that returns information
needed to reconcile data slice with that retruned by other data
sources.

There is a generic mutation_query() algorithm introduced, which can
work with any mutation_source.

database::query_mutations() is a shard-local interface for mutation
queries.

The reconcilable_result is introduced as a medium for mutation query
results. It piggy backs on frozen_mutation as a medium for
reconcilable data.
2015-07-12 12:51:38 +02:00
Avi Kivity
9c6dd8b724 Merge "Fix CQL index name case sensitivity" from Pekka
"Fix index name case sensitivity as per Origin commit 68be72f ("Fix
case-sensitivity of index name on CREATE/DROP INDEX") which addressed
CASSANDRA-8365.

Please note that the imported code is from "cassandra-2.2.0-rc2" tag
that points to the following commit:

  ebc50d783505854f04f183297ad3009b9095b07e"

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-12 12:45:26 +03:00
Pekka Enberg
7e31dfa31f cql3: Convert CFName to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:49:30 +03:00
Pekka Enberg
573c39386d cql3: Convert IndexName to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:42:10 +03:00
Pekka Enberg
2c02c9c436 cql3: Convert KeyspaceElementName to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-10 10:31:56 +03:00
Paweł Dziepak
ede9886f50 dht: add byte_ordered_partitioner
Some of the tests in DTEST take advantage of the fact that
ByteOrderedPartitioner guarantees certain ordering of partition keys.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-09 23:43:16 +02:00
Tomasz Grabiec
ec65d7fa73 Introduce partition_slice_builder 2015-07-09 19:55:01 +02:00
Tomasz Grabiec
8a18d2b699 Extract memtable implementation to memtable.cc 2015-07-09 19:46:29 +02:00
Tomasz Grabiec
31b0c60640 Merge branch 'penberg/cql-drop-table' from seastar-dev.git
From Pekka:

"This series enables DROP TABLE statement in the front-end. Our
back-end is not really prepared to deal with it so throw "not
implemented" exception from migration manager."
2015-07-09 10:53:48 +02:00
Asias He
f1dc4f21d5 streaming: Send stream_init_message to remote 2015-07-09 15:52:28 +08:00
Asias He
1aab3c7bb9 streaming: Drop serialization interface for {outgoing,incoming}_file_message
We will send mutations using the frozen_mutation verb
2015-07-09 15:52:28 +08:00
Pekka Enberg
b68f93191e cql3: Convert DropTableStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-09 09:36:39 +03:00
Pekka Enberg
816254ed45 cql3: Convert DropKeyspaceStatement to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-07-08 18:40:30 +02:00
Calle Wilund
6cf2230cb6 Add batchlog_manager_test
Very simple, and limited, but at least checks that very basic
replay works.
2015-07-08 10:59:57 +02:00
Calle Wilund
ef2cc9b05d BatchLogManager.java -> C++
Somewhat simplifies version of the Origin code, since from what I 
can see, there is less need for us to do explicit query sends in 
the BLM itself, instead we can just go through storage_proxy. 
I could be wrong though.
2015-07-08 10:59:57 +02:00
Calle Wilund
8a8694cbbf Add naive rate limiter object
This is mostly a placeholder, since the "limiting" is rather coarse
and stuttering
2015-07-08 10:50:46 +02:00
Avi Kivity
957b4076a2 Merge "CQL: Handle token function & restrictions" from Calle
"Implementation of:

* Token func
* Token restriction
* Token relation
* Token cql parsing

This series contains some hefty refactoring of the cql3::restrictions
interfaces, to handle the slightly different conditions of the token
relation. (See individual commit comment)"
2015-07-08 11:35:22 +03:00
Calle Wilund
bb6677b47a TokenRelation: Java -> c++ 2015-07-08 10:02:31 +02:00
Avi Kivity
8e2d36ed74 Merge seastar upstream 2015-07-07 17:34:32 +03:00
Avi Kivity
7ad4483879 Revert "build: allow the compiler to be a script"
This reverts commit 68b192d1be5efb50e49e46f19370ed49d9d28e30; it fails
unconditionally, causing debug symbols (for example) not to be emitted.
2015-07-07 17:17:46 +03:00
Avi Kivity
8429e39a9f Merge seastar upstream 2015-07-07 13:25:52 +03:00
Paweł Dziepak
22568a1995 types: implement timestamp_type_impl::from_string()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-06 23:36:18 +02:00
Avi Kivity
68b192d1be build: allow the compiler to be a script 2015-07-06 10:24:54 +03:00
Calle Wilund
ad12b7d21c Add query_processor_test
Testing execute_internal somewhat
2015-07-06 08:21:16 +02:00
Calle Wilund
4a4f8c9d38 UntypedResultSet Java->C++
Initial translation, needed to implement
query_processor::execute_internal
2015-07-06 08:21:16 +02:00
Avi Kivity
8fa053c7c6 Merge "Adding the hinted_handoff API" from Amnon
"This series adds the hinted handoff and hinted handoff metrics API with a stub
implementation.  The API definition was based on the HintedHandOffMetricsMBean
and the HintedHandoffMetrics."

Conflicts:
	api/api.cc
	configure.py
2015-07-05 17:33:25 +03:00
Avi Kivity
b8f8f66e81 Merge "Adding the endpoint_snitch_api" from Amnon
"This series adds the endpoint snitch api. It is based on the
EndpointSnitchInfoMBean definition."

Conflicts:
	api/api.cc
	configure.py
2015-07-05 17:31:23 +03:00
Avi Kivity
5a110dc2ab Merge "Adding the compaction_manager API" from Amnon
"This series adds the compaction_manager that is based on the
CompactionManagerMBean and its metrics that is based on the CompactionMetrics.
It contain a stub implementation so that the API can be accessed from the JMX
API.

The doc file can be found:
/api-doc/compaction_manager/"
2015-07-05 16:44:36 +03:00
Amnon Heiman
daceaec74c Adding a stub implementation for the hinted_handoff
This adds a stub implementation for the hinted handoff.
The API returns the currect type but with stubed values.

After applying this patch the api-doc will be available at:
/api-doc/hinted_handoff/

The following url will be available:
/hinted_handoff/hints
/hinted_handoff/schedule
/hinted_handoff/pause

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-05 16:30:30 +03:00
Amnon Heiman
389430b3da API: Adding the hinted_handoff swagger definition
This adds the swagger definition file for the hinted_handoff.
The API is based on the HintedHandOffMBean definition.

It adds the following command:
st_endpoints_pending_hints
truncate_all_hints
schedule_hint_delivery
pause_hints_delivery

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-05 16:30:24 +03:00
Paweł Dziepak
b211bfa514 gc_clock: support adding an offset to the current time
This, intended for tests, feature allows testing time related event without
need for real time waits.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-02 17:26:22 +02:00
Amnon Heiman
ff4da7fcdc Adding the endpoint_snitch API implementation
This adds the implementation for the API endpoint_snitch
After this patch the API doc can be found at:
/api-doc/endpoint_snitch_info/

The following url are available:
/snitch/datacenter
/snitch/rack

The get name is stubed
/snitch/name

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-02 17:45:23 +03:00
Amnon Heiman
3a43a61203 Adding the Swagger definition of the endpoint_snitch_info
This adds the Swagger definition for the endpoint_snitch_info that is
based on the EndpointSnitchInfoMBean.
The following commands where added:
get_datacenter
get_rack
get_snitch_name

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-02 17:44:05 +03:00
Tomasz Grabiec
eba6b492a6 tests: Introduce result_set assertions 2015-07-02 14:51:27 +02:00
Amnon Heiman
2d04668de5 API: Adding the compaction_manager API stub implementation
This adds a stub implementation for the compaction_manager API.

The methods return the right types but with a stub value.
After this patch the following url will be available:
/compaction_manager/compactions
/compaction_manager/compaction_summary
/compaction_manager/force_user_defined_compaction
/compaction_manager/stop_compaction

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-02 09:46:19 +03:00
Amnon Heiman
771f818ed0 Adding the compaction_manager Swagger definition file
This adds the Swagger definition file for the compaction_manager.
It is based on the CompactionManagerMBean and contains the following
command:

get_compactions
get_compaction_summary
force_user_defined_compaction
stop_compaction

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-02 09:33:57 +03:00
Asias He
e8156ca552 streaming: Implement serialize interface for file_message_header 2015-06-30 12:19:01 +08:00
Asias He
b35d29f91f streaming: Implement serialize interface for prepare_message 2015-06-30 11:43:29 +08:00
Asias He
237fedb1fc streaming: Implement serialize interface for received_message 2015-06-30 10:37:49 +08:00
Asias He
85ecd6b2f2 streaming: Implement serialize interface for retry_message 2015-06-30 10:33:13 +08:00
Asias He
8c67244a13 streaming: Implement serialize interface for stream_init_message 2015-06-30 10:33:13 +08:00
Vlad Zolotarov
d1d8cae95e tests: network_topology_strategy_test
Unit test for NetworkTopologyStrategy class.
Creates a dummy cluster topology: token ring, token_metadata, snitch (RackInferringSnitch).
Then requests a natural endpoints for tokens that lay between each two adjacent ring tokens
and verifies the output.

It also checks the natural_endpoints caching:
   1) Verifies that the result is calculated when we query the specific token_ring point
      for the first time.
   2) Verifies that the result is taken from the cache when we query the specific token_ring
      point for the second time.
   3) Verifies that the results in (1) and (2) are identical.
   4) Verifies that the cache is invalidated after token_metadata::invalidate_cached_rings()
      is called.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:50:55 +03:00
Vlad Zolotarov
9a6e6b4ae1 locator: added network_topology_strategy class
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use new location of a sequenced_set.
   - Indentation.
   - Use all caps in a FIXME word.
2015-06-29 18:50:49 +03:00
Avi Kivity
f54299c1ea Merge "Adding the collectd API" from Amnon
"V2 Change how the information is gothered from the CPUs.  As a result of the
change, each function call in the parallel_for_each holds its own copy of the
ID, following that the get_collectd_value method was changed to get a const
reference, to prevent the redundant creation of a shared_ptr from the local
copy.

This series adds an API for the collectd. After applying the series the
collectd will be available from the API."
2015-06-29 11:21:40 +03:00