JmxMBeanServer is a concrete implementation of a MBeanServer.
We want to use it directly because we need to bypass calls to
JmxMBeanServer.registerMBean and JmxMBeanServer.unregisterMBean.
They take ObjectName as parameter, copy it using
ObjectName.getInstance(ObjectName) and pass it to registerMBean
and unregisterMBean of JmxMBeanServer.getMBeanServerInterceptor().
We want to avoid this copy and pass the ObjectName argument directly
to JmxMBeanServer.getMBeanServerInterceptor().
To do that this patch:
1. changes all MBeanServer variables to JmxMBeanServer
2. creates JmxMBeanServer in APIBuilder making sure accessing
interceptors is allowed
3. makes sure that JmxMBeanServer.getMBeanServerInterceptor().registerMBean
is called wherever JmxMBeanServer.registerMBean was called
4. makes sure that JmxMBeanServer.getMBeanServerInterceptor().unregisterMBean
is called whenever JmxMBeanServer.unregisterMBean was called
Next patch will use different ObjectName implementation that will
use less memory and this patch is crucial because without it every ObjectName
is transformed with ObjectName.getInstance which turns the object into
a regular ObjectName.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This expose the ColumnFamilyStore registration via static method.
It would allow an external object (ie. MBeanServer) to update the
registration on demand.
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This patch fix the exception handling for connection problem, instead of
ProcessingException it now expect IllegalStateException.
The rest of the functionality remains the same.
Fixes#26
Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1458602355-23601-1-git-send-email-amnon@scylladb.com>
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>
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>
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>
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>
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>
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>
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>
The logic of that timer, should be that after some defined time from the
previous request a new one will be sent, the actuall rate is
meaningless and only cause delyed request to be sent in a higher
frequency after the delayed reponse was returned.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Some of the depricated method in column family are replaced by counters
in Origin. Still, some tools, like nodetool uses the depricated API.
This adds an implementation to some of the depricated method that is
based on the column family counters similiar to origin.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This uses the column family timer to check that the API is still
available.
After MAX_RETRY (currently set to 30s) the proxy will shutdown.
This address issue #2
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The getEstimatedRowSizeHistogram is based on the column_family.json that
defined in the API.
The implementation in the MBean and in the metrics is now works with the
get histogram as long array method in the client.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
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>
This patch cleans the file formatting of ColumnFamilyStore, CommitLog,
StorageProxy and StorageService.
Those files will be modified when moving to 2.1
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This Adds the CommitLogMetrics object.
The implementation is based on the API, that define in commitlog.json
After this patch, it will be possible to connect with jconsole and see
the CommitLogMetrics.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
"The column family matrics is a set of data related to the column family.
This series adds an API based on the ColumnFamilyMetrics mbean.
It has a stub implementation, just so the JMX proxy would get a response."
The CompactionMetrics is used to report statistics about compaction. It
is based on calling the API that defined in compaction_manager.json
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the CompactionManagerMBean and its implementation
CompactionManager.
The implementation is based on the API, that is define in
compaction_manager.json
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
The ColumnFamilyMetrics is used to report statistic of a column family.
This adds an adaptation for the ColumnFamilyMetrics that works with the
API that define in column_family.json
It adds the ColumnFamilyMetrics to the ColumnFamilyStore and expose the
keyspace name, so the ColumnFamilyMetrics would have access to it.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This patch adds the implementation for the ColumnFamilyStore by adding
calls to the relevent API that define in column_family.json
This patch also do some clean up, by removing leading underscore from
parameter names and trailing white spaces.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds the ColumnFamilyStoreMBean with most of its method stub. The
only current functionality is returnning the column family name and the
registration of the StoreMBean.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This adds two of the supported CommitLog method, the
getActiveSegmentNames and the getArchivingSegmentNames.
The API for both returns full path, so the JMX API takes the file name
from the path and remove duplicates.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>