xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
nodestore
include/xrpl/nodestore/Scheduler.h
1
#pragma once
2
3
#include <xrpl/nodestore/Task.h>
4
5
#include <
chrono
>
6
7
namespace
xrpl::node_store
{
8
9
enum class
FetchType
{
Synchronous
,
Async
};
10
14
struct
FetchReport
15
{
16
explicit
FetchReport
(
FetchType
fetchType
) :
fetchType
(
fetchType
)
17
{
18
}
19
20
std::chrono::milliseconds
elapsed
{};
21
FetchType
const
fetchType
;
22
bool
wasFound
=
false
;
23
};
24
28
struct
BatchWriteReport
29
{
30
explicit
BatchWriteReport
() =
default
;
31
32
std::chrono::milliseconds
elapsed
;
33
int
writeCount
;
34
};
35
45
class
Scheduler
46
{
47
public
:
48
virtual
~Scheduler
() =
default
;
49
56
virtual
void
57
scheduleTask
(
Task
& task) = 0;
58
63
virtual
void
64
onFetch
(
FetchReport
const
& report) = 0;
65
70
virtual
void
71
onBatchWrite
(
BatchWriteReport
const
& report) = 0;
72
};
73
74
}
// namespace xrpl::node_store
chrono
xrpl::node_store::Scheduler
Scheduling for asynchronous backend activity.
Definition
include/xrpl/nodestore/Scheduler.h:46
xrpl::node_store::Scheduler::onBatchWrite
virtual void onBatchWrite(BatchWriteReport const &report)=0
Reports the completion of a batch write Allows the scheduler to monitor the node store's performance.
xrpl::node_store::Scheduler::onFetch
virtual void onFetch(FetchReport const &report)=0
Reports completion of a fetch Allows the scheduler to monitor the node store's performance.
xrpl::node_store::Scheduler::scheduleTask
virtual void scheduleTask(Task &task)=0
Schedules a task.
xrpl::node_store::Scheduler::~Scheduler
virtual ~Scheduler()=default
std::chrono::milliseconds
xrpl::node_store
Definition
ServiceRegistry.h:18
xrpl::node_store::FetchType
FetchType
Definition
include/xrpl/nodestore/Scheduler.h:9
xrpl::node_store::FetchType::Async
@ Async
Definition
include/xrpl/nodestore/Scheduler.h:9
xrpl::node_store::FetchType::Synchronous
@ Synchronous
Definition
include/xrpl/nodestore/Scheduler.h:9
xrpl::node_store::BatchWriteReport
Contains information about a batch write operation.
Definition
include/xrpl/nodestore/Scheduler.h:29
xrpl::node_store::BatchWriteReport::BatchWriteReport
BatchWriteReport()=default
xrpl::node_store::BatchWriteReport::writeCount
int writeCount
Definition
include/xrpl/nodestore/Scheduler.h:33
xrpl::node_store::BatchWriteReport::elapsed
std::chrono::milliseconds elapsed
Definition
include/xrpl/nodestore/Scheduler.h:32
xrpl::node_store::FetchReport
Contains information about a fetch operation.
Definition
include/xrpl/nodestore/Scheduler.h:15
xrpl::node_store::FetchReport::wasFound
bool wasFound
Definition
include/xrpl/nodestore/Scheduler.h:22
xrpl::node_store::FetchReport::fetchType
FetchType const fetchType
Definition
include/xrpl/nodestore/Scheduler.h:21
xrpl::node_store::FetchReport::FetchReport
FetchReport(FetchType fetchType)
Definition
include/xrpl/nodestore/Scheduler.h:16
xrpl::node_store::FetchReport::elapsed
std::chrono::milliseconds elapsed
Definition
include/xrpl/nodestore/Scheduler.h:20
xrpl::node_store::Task
Derived classes perform scheduled tasks.
Definition
Task.h:9
Generated by
1.17.0