Commit Graph

177 Commits

Author SHA1 Message Date
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
Asias He
d0dcaf16fb api/storage_service: Add is_rpc_server_running 2015-09-01 14:31:44 +08:00
Asias He
c2bb9a6cbc api/storage_service: Add start_rpc_server 2015-09-01 14:31:44 +08:00
Asias He
e7d2bbdf4a api/storage_service: Add stop_rpc_server 2015-09-01 14:31:44 +08:00
Asias He
d49245d198 api/storage_service: Add is_initialized
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/is_initialized"

true
2015-09-01 14:31:44 +08:00
Nadav Har'El
cc4117d6c1 repair: do not use an atomic integer
Avi asked not to use an atomic integer to produce ids for repair
operations. The existing code had another bug: It could return some
id immediately, but because our start_repair() hasn't started running
code on cpu 0 yet, the new id was not yet registered and if we were to
call repair_get_status() for this id too quickly, it could fail.

The solution for both issues is that start_repair() should return not
an int, but a future<int>: the integer id is incremented on cpu 0 (so
no atomics are needed), and then returned and the future is fulfilled.

Note that the future returned by start_repair() does not wait for the
repair to be over - just for its index to be registered and be usable
to a call to repair_get_status().

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-31 09:31:19 +03:00
Avi Kivity
554645db91 Revert "Merge "Move the API configuration from command line to configuration" from Amnon"
See issue #59 for details.

This reverts commit 5aa0244d32, reversing
changes made to 7fb109a58d.
2015-08-30 12:09:00 +03:00
Avi Kivity
5aa0244d32 Merge "Move the API configuration from command line to configuration" from Amnon
"This series address issues #59 and #23.

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."

Fixes #59
Fixes #23
2015-08-29 12:34:04 +03:00
Amnon Heiman
f1cda74c15 API: storage_service - return an error for wrong keyspace name
This patch addresses issu #155, it adds a helper function that if a
keyspace does not exists it throw a bad parameter exception.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-29 11:22:27 +03:00
Amnon Heiman
800578f164 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-08-28 20:26:30 +03:00
Amnon Heiman
7b1c973884 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-08-28 20:20:20 +03:00
Avi Kivity
28bb65525b Merge "API updates for storage_service" from Asias
"Added APIs like get_release_version, get_operation_mode, is_gossip_running and
so on."
2015-08-27 11:40:48 +03:00