Commit Graph

53948 Commits

Author SHA1 Message Date
Raphael S. Carvalho
8324ff990c sstables: add method add_generation
metadata_collector was made member of class sstable, such that the
compaction procedure will be able to use the method add_generation
from a sstable object.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-30 18:09:01 +03:00
Amnon Heiman
338c1c20b7 Adding a stub implementation for the column_familiy matrics API
This adds a stub implemtation for the column_familiy matrics API.
It return the correct type with a stub value.

Column family specific API are mark with a comment
After this patch the following API will be available:

/column_family/metrics/memtable_columns_count/{name}
/column_family/metrics/memtable_columns_count/
/column_family/metrics/memtable_on_heap_size/{name}
/column_family/metrics/memtable_on_heap_size
/column_family/metrics/memtable_off_heap_size/{name}
/column_family/metrics/memtable_off_heap_size
/column_family/metrics/memtable_live_data_size/{name}
/column_family/metrics/memtable_live_data_size
/column_family/metrics/all_memtables_on_heap_size/{name}
/column_family/metrics/all_memtables_on_heap_size
/column_family/metrics/all_memtables_off_heap_size/{name}
/column_family/metrics/all_memtables_off_heap_size
/column_family/metrics/all_memtables_live_data_size/{name}
/column_family/metrics/all_memtables_live_data_size
/column_family/metrics/memtable_switch_count/{name}
/column_family/metrics/memtable_switch_count
/column_family/metrics/estimated_row_size_histogram/{name}
/column_family/metrics/estimated_column_count_histogram/{name}
/column_family/metrics/compression_ratio/{name}
/column_family/metrics/compression_ratio
/column_family/metrics/read_latency/{name}
/column_family/metrics/read_latency
/column_family/metrics/range_latency/{name}
/column_family/metrics/range_latency
/column_family/metrics/write_latency/{name}
/column_family/metrics/write_latency
/column_family/metrics/pending_flushes/{name}
/column_family/metrics/pending_flushes
/column_family/metrics/pending_compactions/{name}
/column_family/metrics/pending_compactions
/column_family/metrics/live_ss_table_count/{name}
/column_family/metrics/live_ss_table_count
/column_family/metrics/live_disk_space_used/{name}
/column_family/metrics/live_disk_space_used
/column_family/metrics/total_disk_space_used/{name}
/column_family/metrics/total_disk_space_used
/column_family/metrics/min_row_size/{name}
/column_family/metrics/min_row_size
/column_family/metrics/max_row_size/{name}
/column_family/metrics/max_row_size
/column_family/metrics/mean_row_size/{name}
/column_family/metrics/mean_row_size
/column_family/metrics/bloom_filter_false_positives/{name}
/column_family/metrics/bloom_filter_false_positives
/column_family/metrics/recent_bloom_filter_false_positives/{name}
/column_family/metrics/recent_bloom_filter_false_positives
/column_family/metrics/bloom_filter_false_ratio/{name}
/column_family/metrics/bloom_filter_false_ratio
/column_family/metrics/recent_bloom_filter_false_ratio/{name}
/column_family/metrics/recent_bloom_filter_false_ratio
/column_family/metrics/bloom_filter_disk_space_used/{name}
/column_family/metrics/bloom_filter_disk_space_used
/column_family/metrics/bloom_filter_off_heap_memory_used/{name}
/column_family/metrics/bloom_filter_off_heap_memory_used
/column_family/metrics/index_summary_off_heap_memory_used/{name}
/column_family/metrics/index_summary_off_heap_memory_used
/column_family/metrics/compression_metadata_off_heap_memory_used/{name}
/column_family/metrics/compression_metadata_off_heap_memory_used
/column_family/metrics/speculative_retries/{name}
/column_family/metrics/speculative_retries
/column_family/metrics/key_cache_hit_rate/{name}
/column_family/metrics/true_snapshots_size/{name}
/column_family/metrics/true_snapshots_size
/column_family/metrics/row_cache_hit_out_of_range/{name}
/column_family/metrics/row_cache_hit_out_of_range
/column_family/metrics/row_cache_hit/{name}
/column_family/metrics/row_cache_hit
/column_family/metrics/row_cache_miss/{name}
/column_family/metrics/row_cache_miss
/column_family/metrics/cas_prepare/{name}
/column_family/metrics/cas_propose/{name}
/column_family/metrics/cas_commit/{name}
/column_family/metrics/sstables_per_read_histogram/{name}
/column_family/metrics/tombstone_scanned_histogram/{name}
/column_family/metrics/live_scanned_histogram/{name}
/column_family/metrics/col_update_time_delta_histogram/{name}

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-30 15:51:08 +03:00
Amnon Heiman
600c4020a7 Adding the column family metrics API definition
This adds the metrics definition in the column family API, the API is
based on the ColumnFamilyMetrics mbean.

The following operation where added:
get_memtable_columns_count
get_all_memtable_columns_count
get_memtable_on_heap_size
get_all_memtable_on_heap_size
get_memtable_off_heap_size
get_all_memtable_off_heap_size
get_memtable_live_data_size
get_all_memtable_live_data_size
get_all_memtables_on_heap_size
get_all_all_memtables_on_heap_size
get_all_memtables_off_heap_size
get_all_all_memtables_off_heap_size
get_all_memtables_live_data_size
get_all_all_memtables_live_data_size
get_memtable_switch_count
get_all_memtable_switch_count
get_estimated_row_size_histogram
get_estimated_column_count_histogram
get_compression_ratio
get_all_compression_ratio
get_read_latency
get_all_read_latency
get_range_latency
get_all_range_latency
get_write_latency
get_all_write_latency
get_pending_flushes
get_all_pending_flushes
get_pending_compactions
get_all_pending_compactions
get_live_ss_table_count
get_all_live_ss_table_count
get_live_disk_space_used
get_all_live_disk_space_used
get_total_disk_space_used
get_all_total_disk_space_used
get_min_row_size
get_all_min_row_size
get_max_row_size
get_all_max_row_size
get_mean_row_size
get_all_mean_row_size
get_bloom_filter_false_positives
get_all_bloom_filter_false_positives
get_recent_bloom_filter_false_positives
get_all_recent_bloom_filter_false_positives
get_bloom_filter_false_ratio
get_all_bloom_filter_false_ratio
get_recent_bloom_filter_false_ratio
get_all_recent_bloom_filter_false_ratio
get_bloom_filter_disk_space_used
get_all_bloom_filter_disk_space_used
get_bloom_filter_off_heap_memory_used
get_all_bloom_filter_off_heap_memory_used
get_index_summary_off_heap_memory_used
get_all_index_summary_off_heap_memory_used
get_compression_metadata_off_heap_memory_used
get_all_compression_metadata_off_heap_memory_used
get_speculative_retries
get_all_speculative_retries
get_key_cache_hit_rate
get_true_snapshots_size
get_all_true_snapshots_size
get_row_cache_hit_out_of_range
get_all_row_cache_hit_out_of_range
get_row_cache_hit
get_all_row_cache_hit
get_row_cache_miss
get_all_row_cache_miss
get_cas_prepare
get_cas_propose
get_cas_commit
get_sstables_per_read_histogram
get_tombstone_scanned_histogram
get_live_scanned_histogram
get_col_update_time_delta_histogram

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-30 15:46:14 +03:00
Nadav Har'El
c892228018 compaction: remove compacted sstables
After compaction, remove the source sstables. This cannot be done
immediately, as ongoing reads might be using them, so we mark the sstable
as "to be deleted", and when all references to this sstable are lost and
the object is destroy, we see this flag and delete the on-disk files.

This patch doesn't change the low-level compact_sstables() (which doesn't
mark its input sstables for deletion), but rather the higher-level example
"strategy" column_family::compact_all_sstables(). I thought we might want
to do this to allow in the future strategies that might only mark the input
sstables for deletion after doing perhaps other steps and to be sure it
doesn't want to abort the compaction and return to the old files. If we
decide this isn't needed, we can easily move the mark_for_deletion() call
to compact_sstables().

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 15:00:39 +03:00
Avi Kivity
d0589ef3cf Merge seastar upstream 2015-06-30 14:59:43 +03:00
Nadav Har'El
770e6b7816 future: add handle_exception() method
This patch adds a "class future" method for handling an exception result
of the future. It is impossible to discard a future's exception while passing
through the value of the result (what will we pass in the case of
exception?), so we discard the result as well.

An example of how this can be used, to log an error (but otherwise do
nothing) if removing a file fails:

  remove_file(filename).handle_exception(
    [] (std::exception_ptr eptr) {
      print("Exception when deleting file: %s", eptr);
    });

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 14:57:53 +03:00
Asias He
dec8bee44d streaming: Add stream_session::description 2015-06-30 17:12:37 +08:00
Asias He
1e5cfa89d1 streaming: Kill a FIXME in stream_session::plan_id 2015-06-30 17:08:45 +08:00
Asias He
7ec2ee6b86 streaming: Add stream_plan::listeners 2015-06-30 16:55:30 +08:00
Asias He
6f0994349a streaming: Add stream_plan::execute 2015-06-30 16:47:25 +08:00
Asias He
92dd0616fa streaming: Wire up stream_result_future in stream_session 2015-06-30 16:39:12 +08:00
Nadav Har'El
e88b7e3453 logging: conveniently log exception
This patch adds an output operator overload for std::exception_ptr, to
make it easy to log a caught exception. It always shows the exception's
exact type, and for some types of exceptions (subtypes of std::system_error
and std::exception) it prints more information.

For example, the code

  try {
    throw std::runtime_error("Hello world");
  } catch (...) {
    sstlog.warn("Exception: {}", std::current_exception());
  }

