Commit Graph

188 Commits

Author SHA1 Message Date
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
Amnon Heiman
4c5f77bfa7 API: Add memeory related methods to column_family
This patch clear the ambiguity in the swagger definition file and adds
the implementation for the memtable memory related methods.

For each column family there is an active memtable and a list of non
active.

when refering the all the memtable in the column family, the nick name
will contain cf_all_memtables.

Each URL has two versions, one, with a column family name, that is
relevant to a specific column family and one without, which is the
result of running the method on all column families.

This patch adds the following implementation to column_family:
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

Memory consumption is map this way: All memory assume to be off heap, so
on heap will return 0, and off heap will return the memory consumption

After this patch the following URL will be available:
/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

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-10 00:23:16 +03:00
Avi Kivity
e5c46420bd Merge "Unimplemented API method to return error." from Amnon
"This series modify the stub implementation of unimplemented API method to
return a 500 Http error.

It does so by adding a new API exception unimplemented_exception and a helper
function unimplemented that throw that exception.

A call to unimplemented was added to each of the stub API methods.

After this series a call to an unimplemented to API would return a 500."
2015-09-09 12:53:21 +03:00
Avi Kivity
6ccb0b15b5 Merge "Move the API configuration from command line to configuration" from Amnon
"It moves the API configuration from the command line argument to the general
config, it also move the api-doc directory to be configurable instead of hard
coded."
2015-09-09 12:35:03 +03:00
Avi Kivity
e2d474ea56 Merge "Enabling the nodetool info" from Amnon
"This series enable the nodetool info, by completing the missing APIs.

The main change is returning fixed value for storage_service
is_rpc_server_running, is_native_transport_running and get_exception_count.

After this series it will be possible to run:
nodetool info (while the jmx is runnning) and to get the results without errors
or crashes."
2015-09-09 11:40:06 +03:00
Amnon Heiman
037dfdcf35 API: add get_load implementation to storage_service
Because of the different implementation the right way of getting the
load (which is the sum of all the live diskspace used) is using the
column_family api and not through the storage_service API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 09:37:37 +03:00
Amnon Heiman
6c2454e8f9 API: Expose the get_cf_stats in column_family
Some APIs other then the column_family need to use the get_cf_stats,
this adds the helper method decleration to the column_family.hh and
change the implementation decleration to be non-static

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 03:57:40 +03:00
Amnon Heiman
fe9f7b4d04 API: Call unimplemented for stub API methods that are stubed
The API contains stub API methods, this adds a call to unimplemented
method in each of the stubed method that is not implemented.

The return remains the same to help the compiler deduce the return type
of the lambda function.

After this patch a call to an unimplemented API function will return
500.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 19:14:30 +03:00
Asias He
312daed342 storage_service: Fix is_starting API
Query _operation_mode on CPU 0.

$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/is_starting"
2015-09-08 11:07:13 +08:00
Asias He
5e3d8a56b2 storage_service: Fix get_operation_mode API
Route request to CPU 0. _operation_mode is not replicated to other CPUS.

Without this:

$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/operation_mode"

returns "NORMAL" and "STARTING" randomly.
2015-09-08 10:55:50 +08:00
Asias He
0d88570286 storage_service: Fix is_gossip_running API and friends
Only cpu 0 instance of gossip has the correct information, route request
to cpu 0.

Fix a bug where

$ curl -X GET --header "Accept: application/json"
 "http://172.31.5.77:10000/storage_service/gossiping"

returns true and false randomly.
2015-09-08 10:45:25 +08:00
Amnon Heiman
31916e6b50 Add unimplemented exception to the API
Not all the API command are implemented it would be better that the user
would receive an error if it tries to call an unimplmeneted API call.

This adds an unimplemented_exception that would be thrown when an API
call is not implemented.

The unimplemented method, simply throws the exception.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 04:56:16 +03:00
Amnon Heiman
c29f53888d API: Take the API doc directory from configuration
The API doc directory will now be taken from configuration instead of
been hard coded.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 03:08:01 +03:00
Amnon Heiman
f4de60a71d API: Add doc directory parameter to the http context
Adding a parameter to the http context so it will not be hard coded and
could be configured.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 02:49:17 +03:00
Avi Kivity
eae8a60930 Merge "storage_service api update" from Asias
"This series wires up more storage_service APIs."
2015-09-01 11:14:13 +03:00
Calle Wilund
09da053bee Commitlog API: Implement some more metrics accessors
Fixes #99
v2/3: Use map_reduce0 + some abstraction.
2015-09-01 09:42:27 +03:00
Asias He
9de78375f6 api/storage_service: Add get_exceptions 2015-09-01 14:31:44 +08:00
Asias He
325a9c3f09 api/storage_service: Add rebuild 2015-09-01 14:31:44 +08:00
Asias He
4ad352e290 api/storage_service: Add get_load_map 2015-09-01 14:31:44 +08:00
Asias He
5cfdb3cc7b api/storage_service: Add get_load 2015-09-01 14:31:44 +08:00
Asias He
ff72300ddd api/storage_service: Add remove_node 2015-09-01 14:31:44 +08:00
Asias He
c97120aba1 api/storage_service: Add decommission 2015-09-01 14:31:44 +08:00
Asias He
118b370ea8 api/storage_service: Add is_native_transport_running 2015-09-01 14:31:44 +08:00
Asias He
24149e04ce api/storage_service: Add stop_native_transport 2015-09-01 14:31:44 +08:00
Asias He
3889e0568d api/storage_service: Add start_native_transport 2015-09-01 14:31:44 +08:00