diff options
25 files changed, 123 insertions, 121 deletions
diff --git a/document/src/tests/documenttestcase.cpp b/document/src/tests/documenttestcase.cpp index bb07f63a83b..5521fac58e8 100644 --- a/document/src/tests/documenttestcase.cpp +++ b/document/src/tests/documenttestcase.cpp @@ -1161,7 +1161,7 @@ TEST(DocumentTest, testCompressionConfigured) Struct("serializetest.body").setId(45) .addField("stringfield", DataType::T_STRING) .setCompression(DocumenttypesConfig::Documenttype:: - Datatype::Sstruct::Compression::LZ4, + Datatype::Sstruct::Compression::Type::LZ4, 9, 99, 0)); DocumentTypeRepo repo2(builder2.config()); diff --git a/document/src/tests/repo/documenttyperepo_test.cpp b/document/src/tests/repo/documenttyperepo_test.cpp index 64900d2ad65..b263ad75930 100644 --- a/document/src/tests/repo/documenttyperepo_test.cpp +++ b/document/src/tests/repo/documenttyperepo_test.cpp @@ -86,7 +86,7 @@ TEST("requireThatStructsCanConfigureCompression") { builder.document(doc_type_id, type_name, Struct(header_name), Struct(body_name).setCompression( - Sstruct::Compression::LZ4, + Sstruct::Compression::Type::LZ4, comp_level, comp_minres, comp_minsize)); DocumentTypeRepo repo(builder.config()); diff --git a/document/src/vespa/document/repo/configbuilder.cpp b/document/src/vespa/document/repo/configbuilder.cpp index 9610697b84f..7d9b607facd 100644 --- a/document/src/vespa/document/repo/configbuilder.cpp +++ b/document/src/vespa/document/repo/configbuilder.cpp @@ -62,8 +62,8 @@ DocTypeRep DocumenttypesConfigBuilderHelper::document(int32_t id, const vespalib::string &name, const DatatypeConfig &header, const DatatypeConfig &body) { - assert(header.type == DatatypeConfig::STRUCT); - assert(body.type == DatatypeConfig::STRUCT); + assert(header.type == DatatypeConfig::Type::STRUCT); + assert(body.type == DatatypeConfig::Type::STRUCT); _config.documenttype.resize(_config.documenttype.size() + 1); _config.documenttype.back().id = id; _config.documenttype.back().name = name; diff --git a/document/src/vespa/document/repo/configbuilder.h b/document/src/vespa/document/repo/configbuilder.h index 5f6f5548ae2..15ee0da0c79 100644 --- a/document/src/vespa/document/repo/configbuilder.h +++ b/document/src/vespa/document/repo/configbuilder.h @@ -39,7 +39,7 @@ struct TypeOrId { struct Struct : DatatypeConfig { Struct(const vespalib::string &name) { - type = STRUCT; + type = Type::STRUCT; sstruct.name = name; } Struct &setCompression(Sstruct::Compression::Type t, int32_t level, @@ -65,7 +65,7 @@ struct Struct : DatatypeConfig { struct Array : DatatypeConfig { Array(TypeOrId nested_type) { addNestedType(nested_type); - type = ARRAY; + type = Type::ARRAY; array.element.id = nested_type.id; } }; @@ -73,7 +73,7 @@ struct Array : DatatypeConfig { struct Wset : DatatypeConfig { Wset(TypeOrId nested_type) { addNestedType(nested_type); - type = WSET; + type = Type::WSET; wset.key.id = nested_type.id; } Wset &removeIfZero() { wset.removeifzero = true; return *this; } @@ -87,7 +87,7 @@ struct Map : DatatypeConfig { Map(TypeOrId key_type, TypeOrId value_type) { addNestedType(key_type); addNestedType(value_type); - type = MAP; + type = Type::MAP; map.key.id = key_type.id; map.value.id = value_type.id; } @@ -95,7 +95,7 @@ struct Map : DatatypeConfig { struct AnnotationRef : DatatypeConfig { AnnotationRef(int32_t annotation_type_id) { - type = ANNOTATIONREF; + type = Type::ANNOTATIONREF; annotationref.annotation.id = annotation_type_id; } }; diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp index bdecd521f44..da59f527115 100644 --- a/document/src/vespa/document/repo/documenttyperepo.cpp +++ b/document/src/vespa/document/repo/documenttyperepo.cpp @@ -310,7 +310,7 @@ void addStruct(int32_t id, const Datatype::Sstruct &s, Repo &repo) { } CompressionConfig::Type type = CompressionConfig::NONE; - if (s.compression.type == Datatype::Sstruct::Compression::LZ4) { + if (s.compression.type == Datatype::Sstruct::Compression::Type::LZ4) { type = CompressionConfig::LZ4; } @@ -348,18 +348,18 @@ void addAnnotationRef(int32_t id, const Datatype::Annotationref &a, Repo &r, con void addDataType(const Datatype &type, Repo &repo, const AnnotationTypeRepo &a_repo) { switch (type.type) { - case Datatype::STRUCT: + case Datatype::Type::STRUCT: return addStruct(type.id, type.sstruct, repo); - case Datatype::ARRAY: + case Datatype::Type::ARRAY: return addArray(type.id, type.array, repo); - case Datatype::WSET: + case Datatype::Type::WSET: return addWset(type.id, type.wset, repo); - case Datatype::MAP: + case Datatype::Type::MAP: return addMap(type.id, type.map, repo); - case Datatype::ANNOTATIONREF: + case Datatype::Type::ANNOTATIONREF: return addAnnotationRef(type.id, type.annotationref, repo, a_repo); default: - throw IllegalArgumentException(make_string("Unknown datatype type %d for id %d", type.type, type.id)); + throw IllegalArgumentException(make_string("Unknown datatype type %d for id %d", static_cast<int>(type.type), type.id)); } } diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp index a46f99d158d..3750f8d1d62 100644 --- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp @@ -28,9 +28,9 @@ Schema::DataType convertIndexDataType(const IndexschemaConfig::Indexfield::Datatype &type) { switch (type) { - case IndexschemaConfig::Indexfield::STRING: + case IndexschemaConfig::Indexfield::Datatype::STRING: return DataType::STRING; - case IndexschemaConfig::Indexfield::INT64: + case IndexschemaConfig::Indexfield::Datatype::INT64: return DataType::INT64; } return DataType::STRING; @@ -41,11 +41,11 @@ Schema::CollectionType convertIndexCollectionType(const IndexschemaConfig::Indexfield::Collectiontype &type) { switch (type) { - case IndexschemaConfig::Indexfield::SINGLE: + case IndexschemaConfig::Indexfield::Collectiontype::SINGLE: return CollectionType::SINGLE; - case IndexschemaConfig::Indexfield::ARRAY: + case IndexschemaConfig::Indexfield::Collectiontype::ARRAY: return CollectionType::ARRAY; - case IndexschemaConfig::Indexfield::WEIGHTEDSET: + case IndexschemaConfig::Indexfield::Collectiontype::WEIGHTEDSET: return CollectionType::WEIGHTEDSET; } return CollectionType::SINGLE; diff --git a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp index ce07858ea0b..f76743b9480 100644 --- a/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdbconfigscout/documentdbconfigscout_test.cpp @@ -216,9 +216,9 @@ setupLiveAttributes(AttributesConfigBuilder::AttributeVector &attributes) attributes.push_back(setupFastSearchAttribute("a0")); attributes.push_back(setupFastSearchAndMoreAttribute("a1")); attributes.push_back(setupFastSearchAttribute("a2")); - attributes.back().datatype = AttributesConfig::Attribute::INT8; + attributes.back().datatype = AttributesConfig::Attribute::Datatype::INT8; attributes.push_back(setupFastSearchAttribute("a3")); - attributes.back().collectiontype = AttributesConfig::Attribute::ARRAY; + attributes.back().collectiontype = AttributesConfig::Attribute::Collectiontype::ARRAY; attributes.push_back(setupFastSearchAttribute("a4")); attributes.back().createifnonexistent = true; } diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp index b85e706397d..3047834be85 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp @@ -271,7 +271,7 @@ CompressionConfig::Type convert(InternalFdispatchrcType::Packetcompresstype type) { switch (type) { - case InternalFdispatchrcType::LZ4: return CompressionConfig::LZ4; + case InternalFdispatchrcType::Packetcompresstype::LZ4: return CompressionConfig::LZ4; default: return CompressionConfig::LZ4; } } diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h index 32f85e904ae..e0b0f0d7403 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h @@ -69,9 +69,9 @@ public: class QueryDistributionMode { public: enum Mode { - RANDOM = PartitionsConfig::Dataset::RANDOM, - AUTOMATIC = PartitionsConfig::Dataset::AUTOMATIC, - FIXEDROW = PartitionsConfig::Dataset::FIXEDROW + RANDOM = static_cast<int>(PartitionsConfig::Dataset::Querydistribution::RANDOM), + AUTOMATIC = static_cast<int>(PartitionsConfig::Dataset::Querydistribution::AUTOMATIC), + FIXEDROW = static_cast<int>(PartitionsConfig::Dataset::Querydistribution::FIXEDROW) }; QueryDistributionMode(Mode mode, double minGroupCoverage, double latencyDecayRate) : diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp index 53f7f544980..a562408b64d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp @@ -152,9 +152,9 @@ template<typename T> CompressionConfig deriveCompression(const T & config) { CompressionConfig compression; - if (config.type == T::LZ4) { + if (config.type == T::Type::LZ4) { compression.type = CompressionConfig::LZ4; - } else if (config.type == T::ZSTD) { + } else if (config.type == T::Type::ZSTD) { compression.type = CompressionConfig::ZSTD; } compression.compressionLevel = config.level; diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 06f19eb06cc..5db499601f3 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -65,7 +65,7 @@ CompressionConfig::Type convert(InternalProtonType::Packetcompresstype type) { switch (type) { - case InternalProtonType::LZ4: return CompressionConfig::LZ4; + case InternalProtonType::Packetcompresstype::LZ4: return CompressionConfig::LZ4; default: return CompressionConfig::LZ4; } } @@ -74,10 +74,10 @@ void setBucketCheckSumType(const ProtonConfig & proton) { switch (proton.bucketdb.checksumtype) { - case InternalProtonType::Bucketdb::LEGACY: + case InternalProtonType::Bucketdb::Checksumtype::LEGACY: bucketdb::BucketState::setChecksumType(bucketdb::BucketState::ChecksumType::LEGACY); break; - case InternalProtonType::Bucketdb::XXHASH64: + case InternalProtonType::Bucketdb::Checksumtype::XXHASH64: bucketdb::BucketState::setChecksumType(bucketdb::BucketState::ChecksumType::XXHASH64); break; } @@ -273,7 +273,7 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) IFlushStrategy::SP strategy; const ProtonConfig::Flush & flush(protonConfig.flush); switch (flush.strategy) { - case ProtonConfig::Flush::MEMORY: { + case ProtonConfig::Flush::Strategy::MEMORY: { auto memoryFlush = std::make_shared<MemoryFlush>( MemoryFlushConfigUpdater::convertConfig(flush.memory, hwInfo.memory()), fastos::ClockSystem::now()); _memoryFlushConfigUpdater = std::make_unique<MemoryFlushConfigUpdater>(memoryFlush, flush.memory, hwInfo.memory()); @@ -281,7 +281,7 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) strategy = memoryFlush; break; } - case ProtonConfig::Flush::SIMPLE: + case ProtonConfig::Flush::Strategy::SIMPLE: default: strategy = std::make_shared<SimpleFlush>(); break; diff --git a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp index 09f89494019..62cde4d2c9c 100644 --- a/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp +++ b/searchlib/src/tests/attribute/attributemanager/attributemanager_test.cpp @@ -222,27 +222,29 @@ AttributeManagerTest::testConfigConvert() // typedef AttributeVector::Config AVC; typedef BT AVBT; typedef CollectionType AVCT; - typedef AttributesConfig::Attribute CACA; + using CACA = AttributesConfig::Attribute; + using CACAD = CACA::Datatype; + using CACAC = CACA::Collectiontype; typedef ConfigConverter CC; - EXPECT_TRUE(assertDataType(AVBT::STRING, CACA::STRING)); - EXPECT_TRUE(assertDataType(AVBT::INT8, CACA::INT8)); - EXPECT_TRUE(assertDataType(AVBT::INT16, CACA::INT16)); - EXPECT_TRUE(assertDataType(AVBT::INT32, CACA::INT32)); - EXPECT_TRUE(assertDataType(AVBT::INT64, CACA::INT64)); - EXPECT_TRUE(assertDataType(AVBT::FLOAT, CACA::FLOAT)); - EXPECT_TRUE(assertDataType(AVBT::DOUBLE, CACA::DOUBLE)); - EXPECT_TRUE(assertDataType(AVBT::PREDICATE, CACA::PREDICATE)); - EXPECT_TRUE(assertDataType(AVBT::TENSOR, CACA::TENSOR)); - EXPECT_TRUE(assertDataType(AVBT::NONE, CACA::NONE)); - - EXPECT_TRUE(assertCollectionType(AVCT::SINGLE, CACA::SINGLE)); - EXPECT_TRUE(assertCollectionType(AVCT::ARRAY, CACA::ARRAY)); - EXPECT_TRUE(assertCollectionType(AVCT::WSET, CACA::WEIGHTEDSET)); + EXPECT_TRUE(assertDataType(AVBT::STRING, CACAD::STRING)); + EXPECT_TRUE(assertDataType(AVBT::INT8, CACAD::INT8)); + EXPECT_TRUE(assertDataType(AVBT::INT16, CACAD::INT16)); + EXPECT_TRUE(assertDataType(AVBT::INT32, CACAD::INT32)); + EXPECT_TRUE(assertDataType(AVBT::INT64, CACAD::INT64)); + EXPECT_TRUE(assertDataType(AVBT::FLOAT, CACAD::FLOAT)); + EXPECT_TRUE(assertDataType(AVBT::DOUBLE, CACAD::DOUBLE)); + EXPECT_TRUE(assertDataType(AVBT::PREDICATE, CACAD::PREDICATE)); + EXPECT_TRUE(assertDataType(AVBT::TENSOR, CACAD::TENSOR)); + EXPECT_TRUE(assertDataType(AVBT::NONE, CACAD::NONE)); + + EXPECT_TRUE(assertCollectionType(AVCT::SINGLE, CACAC::SINGLE)); + EXPECT_TRUE(assertCollectionType(AVCT::ARRAY, CACAC::ARRAY)); + EXPECT_TRUE(assertCollectionType(AVCT::WSET, CACAC::WEIGHTEDSET)); EXPECT_TRUE(assertCollectionType(AVCT(AVCT::SINGLE, true, false), - CACA::SINGLE, true, false)); + CACAC::SINGLE, true, false)); EXPECT_TRUE(assertCollectionType(AVCT(AVCT::SINGLE, false, true), - CACA::SINGLE, false, true)); + CACAC::SINGLE, false, true)); { // fastsearch CACA a; @@ -270,7 +272,7 @@ AttributeManagerTest::testConfigConvert() } { // tensor CACA a; - a.datatype = CACA::TENSOR; + a.datatype = CACAD::TENSOR; a.tensortype = "tensor(x[5])"; AttributeVector::Config out = ConfigConverter::convert(a); EXPECT_EQUAL("tensor(x[5])", out.tensorType().to_spec()); diff --git a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp index ae08204f5bc..535e81fc032 100644 --- a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp @@ -19,20 +19,20 @@ DataTypeMap getDataTypeMap() { DataTypeMap map; - map[AttributesConfig::Attribute::STRING] = BasicType::STRING; - map[AttributesConfig::Attribute::BOOL] = BasicType::BOOL; - map[AttributesConfig::Attribute::UINT2] = BasicType::UINT2; - map[AttributesConfig::Attribute::UINT4] = BasicType::UINT4; - map[AttributesConfig::Attribute::INT8] = BasicType::INT8; - map[AttributesConfig::Attribute::INT16] = BasicType::INT16; - map[AttributesConfig::Attribute::INT32] = BasicType::INT32; - map[AttributesConfig::Attribute::INT64] = BasicType::INT64; - map[AttributesConfig::Attribute::FLOAT] = BasicType::FLOAT; - map[AttributesConfig::Attribute::DOUBLE] = BasicType::DOUBLE; - map[AttributesConfig::Attribute::PREDICATE] = BasicType::PREDICATE; - map[AttributesConfig::Attribute::TENSOR] = BasicType::TENSOR; - map[AttributesConfig::Attribute::REFERENCE] = BasicType::REFERENCE; - map[AttributesConfig::Attribute::NONE] = BasicType::NONE; + map[AttributesConfig::Attribute::Datatype::STRING] = BasicType::STRING; + map[AttributesConfig::Attribute::Datatype::BOOL] = BasicType::BOOL; + map[AttributesConfig::Attribute::Datatype::UINT2] = BasicType::UINT2; + map[AttributesConfig::Attribute::Datatype::UINT4] = BasicType::UINT4; + map[AttributesConfig::Attribute::Datatype::INT8] = BasicType::INT8; + map[AttributesConfig::Attribute::Datatype::INT16] = BasicType::INT16; + map[AttributesConfig::Attribute::Datatype::INT32] = BasicType::INT32; + map[AttributesConfig::Attribute::Datatype::INT64] = BasicType::INT64; + map[AttributesConfig::Attribute::Datatype::FLOAT] = BasicType::FLOAT; + map[AttributesConfig::Attribute::Datatype::DOUBLE] = BasicType::DOUBLE; + map[AttributesConfig::Attribute::Datatype::PREDICATE] = BasicType::PREDICATE; + map[AttributesConfig::Attribute::Datatype::TENSOR] = BasicType::TENSOR; + map[AttributesConfig::Attribute::Datatype::REFERENCE] = BasicType::REFERENCE; + map[AttributesConfig::Attribute::Datatype::NONE] = BasicType::NONE; return map; } @@ -40,9 +40,9 @@ CollectionTypeMap getCollectionTypeMap() { CollectionTypeMap map; - map[AttributesConfig::Attribute::SINGLE] = CollectionType::SINGLE; - map[AttributesConfig::Attribute::ARRAY] = CollectionType::ARRAY; - map[AttributesConfig::Attribute::WEIGHTEDSET] = CollectionType::WSET; + map[AttributesConfig::Attribute::Collectiontype::SINGLE] = CollectionType::SINGLE; + map[AttributesConfig::Attribute::Collectiontype::ARRAY] = CollectionType::ARRAY; + map[AttributesConfig::Attribute::Collectiontype::WEIGHTEDSET] = CollectionType::WSET; return map; } diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.h b/searchlib/src/vespa/searchlib/common/tunefileinfo.h index d431a9cf78f..bcd6765845b 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.h +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.h @@ -26,10 +26,10 @@ public: template <typename Config> void setFromConfig(const enum Config::Io &config) { switch (config) { - case Config::NORMAL: + case Config::Io::NORMAL: _tuneControl = NORMAL; break; - case Config::DIRECTIO: + case Config::Io::DIRECTIO: _tuneControl = DIRECTIO; break; default: @@ -70,13 +70,13 @@ public: template <typename Config> void setFromConfig(const enum Config::Io &config) { switch (config) { - case Config::NORMAL: + case Config::Io::NORMAL: _tuneControl = NORMAL; break; - case Config::OSYNC: + case Config::Io::OSYNC: _tuneControl = OSYNC; break; - case Config::DIRECTIO: + case Config::Io::DIRECTIO: _tuneControl = DIRECTIO; break; default: diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp index 17d7949e9b9..5f28f82c526 100644 --- a/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp +++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.hpp @@ -12,9 +12,9 @@ template <typename TuneControlConfig, typename MMapConfig> void TuneFileRandRead::setFromConfig(const enum TuneControlConfig::Io & tuneControlConfig, const MMapConfig & mmapFlags) { switch ( tuneControlConfig) { - case TuneControlConfig::NORMAL: _tuneControl = NORMAL; break; - case TuneControlConfig::DIRECTIO: _tuneControl = DIRECTIO; break; - case TuneControlConfig::MMAP: _tuneControl = MMAP; break; + case TuneControlConfig::Io::NORMAL: _tuneControl = NORMAL; break; + case TuneControlConfig::Io::DIRECTIO: _tuneControl = DIRECTIO; break; + case TuneControlConfig::Io::MMAP: _tuneControl = MMAP; break; default: _tuneControl = NORMAL; break; } setFromMmapConfig(mmapFlags); @@ -25,15 +25,15 @@ void TuneFileRandRead::setFromMmapConfig(const MMapConfig & mmapFlags) { for (size_t i(0), m(mmapFlags.options.size()); i < m; i++) { switch (mmapFlags.options[i]) { - case MMapConfig::MLOCK: _mmapFlags |= MAP_LOCKED; break; - case MMapConfig::POPULATE: _mmapFlags |= MAP_POPULATE; break; - case MMapConfig::HUGETLB: _mmapFlags |= MAP_HUGETLB; break; + case MMapConfig::Options::MLOCK: _mmapFlags |= MAP_LOCKED; break; + case MMapConfig::Options::POPULATE: _mmapFlags |= MAP_POPULATE; break; + case MMapConfig::Options::HUGETLB: _mmapFlags |= MAP_HUGETLB; break; } } switch (mmapFlags.advise) { - case MMapConfig::NORMAL: setAdvise(POSIX_FADV_NORMAL); break; - case MMapConfig::RANDOM: setAdvise(POSIX_FADV_RANDOM); break; - case MMapConfig::SEQUENTIAL: setAdvise(POSIX_FADV_SEQUENTIAL); break; + case MMapConfig::Advise::NORMAL: setAdvise(POSIX_FADV_NORMAL); break; + case MMapConfig::Advise::RANDOM: setAdvise(POSIX_FADV_RANDOM); break; + case MMapConfig::Advise::SEQUENTIAL: setAdvise(POSIX_FADV_SEQUENTIAL); break; } } diff --git a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp index 0b02d10ffab..b8d21fb7465 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/translogserverapp.cpp @@ -28,9 +28,9 @@ DomainPart::Crc getCrc(searchlib::TranslogserverConfig::Crcmethod crcType) { switch (crcType) { - case searchlib::TranslogserverConfig::ccitt_crc32: + case searchlib::TranslogserverConfig::Crcmethod::ccitt_crc32: return DomainPart::ccitt_crc32; - case searchlib::TranslogserverConfig::xxh64: + case searchlib::TranslogserverConfig::Crcmethod::xxh64: return DomainPart::xxh64; } LOG_ABORT("should not be reached"); diff --git a/storage/src/tests/distributor/distributortest.cpp b/storage/src/tests/distributor/distributortest.cpp index 2710ed67717..dfc67fd6f5a 100644 --- a/storage/src/tests/distributor/distributortest.cpp +++ b/storage/src/tests/distributor/distributortest.cpp @@ -607,15 +607,15 @@ TEST_F(DistributorTest, host_info_reporter_config_is_propagated_to_reporter) { TEST_F(DistributorTest, replica_counting_mode_is_configured_to_trusted_by_default) { setupDistributor(Redundancy(2), NodeCount(2), "storage:2 distributor:1"); - EXPECT_EQ(ConfigBuilder::TRUSTED, currentReplicaCountingMode()); + EXPECT_EQ(ConfigBuilder::MinimumReplicaCountingMode::TRUSTED, currentReplicaCountingMode()); } TEST_F(DistributorTest, replica_counting_mode_config_is_propagated_to_metric_updater) { setupDistributor(Redundancy(2), NodeCount(2), "storage:2 distributor:1"); ConfigBuilder builder; - builder.minimumReplicaCountingMode = ConfigBuilder::ANY; + builder.minimumReplicaCountingMode = ConfigBuilder::MinimumReplicaCountingMode::ANY; configureDistributor(builder); - EXPECT_EQ(ConfigBuilder::ANY, currentReplicaCountingMode()); + EXPECT_EQ(ConfigBuilder::MinimumReplicaCountingMode::ANY, currentReplicaCountingMode()); } TEST_F(DistributorTest, bucket_activation_is_enabled_by_default) { diff --git a/storageserver/src/apps/storaged/storage.cpp b/storageserver/src/apps/storaged/storage.cpp index 0261d8e587e..b1eafcbad93 100644 --- a/storageserver/src/apps/storaged/storage.cpp +++ b/storageserver/src/apps/storaged/storage.cpp @@ -37,8 +37,8 @@ Process::UP createProcess(vespalib::stringref configId) { if (serverConfig->isDistributor) { return Process::UP(new DistributorProcess(configId)); } else switch (serverConfig->persistenceProvider.type) { - case vespa::config::content::core::StorServerConfig::PersistenceProvider::STORAGE: - case vespa::config::content::core::StorServerConfig::PersistenceProvider::DUMMY: + case vespa::config::content::core::StorServerConfig::PersistenceProvider::Type::STORAGE: + case vespa::config::content::core::StorServerConfig::PersistenceProvider::Type::DUMMY: return Process::UP(new DummyServiceLayerProcess(configId)); default: throw vespalib::IllegalStateException("Unknown persistence provider.", VESPA_STRLOC); diff --git a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp index 6ef391fa56a..57fdcdeb248 100644 --- a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp +++ b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp @@ -32,7 +32,7 @@ DistributorProcess::setupConfig(uint64_t subscribeTimeout) std::unique_ptr<vespa::config::content::core::StorServerConfig> config = config::ConfigGetter<vespa::config::content::core::StorServerConfig>::getConfig(_configUri.getConfigId(), _configUri.getContext(), subscribeTimeout); if (config->persistenceProvider.type - != vespa::config::content::core::StorServerConfig::PersistenceProvider::STORAGE) + != vespa::config::content::core::StorServerConfig::PersistenceProvider::Type::STORAGE) { _activeFlag = DistributorNode::NEED_ACTIVE_BUCKET_STATES_SET; } diff --git a/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp b/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp index 4ed4e9462d3..ba94caa8965 100644 --- a/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/rankmanager.cpp @@ -43,7 +43,7 @@ RankManager::Snapshot::detectFields(const VsmfieldsHandle & fields) { for (uint32_t i = 0; i < fields->fieldspec.size(); ++i) { const VsmfieldsConfig::Fieldspec & fs = fields->fieldspec[i]; - bool isAttribute = (fs.fieldtype == VsmfieldsConfig::Fieldspec::ATTRIBUTE); + bool isAttribute = (fs.fieldtype == VsmfieldsConfig::Fieldspec::Fieldtype::ATTRIBUTE); LOG(debug, "Adding field of type '%s' and name '%s' with id '%u' the index environment.", isAttribute ? "ATTRIBUTE" : "INDEX", fs.name.c_str(), i); // This id must match the vsm specific field id diff --git a/vsm/src/tests/searcher/searcher.cpp b/vsm/src/tests/searcher/searcher.cpp index f5f7508a256..02555f9d6f6 100644 --- a/vsm/src/tests/searcher/searcher.cpp +++ b/vsm/src/tests/searcher/searcher.cpp @@ -766,7 +766,7 @@ TEST("FieldSearchSpec constrution") { EXPECT_EQUAL(0x100000u, f.maxLength()); } { - FieldSearchSpec f(7, "f0", VsmfieldsConfig::Fieldspec::AUTOUTF8, "substring", 789); + FieldSearchSpec f(7, "f0", VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8, "substring", 789); EXPECT_TRUE(f.valid()); EXPECT_EQUAL(7u, f.id()); EXPECT_EQUAL("f0", f.name()); @@ -777,8 +777,8 @@ TEST("FieldSearchSpec constrution") { TEST("snippet modifier manager") { FieldSearchSpecMapT specMap; - specMap[0] = FieldSearchSpec(0, "f0", VsmfieldsConfig::Fieldspec::AUTOUTF8, "substring", 1000); - specMap[1] = FieldSearchSpec(1, "f1", VsmfieldsConfig::Fieldspec::AUTOUTF8, "", 1000); + specMap[0] = FieldSearchSpec(0, "f0", VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8, "substring", 1000); + specMap[1] = FieldSearchSpec(1, "f1", VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8, "", 1000); IndexFieldMapT indexMap; indexMap["i0"].push_back(0); indexMap["i1"].push_back(1); diff --git a/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp b/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp index c5e63fde7ba..1440b894934 100644 --- a/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp +++ b/vsm/src/vespa/vsm/vsm/docsumfieldspec.cpp @@ -16,7 +16,7 @@ DocsumFieldSpec::FieldIdentifier::FieldIdentifier(FieldIdT id, FieldPath path) : DocsumFieldSpec::DocsumFieldSpec() : _resultType(search::docsummary::RES_INT), - _command(VsmsummaryConfig::Fieldmap::NONE), + _command(VsmsummaryConfig::Fieldmap::Command::NONE), _outputField(), _inputFields() { } diff --git a/vsm/src/vespa/vsm/vsm/docsumfilter.cpp b/vsm/src/vespa/vsm/vsm/docsumfilter.cpp index 872ccf6acf8..3794e78cf5b 100644 --- a/vsm/src/vespa/vsm/vsm/docsumfilter.cpp +++ b/vsm/src/vespa/vsm/vsm/docsumfilter.cpp @@ -188,7 +188,7 @@ DocsumFilter::getFieldValue(const DocsumFieldSpec::FieldIdentifier & fieldId, return nullptr; } switch (command) { - case VsmsummaryConfig::Fieldmap::FLATTENJUNIPER: + case VsmsummaryConfig::Fieldmap::Command::FLATTENJUNIPER: if (_snippetModifiers != nullptr) { FieldModifier * mod = _snippetModifiers->getModifier(fId); if (mod != nullptr) { @@ -319,7 +319,7 @@ DocsumFilter::writeSlimeField(const DocsumFieldSpec & fieldSpec, const Document & docsum, ResultPacker & packer) { - if (fieldSpec.getCommand() == VsmsummaryConfig::Fieldmap::NONE) { + if (fieldSpec.getCommand() == VsmsummaryConfig::Fieldmap::Command::NONE) { const DocsumFieldSpec::FieldIdentifier & fieldId = fieldSpec.getOutputField(); const document::FieldValue * fv = docsum.getField(fieldId.getId()); if (fv != nullptr) { @@ -347,7 +347,7 @@ DocsumFilter::writeFlattenField(const DocsumFieldSpec & fieldSpec, const Document & docsum, ResultPacker & packer) { - if (fieldSpec.getCommand() == VsmsummaryConfig::Fieldmap::NONE) { + if (fieldSpec.getCommand() == VsmsummaryConfig::Fieldmap::Command::NONE) { LOG(debug, "writeFlattenField: Cannot handle command NONE"); packer.AddEmpty(); return; @@ -362,7 +362,7 @@ DocsumFilter::writeFlattenField(const DocsumFieldSpec & fieldSpec, } switch (fieldSpec.getCommand()) { - case VsmsummaryConfig::Fieldmap::FLATTENJUNIPER: + case VsmsummaryConfig::Fieldmap::Command::FLATTENJUNIPER: _flattenWriter.setSeparator("\x1E"); // record separator (same as juniper uses) break; default: @@ -453,7 +453,7 @@ DocsumFilter::getMappedDocsum(uint32_t id) // this really means 'structured data' writeSlimeField(*it, doc, _packer); } else { - if (it->getInputFields().size() == 1 && it->getCommand() == VsmsummaryConfig::Fieldmap::NONE) { + if (it->getInputFields().size() == 1 && it->getCommand() == VsmsummaryConfig::Fieldmap::Command::NONE) { const DocsumFieldSpec::FieldIdentifier & fieldId = it->getInputFields()[0]; const document::FieldValue * field = doc.getField(fieldId.getId()); if (field != nullptr) { @@ -461,7 +461,7 @@ DocsumFilter::getMappedDocsum(uint32_t id) } else { writeEmpty(type, _packer); // void input } - } else if (it->getInputFields().size() == 0 && it->getCommand() == VsmsummaryConfig::Fieldmap::NONE) { + } else if (it->getInputFields().size() == 0 && it->getCommand() == VsmsummaryConfig::Fieldmap::Command::NONE) { LOG(spam, "0 inputfields for output field %u", it->getOutputField().getId()); writeEmpty(type, _packer); // no input } else { diff --git a/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp b/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp index bb30cdd89e9..8d4cf72b824 100644 --- a/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp +++ b/vsm/src/vespa/vsm/vsm/fieldsearchspec.cpp @@ -45,7 +45,7 @@ FieldSearchSpec::FieldSearchSpec() : _name(), _maxLength(0x100000), _searcher(), - _searchMethod(VsmfieldsConfig::Fieldspec::NONE), + _searchMethod(VsmfieldsConfig::Fieldspec::Searchmethod::NONE), _arg1(), _reconfigured(false) { @@ -65,12 +65,12 @@ FieldSearchSpec::FieldSearchSpec(const FieldIdT & fid, const vespalib::string & { switch(searchDef) { default: - LOG(warning, "Unknown searchdef = %d. Defaulting to AUTOUTF8", searchDef); + LOG(warning, "Unknown searchdef = %d. Defaulting to AUTOUTF8", static_cast<int>(searchDef)); [[fallthrough]]; - case VsmfieldsConfig::Fieldspec::AUTOUTF8: - case VsmfieldsConfig::Fieldspec::NONE: - case VsmfieldsConfig::Fieldspec::SSE2UTF8: - case VsmfieldsConfig::Fieldspec::UTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::NONE: + case VsmfieldsConfig::Fieldspec::Searchmethod::SSE2UTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::UTF8: if (arg1 == "substring") { _searcher = UTF8SubStringFieldSearcher(fid); } else if (arg1 == "suffix") { @@ -79,25 +79,25 @@ FieldSearchSpec::FieldSearchSpec(const FieldIdT & fid, const vespalib::string & _searcher = UTF8ExactStringFieldSearcher(fid); } else if (arg1 == "word") { _searcher = UTF8ExactStringFieldSearcher(fid); - } else if (searchDef == VsmfieldsConfig::Fieldspec::UTF8) { + } else if (searchDef == VsmfieldsConfig::Fieldspec::Searchmethod::UTF8) { _searcher = UTF8StrChrFieldSearcher(fid); } else { _searcher = FUTF8StrChrFieldSearcher(fid); } break; - case VsmfieldsConfig::Fieldspec::BOOL: + case VsmfieldsConfig::Fieldspec::Searchmethod::BOOL: _searcher = BoolFieldSearcher(fid); break; - case VsmfieldsConfig::Fieldspec::INT8: - case VsmfieldsConfig::Fieldspec::INT16: - case VsmfieldsConfig::Fieldspec::INT32: - case VsmfieldsConfig::Fieldspec::INT64: + case VsmfieldsConfig::Fieldspec::Searchmethod::INT8: + case VsmfieldsConfig::Fieldspec::Searchmethod::INT16: + case VsmfieldsConfig::Fieldspec::Searchmethod::INT32: + case VsmfieldsConfig::Fieldspec::Searchmethod::INT64: _searcher = IntFieldSearcher(fid); break; - case VsmfieldsConfig::Fieldspec::FLOAT: + case VsmfieldsConfig::Fieldspec::Searchmethod::FLOAT: _searcher = FloatFieldSearcher(fid); break; - case VsmfieldsConfig::Fieldspec::DOUBLE: + case VsmfieldsConfig::Fieldspec::Searchmethod::DOUBLE: _searcher = DoubleFieldSearcher(fid); break; } @@ -114,10 +114,10 @@ FieldSearchSpec::reconfig(const search::QueryTerm & term) return; } switch (_searchMethod) { - case VsmfieldsConfig::Fieldspec::NONE: - case VsmfieldsConfig::Fieldspec::AUTOUTF8: - case VsmfieldsConfig::Fieldspec::UTF8: - case VsmfieldsConfig::Fieldspec::SSE2UTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::NONE: + case VsmfieldsConfig::Fieldspec::Searchmethod::AUTOUTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::UTF8: + case VsmfieldsConfig::Fieldspec::Searchmethod::SSE2UTF8: if ((term.isSubstring() && _arg1 != "substring") || (term.isSuffix() && _arg1 != "suffix") || (term.isExactstring() && _arg1 != "exact") || diff --git a/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp b/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp index 1cd35e7ca61..f87c327e86a 100644 --- a/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp +++ b/vsm/src/vespa/vsm/vsm/vsm-adapter.cpp @@ -51,7 +51,7 @@ GetDocsumsStateCallback::~GetDocsumsStateCallback() = default; DocsumTools::FieldSpec::FieldSpec() : _outputName(), _inputNames(), - _command(VsmsummaryConfig::Fieldmap::NONE) + _command(VsmsummaryConfig::Fieldmap::Command::NONE) { } DocsumTools::FieldSpec::~FieldSpec() = default; |