<div dir="ltr">Sorry again:<div><br></div><div>Now I'm REALLY confused.  The note in the documentation for doBeforeErase says:</div><div><br></div><div><dt style="font-weight:bold;color:rgb(0,0,0);font-family:"lucida grande",verdana,geneva,arial,sans-serif;font-size:13px">Note</dt><dd style="margin-bottom:6px;color:rgb(0,0,0);font-family:"lucida grande",verdana,geneva,arial,sans-serif;font-size:13px">This will not be invoked for an entry being evicted by policy.</dd></div><div><br></div><div>Besides the policy, what else is responsible for evicting an item?  In the LRU and Priority FIFO, it seems an emitSignal is called, which I assume is supposed to trigger beforeErase, which calls doBeforeErase?  This is a confusing spider web.  Hopefully you can help me untangle it.  :)</div><div><br></div><div>I'm headed to bed.  I'd really appreciate some clarification on these issues.  </div><div><br></div><div>Thanks so much for your patience, everyone,</div><div><br></div><div>John</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 4, 2016 at 2:23 AM, John Baugh <span dir="ltr"><<a href="mailto:jpbaugh@umich.edu" target="_blank">jpbaugh@umich.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">All -<div><br></div><div>As a follow up, I noticed that <b>emitSignal(beforeEvict, i); </b>is called in both the LRU and Priority FIFO Policies.  Is <b>this </b>what tells the Cs to remove the actual data, as the Policy subclass should also mimic / mirror the removal from its "secondary index" (to quote Junxiao)?  I assume since it's not just calling beforeEvict or something that it must be doing something besides just that.</div><div><br></div><div>This may be the last major piece to my puzzle of figuring out what is going on.</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 3, 2016 at 8:00 PM, John Baugh <span dir="ltr"><<a href="mailto:jpbaugh@umich.edu" target="_blank">jpbaugh@umich.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Junxiao and Muhammad,<div><br></div><div>Thank you for your responses.  For a little more clarification regarding where the actual data entries are stored:</div><div><br></div><div>When I look at cs.hpp:  <b><a href="http://ndnsim.net/2.1/doxygen/cs_8hpp_source.html" target="_blank">http://ndnsim.net/2.1/doxygen<wbr>/cs_8hpp_source.html</a></b>, and also the cs.cpp file: <b><a href="http://ndnsim.net/2.1/doxygen/cs_8cpp_source.html" target="_blank">http://ndnsim.net/2.1/doxygen/<wbr>cs_8cpp_source.html</a></b>, I see the following:</div><div><br></div><div>In the Cs <b>HPP , </b>I see as data (private)<b>:</b></div><div><b><br></b></div><b>Table m_table;<br>unique_ptr<Policy> m_policy;<br>ndn::util::signal::ScopedConne<wbr>ction m_beforeEvictConnection;</b><div><b><br></b></div><div><b><br></b></div><div>So, a table (of entry names?), a smart pointer to the Policy (possibly with a polymorphic object), and a signal - no data.</div><div><br></div><div>In the Cs <b>CPP</b>, I see nothing indicating insertion of data, except <i>through </i>the policy.</div><div><br></div><div>On the contrary, when I look at one of the <b>Policy classes</b>, such as in the FIFO policy (<a href="http://ndnsim.net/2.1/doxygen/cs-policy-priority-fifo_8cpp_source.html" target="_blank">http://ndnsim.net/2.1/doxygen<wbr>/cs-policy-priority-fifo_8cpp_<wbr>source.html</a>) I see use of what appears to be a map of entries, and an actual queue (m_queue).</div><div><br></div><div>I'm just trying to wrap my head around what is going where.</div><div><br></div><div>I've been told, or given the impression, that if you want to change the caching algorithm (cache replacement, caching) then the route to go is to provide a subclass of the <b>Policy</b>, NOT the <b>Cs </b>itself.</div><div><br></div><div>Thanks a ton, everyone,</div><div><br></div><div>John</div></div><div class="m_-4250127805599743925HOEnZb"><div class="m_-4250127805599743925h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 3, 2016 at 6:58 AM, Junxiao Shi <span dir="ltr"><<a href="mailto:shijunxiao@email.arizona.edu" target="_blank">shijunxiao@email.arizona.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="white-space:pre-wrap">Hi John<br><br>1. With few exceptions, names beginning with /localhost/nfd belong to NFD Management protocol <a href="https://redmine.named-data.net/projects/nfd/wiki/Management" target="_blank">https://redmine.named-data.net<wbr>/projects/nfd/wiki/Management</a> . NFD Management protocol is designed as an NDN application layer protocol, so its packets show up as Interests and Data. CS caches them just as any other Data.<br>2. Yes, NS_LOG allows one to enable and disable each logging component individually via NS_LOG environ at runtime. For tracers, see <a href="https://www.nsnam.org/docs/release/3.25/manual/html/tracing.html" target="_blank">https://www.nsnam.org/docs/rel<wbr>ease/3.25/manual/html/tracing.<wbr>html</a> "tracing motivation" and remember that NS_LOG will not work if ns-3 is compiled in release mode.<br>3. No. CS itself caches the Data inside nfd::cs::Entry class and maintains an index based on names. The argument passed to Policy APIs is the iterator on CS's primary index, and Policy maintains a secondary index of those iterators used for eviction. The reason for this separation is to support different Policy types with standard C++ subclasses, rather than complex compile-time templates (which was used in ndnSIM 1.0 and appears as "old ContentStore").<br><br>Yours, Junxiao</div><br><div class="gmail_quote"><div><div class="m_-4250127805599743925m_-127563313172133322h5"><div dir="ltr">On Fri, Dec 2, 2016 at 23:54 John Baugh <<a href="mailto:jpbaugh@umich.edu" target="_blank">jpbaugh@umich.edu</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4250127805599743925m_-127563313172133322h5"><div dir="ltr" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">Greetings all,<div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">I'm playing around with some of the content store stuff at the moment and have a couple questions.</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">Here are the relevant files to my questions:<br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><b class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">My primary simulation file:</b></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><a href="https://drive.google.com/open?id=0By9ufeKqmJYYN0dLMENXOVJjSlE" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg" target="_blank">https://drive.google.com/open?<wbr>id=0By9ufeKqmJYYN0dLMENXOVJjSl<wbr>E</a><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><b class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">My derived / customized policy class:</b></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><a href="https://drive.google.com/open?id=0By9ufeKqmJYYYUZOQUZFd21ORDA" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg" target="_blank">https://drive.google.com/open?<wbr>id=0By9ufeKqmJYYYUZOQUZFd21ORD<wbr>A</a><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><b class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">The output of the contents of Content Store:</b></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><a href="https://drive.google.com/open?id=0By9ufeKqmJYYTXdCMU1nN3lYeFU" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg" target="_blank">https://drive.google.com/open?<wbr>id=0By9ufeKqmJYYTXdCMU1nN3lYeF<wbr>U</a><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">Questions:</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">1.)  I figure the stuff with /prefix/.... in front of it is just randomized / pseudorandomly generated items just starting with /prefix.  But <b class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">what in the world is </b>the other garbage being printed to the file?  Usually it's something like /localhost/nfd/faces/enable-lo<wbr>cal/control/<random string>.</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">Is this some sort of setup information / link confirmation ACK or something that the nodes send/receive?  Why is the CS caching it as if it were data?  </div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">2.)  Is there a significant advantage to using one of the NS_LOG or tracers over using standard <fstream> library objects?</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">3.)  If I understand correctly, the <b class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">POLICY </b>is responsible for actually caching the data?  I assume that's all handled with the doBeforeInsert and the related virtual functions, like the policies that ndnSIM provides (FIFO, LRU, etc.), correct?  The Content Store object itself seems to just cache the <i class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">names</i> and not the actual data?</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">Thanks,</div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg"></div><div class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">John</div></div></div></div><span>
______________________________<wbr>_________________<br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">
ndnSIM mailing list<br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">
<a href="mailto:ndnSIM@lists.cs.ucla.edu" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg" target="_blank">http://www.lists.cs.ucla.edu/m<wbr>ailman/listinfo/ndnsim</a><br class="m_-4250127805599743925m_-127563313172133322m_-4451462359308866137gmail_msg">
</span></blockquote></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>