Commit Graph

212 Commits

Author SHA1 Message Date
Avi Kivity
a699bc20bc Merge "Adding the stream metrics API" from Amnon
"This series adds the stream metrics API, the swagger definition are based on
the StreamMetrics class in origin."
2015-10-22 17:18:01 +03:00
Amnon Heiman
5323b29699 API: Add compaction history to the API
This patch adds a definition and a stub for the compaction history. The
implementation should read fromt the compaction history table and return
an array of results.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 17:16:58 +03:00
Avi Kivity
5d37ee29f8 Merge "Adding log level support to the API" from Amnon
"This series adds an API to get and set the log level.
After this series it will be possible to use the folloing url:
GET/POST:
/system/logger
/system/logger/{name}"
2015-10-22 17:15:41 +03:00
Avi Kivity
b4e5b9dcf1 Merge "Add support to nodetool describecluster"
"This series adds the functionality that is required for nodetool
describecluster

It uses the gossiper for get cluster name and get partitioner.  The
describe_schema_versions functionality is missing and a workaround is used so
the command would work.

After this series an example for nodetool describecluster:
./bin/nodetool describecluster
Cluster Information:
	Name: Test Cluster
	Snitch: org.apache.cassandra.locator.SimpleSnitch
	Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
	Schema versions:
		127.0.0.1: [48c4e6c8-5d6a-3800-9a3a-517d3f7b2f26]"
2015-10-22 17:11:30 +03:00
Avi Kivity
f7087da054 Merge "GET methods for snapshots" from Glauber
"The snapshots API need to expose GET methods so people can
query information on them. Now that taking snapshots is supported,
this relatively simple series implement get_snapshot_details, a
column family method, and wire that up through the storage_service."
2015-10-22 15:23:45 +03:00
Avi Kivity
5f3a46eabb Merge "load_new_sstables" from Glauber
"This patchset implements load_new_sstables, allowing one to move tables inside the
data directory of a CF, and then call "nodetool refresh" to start using them.

Keep in mind that for Cassandra, this is deemed an unsafe operation:
https://issues.apache.org/jira/browse/CASSANDRA-6245

It is still for us something we should not recommend - unless the CF is totally
empty and not yet used, but we can do a much better job in the safety front.

To guarantee that, the process works in four steps:

1) All writes to this specific column family are disabled. This is a horrible thing to
   do, because dirty memory can grow much more than desired during this. Throughout out
   this implementation, we will try to keep the time during which the writes are disabled
   to its bare minimum.

   While disabling the writes, each shard will tell us about the highest generation number
   it has seen.

2) We will scan all tables that we haven't seen before. Those are any tables found in the
   CF datadir, that are higher than the highest generation number seen so far. We will link
   them to new generation numbers that are sequential to the ones we have so far, and end up
   with a new generation number that is returned to the next step

3) The generation number computed in the previous step is now propagated to all CFs, which
   guarantees that all further writes will pick generation numbers that won't conflict with
   the existing tables. Right after doing that, the writes are resumed.

4) The tables we found in step 2 are passed on to each of the CFs. They can now load those
   tables while operations to the CF proceed normally."
2015-10-22 13:42:24 +03:00
Amnon Heiman
c130381284 Adding live_scanned and tombstone scaned histogram to column family
This series adds a histogrm to the column family for live scanned and
tombstone scaned.

It expose those histogram via the API instead of the stub implmentation,
currently exist.

The implementation update of the histogram will be added in a different
series.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 11:13:28 +03:00
Amnon Heiman
378a97b66b API: Add row cahe hits and miss per column family
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 11:12:14 +03:00
Glauber Costa
fd8e5c7e4c api: load new sstables
Just a wrapper into the storage_service's homonymous call.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-21 18:30:04 +02:00
Glauber Costa
71c1b2fe69 api: get true snapshot size
Thin wrapper around storage service's facility.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-21 13:48:44 +02:00
Glauber Costa
c0630bedc2 api: get_snapshot_details
That's basically conversion work between what the storage_service returns
and the json types.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-21 13:48:44 +02:00
Glauber Costa
3a95a9cbe6 api: implement clear snapshot
Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-20 15:58:31 +02:00
Glauber Costa
19bb50f450 api: implement take_snapshot
Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-20 15:58:31 +02:00
Amnon Heiman
1e8752d55e API: Fix a confusion in the storage service snapshot details
There was a confusion between the snapshot key and the keyspace in the
snapshot details, this fixes it.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-20 13:53:09 +03:00
Amnon Heiman
91d396760e API: add a workaround for the get schema_versions
This adds a workaround for the get schema_version, it will return only a
shcema version of the local node, this is a temporary workaround until
describe_schema_versions will be implemented.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-20 10:56:21 +03:00
Amnon Heiman
383d7ccf4d Add the get cluster and partitioner names to the API
This adds the implementation for the get cluster name and get
partitioner name to the storage_service API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-20 10:54:55 +03:00
Avi Kivity
2ccb5feabd Merge "Support nodetool cfhistogram"
"This series adds the missing estimated histogram to the column family and to
the API so the nodetool cfhistogram would work."
2015-10-19 17:11:46 +03:00
Amnon Heiman
5998ee718a API: Add logger API implementation to the system API
This patch adds the ability to set one or all log levels get a log level
and get all logs name.

