NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
Public Member Functions | |
DummyRequest (uint8_t maxRetries, uint32_t initialValue, uint32_t additionValue, uint32_t returnNewRequestFrequency) | |
std::vector< AbstractRequestPtr > | executeRequestLogic () override |
executes the logic of the main thread. sub-requests can be scheduled from withing this function. Access to any data structure via the storage handler requires scheduling a sub-request which will make the resource access More... | |
std::vector< AbstractRequestPtr > | rollBack (std::exception_ptr, const StorageHandlerPtr &) override |
Roll back any changes made by a request that did not complete due to errors. More... | |
DummyRequest (const std::vector< ResourceType > &requiredResources, uint8_t maxRetries, uint32_t responseValue) | |
std::vector< AbstractRequestPtr > | executeRequestLogic (const StorageHandlerPtr &) override |
Executes the request logic. More... | |
std::vector< AbstractRequestPtr > | rollBack (std::exception_ptr, const StorageHandlerPtr &) override |
Roll back any changes made by a request that did not complete due to errors. More... | |
![]() | |
AbstractMultiRequest (uint8_t maxRetries) | |
Constructor. More... | |
std::vector< AbstractRequestPtr > | execute (const StorageHandlerPtr &storageHandle) final |
Executes the request logic. The first thread to execute this function for this request will be in charge of scheduling tasks for the following threads. More... | |
bool | isDone () |
Indicates if this request has finished its execution. More... | |
![]() | |
AbstractRequest (uint8_t maxRetries) | |
constructor More... | |
void | setId (RequestId requestId) |
set the id of this object. This has to be done before any resource is locked. More... | |
std::vector< AbstractRequestPtr > | handleError (const std::exception_ptr &ex, const StorageHandlerPtr &storageHandle) |
Calls rollBack and executes additional error handling based on the exception if necessary. More... | |
bool | retry () |
Check if the request has already reached the maximum allowed retry attempts or if it can be retried again. If the maximum is not reached yet, increase the amount of recorded actual retries. More... | |
std::future< AbstractRequestResponsePtr > | getFuture () |
creates a future which will contain the response supplied by this request More... | |
virtual | ~AbstractRequest ()=default |
destructor More... | |
template<class RequestType > | |
bool | instanceOf () |
Checks if this object is of type AbstractRequest. More... | |
template<class RequestType > | |
std::shared_ptr< RequestType > | as () |
Dynamically casts the exception to the given type. More... | |
![]() | |
AbstractUniRequest (const std::vector< ResourceType > &requiredResources, uint8_t maxRetries) | |
constructor More... | |
std::vector< AbstractRequestPtr > | execute (const StorageHandlerPtr &storageHandle) final |
Acquires locks on the needed resources and executes the request logic. More... | |
Public Attributes | |
std::atomic< uint32_t > | responseValue |
Protected Member Functions | |
void | preRollbackHandle (std::exception_ptr, const StorageHandlerPtr &) override |
Performs request specific error handling to be done before changes to the storage are rolled back. More... | |
void | postRollbackHandle (std::exception_ptr, const StorageHandlerPtr &) override |
Performs request specific error handling to be done after changes to the storage are rolled back. More... | |
void | preRollbackHandle (std::exception_ptr, const StorageHandlerPtr &) override |
Performs request specific error handling to be done before changes to the storage are rolled back. More... | |
void | postRollbackHandle (std::exception_ptr, const StorageHandlerPtr &) override |
Performs request specific error handling to be done after changes to the storage are rolled back. More... | |
void | postExecution (const StorageHandlerPtr &) override |
Performs steps to be done after execution of the request logic, e.g. unlocking the required data structures. More... | |
![]() | |
SubRequestFuture | scheduleSubRequest (AbstractSubRequestPtr subRequest) |
schedule a sub-request to be executed More... | |
![]() | |
void | trySetExceptionInPromise (std::exception_ptr exception) |
if no exception or value has been set in this requests response promise yet, set the supplied exception. If a value has already been set, this method has no effect More... | |
void | setExceptionInPromiseOrRethrow (std::exception_ptr exception) |
set and exception on the response promise if no value or exception has been set yet. If the promise already has a value or exception set, rethrow the exception in thsi thread More... | |
![]() | |
RequestId | getResourceLockingId () override |
get an id that identifies this object to lock resources for exclusive use by this object More... | |
![]() | |
StorageResourceLocker (std::vector< ResourceType > requiredResources) | |
Constructor. More... | |
virtual void | preExecution (const StorageHandlerPtr &storageHandle) |
Performs steps to be done before execution of the request logic, e.g. locking the required data structures. More... | |
Additional Inherited Members | |
![]() | |
RequestId | requestId {INVALID_REQUEST_ID} |
std::promise< AbstractRequestResponsePtr > | responsePromise |
|
inline |
|
inline |
|
inlineoverridevirtual |
executes the logic of the main thread. sub-requests can be scheduled from withing this function. Access to any data structure via the storage handler requires scheduling a sub-request which will make the resource access
Implements NES::RequestProcessor::AbstractMultiRequest.
References NES::RequestProcessor::AbstractRequest::responsePromise, responseValue, and NES::RequestProcessor::AbstractMultiRequest::scheduleSubRequest().
|
inlineoverridevirtual |
Executes the request logic.
storageHandle | a handle to access the coordinators data structures which might be needed for executing the request |
Implements NES::RequestProcessor::AbstractUniRequest.
References NES::RequestProcessor::AbstractRequest::responsePromise, and responseValue.
|
inlineoverrideprotectedvirtual |
Performs steps to be done after execution of the request logic, e.g. unlocking the required data structures.
storageHandle | The storage access handle used by the request |
Reimplemented from NES::RequestProcessor::StorageResourceLocker.
|
inlineoverrideprotectedvirtual |
Performs request specific error handling to be done after changes to the storage are rolled back.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle used by the request |
Implements NES::RequestProcessor::AbstractRequest.
|
inlineoverrideprotectedvirtual |
Performs request specific error handling to be done after changes to the storage are rolled back.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle used by the request |
Implements NES::RequestProcessor::AbstractRequest.
|
inlineoverrideprotectedvirtual |
Performs request specific error handling to be done before changes to the storage are rolled back.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle used by the request |
Implements NES::RequestProcessor::AbstractRequest.
|
inlineoverrideprotectedvirtual |
Performs request specific error handling to be done before changes to the storage are rolled back.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle used by the request |
Implements NES::RequestProcessor::AbstractRequest.
|
inlineoverridevirtual |
Roll back any changes made by a request that did not complete due to errors.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle that was used by the request to modify the system state. |
Implements NES::RequestProcessor::AbstractRequest.
|
inlineoverridevirtual |
Roll back any changes made by a request that did not complete due to errors.
ex | The exception thrown during request execution. std::exception_ptr is used to be able to allow setting an exception state on the requests response promise without losing data to slicing in case the request cannot handle the exception itself |
storageHandle | The storage access handle that was used by the request to modify the system state. |
Implements NES::RequestProcessor::AbstractRequest.
std::atomic<uint32_t> NES::RequestProcessor::DummyRequest::responseValue |
Referenced by executeRequestLogic().