summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/BackgroundSaveEvictorI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-08-21 17:01:15 -0400
committerBernard Normier <bernard@zeroc.com>2012-08-21 17:03:33 -0400
commit472d9552de83c5e8b96030f47ed222de77556417 (patch)
treeda9ed5b4c66c3e9ce112dbe6797cf73d8d386152 /cpp/src/Freeze/BackgroundSaveEvictorI.cpp
parentFixed ICE-2097: with Ice encoding > 1.0, Freeze evictors no longer maintain (diff)
downloadice-472d9552de83c5e8b96030f47ed222de77556417.tar.bz2
ice-472d9552de83c5e8b96030f47ed222de77556417.tar.xz
ice-472d9552de83c5e8b96030f47ed222de77556417.zip
Much better fix for ICE-2097: whether or not to keep the stats is no longer
determined by the encoding but by the Catalog data for the evictor. With the new default, the catalog data key and value are set, in particular the value is set to "Object". With old evictors, the catalog data value was set to "", which means ::Freeze::ObjectRecord (with stats).
Diffstat (limited to 'cpp/src/Freeze/BackgroundSaveEvictorI.cpp')
-rw-r--r--cpp/src/Freeze/BackgroundSaveEvictorI.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/cpp/src/Freeze/BackgroundSaveEvictorI.cpp b/cpp/src/Freeze/BackgroundSaveEvictorI.cpp
index f71a286b2d9..7b2215f7341 100644
--- a/cpp/src/Freeze/BackgroundSaveEvictorI.cpp
+++ b/cpp/src/Freeze/BackgroundSaveEvictorI.cpp
@@ -301,7 +301,7 @@ Freeze::BackgroundSaveEvictorI::addFacet(const ObjectPtr& servant, const Identit
ObjectRecord& rec = element->rec;
rec.servant = servant;
- if(_encoding == Ice::Encoding_1_0)
+ if(store->keepStats())
{
rec.stats.creationTime = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
rec.stats.lastSaveTime = 0;
@@ -934,11 +934,7 @@ Freeze::BackgroundSaveEvictorI::run()
deque<StreamedObject> streamedObjectQueue;
- Long streamStart = 0;
- if(_encoding == Ice::Encoding_1_0 || _trace >= 1)
- {
- streamStart = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
- }
+ Long streamStart = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
//
// Stream each element
@@ -1120,12 +1116,8 @@ Freeze::BackgroundSaveEvictorI::run()
txSize = streamedObjectQueue.size();
}
- Long saveStart = 0;
- if(_encoding == Ice::Encoding_1_0 || _trace >= 1)
- {
- saveStart = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
- }
-
+ Long saveStart = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
+
try
{
DbTxn* tx = 0;
@@ -1404,17 +1396,18 @@ Freeze::BackgroundSaveEvictorI::stream(const BackgroundSaveEvictorElementPtr& el
obj.status = element->status;
obj.store = &element->store;
-
+
const Identity& ident = element->cachePosition->first;
ObjectStoreBase::marshal(ident, obj.key, _communicator, _encoding);
if(element->status != destroyed)
{
- if(_encoding == Ice::Encoding_1_0)
+ bool keepStats = obj.store->keepStats();
+ if(keepStats)
{
EvictorIBase::updateStats(element->rec.stats, streamStart);
}
- ObjectStoreBase::marshal(element->rec, obj.value, _communicator, _encoding);
+ ObjectStoreBase::marshal(element->rec, obj.value, _communicator, _encoding, keepStats);
}
}