Skip to content

Instantly share code, notes, and snippets.

View jsanda's full-sized avatar

John Sanda jsanda

View GitHub Profile
(ns rhq.plugin
(:require [rhq.config :as config])
(:import [org.rhq.core.pluginapi.inventory
ResourceDiscoveryComponent ResourceDiscoveryContext ClassLoaderFacet
DiscoveredResourceDetails ResourceComponent ResourceContext]
[org.rhq.core.domain.measurement AvailabilityType])
(:gen-class
:name rhq.plugin.PluginComponent
:implements [org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent
org.rhq.core.pluginapi.inventory.ResourceComponent]))
<plugin displayName="Clojure Test Plugin"
name="clj-test"
package="rhq.clj.test"
version="1.0"
xmlns:c="urn:xmlns:rhq-configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin">
<server class="rhq.plugin.PluginComponent"
discovery="rhq.plugin.PluginComponent"
name="CLJTestServer"/>
java.lang.ExceptionInInitializerError
at clojure.lang.Namespace.<init>(Namespace.java:34)
at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
at clojure.lang.Var.internPrivate(Var.java:94)
at rhq.plugin.PluginComponent.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.rhq.core.pc.plugin.PluginComponentFactory.instantiateClass(PluginComponentFactory.java:246)
at org.rhq.core.pc.plugin.PluginComponentFactory.getDiscoveryComponent(PluginComponentFactory.java:113)
at org.rhq.core.pc.inventory.AutoDiscoveryExecutor.pluginDiscovery(AutoDiscoveryExecutor.java:170)
package rhq.clj.test;
import clojure.lang.RT;
import clojure.lang.Var;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.inventory.*;
import java.util.HashSet;
import java.util.Set;
(ns rhq.clj.test)
(defn discover [] (.println System/out "DISCOVER"))
create column family raw_metrics
with comparator = DateType and
default_validation_class = DoubleType and
key_validation_class = Int32Type;
create column family one_hour_metric_data
with comparator = 'CompositeType(DateType, Int32Type)' and
default_validation_class = DoubleType and
key_validation_class = Int32Type;
[default@rhq] get one_hour_metric_data[10261];
=> (column=2012-06-14 16:00:00-0400:0, value=8528.610195208777, timestamp=1339707619159001, ttl=1209600)
=> (column=2012-06-14 16:00:00-0400:1, value=7914.6, timestamp=1339707619159002, ttl=1209600)
=> (column=2012-06-14 16:00:00-0400:2, value=8221.605097604388, timestamp=1339707619159000, ttl=1209600)
=> (column=2012-06-14 17:00:00-0400:0, value=80320.63306613911, timestamp=1339711200084005, ttl=1209600)
create column family metrics_aggregates_index
with comparator = 'CompositeType(DateType, Int32Type)' and
default_validation_class = Int32Type and
key_validation_class = UTF8Type;
@jsanda
jsanda / gist:3003925
Created June 27, 2012 12:57
/etc/sysctl.conf settings for rhq dev box
# Kernel sysctl configuration file
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1