Commit Graph

3 Commits

Author SHA1 Message Date
Amnon Heiman
649922fed8 Updating the http client and support API exception
The API returns errors with an HTTP code 400, 404 or 500 depending on
the cause with a json object that contains the failure reason.  The
error message should be populate to the JMX calling client, translated
to the appropriate exception.

This patch adds the ability to detect API failure and throw a runtime
exception with the returned message.

It is up to the calling method what to do with the exception, if it
would do nothing, the calling client would get a RuntimeException,
depends on origin MBean definition, the caller can catch the exception
and throw a specific kind.

Note that any exception that is thrown must be known to the JMX client
or it will not be able to process it.

As a first step, this patch replaces the jersey client to the newer
version under glassfish, which has an easy way of getting a Reply
object, and check its status before returning the results.

The only difference in the method that uses the APIClient is the use of
MultivaluedHashMap.

The following MBean implementation where changed

ColumnFamily
CompactionManager
Gossiper
EndpointSnitchInfo
CacheService
StorageProxy
StorageService

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-10-28 11:25:37 +02:00
Amnon Heiman
366b744d7b Instantiate the CacheMetrics
CacheService holds an instance of cache metrics per: key, row and counter.

This instantiate the different metrics. After this petch it will be
possible to connect with jsconsole and see those metrics

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-01 10:11:21 +03:00
Amnon Heiman
769b222173 Adding the CacheServiceMBean and CacheService
This adds the CacheServiceMBean and its implementation the CacheService
class.

The implementation is based on calls to the API that define in
cache_service.json

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-24 16:48:56 +03:00