summaryrefslogtreecommitdiffstats
path: root/searchcorespi
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-05 14:40:17 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-12-05 18:45:15 +0000
commit0a208d8a839f14164cd1561e38cb21a270c64380 (patch)
tree43b5185e77c237d322349edbee03cee30867e6a6 /searchcorespi
parente4b328f4ee05b55131420df7f6b5a3685d5dffa5 (diff)
Replace UTCTimeStamp with std::chrono::system_clock::time_point
Diffstat (limited to 'searchcorespi')
-rw-r--r--searchcorespi/src/vespa/searchcorespi/flush/iflushtarget.h4
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexfusiontarget.cpp2
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp7
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h4
4 files changed, 9 insertions, 8 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/flush/iflushtarget.h b/searchcorespi/src/vespa/searchcorespi/flush/iflushtarget.h
index 6d3313b4cf2..31707643649 100644
--- a/searchcorespi/src/vespa/searchcorespi/flush/iflushtarget.h
+++ b/searchcorespi/src/vespa/searchcorespi/flush/iflushtarget.h
@@ -3,7 +3,7 @@
#include "flushstats.h"
#include "flushtask.h"
-#include <vespa/fastos/timestamp.h>
+#include <vespa/vespalib/util/time.h>
#include <vector>
namespace searchcorespi {
@@ -60,7 +60,7 @@ public:
using MemoryGain = Gain<int64_t>;
using DiskGain = Gain<int64_t>;
using SerialNum = search::SerialNum;
- using Time = fastos::UTCTimeStamp;
+ using Time = vespalib::system_time;
/**
* Convenience typedefs.
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexfusiontarget.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexfusiontarget.cpp
index a9b4531fe93..b538e817cf8 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexfusiontarget.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexfusiontarget.cpp
@@ -74,7 +74,7 @@ IndexFusionTarget::needUrgentFlush() const
IFlushTarget::Time
IndexFusionTarget::getLastFlushTime() const
{
- return fastos::ClockSystem::now();
+ return vespalib::system_clock::now();
}
IFlushTarget::SerialNum
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
index e2ab5f5ff1f..0ca6d299288 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -19,6 +19,7 @@
#include <vespa/vespalib/util/closuretask.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/lambdatask.h>
+#include <vespa/vespalib/util/time.h>
#include <sstream>
#include <vespa/log/log.h>
@@ -617,7 +618,7 @@ IndexMaintainer::doneFlush(FlushArgs *args, IDiskIndex::SP *disk_index) {
return false; // Must retry operation
}
_flush_serial_num = std::max(_flush_serial_num, args->flush_serial_num);
- fastos::UTCTimeStamp timeStamp = search::FileKit::getModificationTime((*disk_index)->getIndexDir());
+ vespalib::system_time timeStamp = search::FileKit::getModificationTime((*disk_index)->getIndexDir());
_lastFlushTime = timeStamp > _lastFlushTime ? timeStamp : _lastFlushTime;
const uint32_t old_id = args->old_absolute_id - _last_fusion_id;
replaceSource(old_id, *disk_index);
@@ -941,10 +942,10 @@ IndexMaintainer::initFlush(SerialNum serialNum, searchcorespi::FlushStats * stat
// No memory index to flush, it was empty
LockGuard lock(_state_lock);
_flush_serial_num = _current_serial_num;
- _lastFlushTime = fastos::ClockSystem::now();
+ _lastFlushTime = vespalib::system_clock::now();
LOG(debug, "No memory index to flush. Update serial number and flush time to current: "
"flushSerialNum(%" PRIu64 "), lastFlushTime(%f)",
- _flush_serial_num, _lastFlushTime.time_since_epoch().sec());
+ _flush_serial_num, vespalib::to_s(_lastFlushTime.time_since_epoch()));
return FlushTask::UP();
}
SerialNum realSerialNum = args.flush_serial_num;
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
index a1bf676e48f..671f87ff35b 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
@@ -94,7 +94,7 @@ class IndexMaintainer : public IIndexManager,
bool _flush_empty_current_index;
SerialNum _current_serial_num;// Protected by IUL
SerialNum _flush_serial_num; // Protected by SL
- fastos::UTCTimeStamp _lastFlushTime; // Protected by SL
+ vespalib::system_time _lastFlushTime; // Protected by SL
// Extra frozen memory indexes. This list is empty unless new
// memory index has been added by force (due to config change or
// data structure limitations).
@@ -335,7 +335,7 @@ public:
uint32_t getNumFrozenMemoryIndexes() const;
uint32_t getMaxFrozenMemoryIndexes() const { return _maxFrozen; }
- fastos::UTCTimeStamp getLastFlushTime() const { return _lastFlushTime; }
+ vespalib::system_time getLastFlushTime() const { return _lastFlushTime; }
// Implements IIndexManager
void putDocument(uint32_t lid, const Document &doc, SerialNum serialNum) override;