rippled
Loading...
Searching...
No Matches
SHAMapStore.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_APP_MISC_SHAMAPSTORE_H_INCLUDED
21#define RIPPLE_APP_MISC_SHAMAPSTORE_H_INCLUDED
22
23#include <xrpld/app/ledger/Ledger.h>
24
25#include <xrpl/nodestore/Manager.h>
26
27#include <optional>
28
29namespace ripple {
30
31class TransactionMaster;
32
38{
39public:
40 virtual ~SHAMapStore() = default;
41
43 virtual void
45
46 virtual void
47 start() = 0;
48
49 virtual void
50 rendezvous() const = 0;
51
52 virtual void
53 stop() = 0;
54
55 virtual std::uint32_t
56 clampFetchDepth(std::uint32_t fetch_depth) const = 0;
57
59 makeNodeStore(int readThreads) = 0;
60
62 virtual LedgerIndex
63 setCanDelete(LedgerIndex canDelete) = 0;
64
66 virtual bool
67 advisoryDelete() const = 0;
68
72 virtual LedgerIndex
74
76 virtual LedgerIndex
78
80 virtual int
81 fdRequired() const = 0;
82
100 minimumOnline() const = 0;
101};
102
103//------------------------------------------------------------------------------
104
107 Application& app,
108 NodeStore::Scheduler& scheduler,
109 beast::Journal journal);
110} // namespace ripple
111
112#endif
A generic endpoint for log messages.
Definition Journal.h:60
Scheduling for asynchronous backend activity.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:38
virtual void start()=0
virtual LedgerIndex setCanDelete(LedgerIndex canDelete)=0
Highest ledger that may be deleted.
virtual void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger)=0
Called by LedgerMaster every time a ledger validates.
virtual void stop()=0
virtual std::uint32_t clampFetchDepth(std::uint32_t fetch_depth) const =0
virtual bool advisoryDelete() const =0
Whether advisory delete is enabled.
virtual LedgerIndex getLastRotated()=0
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
virtual ~SHAMapStore()=default
virtual int fdRequired() const =0
Returns the number of file descriptors that are needed.
virtual LedgerIndex getCanDelete()=0
Highest ledger that may be deleted.
virtual void rendezvous() const =0
virtual std::optional< LedgerIndex > minimumOnline() const =0
The minimum ledger to try and maintain in our database.
virtual std::unique_ptr< NodeStore::Database > makeNodeStore(int readThreads)=0
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)