Commit Graph

94 Commits

Author SHA1 Message Date
Amnon Heiman
6c2bb34ca3 StorageService: change repair to the updated API
The API now uses explicit parameters to pass the parameters to repair.
This patch changes how the parameters are passed to the API to be
compatible with the changed API.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Reviewed-by: Nadav Har'El <nyh@scylladb.com>
2015-12-29 17:24:20 +02:00
Nadav Har'El
69c6913668 scylla-jmx: fix the forceRepairAsync() used by "nodetool repair"
"nodetool repair" ends up calling one of the dozen forceAsyncRepair()
functions. This function ignored its option rather than passing it on,
so this patch fixes that.

Note that there are still many more forceAsyncRepair() overloads which
similarly ignore their options, and it is possible that certain invocation
of "nodetool repair" will need them, so we will need to fix all of them
in the future.

After this patch, "nodetool repair" no longer works because now Scylla
needs to be fixed to understand the "parallelism" and "incremental" options
passed to it.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2015-12-29 09:25:11 +02:00
Nadav Har'El
f8b4dfed38 scylla-jmx: use ":", not "=", to build options list
Scylla's repair REST API (see scylla/api/storage_service.cc) takes all
repair options as one "options" string. The options are separated by ",",
and for each option, the name and value are separated by ":". The existing
code wrongly used "=" instead of ":", so this patch fixes it.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2015-12-28 15:55:32 +02:00
Amnon Heiman
4f275cc44b StorageService: format the describering output
The describeRingJMX method, returns a formated output. The output should
be similiar to origin as oppose to the current implementation that
returns a json representation.

After the change an example of nodetool describering:
$ nodetool describering keyspace1
Schema Version:1074c31b-1f39-3df2-90ff-7f0b64bb3ea4
TokenRange:
	TokenRange(start_token:7485973865401664349,
end_token:-338297331236877217, endpoints:[127.0.0.1],
rpc_endpoints:[127.0.0.1],
endpoint_details:[EndpointDetails(host:127.0.0.1,
datacenter:datacenter1, rack:rack1)])
	TokenRange(start_token:-338297331236877217,
end_token:7485973865401664349, endpoints:[127.0.0.2],
rpc_endpoints:[127.0.0.2],
endpoint_details:[EndpointDetails(host:127.0.0.2,
datacenter:datacenter1, rack:rack1)])

On sycall-jmx:
Fixes #21

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-28 09:56:44 +02:00
Nadav Har'El
9b03fa1074 scylla-jmx: repairAsync: don't ignore options
repairAsync() builds an "options" argument from the options map it gets,
but then forgot to pass this argument to the request :-)

This is part of issue scylladb/#714.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2015-12-27 19:56:37 +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
Amnon Heiman
75479531e0 StorageService: rename the dc parameter in rebuild
The API uses the source_dc as a query parameter, the jmx should use the
same.

In addition, the rebuild method can get null as a datacenter value and
in that case it should not pass a parameter.

Fixes scylladb/scylla#668.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-18 11:01:47 +02:00
Pekka Enberg
7543882d6c Clean up after unused imports
Remove unused imports that Eclipse complains about.

Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-12-17 09:29:48 +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
107664dbf1 CompactionManager: Switch to the update compaction history API
This changes the CompactionManager getCompactionHistory to use the new
get_compaction_history API.

It uses the CompactionHistoryTabularData to parse and report the
results.

After this patch nodetool compactionhistory would work.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-16 14:52:21 +02:00
Amnon Heiman
8e7c432374 Importing CompactionHistoryTabularData from origin
This patch import and modify CompactionHistoryTabularData from origin.
It will be used by the getCompactionHistory method in CompactionManager.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-16 14:51:52 +02:00
Amnon Heiman
fb9f3c8961 StorageService: getLoadMap should format the load
Similiar to origin, the load map should return a formated load value.

After this patch the nodetool status command:
$nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns    Host ID
Rack
UN  127.0.0.1  394.97 MB  256     ?
292a6c7f-2063-484c-b54d-9015216f1750  rack1
UN  127.0.0.2  151.07 MB  256     ?
102b6ecd-2081-4073-8172-bf818c35e27b  rack1

Under scylla-jmx
Fixes #18

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-14 09:05:21 +02:00
Amnon Heiman
67b244b8e4 StorageService: Fix a typo in the get snapshots API
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-08 10:41:14 +02:00
Amnon Heiman
7b9ea44354 Import the GCInspectorMXBean from origin
Although there is little relevant information in the GC inspector, some
application like cassandra-stress looks for it and fails if it cannot be
found.

This patch import the GCInspectorMBean and its implementation.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-07 13:00:07 +02:00
Amnon Heiman
ba0ed7cbc7 createColumnFamilyGauge to support double values return from the API
There are cases where the API uses double to return a value that the JMX
expect to be long.

For example in mean column row size. This type difference should not be
a problem and the result should be cast to long or int.

This patch allows the values to be double and cast the result to int or
long.

This fix (scylla-jmx)
Fixes #12

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-03 12:38:35 +02:00
Amnon Heiman
3a69e3d9da ColumnFamilyStore: getSSTableCountPerLevel should return null not empty array
When getSSTableCountPerLevel is called and the system is not using level
compaction the expected return is null and not an empty array.

