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 <boost/optional.hpp>
27 
28 namespace ripple {
29 
30 class TransactionMaster;
31 class Stoppable;
32 
38 {
39 public:
40  virtual ~SHAMapStore() = default;
41 
43  virtual void
45 
46  virtual void
47  rendezvous() const = 0;
48 
49  virtual std::uint32_t
50  clampFetchDepth(std::uint32_t fetch_depth) const = 0;
51 
53  makeNodeStore(std::string const& name, std::int32_t readThreads) = 0;
54 
56  virtual LedgerIndex
57  setCanDelete(LedgerIndex canDelete) = 0;
58 
60  virtual bool
61  advisoryDelete() const = 0;
62 
66  virtual LedgerIndex
67  getLastRotated() = 0;
68 
70  virtual LedgerIndex
71  getCanDelete() = 0;
72 
74  virtual int
75  fdRequired() const = 0;
76 
93  virtual boost::optional<LedgerIndex>
94  minimumOnline() const = 0;
95 };
96 
97 //------------------------------------------------------------------------------
98 
101  Application& app,
102  Stoppable& parent,
103  NodeStore::Scheduler& scheduler,
104  beast::Journal journal);
105 } // namespace ripple
106 
107 #endif
ripple::Application
Definition: Application.h:101
ripple::SHAMapStore::makeNodeStore
virtual std::unique_ptr< NodeStore::Database > makeNodeStore(std::string const &name, std::int32_t readThreads)=0
std::string
STL class.
std::shared_ptr
STL class.
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:37
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::Stoppable
Provides an interface for starting and stopping.
Definition: Stoppable.h:201
ripple::SHAMapStore::setCanDelete
virtual LedgerIndex setCanDelete(LedgerIndex canDelete)=0
Highest ledger that may be deleted.
ripple::SHAMapStore::minimumOnline
virtual boost::optional< LedgerIndex > minimumOnline() const =0
The minimum ledger to try and maintain in our database.
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::make_SHAMapStore
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, Stoppable &parent, NodeStore::Scheduler &scheduler, beast::Journal journal)
Definition: SHAMapStoreImp.cpp:793
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.
std::unique_ptr
STL class.