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>
Refs scylladb/scylla#2340 (trunk/1.7)
Must proxy "register" call, otherwise unregistration of mbeans
will instead try to double-register. Code for this somehow fell away.
Message-Id: <1494417610-9720-1-git-send-email-calle@scylladb.com>
nodetool from scylla-tools-java still uses it. Currently `nodetool compact` fails like this:
error: forceKeyspaceCompaction(java.lang.String, [Ljava.lang.String;)
-- StackTrace --
java.lang.NoSuchMethodException: forceKeyspaceCompaction(java.lang.String, [Ljava.lang.String;)
Fixesscylladb/scylla#2261
Probably broken by 3e146845b4
Message-Id: <1491470483-6147-1-git-send-email-tgrabiec@scylladb.com>
This patch fixes two issues with the histogram implementation:
* Need to all update before trying to read values from the histogram.
* The histogram values return from the API in microseconds and not nano.
See Scylladb/scylla#2155
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <20170315130725.22261-1-amnon@scylladb.com>
When parsing the snapshot disk sizes, it should be long and not int.
See scylladb/scylla#2104
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1487760019-1354-1-git-send-email-amnon@scylladb.com>
Actually removes a bunch of code to manage the JMX connector,
since as of jdk8u102, the standard jmx connector answers to
property setting bind address -> can restrict access.
Note that the RMI connector will now (as is jdk normal)
_bind_ to 0.0.0.0, but it will not answer non-local requests
if "remote" is not enabled. This is the default jdk behaviour.
In any case, we rely on setting the appropriate properties
instead, and also allow pass-through of -D flags to java,
which in turn means those who wish can turn on both auth
and ssl, set key/trust stores etc etc.
Message-Id: <1485357178-20714-1-git-send-email-calle@scylladb.com>
This patch change the sorting of tokensEndpointMap so it will use the
order returned by the API.
See Scylladb/scylla#1945
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
The getMapStrValue return a map from the API. This change the
implementation to use linkedHashMap so the map will be sorted according
to the API order.
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Note: c3 adds configurable size threshold counting of messages sent,
dividing info "large"/"small" partitions (+gossiper). Message bulk
queries in v3 mbean reflects this.
Scylla does not (yet?) have such a threshold divider, so this is
highly incomplete and just delegates to old apis that "sort-of" fit.
Currently, we have a scary looking dtest failure when attempting to force flush a
Nodetool command '/data/jenkins/workspace/scylla-1.3-dtest/label/monster/mode/release/smp/1/scylla/resources/cassandra/bin/nodetool -h localhost -p 7100 flush' failed; exit status: 2; stderr: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
error: javax.ws.rs.ProcessingException (no security manager: RMI class loader disabled)
-- StackTrace --
java.lang.ClassNotFoundException: javax.ws.rs.ProcessingException (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:219)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:245)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1020)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:298)
at com.sun.proxy.$Proxy7.forceKeyspaceFlush(Unknown Source)
at org.apache.cassandra.tools.NodeProbe.forceKeyspaceFlush(NodeProbe.java:290)
at org.apache.cassandra.tools.NodeTool$Flush.execute(NodeTool.java:1227)
at org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:288)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:202)
The problem is rather innocent: the API call fails and we leak
javax.ws.rs.ProcessingException, which is not available in nodetool's
classpath. In fact, we already fixed the problem for GETs in commit
02e0598 ("APIClient: Fix error handling if connection to API server
fails") so do the same thing for POSTs.
Message-Id: <1471589525-26435-1-git-send-email-penberg@scylladb.com>
When removing the pull based timers in the API the sum method in the
APITimer was left stubed by mistake.
This patch take the sum from the histogram as it should be.
Another missed changes are the units, in the yammer library the Timer
does unit conversion before returning the values.
This patch takes the unit conversion from the yammer library to be
compatible.
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1464173726-7482-1-git-send-email-amnon@scylladb.com>
With the change to APITimer there is no longer a need to periodically
pull the API.
The verb will be register on the object initialization and will be
updated whenever they are been used.
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
With the change in the meter implementation, retrieving a non existing
metrics would take time.
For this, the CacheService would mark caches that are not supported with
null url, so the metrics will be register but will return 0 for all
request (instead of going to the API that will return 0).
Signed-off-by: Amnon Heiman <amnon@scylladb.com>