aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/vespa/searchlib/docstore/filechunk.cpp')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/filechunk.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
index a280ae08b46..d7922fcca2a 100644
--- a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
@@ -14,7 +14,6 @@
#include <vespa/vespalib/util/executor.h>
#include <vespa/vespalib/util/arrayqueue.hpp>
#include <vespa/vespalib/util/array.hpp>
-#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/fastos/file.h>
#include <future>
@@ -37,7 +36,7 @@ const vespalib::string DOC_ID_LIMIT_KEY("docIdLimit");
using vespalib::make_string;
-FileChunk::ChunkInfo::ChunkInfo(uint64_t offset, uint32_t size, uint64_t lastSerial)
+FileChunk::ChunkInfo::ChunkInfo(uint64_t offset, uint32_t size, uint64_t lastSerial) noexcept
: _lastSerial(lastSerial),
_offset(offset),
_size(size)
@@ -130,7 +129,7 @@ public:
}
};
-using TmpChunkMetaV = vespalib::Array<TmpChunkMeta>;
+using TmpChunkMetaV = std::vector<TmpChunkMeta>;
namespace {
@@ -182,7 +181,7 @@ FileChunk::updateLidMap(const unique_lock &guard, ISetLid &ds, uint64_t serialNu
tempVector.reserve(fileSize/(sizeof(ChunkMeta)+sizeof(LidMeta)));
while ( ! is.empty() && is.good()) {
const int64_t lastKnownGoodPos = _idxHeaderLen + is.rp();
- tempVector.push_back(TmpChunkMeta());
+ tempVector.emplace_back();
TmpChunkMeta & chunkMeta(tempVector.back());
try {
chunkMeta.deserialize(is);
@@ -239,7 +238,7 @@ FileChunk::updateLidMap(const unique_lock &guard, ISetLid &ds, uint64_t serialNu
}
serialNum = chunkMeta.getLastSerial();
addNumBuckets(bucketMap.getNumBuckets());
- _chunkInfo.push_back(ChunkInfo(chunkMeta.getOffset(), chunkMeta.getSize(), chunkMeta.getLastSerial()));
+ _chunkInfo.emplace_back(chunkMeta.getOffset(), chunkMeta.getSize(), chunkMeta.getLastSerial());
assert(serialNum >= _lastPersistedSerialNum.load(std::memory_order_relaxed));
_lastPersistedSerialNum.store(serialNum, std::memory_order_relaxed);
}
@@ -531,7 +530,7 @@ FileChunk::getMemoryFootprint() const
size_t
FileChunk::getMemoryMetaFootprint() const
{
- return sizeof(*this) + _chunkInfo.byteCapacity();
+ return sizeof(*this) + _chunkInfo.capacity()*sizeof(ChunkInfoVector::value_type);
}
vespalib::MemoryUsage
@@ -540,8 +539,8 @@ FileChunk::getMemoryUsage() const
vespalib::MemoryUsage result;
result.incAllocatedBytes(sizeof(*this));
result.incUsedBytes(sizeof(*this));
- result.incAllocatedBytes(_chunkInfo.byteCapacity());
- result.incUsedBytes(_chunkInfo.byteSize());
+ result.incAllocatedBytes(_chunkInfo.capacity()*sizeof(ChunkInfoVector::value_type));
+ result.incUsedBytes(_chunkInfo.size()*sizeof(ChunkInfoVector::value_type));
return result;
}