summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/reprocessing
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2017-04-19 10:51:04 +0200
committerGitHub <noreply@github.com>2017-04-19 10:51:04 +0200
commit6adab6f821248cf7c7e6b3105c6e26145b8abaea (patch)
treee34095fc4dff471c24ebd4ad4d6939f798c44895 /searchcore/src/tests/proton/reprocessing
parent92d2c47b4904e4fb811e4a91849809ca5307a265 (diff)
parent5188254e1a5969d3504bcbe422c213b61a2ca00b (diff)
Merge pull request #2177 from yahoo/toregge/add-index-aspect-inspector
Toregge/add index aspect inspector
Diffstat (limited to 'searchcore/src/tests/proton/reprocessing')
-rw-r--r--searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
index aeb6d9a3587..73dfae75d7b 100644
--- a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
+++ b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
@@ -8,6 +8,7 @@ LOG_SETUP("attribute_reprocessing_initializer_test");
#include <vespa/searchcore/proton/attribute/attributedisklayout.h>
#include <vespa/searchcore/proton/attribute/attribute_directory.h>
#include <vespa/searchcore/proton/attribute/document_field_populator.h>
+#include <vespa/searchcore/proton/common/i_indexschema_inspector.h>
#include <vespa/searchcore/proton/reprocessing/attribute_reprocessing_initializer.h>
#include <vespa/searchcore/proton/reprocessing/i_reprocessing_handler.h>
#include <vespa/searchcore/proton/test/attribute_utils.h>
@@ -105,6 +106,23 @@ struct MyDocTypeInspector : public IDocumentTypeInspector
}
};
+struct MyIndexschemaInspector : public IIndexschemaInspector
+{
+ const search::index::Schema &_schema;
+ MyIndexschemaInspector(const search::index::Schema &schema)
+ : _schema(schema)
+ {
+ }
+ virtual bool isStringIndex(const vespalib::string &name) const override {
+ uint32_t fieldId = _schema.getIndexFieldId(name);
+ if (fieldId == Schema::UNKNOWN_FIELD_ID) {
+ return false;
+ }
+ const auto &field = _schema.getIndexField(fieldId);
+ return (field.getDataType() == DataType::STRING);
+ }
+};
+
struct Fixture
{
test::DirectoryHandler _dirHandler;
@@ -134,10 +152,12 @@ struct Fixture
}
~Fixture() { }
void init() {
+ MyIndexschemaInspector oldIndexschemaInspector(_oldCfg._schema);
_initializer.reset(new AttributeReprocessingInitializer
(ARIConfig(_newCfg._mgr, _newCfg._schema),
ARIConfig(_oldCfg._mgr, _oldCfg._schema),
- _inspector, "test", INIT_SERIAL_NUM));
+ _inspector, oldIndexschemaInspector,
+ "test", INIT_SERIAL_NUM));
_initializer->initialize(_handler);
}
Fixture &addOldConfig(const StringVector &fields,