net.opentsdb.search
public abstract class SearchPlugin extends Object
 Note: Implementations must have a parameterless constructor. The 
 initialize(TSDB) method will be called immediately after the plugin 
 is instantiated and before any other methods are called.
 
Note: Since canonical information is stored in the underlying OpenTSDB database, the same document may be re-indexed more than once. This may happen if someone runs a full re-indexing thread to make sure the search engine is up to date, particularly after a TSD crash where some data may not have been sent. Be sure to account for that when indexing. Each object has a way to uniquely identify it, see the method notes below.
Warning: All indexing methods should be performed asynchronously. You may want to create a queue in the implementation to store data until you can ship it off to the service. Every indexing method should return as quickly as possible.
| Constructor and Description | 
|---|
SearchPlugin()  | 
| Modifier and Type | Method and Description | 
|---|---|
abstract void | 
collectStats(StatsCollector collector)
Called by the TSD when a request for statistics collection has come in. 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
deleteAnnotation(Annotation note)
Called to remove an annotation object from the index
 Note: Unique Document ID = TSUID and Start Time 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
deleteTSMeta(String tsuid)
Called when we need to remove a timeseries meta object from the engine
 Note: Unique Document ID = TSUID 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
deleteUIDMeta(UIDMeta meta)
Called when we need to remove a UID meta object from the engine
 Note: Unique Document ID = UID and the Type "TYPEUID" 
 | 
abstract com.stumbleupon.async.Deferred<SearchQuery> | 
executeQuery(SearchQuery query)
Executes a very basic search query, returning the results in the SearchQuery
 object passed in. 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
indexAnnotation(Annotation note)
Indexes an annotation object
 Note: Unique Document ID = TSUID and Start Time 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
indexTSMeta(TSMeta meta)
Indexes a timeseries metadata object in the search engine
 Note: Unique Document ID = TSUID 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
indexUIDMeta(UIDMeta meta)
Indexes a UID metadata object for a metric, tagk or tagv
 Note: Unique Document ID = UID and the Type "TYPEUID" 
 | 
abstract void | 
initialize(TSDB tsdb)
Called by TSDB to initialize the plugin
 Implementations are responsible for setting up any IO they need as well
 as starting any required background threads. 
 | 
abstract com.stumbleupon.async.Deferred<Object> | 
shutdown()
Called to gracefully shutdown the plugin. 
 | 
abstract String | 
version()
Should return the version of this plugin in the format:
 MAJOR.MINOR.MAINT, e.g. 
 | 
public abstract void initialize(TSDB tsdb)
tsdb - The parent TSDB objectIllegalArgumentException - if required configuration parameters are 
 missingException - if something else goes wrongpublic abstract com.stumbleupon.async.Deferred<Object> shutdown()
Object has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract String version()
public abstract void collectStats(StatsCollector collector)
collector - The collector used for emitting statisticspublic abstract com.stumbleupon.async.Deferred<Object> indexTSMeta(TSMeta meta)
meta - The TSMeta to indexObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<Object> deleteTSMeta(String tsuid)
tsuid - The hex encoded TSUID to removeObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<Object> indexUIDMeta(UIDMeta meta)
meta - The UIDMeta to indexObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<Object> deleteUIDMeta(UIDMeta meta)
meta - The UIDMeta to removeObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<Object> indexAnnotation(Annotation note)
note - The annotation to indexObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<Object> deleteAnnotation(Annotation note)
note - The annotation to removeObject has not special meaning and can be null
 (think of it as Deferred<Void>).public abstract com.stumbleupon.async.Deferred<SearchQuery> executeQuery(SearchQuery query)
query - The query to execute against the search engine