After this patch the following url will be available:
GET/POST
/system/logger
/system/logger/{name}

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-19 15:05:46 +03:00
Amnon Heiman
ba1e6adf2a Adding the system swagger definition
The system api will include system related command, currently it holds
the logger related API. It holds definition for the following commands:
get_all_logger_names
set_all_logger_level
get_logger_level
set_logger_level

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-19 14:59:54 +03:00
Amnon Heiman
1acd47ddce API: Adding implementation for the stream manager metrics
This adds an implementation for the stream manager metrics.

And the following url will be available:
/stream_manager/metrics/outbound
/stream_manager/metrics/incoming/{peer}
/stream_manager/metrics/incoming
/stream_manager/metrics/outgoing/{peer}
/stream_manager/metrics/outgoing

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-15 16:04:36 +03:00
Amnon Heiman
164ccd0525 API: Adding the stream manager Swagger definition
This adds the swagger definition file for the stream manager. The API is
based on the StreamManagerMBean and the StreamMetrics.
The following commands where added:
get_current_streams
get_current_streams_state
get_all_active_streams_outbound
get_total_incoming_bytes
get_all_total_incoming_bytes
get_total_outgoing_bytes
get_all_total_outgoing_bytes
2015-10-15 16:04:11 +03:00
Asias He
c58ae5432c storage_service: Fix nodetool info return wrong gossiper status
Before:
$ nodetool info
ID                     : a5adfbbf-cfd8-4c88-ab6b-6a34ccc2857c
Gossip active          : false

After:
$ nodetool info
ID                     : a5adfbbf-cfd8-4c88-ab6b-6a34ccc2857c
Gossip active          : true

Fix #354.
2015-10-14 12:37:51 +03:00
Amnon Heiman
6fd3c81db5 keyspace clean up should be a POST not a GET 2015-10-11 15:51:56 +03:00
Amnon Heiman
0ec0a5703b API: column family estimated histograms
This patch fix an issue with the read latency estimated historam
implementation and add a call to the estimated number of sstable
histogram.

The later is not yet implemented on the datbase side.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-08 14:59:17 +03:00
Glauber Costa
639ba2b99d incremental backups: move control to the CF level
Currently, we control incremental backups behavior from the storage service.
This creates some very concrete problems, since the storage service is not
always available and initialized.

The solution is to move it to the column family (and to the keyspace so we can
properly propagate the conf file value). When we change this from the api, we will
have to iterate over all of them, changing the value accordingly.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-05 13:16:11 +02:00
Avi Kivity
7c23ec49ae Merge "Support incremental backups" from Glauber
"Generate backups when the configuration file indicates we should;
toggle behavior on/off through the API."
2015-10-04 13:49:20 +03:00
Amnon Heiman
a04401d5a4 API: Column family to return sum of the total read and write
This adds the implementation that return the estimated total latency of
the read and of the write.

First the method that sum the count was renamed to get_cf_stats_count
and a method was added named get_cf_stats_sum to sum the estimated
latencies.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Amnon Heiman
4145a48335 API: return estimated sum from histogram
The histogram that are used typically only sample the data, so to get an
estimation of the actual sum, we use the estimated mean multiply by the
actuall count.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Amnon Heiman
8e9729371f API: Add functionality to column family to support nodetool cfstats
This adds the API definition with stub implementation that would make
the nodetool cfstats to run.

After this patch the nodetool cfstats command would work, but with stub
imlementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Amnon Heiman
2b59bb2d2b API: storage proxy definition cas read and write
This patch add some missing definition for cas read an write, the API
definition is for completness only as we do not support cas yet.

It also change a part of the definition from storage_service to
storage_proxy as it should be.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-04 11:52:19 +03:00
Glauber Costa
700b37635f api: incremental backups
GET and POST methods are implemented in the API.

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-10-02 18:23:27 +02:00
Avi Kivity
c30feb714c Merge "gossip heart_beat_version + time to wait for seed" from Asias 2015-09-29 15:49:24 +03:00
Glauber Costa
5dd0953bb9 api: implement filter off heap memory calculation
For us, everything is "off heap", so this will just be the total amount of
memory used by the filters.

Fixes #339

Signed-off-by: Glauber Costa <glommer@scylladb.com>
2015-09-28 16:44:26 +02:00
Asias He
e43b2c2c89 api: Add get_current_heart_beat_version
curl -X GET "http://127.0.0.1:10000/gossiper/heart_beat_version/127.0.0.2"

This is useful to check if the gossip code is still running when
debugging.

