![]() |
Fledge
An open source edge computing platform for industrial users
|
A class used in the North service to load data from the buffer. More...
#include <data_load.h>
Public Member Functions | |
DataLoad (const std::string &name, long streamId, StorageClient *storage) | |
DataLoad Constructor. More... | |
virtual | ~DataLoad () |
DataLoad destructor. More... | |
void | loadThread () |
The background thread that loads data from the database. | |
bool | setDataSource (const std::string &source) |
Set the source of data for the service. More... | |
void | triggerRead (unsigned int blockSize) |
Trigger the loading thread to read a block of data. More... | |
void | updateLastSentId (unsigned long id) |
Update the last sent ID for our stream. | |
void | flushLastSentId () |
Flush the last sent Id to the storeage layer. | |
ReadingSet * | fetchReadings (bool wait) |
Fetch Readings. More... | |
void | shutdown () |
External call to shutdown the north service. | |
void | restart () |
External call to restart the north service. | |
bool | isRunning () |
void | configChange (const std::string &category, const std::string &newConfig) |
Configuration change for one of the filters or to the pipeline. More... | |
void | configChildCreate (const std::string &, const std::string &, const std::string &) |
void | configChildDelete (const std::string &, const std::string &) |
unsigned long | getLastFetched () |
void | setBlockSize (unsigned long blockSize) |
void | setStreamUpdate (unsigned long streamUpdate) |
void | setPerfMonitor (PerformanceMonitor *perfMonitor) |
const std::string & | getName () |
StorageClient * | getStorage () |
void | setPrefetchLimit (unsigned int limit) |
![]() | |
virtual bool | securityChange (const std::string &payload) |
Static Public Member Functions | |
static void | passToOnwardFilter (OUTPUT_HANDLE *outHandle, READINGSET *readings) |
Pass the current readings set to the next filter in the pipeline. More... | |
static void | pipelineEnd (OUTPUT_HANDLE *outHandle, READINGSET *readings) |
Use the current readings (they have been filtered by all filters) More... | |
A class used in the North service to load data from the buffer.
This class is responsible for loading the reading from the storage service and buffering them ready for the egress thread to process them.
DataLoad::DataLoad | ( | const std::string & | name, |
long | streamId, | ||
StorageClient * | storage | ||
) |
DataLoad Constructor.
Create and start the loading thread
|
virtual |
DataLoad destructor.
Shutdown and wait for the loading thread
|
virtual |
Configuration change for one of the filters or to the pipeline.
category | The name of the configuration category |
newConfig | The new category contents |
The category that has changed is the one for the north service itself. The only items that concerns us here is the filter item that defines the filter pipeline and the data source. If the item is the filter pipeline we extract that item and check to see if it defines a pipeline that is different to the one we currently have.
If it is the filter pipeline we destroy the current pipeline and create a new one.
Implements ServiceHandler.
ReadingSet * DataLoad::fetchReadings | ( | bool | wait | ) |
Fetch Readings.
wait | Boolean to determine if the call should block the calling thread |
|
static |
Pass the current readings set to the next filter in the pipeline.
Note: This routine must be passed to all filters "plugin_init" except the last one
Static method
outHandle | Pointer to next filter |
readings | Current readings set |
|
static |
Use the current readings (they have been filtered by all filters)
The assumption is that one of two things has happened.
Note: This routine must be passed to last filter "plugin_init" only
Static method
outHandle | Pointer to DataLoad class |
readingSet | Filtered reading set being added to Ingest::m_data |
bool DataLoad::setDataSource | ( | const std::string & | source | ) |
Set the source of data for the service.
source | The data source |
void DataLoad::triggerRead | ( | unsigned int | blockSize | ) |
Trigger the loading thread to read a block of data.
This is called by any thread to request that data be added to the buffer ready for collection.