public class HawkularStorageAdapter extends Object implements StorageAdapter
| Constructor and Description |
|---|
HawkularStorageAdapter() |
| Modifier and Type | Method and Description |
|---|---|
AvailDataPayloadBuilder |
createAvailDataPayloadBuilder() |
MetricDataPayloadBuilder |
createMetricDataPayloadBuilder() |
MetricTagPayloadBuilder |
createMetricTagPayloadBuilder() |
<L> void |
discoveryCompleted(DiscoveryEvent<L> event)
Notifies this listener that a discovery scan has completed.
|
MonitorServiceConfiguration.StorageAdapterConfiguration |
getStorageAdapterConfiguration() |
void |
initialize(String feedId,
MonitorServiceConfiguration.StorageAdapterConfiguration config,
Diagnostics diag,
HttpClientBuilder httpClientBuilder)
Initializes the storage adapter.
|
<L> void |
resourcesAdded(InventoryEvent<L> event)
Notifies this listener that the resources in
InventoryEvent.getPayload()
were added to the monitored endpoint. |
<L> void |
resourcesRemoved(InventoryEvent<L> event)
Notifies this listener that the resources in
InventoryEvent.getPayload()
were removed from the monitored endpoint. |
void |
shutdown()
Clean up and stop whatever the storage adapter is doing.
|
void |
store(AvailDataPayloadBuilder payloadBuilder,
long waitMillis)
Stores the availability data found in the given builder.
|
void |
store(MetricDataPayloadBuilder payloadBuilder,
long waitMillis)
Stores the metric data found in the given builder.
|
void |
store(MetricTagPayloadBuilder payloadBuilder,
long waitMillis)
Stores the metric tags found in the given builder.
|
void |
storeAvails(Set<AvailDataPoint> datapoints,
long waitMillis)
Stores the given availability check data points.
|
void |
storeMetrics(Set<MetricDataPoint> datapoints,
long waitMillis)
Stores the given collected metric data points.
|
public void initialize(String feedId, MonitorServiceConfiguration.StorageAdapterConfiguration config, Diagnostics diag, HttpClientBuilder httpClientBuilder)
StorageAdapterinitialize in interface StorageAdapterfeedId - identifies the feed that is storing dataconfig - the configuration of the storage adapterdiag - the object used to track internal diagnostic data for the storage adapterhttpClientBuilder - used to communicate with the storage serverpublic MonitorServiceConfiguration.StorageAdapterConfiguration getStorageAdapterConfiguration()
getStorageAdapterConfiguration in interface StorageAdapterpublic MetricDataPayloadBuilder createMetricDataPayloadBuilder()
createMetricDataPayloadBuilder in interface MetricStoragepublic AvailDataPayloadBuilder createAvailDataPayloadBuilder()
createAvailDataPayloadBuilder in interface AvailStoragepublic MetricTagPayloadBuilder createMetricTagPayloadBuilder()
createMetricTagPayloadBuilder in interface MetricStoragepublic void storeMetrics(Set<MetricDataPoint> datapoints, long waitMillis)
StorageAdapterwaitMillis is provided, it indicates the caller is willing
to wait up to that amount of milliseconds for the store to complete before returning.
Note that if the given data points contain data across multiple tenants, the waitMillis will be the wait
time for each storage attempt per tenant (in other words, if you ask to wait 1000 milliseconds and pass in
data points for two different tenants, the wait time could be up to 2000 milliseconds because you will
wait 1000 for storing the data for tenant 1 and 1000 for storing data for tenant 2).storeMetrics in interface StorageAdapterdatapoints - the data to be storedwaitMillis - the amount of milliseconds to wait for the store to complete before returning (0==no wait).public void store(MetricDataPayloadBuilder payloadBuilder, long waitMillis)
MetricStoragewaitMillis is provided, it indicates the caller is willing
to wait up to that amount of milliseconds for the store to complete before returning.store in interface MetricStoragepayloadBuilder - contains the metric data to storewaitMillis - the amount of milliseconds to wait for the store to complete before returning (0==no wait)public void storeAvails(Set<AvailDataPoint> datapoints, long waitMillis)
StorageAdapterwaitMillis is provided, it indicates the caller is willing
to wait up to that amount of milliseconds for the store to complete before returning.
Note that if the given data points contain data across multiple tenants, the waitMillis will be the wait
time for each storage attempt per tenant (in other words, if you ask to wait 1000 milliseconds and pass in
data points for two different tenants, the wait time could be up to 2000 milliseconds because you will
wait 1000 for storing the data for tenant 1 and 1000 for storing data for tenant 2).storeAvails in interface StorageAdapterdatapoints - the data to be storedwaitMillis - the amount of milliseconds to wait for the store to complete before returning (0==no wait).public void store(AvailDataPayloadBuilder payloadBuilder, long waitMillis)
AvailStoragewaitMillis is provided, it indicates the caller is willing
to wait up to that amount of milliseconds for the store to complete before returning.store in interface AvailStoragepayloadBuilder - contains the availability data to storewaitMillis - the amount of milliseconds to wait for the store to complete before returning (0==no wait)public void store(MetricTagPayloadBuilder payloadBuilder, long waitMillis)
MetricStoragewaitMillis is provided, it indicates the caller is willing
to wait up to that amount of milliseconds for the store to complete before returning.store in interface MetricStoragepayloadBuilder - contains the metric tags to storewaitMillis - the amount of milliseconds to wait for the store to complete before returning (0==no wait)public <L> void resourcesAdded(InventoryEvent<L> event)
InventoryListenerInventoryEvent.getPayload()
were added to the monitored endpoint.
Note that these resources need to be flushed to persistent storage by
calling InventoryListener.discoveryCompleted(DiscoveryEvent) after all resources have
been added (or removed).resourcesAdded in interface InventoryListenerevent - the InventoryEventpublic <L> void resourcesRemoved(InventoryEvent<L> event)
InventoryListenerInventoryEvent.getPayload()
were removed from the monitored endpoint.
Note that these resources need to be flushed to persistent storage by
calling InventoryListener.discoveryCompleted(DiscoveryEvent) after all resources have
been added (or removed).resourcesRemoved in interface InventoryListenerevent - the InventoryEventpublic <L> void discoveryCompleted(DiscoveryEvent<L> event)
InventoryListenerDiscoveryEvent.getResourceManager() were updated as part of the completed
discovery scan.
Make sure you call this after you add
and remove resources.discoveryCompleted in interface InventoryListenerevent - the DiscoveryEventpublic void shutdown()
StorageAdaptershutdown in interface StorageAdapterCopyright © 2015–2016 Red Hat, Inc.. All rights reserved.