table: Make LRU the default CS replacement policy

Change-Id: I01fe000544da9df860437ffc8869bc6b20e844c0
refs: #4728
This commit is contained in:
Chavoosh Ghasemi
2018-09-10 14:51:33 -07:00
committed by Alex Afanasyev
parent d47cd63b1b
commit 32e7609edf
4 changed files with 16 additions and 17 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2016, Regents of the University of California,
/*
* Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -38,7 +38,7 @@ namespace nfd {
* tables
* {
* cs_max_packets 65536
* cs_policy priority_fifo
* cs_policy lru
* cs_unsolicited_policy drop-all
*
* strategy_choice
+2 -3
View File
@@ -37,11 +37,10 @@ NDN_CXX_ASSERT_FORWARD_ITERATOR(Cs::const_iterator);
NFD_LOG_INIT(ContentStore);
unique_ptr<Policy>
static unique_ptr<Policy>
makeDefaultPolicy()
{
const std::string DEFAULT_POLICY = "priority_fifo";
return Policy::create(DEFAULT_POLICY);
return Policy::create("lru");
}
Cs::Cs(size_t nMaxPackets)
+1 -1
View File
@@ -51,7 +51,7 @@ tables
; Set the CS replacement policy.
; Available policies are: priority_fifo, lru
cs_policy priority_fifo
cs_policy lru
; Set a policy to decide whether to cache or drop unsolicited Data.
; Available policies are: drop-all, admit-local, admit-network, admit-all
+10 -10
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2016, Regents of the University of California,
/*
* Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -162,9 +162,9 @@ BOOST_AUTO_TEST_CASE(Default)
}
)CONFIG";
BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
runConfig(CONFIG, false);
cs::Policy* currentPolicy = cs.getPolicy();
NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy);
NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::LruPolicy);
}
BOOST_AUTO_TEST_CASE(Known)
@@ -172,17 +172,17 @@ BOOST_AUTO_TEST_CASE(Known)
const std::string CONFIG = R"CONFIG(
tables
{
cs_policy lru
cs_policy priority_fifo
}
)CONFIG";
BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, true));
runConfig(CONFIG, true);
cs::Policy* currentPolicy = cs.getPolicy();
NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy);
BOOST_REQUIRE_NO_THROW(runConfig(CONFIG, false));
currentPolicy = cs.getPolicy();
NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::LruPolicy);
runConfig(CONFIG, false);
currentPolicy = cs.getPolicy();
NFD_CHECK_TYPEID_EQUAL(*currentPolicy, cs::PriorityFifoPolicy);
}
BOOST_AUTO_TEST_CASE(Unknown)