diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-16 22:39:44 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-16 22:39:44 +0000 |
commit | 60d3c83657adbeeb6b3c072d9e3d0f017eeb7709 (patch) | |
tree | 92568499c259541e43e459b7a68c8af7f371d9f7 /searchcommon | |
parent | b435eb84efa3b47e43e4865637532938e26e1e3f (diff) |
UINT1 -> BOOL
Diffstat (limited to 'searchcommon')
3 files changed, 42 insertions, 34 deletions
diff --git a/searchcommon/src/tests/schema/schema_test.cpp b/searchcommon/src/tests/schema/schema_test.cpp index 8a70e4f12df..e9997c2e70d 100644 --- a/searchcommon/src/tests/schema/schema_test.cpp +++ b/searchcommon/src/tests/schema/schema_test.cpp @@ -1,16 +1,16 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> #include <vespa/vespalib/stllike/string.h> #include <fstream> #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/configparser.h> #include <vespa/searchcommon/common/schemaconfigurer.h> +#include <vespa/searchcommon/common/schema.h> +#include <vespa/log/log.h> LOG_SETUP("schema_test"); using vespalib::string; -namespace search { -namespace index { +namespace search::index { using schema::DataType; using schema::CollectionType; @@ -426,7 +426,6 @@ TEST("require that schema can be built with imported attribute fields") TEST_DO(assertField(SIAF("regular", DataType::INT32, CollectionType::SINGLE), regular[0])); } -} // namespace index -} // namespace search +} TEST_MAIN() { TEST_RUN_ALL(); } diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp index cae2299132f..e7f103f0ebb 100644 --- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp @@ -1,6 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "schemaconfigurer.h" +#include <vespa/config-attributes.h> +#include <vespa/config-imported-fields.h> +#include <vespa/config-indexschema.h> +#include <vespa/config-summary.h> +#include <vespa/searchcommon/common/schema.h> +#include <vespa/searchcommon/attribute/collectiontype.h> +#include <vespa/searchcommon/attribute/basictype.h> + #include <vespa/searchcommon/config/subscriptionproxyng.h> #include <vespa/log/log.h> @@ -9,8 +17,7 @@ LOG_SETUP(".index.schemaconfigurer"); using namespace config; using namespace vespa::config::search; -namespace search { -namespace index { +namespace search::index { using schema::DataType; using schema::CollectionType; @@ -53,7 +60,7 @@ convertDataType(const ConfigType &type) switch (type) { case ConfigType::STRING: return DataType::STRING; - case ConfigType::UINT1: + case ConfigType::BOOL: return DataType::UINT1; case ConfigType::UINT2: return DataType::UINT2; @@ -228,8 +235,7 @@ SchemaConfigurer::configure(const SummaryConfig & cfg) SchemaBuilder::build(cfg, _schema); } -SchemaConfigurer::SchemaConfigurer(Schema &schema, - const vespalib::string &configId) +SchemaConfigurer::SchemaConfigurer(Schema &schema, const vespalib::string &configId) : _schema(schema) { search::SubscriptionProxyNg<SchemaConfigurer, IndexschemaConfig> @@ -243,6 +249,4 @@ SchemaConfigurer::SchemaConfigurer(Schema &schema, summarySubscriber.subscribe(configId.c_str()); } - -} // namespace search::index -} // namespace search +} diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h index e1999e45296..75d75bc256b 100644 --- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h +++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h @@ -2,16 +2,17 @@ #pragma once -#include <vespa/config-attributes.h> -#include <vespa/config-imported-fields.h> -#include <vespa/config-indexschema.h> -#include <vespa/config-summary.h> -#include <vespa/searchcommon/common/schema.h> -#include <vespa/searchcommon/attribute/collectiontype.h> -#include <vespa/searchcommon/attribute/basictype.h> +#include <vespa/vespalib/stllike/string.h> -namespace search { -namespace index { +namespace vespa::config::search::internal { + class InternalIndexschemaType; + class InternalAttributesType; + class InternalSummaryType; +} + +namespace search::index { + +class Schema; /** * Schema class used to give a high-level description of the content @@ -20,34 +21,40 @@ namespace index { class SchemaBuilder { public: + using IndexschemaConfig = const vespa::config::search::internal::InternalIndexschemaType; + using AttributesConfig = const vespa::config::search::internal::InternalAttributesType; + using SummaryConfig = const vespa::config::search::internal::InternalSummaryType; /** * Build from indexschema config. * - * @param indexCfg vespa::config::search::IndexschemaConfig to use + * @param indexCfg IndexschemaConfig to use */ - static void build(const vespa::config::search::IndexschemaConfig &cfg, Schema &schema); + static void build(const IndexschemaConfig &cfg, Schema &schema); /** * Build from attribute config. * - * @param attributeCfg vespa::config::search::AttributesConfig to use + * @param attributeCfg AttributesConfig to use **/ - static void build(const vespa::config::search::AttributesConfig &cfg, Schema &schema); + static void build(const AttributesConfig &cfg, Schema &schema); /** * Build from summary config. * - * @param summaryCfg vespa::config::search::SummaryConfig to use + * @param summaryCfg SummaryConfig to use **/ - static void build(const vespa::config::search::SummaryConfig &cfg, Schema &schema); + static void build(const SummaryConfig &cfg, Schema &schema); }; class SchemaConfigurer { private: + using IndexschemaConfig = SchemaBuilder::IndexschemaConfig; + using AttributesConfig = SchemaBuilder::AttributesConfig; + using SummaryConfig = SchemaBuilder::SummaryConfig; Schema & _schema; - void configure(const vespa::config::search::IndexschemaConfig & cfg); - void configure(const vespa::config::search::AttributesConfig & cfg); - void configure(const vespa::config::search::SummaryConfig & cfg); + void configure(const IndexschemaConfig & cfg); + void configure(const AttributesConfig & cfg); + void configure(const SummaryConfig & cfg); public: /** @@ -58,6 +65,4 @@ public: SchemaConfigurer(Schema & schema, const vespalib::string &configId); }; -} // namespace search::index -} // namespace search - +} |