<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1454472732;
        mso-list-template-ids:-1;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><div><div><p class=MsoNormal>Hi John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m answering about NFD 0.5.0.</p></div><div><ol start=1 type=1><li class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;mso-list:l0 level1 lfo1'>The NFD developer documentation makes mention of <b>admission policy</b> related to the content store.  Is this the CachePolicy?</li></ol><p class=MsoNormal>No. CachePolicy belongs to NDNLPv2.</p><p class=MsoNormal>In ContentStore, there is only one policy: <span style='font-family:"Courier New"'>nfd::cs::Policy</span>. This type serves as both admission policy and eviction policy.</p><p class=MsoNormal>To implement an admission policy, override <span style='font-family:"Courier New"'>doAfterInsert</span> method, check the newly inserted data, and evict it right away if the policy decides not the admit the data. Although the data is already inserted to the lookup index when <span style='font-family:"Courier New"'>doAfterInsert</span> is invoked, evicting it immediately is equivalent to not admitting it.</p><p class=MsoNormal>The rationale of not having a “before insert” API is to reduce the number of virtual functions a policy must override.</p><ol start=2 type=1><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1'>In order to customize how data (perhaps, rather what data) makes it in to the CS and what is removed when, do I subclass CachePolicy?</li></ol><p class=MsoNormal>No. You should subclass <span style='font-family:"Courier New"'>nfd::cs::Policy</span>.</p><ol start=2 type=1><ul type=circle><li class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;mso-list:l0 level2 lfo1'>Once you create such a subclass, where do you put it so "the system" will recognize it when you use a CS::setPolicy call?</li></ul></ol><p class=MsoNormal>For now, <span style='font-family:"Courier New"'><a href="https://github.com/named-data/NFD/blob/cbc8e947bf778b728446edc33edd0953df025f90/daemon/table/cs.cpp#L48-L52">nfd::cs::makeDefaultPolicy</a></span> function.</p><p class=MsoNormal>In #<a href="https://redmine.named-data.net/issues/3148">3148</a> we’ll allow configuration. Runtime changes of the policy will still be disallowed.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Yours, Junxiao</p></div></div></div></body></html>