This fix (scylla-jmx)
Fixes #11

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-03 12:20:30 +02:00
Amnon Heiman
e194ca85a4 ColumnFamilyStore: Use the combine API with metrics
The column family store API was changed so it would have a single API to
return the snapshot size.

This changes the JMX to use the same API regardless if it is called from
the ColumnFamilyMetrics or from ColumnFamilyStore.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-12-02 14:32:47 +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
1292bd9ba4 MessagingService: Add the depricated getRecentTimeoutsPerHost and
getRecentTotalTimeouts

This patch adds the impelementation for the depricated method
getRecentTimeoutsPerHost and getRecentTotalTimeouts.

The implementatin is based on origin, the recent version of the method,
return the delta from the last call to the method.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-17 11:57:07 +02:00
Amnon Heiman
db7aad26f5 MessagingService add dropped and recently dropped messages impl
This patch adds the implementation of the dropped messages and the
recent dropped messages.

The MessagingService holds a timer that periodically load the dropped
messages from the API and distribute the results between the
DroppedMessagesMetrics instances.

This mimic the timer behaviour in origin, only it does one API call for
all Verb.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-17 11:56:03 +02:00
Amnon Heiman
896fd64de9 Import the DroppedMessageMetrics from origin
This patch import the DroppedMessageMetrics from origin, as oppose to
origin, it does not run timers but relay on the Messaging sevice.

This save the timer and API call for each of the Verb.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-16 11:52:29 +02:00
Amnon Heiman
b783a0d09a MessagingService: Add dropped and timeout support
This adds the implementation for dropped messages and timeout messages
counters in MessagingService.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-11 09:49:50 +02:00
Pekka Enberg
e530c13f87 Merge "Adding deprecated implementation to cache" from Amnon
"This series adds some deprecated methods implemenetation to the CacheService
depnding on its metrics.

It also stub the getDrainProgress in StorageService."
2015-11-11 09:40:04 +02:00
Amnon Heiman
fadfb9443c StorageService: Add describering functionality
This patch adds the describering method to StorageService, the
implementation is based on the storage_service API that is define in
storage_service.json

The implementation reflect the changes in the API, that returns an
object vs. the jmx_describe ring.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-11-11 09:14:05 +02:00
Amnon Heiman
27c0eb8c99 StorageService: move should pass the parameter to the API
When calling the API move method, the proxy should pass the new_token
parameter.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-11-11 08:53:27 +02:00
Amnon Heiman
07b319d827 StorageService: Stub the getDrainProgress
Drain progress is not implemented yet, it is needed by the nodetool
command so it will not fail.

This patches the functionality until the API will be ready, which, in
that time it would be revert.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-10 17:03:50 +02:00
Amnon Heiman
01477809ac CacheService: Add depricated unimplemented methods
This patch follow origin in the implementation of the depricated methods
in CacheService. It propogate the request to the relevant metrics.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-10 16:54:48 +02:00
Amnon Heiman
54d451de88 CacheMetrics: Add recent hit rate
The depricated recent hit rate implementation was add from Origin as it
is still been used by external system.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-10 15:58:51 +02:00
Avi Kivity
72f6f5dab4 Merge "Enabling nodetool netstats" from Amnon
"This series adds the jmx implementation to enable netstats.
After this series netstats should complete successfuly.
A run example:

$ ./bin/nodetool netstats
Mode: NORMAL
repair 397c91a0-8205-11e5-83e4-000000000001
repair 3977d5ba-8205-11e5-83e4-000000000001
repair 3977d624-8205-11e5-83e4-000000000001
repair 397c8fc8-8205-11e5-83e4-000000000001
.......
......
repair 3977d502-8205-11e5-83e4-000000000001
Read Repair Statistics:
Attempted: 1
Mismatch (Blocking): 0
Mismatch (Background): 0
Pool Name                    Active   Pending      Completed
Commands                        n/a         0          21182
Responses                       n/a         0            597"
2015-11-08 11:48:40 +02:00
Amnon Heiman
9b14550d0a StorageService: register the StreamManagerMBean
This patch adds the registration of StreamManagerMBean to
StorageService, similiar to the way it is done in origin.

After this patch the StreamManager will be available via Jconsole.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-03 11:33:40 +02:00
Amnon Heiman
3cb168bed3 MessagingService: Add tasks statistics
This patch adds the implementation of:
getResponsePendingTasks()
getResponseCompletedTasks()
getDroppedMessages()

The implementation is based on the messaging_service API that defined in
messaging_service.json.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-03 11:33:40 +02:00
Amnon Heiman
20778b2df6 Add StreamManagerMBean with its subclasses
The StreamManager getStreams returns an hirarchy of classes. This patch
import StreamManagerMBean with the class hirarchy and add an
implementation to StreamManager.

The implementation is based on the stream_manager API.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-11-03 11:28:44 +02:00
Amnon Heiman
00694ce40a StorageService: getLoadString should return units
This address issue #512

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
2015-10-29 15:54:29 +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
a707b487f0 StorageService: remove node should use hostid and not token
There is a confusion in origin, the MBean declare token as the parameter
to remove, but the implementation actually uses host id.

