rippled
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 <ripple/app/ledger/Ledger.h>
24 #include <ripple/nodestore/Manager.h>
25 #include <ripple/protocol/ErrorCodes.h>
26 #include <optional>
27 
28 namespace ripple {
29 
30 class TransactionMaster;
31 
37 {
38 public:
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
72  getLastRotated() = 0;
73 
75  virtual LedgerIndex
76  getCanDelete() = 0;
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
ripple::Application
Definition: Application.h:115
ripple::SHAMapStore::makeNodeStore
virtual std::unique_ptr< NodeStore::Database > makeNodeStore(int readThreads)=0
std::shared_ptr
STL class.
ripple::SHAMapStore::minimumOnline
virtual std::optional< LedgerIndex > minimumOnline() const =0
The minimum ledger to try and maintain in our database.
ripple::SHAMapStore::~SHAMapStore
virtual ~SHAMapStore()=default
ripple::SHAMapStore::onLedgerClosed
virtual void onLedgerClosed(std::shared_ptr< Ledger const > const &ledger)=0
Called by LedgerMaster every time a ledger validates.
ripple::SHAMapStore
class to create database, launch online delete thread, and related SQLite database
Definition: SHAMapStore.h:36
ripple::SHAMapStore::stop
virtual void stop()=0
ripple::SHAMapStore::rendezvous
virtual void rendezvous() const =0
ripple::SHAMapStore::getLastRotated
virtual LedgerIndex getLastRotated()=0
Maximum ledger that has been deleted, or will be deleted if currently in the act of online deletion.
ripple::SHAMapStore::advisoryDelete
virtual bool advisoryDelete() const =0
Whether advisory delete is enabled.
ripple::SHAMapStore::clampFetchDepth
virtual std::uint32_t clampFetchDepth(std::uint32_t fetch_depth) const =0
ripple::SHAMapStore::setCanDelete
virtual LedgerIndex setCanDelete(LedgerIndex canDelete)=0
Highest ledger that may be deleted.
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint32_t
ripple::NodeStore::Scheduler
Scheduling for asynchronous backend activity.
Definition: ripple/nodestore/Scheduler.h:60
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::SHAMapStore::getCanDelete
virtual LedgerIndex getCanDelete()=0
Highest ledger that may be deleted.
ripple::SHAMapStore::fdRequired
virtual int fdRequired() const =0
Returns the number of file descriptors that are needed.
optional
ripple::make_SHAMapStore
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
Definition: SHAMapStoreImp.cpp:728
std::unique_ptr
STL class.
ripple::SHAMapStore::start
virtual void start()=0