cs+fw: omitted FreshnessPeriod implies always stale
refs #3944
Change-Id: I018242b3ba5850e8a126f956af4150b512406efd
diff --git a/daemon/table/cs-entry-impl.cpp b/daemon/table/cs-entry-impl.cpp
index c8bd357..255cfff 100644
--- a/daemon/table/cs-entry-impl.cpp
+++ b/daemon/table/cs-entry-impl.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,13 +46,6 @@
return !this->hasData();
}
-bool
-EntryImpl::canStale() const
-{
- BOOST_ASSERT(!this->isQuery());
- return this->getStaleTime() < time::steady_clock::TimePoint::max();
-}
-
void
EntryImpl::unsetUnsolicited()
{
diff --git a/daemon/table/cs-entry-impl.hpp b/daemon/table/cs-entry-impl.hpp
index d061f88..262fcd1 100644
--- a/daemon/table/cs-entry-impl.hpp
+++ b/daemon/table/cs-entry-impl.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -52,11 +52,6 @@
*/
EntryImpl(shared_ptr<const Data> data, bool isUnsolicited);
- /** \return true if entry can become stale, false if entry is never stale
- */
- bool
- canStale() const;
-
void
unsetUnsolicited();
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index d4f3921..4bf84d5 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+ * Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,12 +48,7 @@
Entry::updateStaleTime()
{
BOOST_ASSERT(this->hasData());
- if (m_data->getFreshnessPeriod() >= time::milliseconds::zero()) {
- m_staleTime = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
- }
- else {
- m_staleTime = time::steady_clock::TimePoint::max();
- }
+ m_staleTime = time::steady_clock::now() + time::milliseconds(m_data->getFreshnessPeriod());
}
bool
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 68289cf..48895b1 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -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-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -76,8 +76,8 @@
return m_isUnsolicited;
}
- /** \return the absolute time when the stored Data becomes expired
- * \retval time::steady_clock::TimePoint::max() if the stored Data never expires
+ /** \return the absolute time when the stored Data becomes stale
+ * \note if the returned TimePoint is in the past, the Data is stale
* \pre hasData()
*/
const time::steady_clock::TimePoint&
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index a61f334..934d759 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.cpp
@@ -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-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -117,11 +117,8 @@
}
else {
entryInfo->queueType = QUEUE_FIFO;
-
- if (i->canStale()) {
- entryInfo->moveStaleEventId = scheduler::schedule(i->getData().getFreshnessPeriod(),
- bind(&PriorityFifoPolicy::moveToStaleQueue, this, i));
- }
+ entryInfo->moveStaleEventId = scheduler::schedule(i->getData().getFreshnessPeriod(),
+ bind(&PriorityFifoPolicy::moveToStaleQueue, this, i));
}
Queue& queue = m_queues[entryInfo->queueType];