Now we can get both the generation version and heart beat version of a
node.

curl -X GET "http://127.0.0.1:10000/gossiper/generation_number/127.0.0.2"
2015-09-28 09:38:33 +08:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Avi Kivity
cc857c0e81 Merge "API: Adding functionaly to column family" from Amnon
"This series is part of a few serieses that adds functionality to column family
command and statistic."
2015-09-17 14:50:07 +03:00
Amnon Heiman
b91013957e API: Flush should wait before returning
This address issue #154

Flush command should wait for the commmand completion before returning.

This change replaces the for loop with a parallel_for_each, it will now
wait for all the flushes to complete before returning.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-17 14:48:51 +03:00
Amnon Heiman
e2501aa64c API: Compaction manager to return 0 for number of compaction
Until there will be an API for the compaction manager, the API return 0
for the number of total compaction.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-13 13:28:31 +03:00
Amnon Heiman
c06eb6b8c8 API: Adding stub and functionality to column family
The following function where added to column family:

is_auto_compaction_disabled
get_built_indexes
get_compression_metadata_off_heap_memory_used
get_compression_parameters
get_compression_ratio
get_read_latency_estimated_histogram
get_write_latency_estimated_histogram

And the get and set compaction strategy methods and a stub
implementation for the compression parameter, crc chec and sstable
count.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-13 13:28:14 +03:00
Amnon Heiman
497e403387 API: Workaround for load_map
The get_load_map method should return a map between nodes addresses and
their load. In origin the implementation is based on the load
broadcaster that we currently do not have.

This workaround return a map with a single entry of the current node
address and its load
2015-09-13 12:50:07 +03:00
Amnon Heiman
ece77c9722 Adding Timers to column_family and commitlog and compaction, and
compression

Timers support expect the API to return histogram. This adds the swagger
definition for the following timer in column_family:
get_coordinator_read_latency
get_coordinator_scan_latency
get_waiting_on_free_memtable_space

The following estimated histogram were added to column_family:
get_read_latency_estimated_recent_histogram
get_read_latency_estimated_histogram
get_range_latency_estimated_recent_histogram
get_range_latency_estimated_histogram
get_write_latency_recent_histogram
get_write_latency_estimated_recent_histogram
get_cas_prepare_estimated_recent_histogram
get_cas_prepare_estimated_histogram
get_cas_propose_estimated_recent_histogram
get_cas_propose_estimated_histogram
get_cas_commit_estimated_recent_histogram
get_cas_commit_estimated_histogram

And the following timers in commitlog:
get_waiting_on_segment_allocation
get_waiting_on_commit

To column family API the following API were added:
set_compaction_strategy_class
get_compaction_strategy_class
set_compression_parameters
set_crc_check_chance
get_sstable_count_per_level

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>

API: Completing the column_family Swagger definition

This adds the missing definition in the column_family to make it
compatible to ColumnFamilyStoreMbean

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-12 08:33:26 +03:00
Amnon Heiman
9d099b3a8d API: Workaround for bloom filter memory calculation
The bloom filter memory calculation is missing, as a workaround until
it will be completed, the memory calculation will return 0.

It is needed by the nodetool info command.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 18:22:22 +03:00
Amnon Heiman
12a92939bf API: cache service save priod time to return 0
We do not save the cache, so the get for save priod in second should
return 0, to indicate never like it is done in origin.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 18:21:40 +03:00
Avi Kivity
53239204f4 Merge "This series adds the stream_manager API." from Amnon
Conflicts:
	api/api.cc
2015-09-10 15:53:58 +03:00
Avi Kivity
8721fdf095 Merge "API: Adding memory consumption method to column_family" from Amnon 2015-09-10 15:47:34 +03:00
Amnon Heiman
a825977f85 API: return an error for wrong keyspace name
This patch addresses issue #155. It register an exception handler
API of the routes object that handle the no_such_keyspace exception.

The handler just throw a bad_parameter_exception with the error message
it got from the no_such_keyspace exception.

After this patch a call with a keyspace that does not exist, will return
a 400 result.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 12:53:21 +03:00
Amnon Heiman
1238240eea API: Return 0 for key and counter cache's metrics
Until we'll support key and counter cache, it is reasonable to return 0
for their statistic and sizes.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 12:42:14 +03:00
Amnon Heiman
ea447dba33 API: Adding the stream_manager API implementation
This adds the implementation for hte stream_manager API.

It goes over all stream, on all shards and combine the result to a
vector of streams.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 01:03:08 +03:00
Amnon Heiman
2601ad279f API: Add a helper function to combine vectors
This is a wrapper function for vector concatenation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 01:03:08 +03:00
Amnon Heiman
3889e068de API: Adding the stream_manager swagger definition
This adds the stream_manager swagger definition file. It is based on the
StreamManagerMBean definition and the return class based on StreamState
class and its sub classes.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 01:02:26 +03:00