diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-08 00:43:42 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-16 23:48:46 +0000 |
commit | e11228ca3457aeeee7e9ac1ad4c78bf26e72f1b1 (patch) | |
tree | b53da9a573071e303745c658308553b08d56e54f /searchcore | |
parent | f6c5439141b1f5fb73156d8805aae1a436d558c5 (diff) |
GC unused code.
Diffstat (limited to 'searchcore')
11 files changed, 19 insertions, 33 deletions
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp index 7b512ad2e78..3c3ed33b8ea 100644 --- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp +++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp @@ -40,7 +40,6 @@ using namespace vespa::config::search::summary; using namespace vespa::config::search; using namespace vespalib; -using fastos::TimeStamp; using proton::matching::SessionManager; using searchcorespi::IndexSearchable; using searchcorespi::index::IThreadingService; diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp index ca513cb1cfb..f380ce03152 100644 --- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp @@ -33,7 +33,6 @@ using document::BucketId; using document::Document; using document::DocumentId; using document::DocumentUpdate; -using fastos::TimeStamp; using proton::matching::SessionManager; using proton::test::MockGidToLidChangeHandler; using search::AttributeVector; diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp index ae72637ec59..d4aebd0b8a7 100644 --- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp +++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp @@ -47,7 +47,6 @@ using document::Document; using document::DocumentId; using document::test::makeBucketSpace; using vespalib::system_clock; -using fastos::TimeStamp; using proton::bucketdb::BucketCreateNotifier; using proton::matching::ISessionCachePruner; using search::AttributeGuard; diff --git a/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp b/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp index 549b2d2626a..7f650847183 100644 --- a/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp +++ b/searchcore/src/tests/proton/server/memoryflush/memoryflush_test.cpp @@ -5,9 +5,7 @@ #include <vespa/searchcore/proton/flushengine/tls_stats_map.h> #include <vespa/searchcore/proton/test/dummy_flush_target.h> #include <vespa/searchcore/proton/server/memoryflush.h> -#include <vespa/fastos/timestamp.h> -using fastos::TimeStamp; using vespalib::system_time; using search::SerialNum; using namespace proton; diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/flush_engine_explorer.cpp b/searchcore/src/vespa/searchcore/proton/flushengine/flush_engine_explorer.cpp index 5baccda279c..0df6cc758f7 100644 --- a/searchcore/src/vespa/searchcore/proton/flushengine/flush_engine_explorer.cpp +++ b/searchcore/src/vespa/searchcore/proton/flushengine/flush_engine_explorer.cpp @@ -4,6 +4,7 @@ #include <vespa/vespalib/data/slime/cursor.h> #include <vespa/vespalib/data/slime/inserter.h> +#include <vespa/fastos/timestamp.h> using vespalib::slime::Cursor; using vespalib::slime::Inserter; @@ -21,8 +22,7 @@ convertToSlime(const FlushEngine::FlushMetaSet &flushingTargets, Cursor &array) Cursor &object = array.addObject(); object.setString("name", target.getName()); object.setString("startTime", fastos::TimeStamp::asString(target.getStart())); - fastos::TimeStamp elapsedTime = target.elapsed(); - object.setDouble("elapsedTime", elapsedTime.sec()); + object.setDouble("elapsedTime", vespalib::to_s(target.elapsed())); } } diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp index 1922b906075..2a0b767a87c 100644 --- a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp +++ b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp @@ -53,7 +53,7 @@ logTarget(const char * text, const FlushContext & ctx) { FlushEngine::FlushMeta::FlushMeta(const vespalib::string & name, uint32_t id) : _name(name), - _stopWatch(), + _timer(), _id(id) { } FlushEngine::FlushMeta::~FlushMeta() = default; @@ -348,17 +348,17 @@ FlushEngine::initFlush(const FlushContext &ctx) void FlushEngine::flushDone(const FlushContext &ctx, uint32_t taskId) { - fastos::TimeStamp duration; + vespalib::duration duration = vespalib::duration::zero(); { std::lock_guard<std::mutex> guard(_lock); duration = _flushing[taskId].elapsed(); } if (LOG_WOULD_LOG(event)) { FlushStats stats = ctx.getTarget()->getLastFlushStats(); - EventLogger::flushComplete(ctx.getName(), duration.ms(), ctx.getTarget()->getFlushedSerialNum(), + EventLogger::flushComplete(ctx.getName(), vespalib::count_ms(duration), ctx.getTarget()->getFlushedSerialNum(), stats.getPath(), stats.getPathElementsToLog()); } - LOG(debug, "FlushEngine::flushDone(taskId='%d') took '%f' secs", taskId, duration.sec()); + LOG(debug, "FlushEngine::flushDone(taskId='%d') took '%f' secs", taskId, vespalib::to_s(duration)); std::lock_guard<std::mutex> guard(_lock); _flushing.erase(taskId); assert(ctx.getHandler()); diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h index 0a4fcabb746..36822a6da65 100644 --- a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h +++ b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.h @@ -7,7 +7,6 @@ #include <vespa/searchcore/proton/common/doctypename.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/time.h> -#include <vespa/fastos/timestamp.h> #include <vespa/fastos/thread.h> #include <set> #include <mutex> @@ -25,13 +24,13 @@ public: FlushMeta(const vespalib::string & name, uint32_t id); ~FlushMeta(); const vespalib::string & getName() const { return _name; } - vespalib::system_time getStart() const { return vespalib::system_clock::now() - vespalib::duration(elapsed()); } - fastos::TimeStamp elapsed() const { return _stopWatch.elapsed(); } + vespalib::system_time getStart() const { return vespalib::system_clock::now() - elapsed(); } + vespalib::duration elapsed() const { return _timer.elapsed(); } uint32_t getId() const { return _id; } bool operator < (const FlushMeta & rhs) const { return _id < rhs._id; } private: vespalib::string _name; - fastos::StopWatch _stopWatch; + vespalib::Timer _timer; uint32_t _id; }; typedef std::set<FlushMeta> FlushMetaSet; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index d6448c0b515..02ad144af68 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -100,7 +100,6 @@ private: InitializeThreads _initializeThreads; typedef search::SerialNum SerialNum; - typedef fastos::TimeStamp TimeStamp; typedef vespalib::Closure Closure; typedef search::index::Schema Schema; using lock_guard = std::lock_guard<std::mutex>; diff --git a/searchcore/src/vespa/searchcore/proton/server/maintenance_jobs_injector.cpp b/searchcore/src/vespa/searchcore/proton/server/maintenance_jobs_injector.cpp index acbd8c5e61a..483497eb008 100644 --- a/searchcore/src/vespa/searchcore/proton/server/maintenance_jobs_injector.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/maintenance_jobs_injector.cpp @@ -11,17 +11,15 @@ #include "sample_attribute_usage_job.h" using vespalib::system_clock; -using fastos::TimeStamp; namespace proton { namespace { IMaintenanceJob::UP -trackJob(const IJobTracker::SP &tracker, - IMaintenanceJob::UP job) +trackJob(const IJobTracker::SP &tracker, IMaintenanceJob::UP job) { - return IMaintenanceJob::UP(new JobTrackedMaintenanceJob(tracker, std::move(job))); + return std::make_unique<JobTrackedMaintenanceJob>(tracker, std::move(job)); } void @@ -62,8 +60,7 @@ injectBucketMoveJob(MaintenanceController &controller, IDiskMemUsageNotifier &diskMemUsageNotifier, const BlockableMaintenanceJobConfig &blockableConfig) { - IMaintenanceJob::UP bmj; - bmj.reset(new BucketMoveJob(calc, + auto bmj = std::make_unique<BucketMoveJob>(calc, moveHandler, bucketModifiedHandler, controller.getReadySubDB(), @@ -74,9 +71,8 @@ injectBucketMoveJob(MaintenanceController &controller, bucketStateChangedNotifier, diskMemUsageNotifier, blockableConfig, - docTypeName, bucketSpace)); - controller.registerJobInMasterThread(trackJob(jobTrackers.getBucketMove(), - std::move(bmj))); + docTypeName, bucketSpace); + controller.registerJobInMasterThread(trackJob(jobTrackers.getBucketMove(), std::move(bmj))); } } @@ -104,15 +100,14 @@ MaintenanceJobsInjector::injectJobs(MaintenanceController &controller, IAttributeManagerSP readyAttributeManager, IAttributeManagerSP notReadyAttributeManager, AttributeUsageFilter &attributeUsageFilter) { - typedef IMaintenanceJob::UP MUP; - controller.registerJobInMasterThread(MUP(new HeartBeatJob(hbHandler, config.getHeartBeatConfig()))); - controller.registerJobInDefaultPool(MUP(new PruneSessionCacheJob(scPruner, config.getSessionCachePruneInterval()))); + controller.registerJobInMasterThread(std::make_unique<HeartBeatJob>(hbHandler, config.getHeartBeatConfig())); + controller.registerJobInDefaultPool(std::make_unique<PruneSessionCacheJob>(scPruner, config.getSessionCachePruneInterval())); if (config.hasVisibilityDelay()) { - controller.registerJobInMasterThread(MUP(new DocumentDBCommitJob(commit, config.getVisibilityDelay()))); + controller.registerJobInMasterThread(std::make_unique<DocumentDBCommitJob>(commit, config.getVisibilityDelay())); } const MaintenanceDocumentSubDB &mRemSubDB(controller.getRemSubDB()); - MUP pruneRDjob(new PruneRemovedDocumentsJob(config.getPruneRemovedDocumentsConfig(), *mRemSubDB.meta_store(), - mRemSubDB.sub_db_id(), docTypeName, prdHandler, fbHandler)); + auto pruneRDjob = std::make_unique<PruneRemovedDocumentsJob>(config.getPruneRemovedDocumentsConfig(), *mRemSubDB.meta_store(), + mRemSubDB.sub_db_id(), docTypeName, prdHandler, fbHandler); controller.registerJobInMasterThread( trackJob(jobTrackers.getRemovedDocumentsPrune(), std::move(pruneRDjob))); if (!config.getLidSpaceCompactionConfig().isDisabled()) { diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp index 309dd44391d..c724e1065e9 100644 --- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp @@ -13,7 +13,6 @@ LOG_SETUP(".proton.server.rtchooks"); using namespace vespalib; using vespalib::compression::CompressionConfig; -using fastos::TimeStamp; namespace { diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp index 9b2d846b2ed..954f7f3c7f7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp @@ -45,7 +45,6 @@ using proton::matching::SessionManager; using vespalib::GenericHeader; using search::common::FileHeaderContext; using proton::documentmetastore::LidReuseDelayer; -using fastos::TimeStamp; using proton::initializer::InitializerTask; using searchcorespi::IFlushTarget; |