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/core/Stoppable.h>
25 #include <ripple/nodestore/Manager.h>
26 #include <ripple/protocol/ErrorCodes.h>
27 #include <boost/optional.hpp>
28 
29 namespace ripple {
30 
31 class TransactionMaster;
32 
37 class SHAMapStore : public Stoppable
38 {
39 public:
40  SHAMapStore(Stoppable& parent) : Stoppable("SHAMapStore", parent)
41  {
42  }
43 
45  virtual void
47 
48  virtual void
49  rendezvous() const = 0;
50 
51  virtual std::uint32_t
52  clampFetchDepth(std::uint32_t fetch_depth) const = 0;
53 
55  makeNodeStore(std::string const& name, std::int32_t readThreads) = 0;
56 
58  virtual LedgerIndex
59  setCanDelete(LedgerIndex canDelete) = 0;
60 
62  virtual bool
63  advisoryDelete() const = 0;
64 
68  virtual LedgerIndex
69  getLastRotated() = 0;
70 
72  virtual LedgerIndex
73  getCanDelete() = 0;
74 
76  virtual int
77  fdRequired() const = 0;
78 
95  virtual boost::optional<LedgerIndex>
96  minimumOnline() const = 0;
97 };
98 
99 //------------------------------------------------------------------------------
100 
103  Application& app,
104  Stoppable& parent,
105  NodeStore::Scheduler& scheduler,
106  beast::Journal journal);
107 } // namespace ripple
108 
109 #endif
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::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
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:780
ripple::SHAMapStore::SHAMapStore
SHAMapStore(Stoppable &parent)
Definition: SHAMapStore.h:40
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.