#include <AbstractRequest.hpp>
|
virtual void | preRollbackHandle (std::exception_ptr ex, const StorageHandlerPtr &storageHandle)=0 |
| Performs request specific error handling to be done before changes to the storage are rolled back. More...
|
|
virtual void | postRollbackHandle (std::exception_ptr ex, const StorageHandlerPtr &storageHandle)=0 |
| Performs request specific error handling to be done after changes to the storage are rolled back. 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...
|
|
◆ AbstractRequest()
NES::RequestProcessor::AbstractRequest::AbstractRequest |
( |
uint8_t |
maxRetries | ) |
|
|
explicit |
constructor
- Parameters
-
maxRetries | amount of retries to execute the request after execution failed due to errors |
◆ ~AbstractRequest()
virtual NES::RequestProcessor::AbstractRequest::~AbstractRequest |
( |
| ) |
|
|
virtualdefault |
◆ as()
template<class RequestType >
std::shared_ptr<RequestType> NES::RequestProcessor::AbstractRequest::as |
( |
| ) |
|
|
inline |
Dynamically casts the exception to the given type.
- Template Parameters
-
- Returns
- returns a shared pointer of the given type
◆ execute()
◆ getFuture()
◆ handleError()
◆ instanceOf()
template<class RequestType >
bool NES::RequestProcessor::AbstractRequest::instanceOf |
( |
| ) |
|
|
inline |
◆ postRollbackHandle()
virtual void NES::RequestProcessor::AbstractRequest::postRollbackHandle |
( |
std::exception_ptr |
ex, |
|
|
const StorageHandlerPtr & |
storageHandle |
|
) |
| |
|
protectedpure virtual |
Performs request specific error handling to be done after changes to the storage are rolled back.
- Parameters
-
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 |
Implemented in NES::RequestProcessor::DummyRequest, NES::RequestProcessor::DummyRequest, NES::RequestProcessor::Experimental::DummyMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureRequest, NES::RequestProcessor::Experimental::DummyConcatRequest, NES::RequestProcessor::StopQueryRequest, NES::RequestProcessor::FailQueryRequest, NES::RequestProcessor::ExplainRequest, NES::RequestProcessor::AddQueryRequest, NES::RequestProcessor::UpdateSourceCatalogRequest, NES::RequestProcessor::GetSourceCatalogRequest, and NES::RequestProcessor::ISQPRequest.
Referenced by handleError().
◆ preRollbackHandle()
virtual void NES::RequestProcessor::AbstractRequest::preRollbackHandle |
( |
std::exception_ptr |
ex, |
|
|
const StorageHandlerPtr & |
storageHandle |
|
) |
| |
|
protectedpure virtual |
Performs request specific error handling to be done before changes to the storage are rolled back.
- Parameters
-
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 |
Implemented in NES::RequestProcessor::DummyRequest, NES::RequestProcessor::DummyRequest, NES::RequestProcessor::Experimental::DummyMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureRequest, NES::RequestProcessor::Experimental::DummyConcatRequest, NES::RequestProcessor::StopQueryRequest, NES::RequestProcessor::FailQueryRequest, NES::RequestProcessor::ExplainRequest, NES::RequestProcessor::AddQueryRequest, NES::RequestProcessor::UpdateSourceCatalogRequest, NES::RequestProcessor::GetSourceCatalogRequest, and NES::RequestProcessor::ISQPRequest.
Referenced by handleError().
◆ retry()
bool NES::RequestProcessor::AbstractRequest::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.
- Returns
- true if the actual retries are less than the allowed maximum
Referenced by handleError().
◆ rollBack()
Roll back any changes made by a request that did not complete due to errors.
- Parameters
-
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. |
- Returns
- a list of follow up requests to be executed (can be empty if no further actions are required)
Implemented in NES::RequestProcessor::DummyRequest, NES::RequestProcessor::DummyRequest, NES::RequestProcessor::Experimental::DummyMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureMultiRequest, NES::RequestProcessor::Experimental::DummyWaitOnFutureRequest, NES::RequestProcessor::Experimental::DummyConcatRequest, NES::RequestProcessor::StopQueryRequest, NES::RequestProcessor::UpdateSourceCatalogRequest, NES::RequestProcessor::GetSourceCatalogRequest, NES::RequestProcessor::ISQPRequest, NES::RequestProcessor::FailQueryRequest, NES::RequestProcessor::ExplainRequest, and NES::RequestProcessor::AddQueryRequest.
Referenced by handleError().
◆ setExceptionInPromiseOrRethrow()
void NES::RequestProcessor::AbstractRequest::setExceptionInPromiseOrRethrow |
( |
std::exception_ptr |
exception | ) |
|
|
protected |
◆ setId()
void NES::RequestProcessor::AbstractRequest::setId |
( |
RequestId |
requestId | ) |
|
◆ trySetExceptionInPromise()
void NES::RequestProcessor::AbstractRequest::trySetExceptionInPromise |
( |
std::exception_ptr |
exception | ) |
|
|
protected |
◆ requestId
RequestId NES::RequestProcessor::AbstractRequest::requestId {INVALID_REQUEST_ID} |
|
protected |
Referenced by NES::RequestProcessor::AbstractUniRequest::execute(), NES::RequestProcessor::ISQPRequest::executeRequestLogic(), NES::RequestProcessor::GetSourceCatalogRequest::executeRequestLogic(), NES::RequestProcessor::UpdateSourceCatalogRequest::executeRequestLogic(), NES::RequestProcessor::StopQueryRequest::executeRequestLogic(), NES::RequestProcessor::AddQueryRequest::executeRequestLogic(), NES::RequestProcessor::ExplainRequest::executeRequestLogic(), NES::RequestProcessor::FailQueryRequest::executeRequestLogic(), NES::RequestProcessor::AbstractUniRequest::getResourceLockingId(), NES::RequestProcessor::FailQueryRequest::postExecution(), NES::RequestProcessor::StopQueryRequest::postExecution(), NES::RequestProcessor::Experimental::DummyWaitOnFutureRequest::postExecution(), and setId().
◆ responsePromise
Referenced by NES::RequestProcessor::Experimental::DummyWaitOnFutureMultiRequest::executeRequestLogic(), NES::RequestProcessor::Experimental::DummyMultiRequest::executeRequestLogic(), NES::RequestProcessor::DummyRequest::executeRequestLogic(), NES::RequestProcessor::Experimental::DummyConcatRequest::executeRequestLogic(), NES::RequestProcessor::ISQPRequest::executeRequestLogic(), NES::RequestProcessor::UpdateSourceCatalogRequest::executeRequestLogic(), NES::RequestProcessor::StopQueryRequest::executeRequestLogic(), NES::RequestProcessor::AddQueryRequest::executeRequestLogic(), NES::RequestProcessor::ExplainRequest::executeRequestLogic(), NES::RequestProcessor::FailQueryRequest::executeRequestLogic(), NES::RequestProcessor::Experimental::DummyWaitOnFutureRequest::executeRequestLogic(), getFuture(), setExceptionInPromiseOrRethrow(), and trySetExceptionInPromise().
The documentation for this class was generated from the following files: