aboutsummaryrefslogtreecommitdiffstats
path: root/searchcorespi
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2021-02-16 13:30:33 +0100
committerGitHub <noreply@github.com>2021-02-16 13:30:33 +0100
commit0399c7f2cf9b75253e91a88e899bab82c36040dd (patch)
tree107c021de2a26f8cc077b304075812af3165a8cd /searchcorespi
parente355514ed46658e015aff3f933101281ae23e8c1 (diff)
parenta29aa609abab633f01a19a7e7576be444a38328e (diff)
Merge pull request #16495 from vespa-engine/arnej/add-size-literals
add literals for sizes in KB, MB, and GB
Diffstat (limited to 'searchcorespi')
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexflushtarget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexflushtarget.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexflushtarget.cpp
index 10779446368..bbd8e9ee35f 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexflushtarget.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexflushtarget.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "indexflushtarget.h"
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchcorespi.index.indexflushtarget");
@@ -41,9 +42,8 @@ IndexFlushTarget::needUrgentFlush() const
{
// Due to limitation of 16G address space of single datastore
// TODO: Even better if urgency was decided by memory index itself.
- constexpr int64_t G = 1024*1024*1024l;
bool urgent = (_numFrozenMemoryIndexes > _maxFrozenMemoryIndexes) ||
- (getApproxMemoryGain().gain() > 16*G);
+ (getApproxMemoryGain().gain() > ssize_t(16_Gi));
SerialNum flushedSerial = _indexMaintainer.getFlushedSerialNum();
LOG(debug, "Num frozen: %u Memory gain: %" PRId64 " Urgent: %d, flushedSerial=%" PRIu64,
_numFrozenMemoryIndexes, getApproxMemoryGain().gain(), static_cast<int>(urgent), flushedSerial);