summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2020-12-04 10:55:28 +0000
committerHåvard Pettersen <havardpe@oath.com>2020-12-04 13:00:22 +0000
commit15fe399eff5ade4ea12dded37c28ec4629899015 (patch)
tree77b6a80d052e01aed107f1083c0ddc372ee2cc36 /searchcore
parentb0fd8829ddaf563947f79ca24a85158a80866a7b (diff)
remove EngineOrFactory
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp15
3 files changed, 8 insertions, 21 deletions
diff --git a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
index 3c1fc8a4622..559e8fd14cd 100644
--- a/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
+++ b/searchcore/src/apps/verify_ranksetup/verify_ranksetup.cpp
@@ -11,7 +11,8 @@
#include <vespa/config/common/exceptions.h>
#include <vespa/eval/eval/tensor_spec.h>
#include <vespa/eval/eval/value_cache/constant_value.h>
-#include <vespa/eval/eval/engine_or_factory.h>
+#include <vespa/eval/eval/fast_value.h>
+#include <vespa/eval/eval/value_codec.h>
#include <vespa/searchcommon/common/schemaconfigurer.h>
#include <vespa/searchcore/config/config-ranking-constants.h>
#include <vespa/searchcore/config/config-onnx-models.h>
@@ -41,7 +42,7 @@ using vespa::config::search::core::OnnxModelsConfig;
using vespa::config::search::core::VerifyRanksetupConfig;
using vespalib::eval::BadConstantValue;
using vespalib::eval::ConstantValue;
-using vespalib::eval::EngineOrFactory;
+using vespalib::eval::FastValueBuilderFactory;
using vespalib::eval::SimpleConstantValue;
using vespalib::eval::TensorSpec;
using vespalib::eval::Value;
@@ -96,7 +97,7 @@ struct DummyConstantValueRepo : IConstantValueRepo {
for (const auto &entry: cfg.constant) {
if (entry.name == name) {
try {
- auto tensor = EngineOrFactory::get().from_spec(TensorSpec(entry.type));
+ auto tensor = vespalib::eval::value_from_spec(TensorSpec(entry.type), FastValueBuilderFactory::get());
return std::make_unique<SimpleConstantValue>(std::move(tensor));
} catch (std::exception &) {
return std::make_unique<BadConstantValue>();
diff --git a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
index 2f6625aaa11..6ad2f69ae7a 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/requestcontext.cpp
@@ -1,7 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "requestcontext.h"
-#include <vespa/eval/eval/engine_or_factory.h>
+#include <vespa/eval/eval/fast_value.h>
+#include <vespa/eval/eval/value_codec.h>
#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/fef/properties.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -10,7 +11,7 @@
#include <vespa/log/log.h>
LOG_SETUP(".proton.matching.requestcontext");
-using vespalib::eval::EngineOrFactory;
+using vespalib::eval::FastValueBuilderFactory;
namespace proton {
@@ -52,7 +53,7 @@ RequestContext::get_query_tensor(const vespalib::string& tensor_name) const
const vespalib::string& value = property.get();
vespalib::nbostream stream(value.data(), value.size());
try {
- return EngineOrFactory::get().decode(stream);
+ return decode_value(stream, FastValueBuilderFactory::get());
} catch (vespalib::Exception& ex) {
LOG(warning, "Query tensor '%s' could not be deserialized: %s",
tensor_name.c_str(), ex.getMessage().c_str());
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index c2b57734903..dddca6a9ddd 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -17,8 +17,6 @@
#include <vespa/document/base/exceptions.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
-#include <vespa/eval/eval/engine_or_factory.h>
-#include <vespa/eval/eval/fast_value.h>
#include <vespa/searchcore/proton/flushengine/flush_engine_explorer.h>
#include <vespa/searchcore/proton/flushengine/flushengine.h>
#include <vespa/searchcore/proton/flushengine/tls_stats_factory.h>
@@ -56,7 +54,6 @@ using search::transactionlog::DomainStats;
using vespa::config::search::core::ProtonConfig;
using vespa::config::search::core::internal::InternalProtonType;
using vespalib::compression::CompressionConfig;
-using vespalib::eval::EngineOrFactory;
namespace proton {
@@ -74,17 +71,6 @@ convert(InternalProtonType::Packetcompresstype type)
}
void
-set_tensor_implementation(const ProtonConfig& cfg)
-{
- if (cfg.tensorImplementation == ProtonConfig::TensorImplementation::TENSOR_ENGINE) {
- LOG(error, "Old tensor engine implementation no longer available");
- } else if (cfg.tensorImplementation == ProtonConfig::TensorImplementation::FAST_VALUE) {
- EngineOrFactory::set(vespalib::eval::FastValueBuilderFactory::get());
- }
- LOG(info, "Tensor implementation used: %s", EngineOrFactory::get().to_string().c_str());
-}
-
-void
setBucketCheckSumType(const ProtonConfig & proton)
{
switch (proton.bucketdb.checksumtype) {
@@ -268,7 +254,6 @@ Proton::init(const BootstrapConfig::SP & configSnapshot)
const ProtonConfig &protonConfig = configSnapshot->getProtonConfig();
const HwInfo & hwInfo = configSnapshot->getHwInfo();
- set_tensor_implementation(protonConfig);
setBucketCheckSumType(protonConfig);
setFS4Compression(protonConfig);
_diskMemUsageSampler = std::make_unique<DiskMemUsageSampler>(protonConfig.basedir,