Commit Graph

17 Commits

Author SHA1 Message Date
Andrea Cavalli cd30267633 Update to java 17 2023-01-24 14:58:50 +01:00
Amnon Heiman 4e4589ba6f FailureDetector: check that states is not null before use
When a node is part of a cluster but is down (like in the situation where
a cluster is taken down and up again but not all nodes are up). There is
no application_state information for that node.

This patch check that the information exists before using it to prevent
null pointer exception.

After this patch, a call to nodetool gossipinfo would return the
available information without failing.

See scylladb/scylla#3330

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <20180329115345.29357-1-amnon@scylladb.com>
2018-03-29 15:18:48 +03:00
elcallio 434ce947b0 Code formatting + source cleanup (eclipse) 2016-10-24 11:43:52 +00:00
elcallio 80762eb60a Rework gms beans 2016-10-24 11:43:51 +00:00
Calle Wilund 68ce437b03 Gossiper: update to c3 compat 2016-10-24 11:43:51 +00:00
Calle Wilund b7a6554ee9 FailureDetector: update to c3 compat 2016-10-24 11:43:51 +00:00
Amnon Heiman 5903271c4d EndpointState: log and ignore not supported states
During upgrade or version inconsistency. The API can return an un
supported state.

Instead of throwing an expcetion the state will be ignore and a warning
will be written to the log.

An example (state where modified in the API)
$ nodetool gossipinfo
/127.0.0.1
  generation:1460450456
  heartbeat:32

The log shows:

Apr 12, 2016 3:40:20 PM org.apache.cassandra.gms.EndpointState
addApplicationState
WARNING: Unknown application state with id:25

Fixes scylladb/scylla#1164.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1460465073-3567-1-git-send-email-amnon@scylladb.com>
2016-04-12 15:53:16 +03: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
Amnon Heiman c8b9198f3b FailureDetector: the ip address should have a leading slash
The ip address of the nodes should have a leading forward slash.

Fixes scylladb/scylla#508

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-24 17:21:07 +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 9f9dc88643 FailureDetector: Change getAllEndpointStates implementation
This patch change getAllEndpointStates implementation. The proxy now
gets from the API a list of objects, it creates the endpoint map from it
and create the result string.

After this patch the nodetool gossipinfo should be formatted like
origin.

After this patch the nodetool gossipinfo return:

./bin/nodetool gossipinfo
127.0.0.2
  generation:1447850743
  heartbeat:78
  RACK:rack1
  DC:datacenter1
  HOST_ID:459137d7-2c7c-4b65-9ef8-f1c93b29dd6b
  RPC_ADDRESS:127.0.0.2
  RELEASE_VERSION:2.1.8
  LOAD:86677
  STATUS:NORMAL,9219539092146142451
  SCHEMA:59adb24e-f3cd-3e02-97f0-5b395827453f
  NET_VERSION:0
127.0.0.1
  generation:1447850742
  heartbeat:75
  RACK:rack1
  DC:datacenter1
  HOST_ID:5216770b-6fc5-4d5b-8c87-33304fd87bc8
  RPC_ADDRESS:127.0.0.1
  RELEASE_VERSION:2.1.8
  LOAD:12655
  STATUS:NORMAL,927478638459366287
  SCHEMA:59adb24e-f3cd-3e02-97f0-5b395827453f
  NET_VERSION:0

Fix #508

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-18 14:48:15 +02:00
Amnon Heiman e01ece2fcd Import ApplicationState, EndpointState and HeartBeatState from origin
This patch import ApplicationState, EndpointState and HeartBeatState
from origin that are used to report the endpoint state map.

The classes where modified to be created by the API objects.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-18 13:58:07 +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 d1e16178df Moving the MBean to 2.1 (8)
This patch changes the MBeans to 2.1 version, with the changes an empty
stub implementation was added to the implementation so the code can
compile.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-07-30 12:01:05 +03:00
Amnon Heiman c671310d0d Adding the FailureDetector MBean support
This adds the FailureDetectorMBean and its implementation.
Setting the phi is not supported yet and will be added when the code
will be completed inside the failure_detector implementation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-03 19:45:39 +03:00
Amnon Heiman 8847343ebd Adding the Gossiper MBean implementation
This adds the implementation of the Gossiper MBean.

To test, run an urchin server, run the API and use jconsole to connect
to the API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-05-25 18:36:12 +03:00
Amnon Heiman cd2b174cd3 JMX API: Add the GossiperMBean stab
This adds a stab implementation of the GossiperMBean

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