mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
254 lines
41 KiB
HTML
254 lines
41 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: DatabaseNodeImp.cpp Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_df9c78dcf3f59a33b12284f95992a64b.html">ripple</a></li><li class="navelem"><a class="el" href="dir_ceb6d1bc218d15504336f945ff1322da.html">nodestore</a></li><li class="navelem"><a class="el" href="dir_1eae1e3c362aa357dbf8694343222a03.html">impl</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">DatabaseNodeImp.cpp</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//------------------------------------------------------------------------------</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/*</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Copyright (c) 2012, 2013 Ripple Labs Inc.</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
|
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
|
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
|
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
|
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
|
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">*/</span></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">//==============================================================================</span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <ripple/app/ledger/Ledger.h></span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <ripple/nodestore/impl/DatabaseNodeImp.h></span></div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <ripple/protocol/HashPrefix.h></span></div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  </div>
|
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">namespace </span>NodeStore {</div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  </div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">void</span></div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a5f23a54188aa2329d979c937d932dbaf"> 28</a></span> <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a5f23a54188aa2329d979c937d932dbaf">DatabaseNodeImp::store</a>(</div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="namespaceripple.html#a57d7e7b27df7e719fdf5569f96be60a3">NodeObjectType</a> type,</div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/container/vector.html">Blob</a>&& data,</div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& hash,</div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a>)</div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">auto</span> nObj = <a class="code" href="classripple_1_1NodeObject.html#a841bb9bba547efbd89b240fa9c1cf146">NodeObject::createObject</a>(type, std::move(data), hash);</div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->canonicalize_replace_cache(hash, nObj);</div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a2edc67988dfa89034505c059fbe41503">backend_</a>->store(nObj);</div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->erase(hash);</div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="classripple_1_1NodeStore_1_1Database.html#a090e39b8c6733b0dc4553f9e8e705605">storeStats</a>(1, nObj->getData().size());</div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> }</div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keywordtype">bool</span></div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a6aa6a71d2359642125d44d950333c0e4"> 42</a></span> <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a6aa6a71d2359642125d44d950333c0e4">DatabaseNodeImp::asyncFetch</a>(</div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& hash,</div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> ledgerSeq,</div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr<NodeObject></a>& nodeObject)</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment">// See if the object is in cache</span></div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  nodeObject = <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->fetch(hash);</div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">if</span> (nodeObject || <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->touch_if_exists(hash))</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  </div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// Otherwise post a read</span></div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <a class="code" href="classripple_1_1NodeStore_1_1Database.html#abff61416b213b5ab28e482a61a9c80f8">Database::asyncFetch</a>(hash, ledgerSeq);</div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> }</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  </div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">void</span></div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#abe504ac619dae082bd15d7f16d12b786"> 58</a></span> <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#abe504ac619dae082bd15d7f16d12b786">DatabaseNodeImp::tune</a>(<span class="keywordtype">int</span> size, <a class="codeRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a> age)</div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->setTargetSize(size);</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->setTargetAge(age);</div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->setTargetSize(size);</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->setTargetAge(age);</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  </div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span></div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#af83b106a8e0f80ef92cc3140e1112ec0"> 67</a></span> <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#af83b106a8e0f80ef92cc3140e1112ec0">DatabaseNodeImp::sweep</a>()</div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> {</div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->sweep();</div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->sweep();</div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> }</div>
|
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr<NodeObject></a></div>
|
|
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a0e021f41fc02828e0a5cfeb076523f2e"> 74</a></span> <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a0e021f41fc02828e0a5cfeb076523f2e">DatabaseNodeImp::fetchNodeObject</a>(</div>
|
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& hash,</div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a>,</div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="structripple_1_1NodeStore_1_1FetchReport.html">FetchReport</a>& fetchReport)</div>
|
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> {</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="comment">// See if the node object exists in the cache</span></div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keyword">auto</span> nodeObject{<a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->fetch(hash)};</div>
|
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">if</span> (!nodeObject && !<a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->touch_if_exists(hash))</div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  {</div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">// Try the backend</span></div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  fetchReport.<a class="code" href="structripple_1_1NodeStore_1_1FetchReport.html#a3063c18d4ab5927e8a3cb129745a2ca3">wentToDisk</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  </div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350c">Status</a> status;</div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">try</span></div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  {</div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  status = <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a2edc67988dfa89034505c059fbe41503">backend_</a>->fetch(hash.<a class="code" href="classripple_1_1base__uint.html#a5342507fe2fb5ac55d578e7e98863f70">data</a>(), &nodeObject);</div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }</div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">catch</span> (<a class="codeRef" href="http://en.cppreference.com/w/cpp/error/exception.html">std::exception</a> <span class="keyword">const</span>& e)</div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  {</div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  JLOG(<a class="code" href="classripple_1_1NodeStore_1_1Database.html#a0d7c3d303adce36199b2c67c4df8a2de">j_</a>.<a class="code" href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">fatal</a>()) << <span class="stringliteral">"Exception, "</span> << e.<a class="codeRef" href="http://en.cppreference.com/w/cpp/error/exception/what.html">what</a>();</div>
|
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="namespaceripple.html#ad99788f1aca6ce31a1fe8365eee1bba3">Rethrow</a>();</div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  </div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">switch</span> (status)</div>
|
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {</div>
|
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordflow">case</span> <a class="code" href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350ca852178e08b8b1f2eb19fd271e63830ef">ok</a>:</div>
|
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  ++<a class="code" href="classripple_1_1NodeStore_1_1Database.html#a89497b9b4c5530b58040931489015d30">fetchHitCount_</a>;</div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">if</span> (nodeObject)</div>
|
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <a class="code" href="classripple_1_1NodeStore_1_1Database.html#a04150d23aa2acaf016d4ca40bd10804a">fetchSz_</a> += nodeObject->getData().size();</div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">case</span> <a class="code" href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350cafa8056068943efe12560207a8a503db8">notFound</a>:</div>
|
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">case</span> <a class="code" href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350ca915a2fc67fa0633b4995f8c1e4d54bdf">dataCorrupt</a>:</div>
|
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  JLOG(<a class="code" href="classripple_1_1NodeStore_1_1Database.html#a0d7c3d303adce36199b2c67c4df8a2de">j_</a>.<a class="code" href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">fatal</a>()) << <span class="stringliteral">"Corrupt NodeObject #"</span> << hash;</div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">default</span>:</div>
|
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  JLOG(<a class="code" href="classripple_1_1NodeStore_1_1Database.html#a0d7c3d303adce36199b2c67c4df8a2de">j_</a>.<a class="code" href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">warn</a>()) << <span class="stringliteral">"Unknown status="</span> << status;</div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">break</span>;</div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  }</div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
|
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">if</span> (!nodeObject)</div>
|
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  {</div>
|
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="comment">// Just in case a write occurred</span></div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  nodeObject = <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->fetch(hash);</div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">if</span> (!nodeObject)</div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="comment">// We give up</span></div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">nCache_</a>->insert(hash);</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  }</div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">else</span></div>
|
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  {</div>
|
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  fetchReport.<a class="code" href="structripple_1_1NodeStore_1_1FetchReport.html#a7ab35eb8a30af6dbc6ee916ccf60474d">wasFound</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  </div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="comment">// Ensure all threads get the same object</span></div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">pCache_</a>->canonicalize_replace_client(hash, nodeObject);</div>
|
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  </div>
|
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="comment">// Since this was a 'hard' fetch, we will log it</span></div>
|
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  JLOG(<a class="code" href="classripple_1_1NodeStore_1_1Database.html#a0d7c3d303adce36199b2c67c4df8a2de">j_</a>.<a class="code" href="classbeast_1_1Journal.html#abbe082bd27ca0f1d1365af2824e4f85b">trace</a>()) << <span class="stringliteral">"HOS: "</span> << hash << <span class="stringliteral">" fetch: in shard db"</span>;</div>
|
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div>
|
|
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  }</div>
|
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  </div>
|
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">return</span> nodeObject;</div>
|
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> }</div>
|
|
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  </div>
|
|
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> } <span class="comment">// namespace NodeStore</span></div>
|
|
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> } <span class="comment">// namespace ripple</span></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<div class="ttc" id="aclassbeast_1_1Journal_html_a3dfb8e2e3eecccdb5cf78ff21bca069c"><div class="ttname"><a href="classbeast_1_1Journal.html#a3dfb8e2e3eecccdb5cf78ff21bca069c">beast::Journal::fatal</a></div><div class="ttdeci">Stream fatal() const</div><div class="ttdef"><b>Definition:</b> <a href="Journal_8h_source.html#l00339">Journal.h:339</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a2edc67988dfa89034505c059fbe41503"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a2edc67988dfa89034505c059fbe41503">ripple::NodeStore::DatabaseNodeImp::backend_</a></div><div class="ttdeci">std::shared_ptr< Backend > backend_</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8h_source.html#l00131">DatabaseNodeImp.h:131</a></div></div>
|
|
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr< NodeObject ></a></div></div>
|
|
<div class="ttc" id="aexception_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/exception.html">std::exception</a></div><div class="ttdoc">STL class.</div></div>
|
|
<div class="ttc" id="aclassbeast_1_1Journal_html_abbe082bd27ca0f1d1365af2824e4f85b"><div class="ttname"><a href="classbeast_1_1Journal.html#abbe082bd27ca0f1d1365af2824e4f85b">beast::Journal::trace</a></div><div class="ttdeci">Stream trace() const</div><div class="ttdoc">Severity stream access functions.</div><div class="ttdef"><b>Definition:</b> <a href="Journal_8h_source.html#l00309">Journal.h:309</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1NodeStore_html_af127c2e4fc73b5d35647147ef45b350ca852178e08b8b1f2eb19fd271e63830ef"><div class="ttname"><a href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350ca852178e08b8b1f2eb19fd271e63830ef">ripple::NodeStore::ok</a></div><div class="ttdeci">@ ok</div><div class="ttdef"><b>Definition:</b> <a href="nodestore_2Types_8h_source.html#l00045">nodestore/Types.h:45</a></div></div>
|
|
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector< unsigned char ></a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a57d7e7b27df7e719fdf5569f96be60a3"><div class="ttname"><a href="namespaceripple.html#a57d7e7b27df7e719fdf5569f96be60a3">ripple::NodeObjectType</a></div><div class="ttdeci">NodeObjectType</div><div class="ttdoc">The types of node objects.</div><div class="ttdef"><b>Definition:</b> <a href="NodeObject_8h_source.html#l00032">NodeObject.h:32</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeObject_html_a841bb9bba547efbd89b240fa9c1cf146"><div class="ttname"><a href="classripple_1_1NodeObject.html#a841bb9bba547efbd89b240fa9c1cf146">ripple::NodeObject::createObject</a></div><div class="ttdeci">static std::shared_ptr< NodeObject > createObject(NodeObjectType type, Blob &&data, uint256 const &hash)</div><div class="ttdoc">Create an object from fields.</div><div class="ttdef"><b>Definition:</b> <a href="NodeObject_8cpp_source.html#l00037">NodeObject.cpp:37</a></div></div>
|
|
<div class="ttc" id="aduration_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a0e021f41fc02828e0a5cfeb076523f2e"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a0e021f41fc02828e0a5cfeb076523f2e">ripple::NodeStore::DatabaseNodeImp::fetchNodeObject</a></div><div class="ttdeci">std::shared_ptr< NodeObject > fetchNodeObject(uint256 const &hash, std::uint32_t, FetchReport &fetchReport) override</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8cpp_source.html#l00074">DatabaseNodeImp.cpp:74</a></div></div>
|
|
<div class="ttc" id="aclassbeast_1_1Journal_html_ad8fefe3e8ad583e1ed1bf02094ac3d8f"><div class="ttname"><a href="classbeast_1_1Journal.html#ad8fefe3e8ad583e1ed1bf02094ac3d8f">beast::Journal::warn</a></div><div class="ttdeci">Stream warn() const</div><div class="ttdef"><b>Definition:</b> <a href="Journal_8h_source.html#l00327">Journal.h:327</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1Database_html_a04150d23aa2acaf016d4ca40bd10804a"><div class="ttname"><a href="classripple_1_1NodeStore_1_1Database.html#a04150d23aa2acaf016d4ca40bd10804a">ripple::NodeStore::Database::fetchSz_</a></div><div class="ttdeci">std::atomic< std::uint32_t > fetchSz_</div><div class="ttdef"><b>Definition:</b> <a href="Database_8h_source.html#l00252">Database.h:252</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1NodeStore_1_1FetchReport_html"><div class="ttname"><a href="structripple_1_1NodeStore_1_1FetchReport.html">ripple::NodeStore::FetchReport</a></div><div class="ttdoc">Contains information about a fetch operation.</div><div class="ttdef"><b>Definition:</b> <a href="ripple_2nodestore_2Scheduler_8h_source.html#l00032">ripple/nodestore/Scheduler.h:32</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1Database_html_a89497b9b4c5530b58040931489015d30"><div class="ttname"><a href="classripple_1_1NodeStore_1_1Database.html#a89497b9b4c5530b58040931489015d30">ripple::NodeStore::Database::fetchHitCount_</a></div><div class="ttdeci">std::atomic< std::uint32_t > fetchHitCount_</div><div class="ttdef"><b>Definition:</b> <a href="Database_8h_source.html#l00251">Database.h:251</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_abe504ac619dae082bd15d7f16d12b786"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#abe504ac619dae082bd15d7f16d12b786">ripple::NodeStore::DatabaseNodeImp::tune</a></div><div class="ttdeci">void tune(int size, std::chrono::seconds age) override</div><div class="ttdoc">Set the maximum number of entries and maximum cache age for both caches.</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8cpp_source.html#l00058">DatabaseNodeImp.cpp:58</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html_a5342507fe2fb5ac55d578e7e98863f70"><div class="ttname"><a href="classripple_1_1base__uint.html#a5342507fe2fb5ac55d578e7e98863f70">ripple::base_uint::data</a></div><div class="ttdeci">pointer data()</div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00103">base_uint.h:103</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1NodeStore_html_af127c2e4fc73b5d35647147ef45b350cafa8056068943efe12560207a8a503db8"><div class="ttname"><a href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350cafa8056068943efe12560207a8a503db8">ripple::NodeStore::notFound</a></div><div class="ttdeci">@ notFound</div><div class="ttdef"><b>Definition:</b> <a href="nodestore_2Types_8h_source.html#l00046">nodestore/Types.h:46</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint< 256 ></a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a43f4e702f8a28e14e0bbe08e1b6c6aa5"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a43f4e702f8a28e14e0bbe08e1b6c6aa5">ripple::NodeStore::DatabaseNodeImp::pCache_</a></div><div class="ttdeci">std::shared_ptr< TaggedCache< uint256, NodeObject > > pCache_</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8h_source.html#l00125">DatabaseNodeImp.h:125</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ad99788f1aca6ce31a1fe8365eee1bba3"><div class="ttname"><a href="namespaceripple.html#ad99788f1aca6ce31a1fe8365eee1bba3">ripple::Rethrow</a></div><div class="ttdeci">void Rethrow()</div><div class="ttdoc">Rethrow the exception currently being handled.</div><div class="ttdef"><b>Definition:</b> <a href="contract_8h_source.html#l00048">contract.h:48</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1NodeStore_html_af127c2e4fc73b5d35647147ef45b350ca915a2fc67fa0633b4995f8c1e4d54bdf"><div class="ttname"><a href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350ca915a2fc67fa0633b4995f8c1e4d54bdf">ripple::NodeStore::dataCorrupt</a></div><div class="ttdeci">@ dataCorrupt</div><div class="ttdef"><b>Definition:</b> <a href="nodestore_2Types_8h_source.html#l00047">nodestore/Types.h:47</a></div></div>
|
|
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1Database_html_a090e39b8c6733b0dc4553f9e8e705605"><div class="ttname"><a href="classripple_1_1NodeStore_1_1Database.html#a090e39b8c6733b0dc4553f9e8e705605">ripple::NodeStore::Database::storeStats</a></div><div class="ttdeci">void storeStats(std::uint64_t count, std::uint64_t sz)</div><div class="ttdef"><b>Definition:</b> <a href="Database_8h_source.html#l00258">Database.h:258</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a6aa6a71d2359642125d44d950333c0e4"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a6aa6a71d2359642125d44d950333c0e4">ripple::NodeStore::DatabaseNodeImp::asyncFetch</a></div><div class="ttdeci">bool asyncFetch(uint256 const &hash, std::uint32_t ledgerSeq, std::shared_ptr< NodeObject > &nodeObject) override</div><div class="ttdoc">Fetch an object without waiting.</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8cpp_source.html#l00042">DatabaseNodeImp.cpp:42</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a5f23a54188aa2329d979c937d932dbaf"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a5f23a54188aa2329d979c937d932dbaf">ripple::NodeStore::DatabaseNodeImp::store</a></div><div class="ttdeci">void store(NodeObjectType type, Blob &&data, uint256 const &hash, std::uint32_t) override</div><div class="ttdoc">Store the object.</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8cpp_source.html#l00028">DatabaseNodeImp.cpp:28</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_a8c8554053c68cd10c47edf735bcda7ad"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#a8c8554053c68cd10c47edf735bcda7ad">ripple::NodeStore::DatabaseNodeImp::nCache_</a></div><div class="ttdeci">std::shared_ptr< KeyCache< uint256 > > nCache_</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8h_source.html#l00128">DatabaseNodeImp.h:128</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1NodeStore_html_af127c2e4fc73b5d35647147ef45b350c"><div class="ttname"><a href="namespaceripple_1_1NodeStore.html#af127c2e4fc73b5d35647147ef45b350c">ripple::NodeStore::Status</a></div><div class="ttdeci">Status</div><div class="ttdoc">Return codes from Backend operations.</div><div class="ttdef"><b>Definition:</b> <a href="nodestore_2Types_8h_source.html#l00044">nodestore/Types.h:44</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1Database_html_abff61416b213b5ab28e482a61a9c80f8"><div class="ttname"><a href="classripple_1_1NodeStore_1_1Database.html#abff61416b213b5ab28e482a61a9c80f8">ripple::NodeStore::Database::asyncFetch</a></div><div class="ttdeci">virtual bool asyncFetch(uint256 const &hash, std::uint32_t ledgerSeq, std::shared_ptr< NodeObject > &nodeObject)=0</div><div class="ttdoc">Fetch an object without waiting.</div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1Database_html_a0d7c3d303adce36199b2c67c4df8a2de"><div class="ttname"><a href="classripple_1_1NodeStore_1_1Database.html#a0d7c3d303adce36199b2c67c4df8a2de">ripple::NodeStore::Database::j_</a></div><div class="ttdeci">const beast::Journal j_</div><div class="ttdef"><b>Definition:</b> <a href="Database_8h_source.html#l00247">Database.h:247</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1NodeStore_1_1DatabaseNodeImp_html_af83b106a8e0f80ef92cc3140e1112ec0"><div class="ttname"><a href="classripple_1_1NodeStore_1_1DatabaseNodeImp.html#af83b106a8e0f80ef92cc3140e1112ec0">ripple::NodeStore::DatabaseNodeImp::sweep</a></div><div class="ttdeci">void sweep() override</div><div class="ttdoc">Remove expired entries from the positive and negative caches.</div><div class="ttdef"><b>Definition:</b> <a href="DatabaseNodeImp_8cpp_source.html#l00067">DatabaseNodeImp.cpp:67</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1NodeStore_1_1FetchReport_html_a7ab35eb8a30af6dbc6ee916ccf60474d"><div class="ttname"><a href="structripple_1_1NodeStore_1_1FetchReport.html#a7ab35eb8a30af6dbc6ee916ccf60474d">ripple::NodeStore::FetchReport::wasFound</a></div><div class="ttdeci">bool wasFound</div><div class="ttdef"><b>Definition:</b> <a href="ripple_2nodestore_2Scheduler_8h_source.html#l00041">ripple/nodestore/Scheduler.h:41</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1NodeStore_1_1FetchReport_html_a3063c18d4ab5927e8a3cb129745a2ca3"><div class="ttname"><a href="structripple_1_1NodeStore_1_1FetchReport.html#a3063c18d4ab5927e8a3cb129745a2ca3">ripple::NodeStore::FetchReport::wentToDisk</a></div><div class="ttdeci">bool wentToDisk</div><div class="ttdef"><b>Definition:</b> <a href="ripple_2nodestore_2Scheduler_8h_source.html#l00040">ripple/nodestore/Scheduler.h:40</a></div></div>
|
|
<div class="ttc" id="awhat_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/exception/what.html">std::exception::what</a></div><div class="ttdeci">T what(T... args)</div></div>
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|