mirror of https://gitee.com/bigwinds/arangodb
issue 506.3: use camel-case configuration parameter names consistntly, add a configuration version property to iresearch view meta (#7475)
* issue 506.3: use camel-case configuration parameter names consistntly, add a configuration version property to iresearch view meta * backport: ensure meta version is supported * backport: hide 'version' property from non-persistence json
This commit is contained in:
parent
2d0a75f0d5
commit
59e002841f
|
@ -52,6 +52,7 @@ arangodb::LogTopic& logTopic() {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
std::string const StaticStrings::LinksField("links");
|
||||
std::string const StaticStrings::VersionField("version");
|
||||
std::string const StaticStrings::ViewIdField("view");
|
||||
|
||||
} // iresearch
|
||||
|
|
|
@ -36,6 +36,12 @@ arangodb::LogTopic& logTopic();
|
|||
ADB_IGNORE_UNUSED static auto& DATA_SOURCE_TYPE = dataSourceType();
|
||||
ADB_IGNORE_UNUSED static auto& TOPIC = logTopic();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief the current implementation version of the iresearch interface
|
||||
/// e.g. which how data is stored in iresearch
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
size_t const LATEST_VERSION = 0;
|
||||
|
||||
struct StaticStrings {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief the name of the field in the IResearch View definition denoting the
|
||||
|
@ -43,6 +49,12 @@ struct StaticStrings {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string const LinksField;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief the name of the field in the IResearch View definition denoting the
|
||||
/// corresponding link definitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static std::string const VersionField;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief the id of the field in the IResearch Link definition denoting the
|
||||
/// corresponding IResearch View
|
||||
|
@ -53,4 +65,4 @@ struct StaticStrings {
|
|||
} // iresearch
|
||||
} // arangodb
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -516,6 +516,7 @@ struct IResearchView::ViewFactory: public arangodb::ViewFactory {
|
|||
);
|
||||
|
||||
if (!meta->init(definition, error)
|
||||
|| meta->_version > LATEST_VERSION
|
||||
|| !impl->_metaState.init(definition, error)) {
|
||||
return arangodb::Result(
|
||||
TRI_ERROR_BAD_PARAMETER,
|
||||
|
@ -927,7 +928,22 @@ arangodb::Result IResearchView::appendVelocyPackDetailed(
|
|||
auto meta = std::atomic_load(&_meta);
|
||||
SCOPED_LOCK(meta->read()); // '_meta' can be asynchronously updated
|
||||
|
||||
if (!meta->json(builder)) {
|
||||
static const std::function<bool(irs::string_ref const& key)> acceptor = [](
|
||||
irs::string_ref const& key
|
||||
)->bool {
|
||||
return key != StaticStrings::VersionField; // ignored fields
|
||||
};
|
||||
static const std::function<bool(irs::string_ref const& key)> persistenceAcceptor = [](
|
||||
irs::string_ref const&
|
||||
)->bool {
|
||||
return true;
|
||||
};
|
||||
arangodb::velocypack::Builder sanitizedBuilder;
|
||||
|
||||
sanitizedBuilder.openObject();
|
||||
|
||||
if (!meta->json(sanitizedBuilder)
|
||||
|| !mergeSliceSkipKeys(builder, sanitizedBuilder.close().slice(), forPersistence ? persistenceAcceptor : acceptor)) {
|
||||
return arangodb::Result(
|
||||
TRI_ERROR_INTERNAL,
|
||||
std::string("failure to generate definition while generating properties jSON for arangosearch View in database '") + vocbase().name() + "'"
|
||||
|
@ -1020,17 +1036,21 @@ arangodb::Result IResearchView::appendVelocyPackDetailed(
|
|||
};
|
||||
|
||||
arangodb::velocypack::Builder sanitizedBuilder;
|
||||
|
||||
sanitizedBuilder.openObject();
|
||||
|
||||
if (!mergeSliceSkipKeys(sanitizedBuilder, linkBuilder.slice(), acceptor)) {
|
||||
Result result(TRI_ERROR_INTERNAL,
|
||||
std::string("failed to generate externally visible link ")
|
||||
.append("definition while emplacing link definition into ")
|
||||
.append("arangosearch view '").append(name()).append("'"));
|
||||
|
||||
LOG_TOPIC(WARN, iresearch::TOPIC) << result.errorMessage();
|
||||
|
||||
return result;
|
||||
}
|
||||
sanitizedBuilder.close();
|
||||
|
||||
sanitizedBuilder.close();
|
||||
linksBuilderWrapper->add(collectionName, sanitizedBuilder.slice());
|
||||
}
|
||||
}
|
||||
|
@ -1909,6 +1929,7 @@ arangodb::Result IResearchView::updateProperties(
|
|||
|
||||
// reset non-updatable values to match current meta
|
||||
meta._locale = viewMeta->_locale;
|
||||
meta._version = viewMeta->_version;
|
||||
meta._writebufferActive = viewMeta->_writebufferActive;
|
||||
meta._writebufferIdle = viewMeta->_writebufferIdle;
|
||||
meta._writebufferSizeMax = viewMeta->_writebufferSizeMax;
|
||||
|
|
|
@ -135,20 +135,20 @@ struct IResearchViewCoordinator::ViewFactory: public arangodb::ViewFactory {
|
|||
|
||||
if (!res.ok()) {
|
||||
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
|
||||
<< "failed to create links while creating arangosearch view '" << view->name() << "': " << res.errorNumber() << " " << res.errorMessage();
|
||||
<< "failed to create links while creating arangosearch view '" << impl->name() << "': " << res.errorNumber() << " " << res.errorMessage();
|
||||
}
|
||||
} catch (arangodb::basics::Exception const& e) {
|
||||
IR_LOG_EXCEPTION();
|
||||
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
|
||||
<< "caught exception while creating links while creating arangosearch view '" << view->name() << "': " << e.code() << " " << e.what();
|
||||
<< "caught exception while creating links while creating arangosearch view '" << impl->name() << "': " << e.code() << " " << e.what();
|
||||
} catch (std::exception const& e) {
|
||||
IR_LOG_EXCEPTION();
|
||||
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
|
||||
<< "caught exception while creating links while creating arangosearch view '" << view->name() << "': " << e.what();
|
||||
<< "caught exception while creating links while creating arangosearch view '" << impl->name() << "': " << e.what();
|
||||
} catch (...) {
|
||||
IR_LOG_EXCEPTION();
|
||||
LOG_TOPIC(WARN, arangodb::iresearch::TOPIC)
|
||||
<< "caught exception while creating links while creating arangosearch view '" << view->name() << "'";
|
||||
<< "caught exception while creating links while creating arangosearch view '" << impl->name() << "'";
|
||||
}
|
||||
|
||||
view = ci->getView(vocbase.name(), std::to_string(impl->id())); // refresh view from Agency
|
||||
|
@ -197,7 +197,22 @@ arangodb::Result IResearchViewCoordinator::appendVelocyPackDetailed(
|
|||
);
|
||||
}
|
||||
|
||||
if (!_meta.json(builder)) {
|
||||
static const std::function<bool(irs::string_ref const& key)> acceptor = [](
|
||||
irs::string_ref const& key
|
||||
)->bool {
|
||||
return key != StaticStrings::VersionField; // ignored fields
|
||||
};
|
||||
static const std::function<bool(irs::string_ref const& key)> persistenceAcceptor = [](
|
||||
irs::string_ref const&
|
||||
)->bool {
|
||||
return true;
|
||||
};
|
||||
arangodb::velocypack::Builder sanitizedBuilder;
|
||||
|
||||
sanitizedBuilder.openObject();
|
||||
|
||||
if (!_meta.json(sanitizedBuilder)
|
||||
|| !mergeSliceSkipKeys(builder, sanitizedBuilder.close().slice(), forPersistence ? persistenceAcceptor : acceptor)) {
|
||||
return arangodb::Result(
|
||||
TRI_ERROR_INTERNAL,
|
||||
std::string("failure to generate definition while generating properties jSON for IResearch View in database '") + vocbase().name() + "'"
|
||||
|
|
|
@ -372,8 +372,8 @@ IResearchViewDBServer::~IResearchViewDBServer() {
|
|||
}
|
||||
|
||||
arangodb::Result IResearchViewDBServer::appendVelocyPackDetailed(
|
||||
arangodb::velocypack::Builder& builder,
|
||||
bool //forPersistence
|
||||
arangodb::velocypack::Builder& builder,
|
||||
bool forPersistence
|
||||
) const {
|
||||
if (!builder.isOpenObject()) {
|
||||
return arangodb::Result(
|
||||
|
@ -385,7 +385,22 @@ arangodb::Result IResearchViewDBServer::appendVelocyPackDetailed(
|
|||
{
|
||||
SCOPED_LOCK(_meta->read()); // '_meta' can be asynchronously updated
|
||||
|
||||
if (!_meta->json(builder)) {
|
||||
static const std::function<bool(irs::string_ref const& key)> acceptor = [](
|
||||
irs::string_ref const& key
|
||||
)->bool {
|
||||
return key != StaticStrings::VersionField; // ignored fields
|
||||
};
|
||||
static const std::function<bool(irs::string_ref const& key)> persistenceAcceptor = [](
|
||||
irs::string_ref const&
|
||||
)->bool {
|
||||
return true;
|
||||
};
|
||||
arangodb::velocypack::Builder sanitizedBuilder;
|
||||
|
||||
sanitizedBuilder.openObject();
|
||||
|
||||
if (!_meta->json(sanitizedBuilder)
|
||||
|| !mergeSliceSkipKeys(builder, sanitizedBuilder.close().slice(), forPersistence ? persistenceAcceptor : acceptor)) {
|
||||
return arangodb::Result(
|
||||
TRI_ERROR_INTERNAL,
|
||||
std::string("failure to generate definition while generating properties jSON for arangosearch view in database '") + vocbase().name() + "'"
|
||||
|
@ -806,4 +821,4 @@ bool IResearchViewDBServer::visitCollections(
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
|
@ -24,6 +24,7 @@
|
|||
#include "utils/index_utils.hpp"
|
||||
#include "utils/locale_utils.hpp"
|
||||
|
||||
#include "IResearchCommon.h"
|
||||
#include "VelocyPackHelper.h"
|
||||
#include "Basics/StringUtils.h"
|
||||
#include "velocypack/Builder.h"
|
||||
|
@ -116,7 +117,7 @@ arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy createConsolidationP
|
|||
|
||||
{
|
||||
// optional size_t
|
||||
static const std::string fieldName("segments_bytes_floor");
|
||||
static const std::string fieldName("segmentsBytesFloor");
|
||||
|
||||
if (slice.hasKey(fieldName)) {
|
||||
auto field = slice.get(fieldName);
|
||||
|
@ -133,7 +134,7 @@ arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy createConsolidationP
|
|||
|
||||
{
|
||||
// optional size_t
|
||||
static const std::string fieldName("segments_bytes_max");
|
||||
static const std::string fieldName("segmentsBytesMax");
|
||||
|
||||
if (slice.hasKey(fieldName)) {
|
||||
auto field = slice.get(fieldName);
|
||||
|
@ -150,7 +151,7 @@ arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy createConsolidationP
|
|||
|
||||
{
|
||||
// optional size_t
|
||||
static const std::string fieldName("segments_max");
|
||||
static const std::string fieldName("segmentsMax");
|
||||
|
||||
if (slice.hasKey(fieldName)) {
|
||||
auto field = slice.get(fieldName);
|
||||
|
@ -167,7 +168,7 @@ arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy createConsolidationP
|
|||
|
||||
{
|
||||
// optional size_t
|
||||
static const std::string fieldName("segments_min");
|
||||
static const std::string fieldName("segmentsMin");
|
||||
|
||||
if (slice.hasKey(fieldName)) {
|
||||
auto field = slice.get(fieldName);
|
||||
|
@ -185,10 +186,10 @@ arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy createConsolidationP
|
|||
properties.openObject();
|
||||
properties.add("type", arangodb::iresearch::toValuePair(POLICY_TIER));
|
||||
properties.add("lookahead", arangodb::velocypack::Value(options.lookahead));
|
||||
properties.add("segments_bytes_floor", arangodb::velocypack::Value(options.floor_segment_bytes));
|
||||
properties.add("segments_bytes_max", arangodb::velocypack::Value(options.max_segments_bytes));
|
||||
properties.add("segments_max", arangodb::velocypack::Value(options.max_segments));
|
||||
properties.add("segments_min", arangodb::velocypack::Value(options.min_segments));
|
||||
properties.add("segmentsBytesFloor", arangodb::velocypack::Value(options.floor_segment_bytes));
|
||||
properties.add("segmentsBytesMax", arangodb::velocypack::Value(options.max_segments_bytes));
|
||||
properties.add("segmentsMax", arangodb::velocypack::Value(options.max_segments));
|
||||
properties.add("segmentsMin", arangodb::velocypack::Value(options.min_segments));
|
||||
properties.close();
|
||||
|
||||
return arangodb::iresearch::IResearchViewMeta::ConsolidationPolicy{
|
||||
|
@ -206,6 +207,7 @@ IResearchViewMeta::Mask::Mask(bool mask /*=false*/) noexcept
|
|||
_consolidationIntervalMsec(mask),
|
||||
_consolidationPolicy(mask),
|
||||
_locale(mask),
|
||||
_version(mask),
|
||||
_writebufferActive(mask),
|
||||
_writebufferIdle(mask),
|
||||
_writebufferSizeMax(mask) {
|
||||
|
@ -215,6 +217,7 @@ IResearchViewMeta::IResearchViewMeta()
|
|||
: _cleanupIntervalStep(10),
|
||||
_consolidationIntervalMsec(60 * 1000),
|
||||
_locale(std::locale::classic()),
|
||||
_version(LATEST_VERSION),
|
||||
_writebufferActive(0),
|
||||
_writebufferIdle(64),
|
||||
_writebufferSizeMax(32*(size_t(1)<<20)) { // 32MB
|
||||
|
@ -247,6 +250,7 @@ IResearchViewMeta& IResearchViewMeta::operator=(IResearchViewMeta&& other) noexc
|
|||
_consolidationIntervalMsec = std::move(other._consolidationIntervalMsec);
|
||||
_consolidationPolicy = std::move(other._consolidationPolicy);
|
||||
_locale = std::move(other._locale);
|
||||
_version = std::move(other._version);
|
||||
_writebufferActive = std::move(other._writebufferActive);
|
||||
_writebufferIdle = std::move(other._writebufferIdle);
|
||||
_writebufferSizeMax = std::move(other._writebufferSizeMax);
|
||||
|
@ -261,6 +265,7 @@ IResearchViewMeta& IResearchViewMeta::operator=(IResearchViewMeta const& other)
|
|||
_consolidationIntervalMsec = other._consolidationIntervalMsec;
|
||||
_consolidationPolicy = other._consolidationPolicy;
|
||||
_locale = other._locale;
|
||||
_version = other._version;
|
||||
_writebufferActive = other._writebufferActive;
|
||||
_writebufferIdle = other._writebufferIdle;
|
||||
_writebufferSizeMax = other._writebufferSizeMax;
|
||||
|
@ -288,6 +293,10 @@ bool IResearchViewMeta::operator==(IResearchViewMeta const& other) const noexcep
|
|||
return false; // values do not match
|
||||
}
|
||||
|
||||
if (_version != other._version) {
|
||||
return false; // values do not match
|
||||
}
|
||||
|
||||
if (_writebufferActive != other._writebufferActive) {
|
||||
return false; // values do not match
|
||||
}
|
||||
|
@ -331,6 +340,25 @@ bool IResearchViewMeta::init(
|
|||
mask = &tmpMask;
|
||||
}
|
||||
|
||||
{
|
||||
// optional uint32_t
|
||||
static const std::string fieldName(StaticStrings::VersionField);
|
||||
|
||||
mask->_version = slice.hasKey(fieldName);
|
||||
|
||||
if (!mask->_version) {
|
||||
_version = defaults._version;
|
||||
} else {
|
||||
auto field = slice.get(fieldName);
|
||||
|
||||
if (!getNumber(_version, field)) {
|
||||
errorField = fieldName;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// optional size_t
|
||||
static const std::string fieldName("cleanupIntervalStep");
|
||||
|
@ -550,6 +578,10 @@ bool IResearchViewMeta::json(
|
|||
}
|
||||
*/
|
||||
|
||||
if ((!ignoreEqual || _version != ignoreEqual->_version) && (!mask || mask->_version)) {
|
||||
builder.add(StaticStrings::VersionField, arangodb::velocypack::Value(_version));
|
||||
}
|
||||
|
||||
if ((!ignoreEqual || _writebufferActive != ignoreEqual->_writebufferActive) && (!mask || mask->_writebufferActive)) {
|
||||
builder.add("writebufferActive", arangodb::velocypack::Value(_writebufferActive));
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ struct IResearchViewMeta {
|
|||
bool _consolidationIntervalMsec;
|
||||
bool _consolidationPolicy;
|
||||
bool _locale;
|
||||
bool _version;
|
||||
bool _writebufferActive;
|
||||
bool _writebufferIdle;
|
||||
bool _writebufferSizeMax;
|
||||
|
@ -88,6 +89,7 @@ struct IResearchViewMeta {
|
|||
size_t _consolidationIntervalMsec; // issue consolidation after <interval> milliseconds (0 == disable)
|
||||
ConsolidationPolicy _consolidationPolicy; // the consolidation policy to use
|
||||
std::locale _locale; // locale used for ordering processed attribute names
|
||||
uint32_t _version; // the version of the iresearch interface e.g. which how data is stored in iresearch (default == latest)
|
||||
size_t _writebufferActive; // maximum number of concurrent segments before segment aquisition blocks, e.g. max number of concurrent transacitons) (0 == unlimited)
|
||||
size_t _writebufferIdle; // maximum number of segments cached in the pool
|
||||
size_t _writebufferSizeMax; // maximum memory byte size per segment before a segment flush is triggered (0 == unlimited)
|
||||
|
|
|
@ -285,7 +285,7 @@ SECTION("test_defaults") {
|
|||
arangodb::iresearch::IResearchViewMetaState metaState;
|
||||
std::string error;
|
||||
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.hasKey("globallyUniqueId") && slice.get("globallyUniqueId").isString() && false == slice.get("globallyUniqueId").copyString().empty()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
|
@ -1036,6 +1036,26 @@ SECTION("test_drop_database") {
|
|||
CHECK((1 == beforeCount));
|
||||
}
|
||||
|
||||
SECTION("test_instantiate") {
|
||||
// valid version
|
||||
{
|
||||
auto json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\", \"version\": 0 }");
|
||||
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
|
||||
arangodb::LogicalView::ptr view;
|
||||
CHECK((arangodb::iresearch::IResearchView::factory().instantiate(view, vocbase, json->slice(), 0).ok()));
|
||||
CHECK((false == !view));
|
||||
}
|
||||
|
||||
// unsupported version
|
||||
{
|
||||
auto json = arangodb::velocypack::Parser::fromJson("{ \"name\": \"testView\", \"type\": \"arangosearch\", \"version\": 123456789 }");
|
||||
TRI_vocbase_t vocbase(TRI_vocbase_type_e::TRI_VOCBASE_TYPE_NORMAL, 1, "testVocbase");
|
||||
arangodb::LogicalView::ptr view;
|
||||
CHECK((!arangodb::iresearch::IResearchView::factory().instantiate(view, vocbase, json->slice(), 0).ok()));
|
||||
CHECK((true == !view));
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("test_truncate_cid") {
|
||||
static std::vector<std::string> const EMPTY;
|
||||
|
||||
|
@ -3325,7 +3345,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3384,7 +3404,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3447,7 +3467,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3510,7 +3530,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3577,7 +3597,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3665,7 +3685,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3727,7 +3747,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3820,7 +3840,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3901,7 +3921,7 @@ SECTION("test_update_overwrite") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -3966,7 +3986,7 @@ SECTION("test_update_overwrite") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4014,7 +4034,7 @@ SECTION("test_update_overwrite") {
|
|||
builder.close();
|
||||
|
||||
auto slice = builder.slice();
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4595,7 +4615,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4657,7 +4677,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4720,7 +4740,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4787,7 +4807,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4875,7 +4895,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -4957,7 +4977,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.get("name").copyString() == "testView"));
|
||||
CHECK((slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name()));
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5025,7 +5045,7 @@ SECTION("test_update_partial") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5114,7 +5134,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5222,7 +5242,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5289,7 +5309,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5434,7 +5454,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5492,7 +5512,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5557,7 +5577,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5624,7 +5644,7 @@ SECTION("test_update_partial") {
|
|||
std::string error;
|
||||
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5679,7 +5699,7 @@ SECTION("test_update_partial") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5732,7 +5752,7 @@ SECTION("test_update_partial") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5800,7 +5820,7 @@ SECTION("test_update_partial") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -5850,7 +5870,7 @@ SECTION("test_update_partial") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK(slice.isObject());
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK(slice.get("name").copyString() == "testView");
|
||||
CHECK(slice.get("type").copyString() == arangodb::iresearch::DATA_SOURCE_TYPE.name());
|
||||
CHECK((slice.hasKey("deleted") && slice.get("deleted").isBoolean() && false == slice.get("deleted").getBoolean())); // has system properties
|
||||
|
@ -6179,4 +6199,4 @@ SECTION("test_update_partial") {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
|
@ -178,6 +178,7 @@ struct IResearchViewCoordinatorSetup {
|
|||
orderedFeatures = arangodb::application_features::ApplicationServer::server->getOrderedFeatures();
|
||||
|
||||
// suppress log messages since tests check error conditions
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::ENGINES.name(), arangodb::LogLevel::FATAL); // suppress ERROR {engines} failed to instantiate index, error: ...
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::FIXME.name(), arangodb::LogLevel::ERR); // suppress ERROR recovery failure due to error from callback
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::CLUSTER.name(), arangodb::LogLevel::FATAL);
|
||||
arangodb::LogTopic::setLogLevel(arangodb::iresearch::TOPIC.name(), arangodb::LogLevel::FATAL);
|
||||
|
@ -221,6 +222,7 @@ struct IResearchViewCoordinatorSetup {
|
|||
arangodb::LogTopic::setLogLevel(arangodb::iresearch::TOPIC.name(), arangodb::LogLevel::DEFAULT);
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::CLUSTER.name(), arangodb::LogLevel::DEFAULT);
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::FIXME.name(), arangodb::LogLevel::DEFAULT);
|
||||
arangodb::LogTopic::setLogLevel(arangodb::Logger::ENGINES.name(), arangodb::LogLevel::DEFAULT);
|
||||
arangodb::ClusterInfo::cleanup(); // reset ClusterInfo::instance() before DatabaseFeature::unprepare()
|
||||
arangodb::application_features::ApplicationServer::server = nullptr;
|
||||
|
||||
|
@ -362,7 +364,7 @@ SECTION("test_defaults") {
|
|||
arangodb::iresearch::IResearchViewMeta meta;
|
||||
std::string error;
|
||||
|
||||
CHECK((13U == slice.length()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((slice.hasKey("globallyUniqueId") && slice.get("globallyUniqueId").isString() && false == slice.get("globallyUniqueId").copyString().empty()));
|
||||
CHECK((slice.get("id").copyString() == "1"));
|
||||
CHECK((slice.hasKey("isSystem") && slice.get("isSystem").isBoolean() && false == slice.get("isSystem").getBoolean()));
|
||||
|
|
|
@ -1116,7 +1116,7 @@ SECTION("test_updateProperties") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
|
||||
CHECK((slice.hasKey("cleanupIntervalStep") && slice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == slice.get("cleanupIntervalStep").getNumber<size_t>()));
|
||||
CHECK((slice.hasKey("consolidationIntervalMsec") && slice.get("consolidationIntervalMsec").isNumber<size_t>() && 52 == slice.get("consolidationIntervalMsec").getNumber<size_t>()));
|
||||
|
@ -1206,7 +1206,7 @@ SECTION("test_updateProperties") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
|
||||
CHECK((slice.hasKey("cleanupIntervalStep") && slice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == slice.get("cleanupIntervalStep").getNumber<size_t>()));
|
||||
CHECK((slice.hasKey("consolidationIntervalMsec") && slice.get("consolidationIntervalMsec").isNumber<size_t>() && 52 == slice.get("consolidationIntervalMsec").getNumber<size_t>()));
|
||||
|
@ -1298,7 +1298,7 @@ SECTION("test_updateProperties") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
|
||||
CHECK((slice.hasKey("cleanupIntervalStep") && slice.get("cleanupIntervalStep").isNumber<size_t>() && 24 == slice.get("cleanupIntervalStep").getNumber<size_t>()));
|
||||
CHECK((slice.hasKey("consolidationIntervalMsec") && slice.get("consolidationIntervalMsec").isNumber<size_t>() && 52 == slice.get("consolidationIntervalMsec").getNumber<size_t>()));
|
||||
|
@ -1393,7 +1393,7 @@ SECTION("test_updateProperties") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
CHECK((slice.isObject()));
|
||||
CHECK((14U == slice.length()));
|
||||
CHECK((15U == slice.length()));
|
||||
CHECK((slice.hasKey("collections") && slice.get("collections").isArray() && 0 == slice.get("collections").length()));
|
||||
CHECK((slice.hasKey("cleanupIntervalStep") && slice.get("cleanupIntervalStep").isNumber<size_t>() && 10 == slice.get("cleanupIntervalStep").getNumber<size_t>()));
|
||||
CHECK((slice.hasKey("consolidationIntervalMsec") && slice.get("consolidationIntervalMsec").isNumber<size_t>() && 52 == slice.get("consolidationIntervalMsec").getNumber<size_t>()));
|
||||
|
|
|
@ -212,6 +212,22 @@ SECTION("test_readCustomizedValues") {
|
|||
CHECK((std::string("consolidationPolicy=>type") == errorField));
|
||||
}
|
||||
|
||||
{
|
||||
std::string errorField;
|
||||
auto json = arangodb::velocypack::Parser::fromJson("{ \"version\": -0.5 }");
|
||||
CHECK((true == metaState.init(json->slice(), errorField)));
|
||||
CHECK(false == meta.init(json->slice(), errorField));
|
||||
CHECK((std::string("version") == errorField));
|
||||
}
|
||||
|
||||
{
|
||||
std::string errorField;
|
||||
auto json = arangodb::velocypack::Parser::fromJson("{ \"version\": 1.5 }");
|
||||
CHECK((true == metaState.init(json->slice(), errorField)));
|
||||
CHECK(false == meta.init(json->slice(), errorField));
|
||||
CHECK((std::string("version") == errorField));
|
||||
}
|
||||
|
||||
// .............................................................................
|
||||
// test valid value
|
||||
// .............................................................................
|
||||
|
@ -224,6 +240,7 @@ SECTION("test_readCustomizedValues") {
|
|||
\"cleanupIntervalStep\": 654, \
|
||||
\"consolidationPolicy\": { \"type\": \"bytes_accum\", \"threshold\": 0.11 }, \
|
||||
\"locale\": \"ru_RU.KOI8-R\", \
|
||||
\"version\": 9, \
|
||||
\"writebufferActive\": 10, \
|
||||
\"writebufferIdle\": 11, \
|
||||
\"writebufferSizeMax\": 12 \
|
||||
|
@ -244,6 +261,7 @@ SECTION("test_readCustomizedValues") {
|
|||
CHECK((false == !meta._consolidationPolicy.policy()));
|
||||
CHECK((.11f == meta._consolidationPolicy.properties().get("threshold").getNumber<float>()));
|
||||
CHECK(std::string("C") == iresearch::locale_utils::name(meta._locale));
|
||||
CHECK((9 == meta._version));
|
||||
CHECK((10 == meta._writebufferActive));
|
||||
CHECK((11 == meta._writebufferIdle));
|
||||
CHECK((12 == meta._writebufferSizeMax));
|
||||
|
@ -263,7 +281,7 @@ SECTION("test_writeDefaults") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
|
||||
CHECK((7U == slice.length()));
|
||||
CHECK((8U == slice.length()));
|
||||
tmpSlice = slice.get("collections");
|
||||
CHECK((true == tmpSlice.isArray() && 0 == tmpSlice.length()));
|
||||
tmpSlice = slice.get("cleanupIntervalStep");
|
||||
|
@ -276,6 +294,8 @@ SECTION("test_writeDefaults") {
|
|||
CHECK((tmpSlice2.isNumber<float>() && .1f == tmpSlice2.getNumber<float>()));
|
||||
tmpSlice2 = tmpSlice.get("type");
|
||||
CHECK((tmpSlice2.isString() && std::string("bytes_accum") == tmpSlice2.copyString()));
|
||||
tmpSlice = slice.get("version");
|
||||
CHECK((true == tmpSlice.isNumber<uint32_t>() && 0 == tmpSlice.getNumber<uint32_t>()));
|
||||
tmpSlice = slice.get("writebufferActive");
|
||||
CHECK((true == tmpSlice.isNumber<size_t>() && 0 == tmpSlice.getNumber<size_t>()));
|
||||
tmpSlice = slice.get("writebufferIdle");
|
||||
|
@ -327,6 +347,7 @@ SECTION("test_writeCustomizedValues") {
|
|||
std::move(*arangodb::velocypack::Parser::fromJson("{ \"type\": \"tier\", \"threshold\": 0.11 }"))
|
||||
);
|
||||
meta._locale = iresearch::locale_utils::locale("en_UK.UTF-8");
|
||||
meta._version = 42;
|
||||
meta._writebufferActive = 10;
|
||||
meta._writebufferIdle = 11;
|
||||
meta._writebufferSizeMax = 12;
|
||||
|
@ -343,7 +364,7 @@ SECTION("test_writeCustomizedValues") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
|
||||
CHECK((7U == slice.length()));
|
||||
CHECK((8U == slice.length()));
|
||||
tmpSlice = slice.get("collections");
|
||||
CHECK((true == tmpSlice.isArray() && 3 == tmpSlice.length()));
|
||||
|
||||
|
@ -363,6 +384,8 @@ SECTION("test_writeCustomizedValues") {
|
|||
CHECK((tmpSlice2.isNumber<float>() && .11f == tmpSlice2.getNumber<float>()));
|
||||
tmpSlice2 = tmpSlice.get("type");
|
||||
CHECK((tmpSlice2.isString() && std::string("tier") == tmpSlice2.copyString()));
|
||||
tmpSlice = slice.get("version");
|
||||
CHECK((true == tmpSlice.isNumber<uint32_t>() && 42 == tmpSlice.getNumber<uint32_t>()));
|
||||
tmpSlice = slice.get("writebufferActive");
|
||||
CHECK((true == tmpSlice.isNumber<size_t>() && 10 == tmpSlice.getNumber<size_t>()));
|
||||
tmpSlice = slice.get("writebufferIdle");
|
||||
|
@ -385,6 +408,7 @@ SECTION("test_readMaskAll") {
|
|||
\"cleanupIntervalStep\": 456, \
|
||||
\"consolidationPolicy\": { \"type\": \"tier\", \"threshold\": 0.1 }, \
|
||||
\"locale\": \"ru_RU.KOI8-R\", \
|
||||
\"version\": 42, \
|
||||
\"writebufferActive\": 10, \
|
||||
\"writebufferIdle\": 11, \
|
||||
\"writebufferSizeMax\": 12 \
|
||||
|
@ -437,12 +461,13 @@ SECTION("test_writeMaskAll") {
|
|||
|
||||
auto slice = builder.slice();
|
||||
|
||||
CHECK((7U == slice.length()));
|
||||
CHECK((8U == slice.length()));
|
||||
CHECK(true == slice.hasKey("collections"));
|
||||
CHECK(true == slice.hasKey("cleanupIntervalStep"));
|
||||
CHECK(true == slice.hasKey("consolidationIntervalMsec"));
|
||||
CHECK(true == slice.hasKey("consolidationPolicy"));
|
||||
CHECK((false == slice.hasKey("locale")));
|
||||
CHECK((true == slice.hasKey("version")));
|
||||
CHECK((true == slice.hasKey("writebufferActive")));
|
||||
CHECK((true == slice.hasKey("writebufferIdle")));
|
||||
CHECK((true == slice.hasKey("writebufferSizeMax")));
|
||||
|
|
Loading…
Reference in New Issue