This patch modify scylla implementation to pass a host id as the
parameter to remove.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-26 10:31:43 +02:00
Pekka Enberg
dc76d2550e Merge "Support deprecated method in StorageProxy" from Amnon
"This series adds latency related depricated methods to the storage
 proxy.

 The implmenetation mimic origin, in which the depricated methods calls
 the counters that replaces them."
2015-10-26 09:15:20 +02:00
Amnon Heiman
ae26226339 ClientRequestMetrics: pass the url similiar to LatencyMetrics
In LatencyMetrics the URL is passed without the ending slash, this
patch use the same notation in ClientRequestMetrics.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-25 13:36:10 +02:00
Avi Kivity
ee7f5354b1 Avoid non-final variables in anonymous classes
Required by Java 7.
2015-10-25 13:22:05 +02:00
Amnon Heiman
392765fa2e StorageProxy: Add depricated method implementation based on metrics
This follow origin by adding the implementation for the depricated
metrics methods.

Similiar to origin, the implementation calls the implementation in the
metrics.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-22 10:43:29 +03:00
Pekka Enberg
b11c108fcf Remove obsolete comments from ColumnFamilyStore 2015-10-21 14:28:17 +03:00
Pekka Enberg
8e0fb98fc4 Merge "Adding estimated histogram support for nodetool cfhistogram" from Amnon
"This series together with the cfhistogram series in scylla adds the
 missing functionality so that nodetoold cfhistogram would work.

 After both series will be apply an execution example is:

 ./bin/nodetool cfhistograms keyspace1 standard1
 keyspace1/standard1 histograms
 Percentile  SSTables     Write Latency      Read Latency    Partition Size        Cell Count
                               (micros)          (micros)           (bytes)
 50%             0.00           6866.00        4866323.00               310                 5
 75%             0.00           8239.00       10090808.00               310                 5
 95%             0.00          20501.00       17436917.00               310                 5
 98%             0.00          35425.00       25109160.00               310                 5
 99%             0.00          51012.00       25109160.00               310                 5
 Min             0.00           2300.00         654950.00               259                 5
 Max             0.00       20924300.00       25109160.00               310                 5"
2015-10-21 14:26:40 +03:00
Amnon Heiman
3667682075 ColumnFamilyStore: add support for estimated latency
This patch uses the estimated latency that was added to the column
family metrics to get the recent and estimated latency.

It follows the same logic as origin does to call the logic in metrics.

The following method implementation will be added:

getMemtableColumnsCount
getRecentSSTablesPerReadHistogram
getSSTablesPerReadHistogram
getLifetimeReadLatencyHistogramMicros
getRecentReadLatencyHistogramMicros
getRecentReadLatencyMicros
getLifetimeWriteLatencyHistogramMicros
getRecentWriteLatencyHistogramMicros
getRecentWriteLatencyMicros
getRangeCount
getTotalRangeLatencyMicros
getLifetimeRangeLatencyHistogramMicros
getRecentRangeLatencyHistogramMicros
getRecentRangeLatencyMicros

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-21 14:22:06 +03:00
Amnon Heiman
db3b3cdeee ColumnFamilyMetrics: add estimted per read histogram support
This uses the recent estimated histogram and the API based estimated
histogram to support the sstable per read recent and total estimated
histogram.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-21 14:22:06 +03:00
Amnon Heiman
960aa6f509 LatencyMetrics: Support totalLatencyHistogram and recentLatencyHistogram
This adds the depricated total and recent estimated histogram.
It uses the new RecentEstimatedHistogram for the recent value and the
API based estimated histogram for the total latency.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-21 14:22:06 +03:00
Amnon Heiman
6df716e5f7 Add an EstimateHistogramWrapper
The EstimatedHistogramWrapper is a helper class that holds the API
related data, so that a class that uses an EstimatedHistogram can
replace it with the wrapper and keep most of its code as is.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-21 14:21:53 +03:00
Amnon Heiman
3bf092c83b StorageService: handle loadNewSStable and forceKeyspaceCleanup
keyspace cleanup was changed from GET to POST and load sstable was
missing the keyspace name.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-10-21 12:27:59 +03:00
Nadav Har'El
f05c6709dd Fix "nodetool repair" error
The existing scylla-jmx code had reversed logic for the success of the repair:
it reported to "nodetool repair" a failure when the repair was successful :-)

Note that "nodetool repair" waits until a FINISHED notification, and then reports
a failure if it previously got any SESSION_FAILED notification; So if repair was
successful, all we need to do is to avoid sending a "SESSION_FAILED" message.
But we don't need to send any additional "SESSION_SUCCESS" message to signal
success. That message type is only used to report progress to the user (a
"session" is part of the repair work, so seeing sessions completing shows
progress), but because Scylla doesn't support this progress report yet, we
can't send these notifications yet, and there's no point in sending one such
message at the end - it's only confusing (especially when the text is the same
as that of the FINISHED message).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-10-15 09:50:35 +03: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