Commit Graph

161 Commits

Author SHA1 Message Date
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
Avi Kivity
0fff367230 Merge "test for compaction metadata's ancestors" from Raphael 2015-08-27 11:07:53 +03:00
Asias He
7f741f90eb api/storage_service: Add join_ring
$ curl -X POST --header "Content-Type: application/json" --header "Accept:
application/json" "http://127.0.0.1:10000/storage_service/join_ring"
2015-08-26 06:51:47 +08:00
Asias He
9528f27201 api/storage_service: Add is_joined
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/join_ring"

true
2015-08-26 06:51:47 +08:00
Asias He
a145787afc api/storage_service: Add stop_gossiping
$ curl -X DELETE --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"
2015-08-26 06:51:47 +08:00
Asias He
67768c5e1b api/storage_service: Add start_gossiping
$ curl -X POST --header "Content-Type: application/json" --header "Accept:
application/json" "http://127.0.0.1:10000/storage_service/gossiping"

btw, the description looks incorrect:
   POST /storage_service/gossiping
   allows a user to recover a forcibly 'killed' node
2015-08-26 06:51:47 +08:00
Asias He
6b4f27dc84 api/storage_service: Add is_gossip_running
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/gossiping"

true
2015-08-26 06:51:47 +08:00
Asias He
5d5016f8d1 api/storage_service: Add is_starting
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/is_starting"

false
2015-08-26 06:51:47 +08:00
Asias He
28a3eef9e3 api/storage_service: Add get_operation_mode
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/operation_mode"

"NORMAL"
2015-08-26 06:51:47 +08:00
Asias He
cafdb99d23 api/storage_service: Add get_schema_version
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/schema_version"

"59adb24e-f3cd-3e02-97f0-5b395827453f"
2015-08-26 06:51:47 +08:00
Asias He
33db0995b9 api/storage_service: Add get_release_version
$ curl -X GET --header "Accept: application/json"
"http://127.0.0.1:10000/storage_service/release_version"

"2.1.8"
2015-08-26 06:51:47 +08:00
Amnon Heiman
c92bd9b121 API: Adding the ownership implmentation to storage_service
This adds the ownwership method implementation to the storage_service
API. After the patch the following url will be supported:

GET /storage_service/ownership/{keyspace}
GET /storage_service/ownership/

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 19:39:14 +03:00
Amnon Heiman
2c5716dac3 API: storage_service Add the swagger definition for ownership
This adds the API for get_effective_ownership and
get_ownership in storage_service.

It is based on the StorageServiceMBean definition.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 19:39:13 +03:00
Amnon Heiman
f55c168ae7 API: Add column family mean row size
This adds the column family mean row size in the per column family and
the total version. I uses the ratio_helper class to calculate the mean
over all the shrades.
2015-08-25 15:48:25 +03:00
Amnon Heiman
db30a588b2 API: Break the async repair into two operations
This distinguish between the async repair that starts the repair, that
will now be a POST request and the method that check on the command
progress that will now be a GET command.

After the change each operation would get the parameters that it needs.

The GET will return an enum based on the repair_status.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-08-25 15:45:30 +03:00
Tomasz Grabiec
4c030bb597 api: Fix return type for /lsa/compact 2015-08-25 15:29:10 +03:00
Glauber Costa
ca2d058520 api/column family: bloom filter file size
Export information about on-disk space used by bloom filters.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 20:14:31 -05:00