public static boolean isCollector() { IoCs.findOrCreateInstance(Repository.class); // ensure we have a repo which init store classes by default return IoCs.getInstance(CollectorCounterStore.class) != null; } }
@Override public void run() { shutdown(); } };
public static <T> T autoSet(final T instance) throws Exception { return autoSet(null, instance); }
public CassandraPathTrackingDataStore() { this.cassandra = IoCs.findOrCreateInstance( CassandraSirona.class ); this.keyspace = cassandra.getKeyspace(); this.family = cassandra.getPathTrackingColumFamily(); this.markerFamilly = cassandra.getMarkerPathTrackingColumFamily(); }
@Created public void run() { reload(); }
@Destroying public void shutdown() { HFactory.shutdownCluster(cluster); }
@AutoSet public class CassandraStatusDataStore extends PeriodicNodeStatusDataStore { private static final Logger LOGGER = Logger.getLogger(CassandraStatusDataStore.class.getName());
public static synchronized <T> T findOrCreateInstance(final Class<T> clazz) { final T t = clazz.cast(SINGLETONS.get(clazz)); if (t != null) { return t; } return newInstance(clazz); }
public static void shutdown() { for (final ToDestroy c : INSTANCES) { c.destroy(); } INSTANCES.clear(); SINGLETONS.clear(); }
public static <T> T processInstance(final T instance) { try { return internalProcessInstance(instance); } catch (final Exception e) { throw new SironaException(e); } }
public CassandraCollectorNodeStatusDataStore() { this.cassandra = IoCs.findOrCreateInstance(CassandraSirona.class); this.keyspace = cassandra.getKeyspace(); this.family = cassandra.getStatusColumnFamily(); this.markerFamily = cassandra.getMarkerStatusesColumnFamily(); }
@Created protected void initMarkerIfNeeded() { if (marker == null) { marker = Localhosts.get(); } LOGGER.warning("This storage used on app side can be a bit slow, maybe consider using a remote collector"); }
@Destroying public void shutdown() { scheduledTask.done(); }
@Override public void contextDestroyed(final ServletContextEvent sce) { IoCs.shutdown(); } }
public static <T> T autoSet(final String key, final T instance) throws Exception { return autoSet(key, instance, instance.getClass()); }
public CassandraCollectorGaugeDataStore() { this.cassandra = IoCs.findOrCreateInstance(CassandraSirona.class); this.keyspace = cassandra.getKeyspace(); this.valueFamily = cassandra.getGaugeValuesColumnFamily(); this.markerFamily = cassandra.getMarkerGaugesColumFamily(); }
@Created protected void initMarkerIfNeeded() { if (marker == null) { marker = Localhosts.get(); } LOGGER.warning("This storage used on app side can be a bit slow, maybe consider using a remote collector"); }
@Destroying public void shutdown() { final BatchFuture task = scheduledTask.get(); if (task != null) { task.done(); scheduledTask.set(null); } status.set(null); }
public CassandraCollectorCounterDataStore() { this.cassandra = IoCs.findOrCreateInstance(CassandraSirona.class); this.keyspace = cassandra.getKeyspace(); this.markerFamily = cassandra.getMarkerCountersColumnFamily(); this.family = cassandra.getCounterColumnFamily(); }
@Created protected void initMarkerIfNotAlreadyDone() { if (marker == null) { marker = Localhosts.get(); } LOGGER.warning("This storage used on app side can be a bit slow, maybe consider using a remote collector"); }