produces the output:
  Exception when deleting sstable file: std::runtime_error (Hello world)

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-30 11:23:01 +03:00
Asias He
212a70f42f streaming: Add constructor for stream_result_future 2015-06-30 16:08:53 +08:00
Asias He
60449c4b59 streaming: Convert StreamResultFuture to C++ 2015-06-30 16:00:56 +08:00
Asias He
ee1f4f022b streaming: Import StreamResultFuture.java 2015-06-30 15:48:21 +08:00
Asias He
abf24b3bfa streaming: Add flush_before_transfer to stream_plan 2015-06-30 15:38:18 +08:00
Asias He
878611beee streaming: Enable connect_all_stream_sessions 2015-06-30 15:25:53 +08:00
Asias He
fcecca89af streaming: Rename start to init_streaming_service
stream_session::start is used to start a session instead of
initialization on startup.
2015-06-30 15:07:19 +08: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
3beb3e749d streaming: Implement serialize interface for stream_summary 2015-06-30 11:14:21 +08:00
Asias He
72394f3739 streaming: Implement serialize interface for stream_request 2015-06-30 11:07:04 +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
Asias He
c58829fa42 utils: Add serialize interface to UUID 2015-06-30 10:01:23 +08:00
Avi Kivity
5b00c72137 Merge "locator: network_topology_strategy" from Vlad
"This series aims to add the network_topology_strategy class.
It adds a few things that were missing in the token_metadata and
abstract_replication_strategy classes on the way:
   - Full topology (a.k.a. Topology) class implementation.
   - ring_range (a.k.a. TokenMetadata.ringIterator). The implementation
     is partial since we don't implement the "inclideMin" parameter.
   - endpoints caching in the abstract_replication_strategy.
   - Add-only Java's LinkedHashSet implementation - sequenced_set.

Then we add the network_topology_strategy class itself and the corresponding
unit test that validates the functionality of both the strategy class and of
the caching mechanism."

Conflicts:
	locator/token_metadata.hh
2015-06-29 18:54:40 +03:00
Avi Kivity
baed19b8ad Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-06-29 18:53:03 +03: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
Vlad Zolotarov
5a19187802 locator: simple_strategy: use ring_range and sequenced_set in calculate_natural_endpoints()
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use new location of sequenced_set.
2015-06-29 18:45:09 +03:00
Vlad Zolotarov
a4041a81a3 locator: added a sequenced_set class
This class implements an add-only vector that ensures that the elements are
unique.
As long as items are only added this class does essentially the same what Java's
LinkedHashSet does.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Moved sequenced_set to its own .hh file.
2015-06-29 18:44:19 +03:00
Vlad Zolotarov
310f4b6724 locator: abstract_replication_strategy: added a counter for natural endpoints cache hits
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
d03122fdaf locator: abstract_replication_strategy: added natural endpoints caching
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
314710b766 locator: abstract_replication_strategy: added replication_strategy_logger
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
4b0cec624e locator: added abstract_replication_strategy::validate_replication_factor()
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
f3dbdf758f locator: abstract_replication_strategy: Comment out an unused member
_keyspace back reference is not used at the moment.
Not deleting since we may need it when we add more code (quite soon).

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 18:43:58 +03:00
Vlad Zolotarov
214343036e locator: token_metadata: added ring_range() method
Returns an iterable range object to traverse the token ring

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Use boost::iterator_range instead of tokens_range class.
   - Make tokens_iterator inherit from std::iterator<std::input_iterator_tag, token>.
2015-06-29 18:43:45 +03:00
Avi Kivity
b27f93af97 Merge "Adding implementation to the storage_service" from Amnon
"The storage_service API contains many function, the actuall implementation will
be added gradually."
2015-06-29 14:57:45 +03:00
Vlad Zolotarov
61657bebe6 locator: token_metadata::update_normal_tokens() - call _topology.add_endpoint(endpoint)
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
b9631f5ff0 locator: token_metadata: added a get_topology() method
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
306287a5d5 locator: added topology class implementation
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
ebce44e20c locator: abstract_replication_strategy::abstract_replication_strategy(): remove a class name padding
We are registering short names instead

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
d17494a7e3 locator: simple_strategy: register a short name and optimize get_replication_factor()
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
7e73afccab locator: local_strategy: register a short name creator
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
e47e0dcde9 locator: moved endpoint_dc_rack from db::system_keyspace to locator namespace
This is meant to resolve to dependecy loop between token_metadata.hh
and system_keyspace.hh.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Avi Kivity
e85197a806 db: fix std::terminate() called during failed find_schema()
One of the find_schema variants calls a find_uuid() that throws out_of_range,
without converting it to no_such_column_family first.  This results in
std::terminate() being called due to exception specifications.

Fix by converting the exception.
2015-06-29 13:32:28 +03:00
Avi Kivity
b3c84bb7e1 Merge "Compression parameters in schema definitions" from Paweł
"When compressor_parameters was introduced it only performed properties
validation, but wasn't properly wired to the rest of the code and the
compression information never made it to the final schema object.

This patchset changes that, now compression parameters are correctly processed
by schema builder as well written and read from system tables. Updated test
case makes sure that not only incorrect values are rejected during validation,
but also that correct values really are set in the created schema."
2015-06-29 12:00:30 +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
Avi Kivity
96ccde7a99 Merge seastar upstream 2015-06-29 11:21:23 +03:00