Detailed Description
The abstract base class for trackers.
A tracker is a data structure that stores meta-data relating to a key derived from a given FlowData instance. The details of key creation and the specifics of the meta-data are determined by the tracker implementation. The key will always be a FlowData instance as defined by DataKeyedCacheBase. The meta-data can be any type and is specified using the generic type parameter T.
As an example, a tracker could create a key using the source IP address from the FlowData evidence and use the associated meta-data to store a count of the number of times a given source IP has been seen.
- Parameters
-
<T> the type of the meta-data object that the tracker stores with each key value.
Inheritance diagram for fiftyone.pipeline.engines.trackers.TrackerBase< T >:
Collaboration diagram for fiftyone.pipeline.engines.trackers.TrackerBase< T >:
Public Member Functions | |
| TrackerBase (CacheConfiguration config) | |
| Construct a new instance. | |
| boolean | track (FlowData flowData) |
Track the specified FlowData instance. | |
Public Member Functions inherited from fiftyone.pipeline.engines.caching.DataKeyedCacheBase< V > | |
| DataKeyedCacheBase (CacheConfiguration configuration) | |
| Construct a new instance. | |
| V | get (FlowData flowData) |
| void | put (FlowData flowData, V value) |
| void | close () throws IOException |
Public Member Functions inherited from fiftyone.caching.PutCache< K, V > | |
| void | put (K key, V value) |
| Add an item to the cache. | |
Public Member Functions inherited from fiftyone.caching.Cache< K, V > | |
| V | get (K key) |
| Retrieves the value for key requested. | |
Protected Member Functions | |
| abstract T | newValue (FlowData data) |
| Create a tracker value instance. | |
| abstract boolean | match (FlowData data, T value) |
| Update the tracker value with relevant details. | |
Protected Member Functions inherited from fiftyone.pipeline.engines.caching.DataKeyedCacheBase< V > | |
| abstract EvidenceKeyFilter | getFilter () |
Returns the EvidenceKeyFilter to use when generating a key from FlowData instances. | |
Constructor & Destructor Documentation
◆ TrackerBase()
| fiftyone.pipeline.engines.trackers.TrackerBase< T >.TrackerBase | ( | CacheConfiguration | config | ) |
Construct a new instance.
- Parameters
-
config the cache configuration to use when building the cache that is used internally by the tracker
Member Function Documentation
◆ match()
|
abstractprotected |
Update the tracker value with relevant details.
Called when a tracked item matches an instance already in the tracker.
- Parameters
-
data the FlowDatathat has matched an existing entry in the trackervalue the meta-data instance that the tracker holds for the key generated from the data
- Returns
- true if the tracker's logic allows further processing of this flow data instance, false otherwise
◆ newValue()
|
abstractprotected |
Create a tracker value instance.
Called when a new key is added to the tracker. The FlowData that is being added to the tracker.
- Parameters
-
data the FlowDatathat is being added to the tracker
- Returns
- a new meta-data instance to be stored with the
DataKeycreated from the flow data instance
Reimplemented in fiftyone.pipeline.engines.fiftyone.trackers.ShareUsageTracker.
◆ track()
| boolean fiftyone.pipeline.engines.trackers.TrackerBase< T >.track | ( | FlowData | flowData | ) |
Track the specified FlowData instance.
If the key created from the data does not yet exist in the tracker then it will be added. If it does already exist then the meta-data will be updated according to the tracker implementation's logic.
- Parameters
-
flowData the FlowDatato track
- Returns
- true if further processing is allowed by the tracker's logic, false otherwise
Implements fiftyone.pipeline.engines.trackers.Tracker.
