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#include <xrpld/nodestore/Manager.h>
25
26#include <optional>
27
28namespace ripple {
29
30class TransactionMaster;
31
37{
38public:
39 virtual ~SHAMapStore() = default;
40
42 virtual void
44
45 virtual void
46 start() = 0;
47
48 virtual void
49 rendezvous() const = 0;
50
51 virtual void
52 stop() = 0;
53
54 virtual std::uint32_t
55 clampFetchDepth(std::uint32_t fetch_depth) const = 0;
56
58 makeNodeStore(int readThreads) = 0;
59
61 virtual LedgerIndex
62 setCanDelete(LedgerIndex canDelete) = 0;
63
65 virtual bool
66 advisoryDelete() const = 0;
67
71 virtual LedgerIndex
73
75 virtual LedgerIndex
77
79 virtual int
80 fdRequired() const = 0;
81
99 minimumOnline() const = 0;
100};
101
102//------------------------------------------------------------------------------
103
106 Application& app,
107 NodeStore::Scheduler& scheduler,
108 beast::Journal journal);
109} // namespace ripple
110
111#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:37
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)