Commit Graph

9 Commits

Author SHA1 Message Date
Amnon Heiman
39b50f63c7 Adding a configuration object for the jmx proxy
This patch adds a configuration object to the jmx proxy that support
both the system/command line based properties and it accept a yaml
configuration file. The later options allows the jmx to read scylla
configuration file and connect to it based on this configuration.

The configuration file reader uses a yaml parser that was added to the
pom.xml

If no configuration file is found in the command line, it would look for
SCYLLA_CONF then SCYLLA_HOME then for relative 'conf' directory

Signed-off-by: Amnon Heiman <amnon@scylladb.com>

need merge apiconfig
2015-11-08 12:12:27 +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
Avi Kivity
77dc745b61 Downgrade Java compatibility level to 1.7.
Allows running on older Linux distributions.
2015-10-25 13:22:41 +02:00
Pekka Enberg
452b0e9856 Make urchin-mbean Jar include its dependencies
Use the maven-shade-plugin to package a single executable Jar file.
Fixes #3.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-09-15 09:56:12 +03:00
Pekka Enberg
a600152de7 Merge 'Adding JMX Metric support'
From Amnon:

 "This series adopt the yammer Metric library to use with out API. The
  library it self is taken as is by adding it to the Maven dependency. The
  required adaptation is that information will not be added in push to the
  library Metric, instead, when required, the specific Metric would use
  the APIClient to fetch information from the system using the API.

  This approach would mean that there will be little adaptation when code
  would be passed from origin."

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>

Conflicts:
	pom.xml
2015-06-17 15:10:30 +03:00
Amnon Heiman
565d62d4db Importing FileUtils.java Pair.java SnapshotDetailsTabularData.java
This adds the functionality that is used by the JMX from Origin.

The following files where import: FileUtils.java  Pair.java
SnapshotDetailsTabularData.java, un needed functionality was removed to
minimize the dependency and they were placed in a util directory.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-15 16:35:44 +03:00
Amnon Heiman
aaae78c2c7 Adding the yammer counter library to pom
This adds the dependency for the yammer counter library and for the
google collection that are used with it.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-11 11:32:29 +03:00
Amnon Heiman
55b80fe541 JMX API rename the cloudius package to cloudius.urchin
The urchin files (Client and Main) where moved to:
com.cloudius.urchin.api and com.cloudius.urchin.main respectively.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2015-05-18 10:27:27 +03:00
Amnon Heiman
d46a124be3 Adding the MBean Service Support
This adds the java project that expose the system MBean.
The Main would start any required classes and would wait forever.

The mvn creates jar with main and set the classpath accordingly.
To start do:

java -jar target/urchin-mbean-1.0.jar

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