summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.h3
-rw-r--r--searchlib/src/vespa/searchlib/common/i_gid_to_lid_mapper.h1
-rw-r--r--searchlib/src/vespa/searchlib/test/mock_gid_to_lid_mapping.h9
4 files changed, 7 insertions, 11 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.cpp b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.cpp
index 2860769235d..c954c34aee8 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.cpp
@@ -1,6 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "imported_attribute_vector_read_guard.h"
+#include <vespa/searchlib/common/i_gid_to_lid_mapper.h>
+#include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h>
namespace search {
namespace attribute {
@@ -17,7 +19,8 @@ ImportedAttributeVectorReadGuard::ImportedAttributeVectorReadGuard(
_referencedLids(),
_reference_attribute_guard(_reference_attribute),
_target_attribute_guard(stableEnumGuard ? std::shared_ptr<AttributeVector>() : _target_attribute),
- _target_attribute_enum_guard(stableEnumGuard ? _target_attribute : std::shared_ptr<AttributeVector>())
+ _target_attribute_enum_guard(stableEnumGuard ? _target_attribute : std::shared_ptr<AttributeVector>()),
+ _mapper(_reference_attribute->getGidToLidMapperFactory()->getMapper())
{
_referencedLids = _reference_attribute->getReferencedLids();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.h b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.h
index 1937953df66..2ca8680f4b8 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.h
+++ b/searchlib/src/vespa/searchlib/attribute/imported_attribute_vector_read_guard.h
@@ -5,6 +5,8 @@
#include "imported_attribute_vector.h"
#include "attributeguard.h"
+namespace search { class IGidToLidMapper; }
+
namespace search::attribute {
class BitVectorSearchCache;
@@ -22,6 +24,7 @@ class ImportedAttributeVectorReadGuard : public ImportedAttributeVector
AttributeGuard _reference_attribute_guard;
AttributeGuard _target_attribute_guard;
AttributeEnumGuard _target_attribute_enum_guard;
+ std::unique_ptr<IGidToLidMapper> _mapper;
uint32_t getReferencedLid(uint32_t lid) const {
return _referencedLids[lid];
diff --git a/searchlib/src/vespa/searchlib/common/i_gid_to_lid_mapper.h b/searchlib/src/vespa/searchlib/common/i_gid_to_lid_mapper.h
index 8a9e2dbd84f..01431d0c75d 100644
--- a/searchlib/src/vespa/searchlib/common/i_gid_to_lid_mapper.h
+++ b/searchlib/src/vespa/searchlib/common/i_gid_to_lid_mapper.h
@@ -29,7 +29,6 @@ class IGidToLidMapper
{
public:
virtual ~IGidToLidMapper() { }
- virtual uint32_t mapGidToLid(const document::GlobalId &gid) const = 0;
virtual void foreach(const IGidToLidMapperVisitor &visitor) const = 0;
};
diff --git a/searchlib/src/vespa/searchlib/test/mock_gid_to_lid_mapping.h b/searchlib/src/vespa/searchlib/test/mock_gid_to_lid_mapping.h
index 86203c19970..df7fff18bca 100644
--- a/searchlib/src/vespa/searchlib/test/mock_gid_to_lid_mapping.h
+++ b/searchlib/src/vespa/searchlib/test/mock_gid_to_lid_mapping.h
@@ -21,15 +21,6 @@ struct MockGidToLidMapper : public search::IGidToLidMapper {
{
}
- uint32_t mapGidToLid(const document::GlobalId &gid) const override {
- auto itr = _map.find(gid);
- if (itr != _map.end()) {
- return itr->second;
- } else {
- return 0u;
- }
- }
-
void foreach(const search::IGidToLidMapperVisitor &visitor) const override {
for (const auto &kv : _map) {
if (kv.second != 0) {