Commit Graph

13 Commits

Author SHA1 Message Date
elcallio
434ce947b0 Code formatting + source cleanup (eclipse) 2016-10-24 11:43:52 +00:00
Calle Wilund
3fe9cfc232 EndpointSnitchInfo: Fix getRack/DC host handling
I.e. our localhost might be (and probably is) different from scyllas
"fb::broadcast", and if not, try to get numerical asap.
2016-10-24 11:43:51 +00:00
elcallio
21a343d003 Rework EnpointSnitchInfo 2016-10-24 11:43:51 +00:00
Calle Wilund
f4759f05e7 EndpointSnitchInfo: update to c3 compat 2016-10-24 11:43:51 +00:00
Amnon Heiman
2eb9f19236 Clean the jmxproxy output
This patch clean the redundant output the jmx proxy creates.
It set the trace level of the called method to finest and remove some
println leftovers.

Fixes #22

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-30 09:27:33 +02:00
Pekka Enberg
0f044e2f47 Rename "com.cloudius.urchin" package to "com.scylladb.jmx"
Move the Scylla JMX code under "com.scylladb.jmx" package.

Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-12-17 09:28:17 +02:00
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
6ed255f2e3 EndpointSnitchInfo: Cache results for data center and rack
This cache the get data center and get rack results for 10s, it has a
direct impact on nodetool status and nodetool ring

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-07 10:24:50 +03:00
Amnon Heiman
929d0aedd4 EndpointSnitchInfo formatting 2015-10-07 10:14:49 +03:00
Amnon Heiman
d67e6e60fc EndPointSnitchInfo: Support null as host name
In origin an undocumented feature (bug?) is that passing null as a host
name for getRack and getDatacenter returns the rack or datacenter
according to the loopbck address.

This follow the same behaviour, so when the host is null, the function
will not fail but will call the API with the local loopback address

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-29 09:30:08 +03:00
Amnon Heiman
fe3b786053 Urchin-JMX: Adding the EndpointSnitchInfo implementation
This adds the call to the API for the EndpointSnitch, the url are based
on the endpoint_snitch_info.json swagger definition file.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudus-systems.com>
2015-09-11 09:25:00 +03:00
Amnon Heiman
0ef065ebc7 JMX-API: Fix an endless loop in EndpointSnitchInfo
This was a code that was modified from Origin, in the JMX API
initilization is done in the custructor, which mean that it would enter
an endless loop.

When initiliation in the constructor this should be used.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-19 18:01:53 +03:00
Amnon Heiman
b0d8fd0de0 JMX API: Adding the EndpointSnitchInfoMBean stab
This adds a stab to the EndpointSnitchInfoMBean

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-18 15:52:53 +03:00