mirror of https://gitee.com/bigwinds/arangodb
issue 430.3: remove redundant constructor from SingleCollectionTransaction (#5996)
This commit is contained in:
parent
e4d7f1c5f0
commit
62ca1235ac
|
@ -204,10 +204,9 @@ void ensureLink(
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(*vocbase),
|
arangodb::transaction::StandaloneContext::Create(*vocbase),
|
||||||
col.get(),
|
*col,
|
||||||
arangodb::AccessMode::Type::EXCLUSIVE
|
arangodb::AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
auto res = trx.begin();
|
auto res = trx.begin();
|
||||||
bool created;
|
bool created;
|
||||||
|
|
||||||
|
@ -356,7 +355,7 @@ void IResearchRocksDBRecoveryHelper::PutCF(uint32_t column_family_id,
|
||||||
auto doc = RocksDBValue::data(value);
|
auto doc = RocksDBValue::data(value);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(coll->vocbase()),
|
transaction::StandaloneContext::Create(coll->vocbase()),
|
||||||
coll.get(),
|
*coll,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -398,7 +397,7 @@ void IResearchRocksDBRecoveryHelper::DeleteCF(uint32_t column_family_id,
|
||||||
auto docId = RocksDBKey::documentId(key);
|
auto docId = RocksDBKey::documentId(key);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(coll->vocbase()),
|
transaction::StandaloneContext::Create(coll->vocbase()),
|
||||||
coll.get(),
|
*coll,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1769,7 +1769,7 @@ void MMFilesCollection::open(bool ignoreErrors) {
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
&_logicalCollection,
|
_logicalCollection,
|
||||||
AccessMode::Type::READ
|
AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ void MMFilesCollectionKeys::create(TRI_voc_tick_t maxTick) {
|
||||||
// copy all document tokens into the result under the read-lock
|
// copy all document tokens into the result under the read-lock
|
||||||
{
|
{
|
||||||
auto ctx = transaction::StandaloneContext::Create(_collection->vocbase());
|
auto ctx = transaction::StandaloneContext::Create(_collection->vocbase());
|
||||||
SingleCollectionTransaction trx(ctx, _collection, AccessMode::Type::READ);
|
SingleCollectionTransaction trx(ctx, *_collection, AccessMode::Type::READ);
|
||||||
|
|
||||||
// already locked by _guard
|
// already locked by _guard
|
||||||
trx.addHint(transaction::Hints::Hint::NO_USAGE_LOCK);
|
trx.addHint(transaction::Hints::Hint::NO_USAGE_LOCK);
|
||||||
|
|
|
@ -762,7 +762,7 @@ int MMFilesCollectorThread::processCollectionOperations(MMFilesCollectorCache* c
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(collection->vocbase()),
|
arangodb::transaction::StandaloneContext::Create(collection->vocbase()),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -437,7 +437,7 @@ void MMFilesCompactorThread::compactDatafiles(LogicalCollection* collection,
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(collection->vocbase()),
|
arangodb::transaction::StandaloneContext::Create(collection->vocbase()),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -688,7 +688,7 @@ bool MMFilesCompactorThread::compactCollection(LogicalCollection* collection, bo
|
||||||
size_t start = physical->getNextCompactionStartIndex();
|
size_t start = physical->getNextCompactionStartIndex();
|
||||||
|
|
||||||
// get number of documents from collection
|
// get number of documents from collection
|
||||||
uint64_t const numDocuments = getNumberOfDocuments(collection);
|
uint64_t const numDocuments = getNumberOfDocuments(*collection);
|
||||||
|
|
||||||
// get maximum size of result file
|
// get maximum size of result file
|
||||||
uint64_t maxSize = MMFilesCompactionFeature::COMPACTOR->maxSizeFactor() * static_cast<MMFilesCollection*>(collection->getPhysical())->journalSize();
|
uint64_t maxSize = MMFilesCompactionFeature::COMPACTOR->maxSizeFactor() * static_cast<MMFilesCollection*>(collection->getPhysical())->journalSize();
|
||||||
|
@ -1022,7 +1022,9 @@ void MMFilesCompactorThread::run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief determine the number of documents in the collection
|
/// @brief determine the number of documents in the collection
|
||||||
uint64_t MMFilesCompactorThread::getNumberOfDocuments(LogicalCollection* collection) {
|
uint64_t MMFilesCompactorThread::getNumberOfDocuments(
|
||||||
|
LogicalCollection const& collection
|
||||||
|
) {
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(_vocbase),
|
transaction::StandaloneContext::Create(_vocbase),
|
||||||
collection,
|
collection,
|
||||||
|
@ -1043,7 +1045,7 @@ uint64_t MMFilesCompactorThread::getNumberOfDocuments(LogicalCollection* collect
|
||||||
return 16384; // assume some positive value
|
return 16384; // assume some positive value
|
||||||
}
|
}
|
||||||
|
|
||||||
return collection->numberDocuments(&trx);
|
return collection.numberDocuments(&trx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief write a copy of the marker into the datafile
|
/// @brief write a copy of the marker into the datafile
|
||||||
|
@ -1057,4 +1059,3 @@ int MMFilesCompactorThread::copyMarker(MMFilesDatafile* compactor, MMFilesMarker
|
||||||
|
|
||||||
return compactor->writeElement(*result, marker);
|
return compactor->writeElement(*result, marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ class MMFilesCompactorThread final : public Thread {
|
||||||
int removeDatafile(LogicalCollection* collection, MMFilesDatafile* datafile);
|
int removeDatafile(LogicalCollection* collection, MMFilesDatafile* datafile);
|
||||||
|
|
||||||
/// @brief determine the number of documents in the collection
|
/// @brief determine the number of documents in the collection
|
||||||
uint64_t getNumberOfDocuments(LogicalCollection* collection);
|
uint64_t getNumberOfDocuments(LogicalCollection const& collection);
|
||||||
|
|
||||||
/// @brief write a copy of the marker into the datafile
|
/// @brief write a copy of the marker into the datafile
|
||||||
int copyMarker(MMFilesDatafile* compactor, MMFilesMarker const* marker,
|
int copyMarker(MMFilesDatafile* compactor, MMFilesMarker const* marker,
|
||||||
|
|
|
@ -127,7 +127,7 @@ Result handleSyncKeysMMFiles(arangodb::DatabaseInitialSyncer& syncer,
|
||||||
{
|
{
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::READ
|
AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -158,7 +158,7 @@ Result handleSyncKeysMMFiles(arangodb::DatabaseInitialSyncer& syncer,
|
||||||
{
|
{
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::READ
|
AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -312,7 +312,7 @@ Result handleSyncKeysMMFiles(arangodb::DatabaseInitialSyncer& syncer,
|
||||||
// first chunk
|
// first chunk
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ Result handleSyncKeysMMFiles(arangodb::DatabaseInitialSyncer& syncer,
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ static void JS_RotateVocbaseCol(
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::V8Context::Create(collection->vocbase(), true),
|
transaction::V8Context::Create(collection->vocbase(), true),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
|
@ -302,7 +302,7 @@ int MMFilesWalRecoverState::executeSingleOperation(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto ctx = transaction::StandaloneContext::Create(*vocbase);
|
auto ctx = transaction::StandaloneContext::Create(*vocbase);
|
||||||
SingleCollectionTransaction trx(ctx, collection, AccessMode::Type::WRITE);
|
SingleCollectionTransaction trx(ctx, *collection, AccessMode::Type::WRITE);
|
||||||
|
|
||||||
trx.addHint(transaction::Hints::Hint::SINGLE_OPERATION);
|
trx.addHint(transaction::Hints::Hint::SINGLE_OPERATION);
|
||||||
trx.addHint(transaction::Hints::Hint::NO_BEGIN_MARKER);
|
trx.addHint(transaction::Hints::Hint::NO_BEGIN_MARKER);
|
||||||
|
@ -937,10 +937,13 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
||||||
<< "cannot create index " << indexId << ", collection "
|
<< "cannot create index " << indexId << ", collection "
|
||||||
<< collectionId << " in database " << databaseId;
|
<< collectionId << " in database " << databaseId;
|
||||||
++state->errorCount;
|
++state->errorCount;
|
||||||
|
|
||||||
return state->canContinue();
|
return state->canContinue();
|
||||||
} else {
|
} else {
|
||||||
auto ctx = transaction::StandaloneContext::Create(*vocbase);
|
auto ctx = transaction::StandaloneContext::Create(*vocbase);
|
||||||
arangodb::SingleCollectionTransaction trx(ctx, col.get(), AccessMode::Type::WRITE);
|
arangodb::SingleCollectionTransaction trx(
|
||||||
|
ctx, *col, AccessMode::Type::WRITE
|
||||||
|
);
|
||||||
std::shared_ptr<arangodb::Index> unused;
|
std::shared_ptr<arangodb::Index> unused;
|
||||||
int res = physical->restoreIndex(&trx, payloadSlice, unused);
|
int res = physical->restoreIndex(&trx, payloadSlice, unused);
|
||||||
|
|
||||||
|
@ -949,6 +952,7 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
|
||||||
<< "cannot create index " << indexId << ", collection "
|
<< "cannot create index " << indexId << ", collection "
|
||||||
<< collectionId << " in database " << databaseId;
|
<< collectionId << " in database " << databaseId;
|
||||||
++state->errorCount;
|
++state->errorCount;
|
||||||
|
|
||||||
return state->canContinue();
|
return state->canContinue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1552,7 +1556,7 @@ int MMFilesWalRecoverState::fillIndexes() {
|
||||||
|
|
||||||
auto ctx = transaction::StandaloneContext::Create(collection->vocbase());
|
auto ctx = transaction::StandaloneContext::Create(collection->vocbase());
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
ctx, collection, AccessMode::Type::WRITE
|
ctx, *collection, AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
int res = physical->fillAllIndexes(&trx);
|
int res = physical->fillAllIndexes(&trx);
|
||||||
|
|
||||||
|
|
|
@ -744,7 +744,7 @@ Result DatabaseInitialSyncer::fetchCollectionDump(
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase()),
|
transaction::StandaloneContext::Create(vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ Result DatabaseInitialSyncer::fetchCollectionSync(
|
||||||
// remote collection has no documents. now truncate our local collection
|
// remote collection has no documents. now truncate our local collection
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase()),
|
transaction::StandaloneContext::Create(vocbase()),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -1022,7 +1022,7 @@ Result DatabaseInitialSyncer::changeCollection(arangodb::LogicalCollection* col,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief determine the number of documents in a collection
|
/// @brief determine the number of documents in a collection
|
||||||
int64_t DatabaseInitialSyncer::getSize(arangodb::LogicalCollection* col) {
|
int64_t DatabaseInitialSyncer::getSize(arangodb::LogicalCollection const& col) {
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase()),
|
transaction::StandaloneContext::Create(vocbase()),
|
||||||
col,
|
col,
|
||||||
|
@ -1034,7 +1034,7 @@ int64_t DatabaseInitialSyncer::getSize(arangodb::LogicalCollection* col) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
OperationResult result = trx.count(col->name(), false);
|
auto result = trx.count(col.name(), false);
|
||||||
|
|
||||||
if (result.result.fail()) {
|
if (result.result.fail()) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1152,7 +1152,7 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters,
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase()),
|
transaction::StandaloneContext::Create(vocbase()),
|
||||||
col,
|
*col,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -1252,15 +1252,12 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters,
|
||||||
parameters.toJson());
|
parameters.toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
Result res;
|
|
||||||
std::string const& masterColl =
|
std::string const& masterColl =
|
||||||
!masterUuid.empty() ? masterUuid : itoa(masterCid);
|
!masterUuid.empty() ? masterUuid : itoa(masterCid);
|
||||||
|
auto res = incremental && getSize(*col) > 0
|
||||||
if (incremental && getSize(col) > 0) {
|
? fetchCollectionSync(col, masterColl, _config.master.lastLogTick)
|
||||||
res = fetchCollectionSync(col, masterColl, _config.master.lastLogTick);
|
: fetchCollectionDump(col, masterColl, _config.master.lastLogTick)
|
||||||
} else {
|
;
|
||||||
res = fetchCollectionDump(col, masterColl, _config.master.lastLogTick);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!res.ok()) {
|
if (!res.ok()) {
|
||||||
return res;
|
return res;
|
||||||
|
@ -1286,7 +1283,7 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters,
|
||||||
try {
|
try {
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase()),
|
transaction::StandaloneContext::Create(vocbase()),
|
||||||
col,
|
*col,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,6 @@ class DatabaseInitialSyncer final : public InitialSyncer {
|
||||||
bool isChild() const; // TODO worker safety
|
bool isChild() const; // TODO worker safety
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
|
||||||
DatabaseInitialSyncer(TRI_vocbase_t& vocbase,
|
DatabaseInitialSyncer(TRI_vocbase_t& vocbase,
|
||||||
ReplicationApplierConfiguration const& configuration);
|
ReplicationApplierConfiguration const& configuration);
|
||||||
|
|
||||||
|
@ -196,7 +195,7 @@ class DatabaseInitialSyncer final : public InitialSyncer {
|
||||||
httpclient::SimpleHttpResult*, uint64_t&);
|
httpclient::SimpleHttpResult*, uint64_t&);
|
||||||
|
|
||||||
/// @brief determine the number of documents in a collection
|
/// @brief determine the number of documents in a collection
|
||||||
int64_t getSize(arangodb::LogicalCollection*);
|
int64_t getSize(arangodb::LogicalCollection const& col);
|
||||||
|
|
||||||
/// @brief incrementally fetch data from a collection
|
/// @brief incrementally fetch data from a collection
|
||||||
// TODO worker safety
|
// TODO worker safety
|
||||||
|
@ -231,7 +230,6 @@ class DatabaseInitialSyncer final : public InitialSyncer {
|
||||||
/// @brief create non-existing views locally
|
/// @brief create non-existing views locally
|
||||||
Result handleViewCreation(VPackSlice const& views);
|
Result handleViewCreation(VPackSlice const& views);
|
||||||
|
|
||||||
private:
|
|
||||||
Configuration _config;
|
Configuration _config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ Result Syncer::createCollection(TRI_vocbase_t& vocbase,
|
||||||
col->guid() == col->name());
|
col->guid() == col->name());
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(vocbase),
|
transaction::StandaloneContext::Create(vocbase),
|
||||||
col,
|
*col,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -664,7 +664,7 @@ Result Syncer::createIndex(VPackSlice const& slice) {
|
||||||
try {
|
try {
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(*vocbase),
|
transaction::StandaloneContext::Create(*vocbase),
|
||||||
col.get(),
|
*col,
|
||||||
AccessMode::Type::WRITE
|
AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
|
@ -392,7 +392,7 @@ Result TailingSyncer::processDocument(TRI_replication_operation_e type,
|
||||||
// update the apply tick for all standalone operations
|
// update the apply tick for all standalone operations
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(*vocbase),
|
transaction::StandaloneContext::Create(*vocbase),
|
||||||
coll,
|
*coll,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ void RestCollectionHandler::handleCommandGet() {
|
||||||
|
|
||||||
if (canUse && (!excludeSystem || !coll.system())) {
|
if (canUse && (!excludeSystem || !coll.system())) {
|
||||||
// We do not need a transaction here
|
// We do not need a transaction here
|
||||||
methods::Collections::Context ctxt(_vocbase, &coll);
|
methods::Collections::Context ctxt(_vocbase, coll);
|
||||||
|
|
||||||
collectionRepresentation(builder, ctxt,
|
collectionRepresentation(builder, ctxt,
|
||||||
/*showProperties*/ false,
|
/*showProperties*/ false,
|
||||||
|
@ -148,7 +148,7 @@ void RestCollectionHandler::handleCommandGet() {
|
||||||
obj->add("revision", result.slice().get("revision"));
|
obj->add("revision", result.slice().get("revision"));
|
||||||
|
|
||||||
// We do not need a transaction here
|
// We do not need a transaction here
|
||||||
methods::Collections::Context ctxt(_vocbase, &coll);
|
methods::Collections::Context ctxt(_vocbase, coll);
|
||||||
|
|
||||||
collectionRepresentation(builder, coll, /*showProperties*/ false,
|
collectionRepresentation(builder, coll, /*showProperties*/ false,
|
||||||
/*showFigures*/ false, /*showCount*/ false,
|
/*showFigures*/ false, /*showCount*/ false,
|
||||||
|
@ -175,7 +175,7 @@ void RestCollectionHandler::handleCommandGet() {
|
||||||
/*detailedCount*/ true);
|
/*detailedCount*/ true);
|
||||||
} else if (sub == "revision") {
|
} else if (sub == "revision") {
|
||||||
|
|
||||||
methods::Collections::Context ctxt(_vocbase, &coll);
|
methods::Collections::Context ctxt(_vocbase, coll);
|
||||||
// /_api/collection/<identifier>/revision
|
// /_api/collection/<identifier>/revision
|
||||||
TRI_voc_rid_t revisionId;
|
TRI_voc_rid_t revisionId;
|
||||||
auto res =
|
auto res =
|
||||||
|
@ -366,7 +366,7 @@ void RestCollectionHandler::handleCommandPut() {
|
||||||
_request->value("isSynchronousReplication");
|
_request->value("isSynchronousReplication");
|
||||||
|
|
||||||
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
||||||
SingleCollectionTransaction trx(ctx, &coll, AccessMode::Type::EXCLUSIVE);
|
SingleCollectionTransaction trx(ctx, coll, AccessMode::Type::EXCLUSIVE);
|
||||||
|
|
||||||
res = trx.begin();
|
res = trx.begin();
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ void RestCollectionHandler::handleCommandPut() {
|
||||||
|
|
||||||
} else if (sub == "rotate") {
|
} else if (sub == "rotate") {
|
||||||
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
||||||
SingleCollectionTransaction trx(ctx, &coll, AccessMode::Type::WRITE);
|
SingleCollectionTransaction trx(ctx, coll, AccessMode::Type::WRITE);
|
||||||
|
|
||||||
res = trx.begin();
|
res = trx.begin();
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ void RestCollectionHandler::handleCommandPut() {
|
||||||
builder.add("result", VPackValue(true));
|
builder.add("result", VPackValue(true));
|
||||||
builder.close();
|
builder.close();
|
||||||
} else if (sub == "loadIndexesIntoMemory") {
|
} else if (sub == "loadIndexesIntoMemory") {
|
||||||
res = methods::Collections::warmup(_vocbase, &coll);
|
res = methods::Collections::warmup(_vocbase, coll);
|
||||||
|
|
||||||
VPackObjectBuilder obj(&builder, true);
|
VPackObjectBuilder obj(&builder, true);
|
||||||
|
|
||||||
|
@ -529,13 +529,13 @@ void RestCollectionHandler::collectionRepresentation(
|
||||||
THROW_ARANGO_EXCEPTION(res);
|
THROW_ARANGO_EXCEPTION(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
methods::Collections::Context ctxt(_vocbase, &coll, trx.get());
|
methods::Collections::Context ctxt(_vocbase, coll, trx.get());
|
||||||
|
|
||||||
collectionRepresentation(builder, ctxt, showProperties, showFigures,
|
collectionRepresentation(builder, ctxt, showProperties, showFigures,
|
||||||
showCount, detailedCount);
|
showCount, detailedCount);
|
||||||
} else {
|
} else {
|
||||||
// We do not need a transaction here
|
// We do not need a transaction here
|
||||||
methods::Collections::Context ctxt(_vocbase, &coll);
|
methods::Collections::Context ctxt(_vocbase, coll);
|
||||||
|
|
||||||
collectionRepresentation(builder, ctxt, showProperties, showFigures,
|
collectionRepresentation(builder, ctxt, showProperties, showFigures,
|
||||||
showCount, detailedCount);
|
showCount, detailedCount);
|
||||||
|
|
|
@ -898,9 +898,7 @@ Result RestReplicationHandler::processRestoreCollection(
|
||||||
|
|
||||||
// instead, truncate them
|
// instead, truncate them
|
||||||
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(ctx, *col, AccessMode::Type::EXCLUSIVE);
|
||||||
ctx, col, AccessMode::Type::EXCLUSIVE
|
|
||||||
);
|
|
||||||
|
|
||||||
// to turn off waitForSync!
|
// to turn off waitForSync!
|
||||||
trx.addHint(transaction::Hints::Hint::RECOVERY);
|
trx.addHint(transaction::Hints::Hint::RECOVERY);
|
||||||
|
@ -2109,9 +2107,7 @@ void RestReplicationHandler::handleCommandAddFollower() {
|
||||||
if (readLockId.isNone()) {
|
if (readLockId.isNone()) {
|
||||||
// Short cut for the case that the collection is empty
|
// Short cut for the case that the collection is empty
|
||||||
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(ctx, *col, AccessMode::Type::EXCLUSIVE);
|
||||||
ctx, col.get(), AccessMode::Type::EXCLUSIVE
|
|
||||||
);
|
|
||||||
auto res = trx.begin();
|
auto res = trx.begin();
|
||||||
|
|
||||||
if (res.ok()) {
|
if (res.ok()) {
|
||||||
|
@ -2323,8 +2319,8 @@ void RestReplicationHandler::handleCommandHoldReadLockCollection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
auto ctx = transaction::StandaloneContext::Create(_vocbase);
|
||||||
auto trx =
|
auto trx = std::make_shared<SingleCollectionTransaction>(ctx, *col, access);
|
||||||
std::make_shared<SingleCollectionTransaction>(ctx, col.get(), access);
|
|
||||||
trx->addHint(transaction::Hints::Hint::LOCK_ENTIRELY);
|
trx->addHint(transaction::Hints::Hint::LOCK_ENTIRELY);
|
||||||
|
|
||||||
Result res = trx->begin();
|
Result res = trx->begin();
|
||||||
|
|
|
@ -1667,7 +1667,7 @@ uint64_t RocksDBCollection::recalculateCounts() {
|
||||||
auto ctx =
|
auto ctx =
|
||||||
transaction::StandaloneContext::Create(_logicalCollection.vocbase());
|
transaction::StandaloneContext::Create(_logicalCollection.vocbase());
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
ctx, &_logicalCollection, AccessMode::Type::EXCLUSIVE
|
ctx, _logicalCollection, AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
auto res = trx.begin();
|
auto res = trx.begin();
|
||||||
|
|
||||||
|
@ -1802,7 +1802,7 @@ void RocksDBCollection::recalculateIndexEstimates(
|
||||||
auto ctx =
|
auto ctx =
|
||||||
transaction::StandaloneContext::Create(_logicalCollection.vocbase());
|
transaction::StandaloneContext::Create(_logicalCollection.vocbase());
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
ctx, &_logicalCollection, AccessMode::Type::EXCLUSIVE
|
ctx, _logicalCollection, AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
auto res = trx.begin();
|
auto res = trx.begin();
|
||||||
|
|
||||||
|
|
|
@ -505,14 +505,15 @@ Result handleSyncKeysRocksDB(DatabaseInitialSyncer& syncer,
|
||||||
|
|
||||||
ManagedDocumentResult mmdr;
|
ManagedDocumentResult mmdr;
|
||||||
OperationOptions options;
|
OperationOptions options;
|
||||||
|
|
||||||
options.silent = true;
|
options.silent = true;
|
||||||
options.ignoreRevs = true;
|
options.ignoreRevs = true;
|
||||||
options.isRestore = true;
|
options.isRestore = true;
|
||||||
|
|
||||||
if (!syncer._state.leaderId.empty()) {
|
if (!syncer._state.leaderId.empty()) {
|
||||||
options.isSynchronousReplicationFrom = syncer._state.leaderId;
|
options.isSynchronousReplicationFrom = syncer._state.leaderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
VPackBuilder keyBuilder;
|
|
||||||
size_t const numChunks = static_cast<size_t>(chunkSlice.length());
|
size_t const numChunks = static_cast<size_t>(chunkSlice.length());
|
||||||
|
|
||||||
// remove all keys that are below first remote key or beyond last remote key
|
// remove all keys that are below first remote key or beyond last remote key
|
||||||
|
@ -520,7 +521,7 @@ Result handleSyncKeysRocksDB(DatabaseInitialSyncer& syncer,
|
||||||
// first chunk
|
// first chunk
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
col,
|
*col,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -584,7 +585,7 @@ Result handleSyncKeysRocksDB(DatabaseInitialSyncer& syncer,
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(syncer.vocbase()),
|
transaction::StandaloneContext::Create(syncer.vocbase()),
|
||||||
col,
|
*col,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -25,42 +25,24 @@
|
||||||
#include "StorageEngine/TransactionCollection.h"
|
#include "StorageEngine/TransactionCollection.h"
|
||||||
#include "StorageEngine/TransactionState.h"
|
#include "StorageEngine/TransactionState.h"
|
||||||
#include "Utils/CollectionNameResolver.h"
|
#include "Utils/CollectionNameResolver.h"
|
||||||
#include "Utils/OperationResult.h"
|
|
||||||
#include "Transaction/Methods.h"
|
#include "Transaction/Methods.h"
|
||||||
#include "Transaction/Context.h"
|
#include "Transaction/Context.h"
|
||||||
#include "VocBase/LogicalCollection.h"
|
#include "VocBase/LogicalDataSource.h"
|
||||||
#include "VocBase/LogicalView.h"
|
|
||||||
|
|
||||||
using namespace arangodb;
|
namespace arangodb {
|
||||||
|
|
||||||
/// @brief create the transaction, using a collection
|
/// @brief create the transaction, using a data-source
|
||||||
SingleCollectionTransaction::SingleCollectionTransaction(
|
SingleCollectionTransaction::SingleCollectionTransaction(
|
||||||
std::shared_ptr<transaction::Context> const& transactionContext,
|
std::shared_ptr<transaction::Context> const& transactionContext,
|
||||||
LogicalCollection const* col, AccessMode::Type accessType)
|
LogicalDataSource const& dataSource,
|
||||||
: transaction::Methods(transactionContext),
|
AccessMode::Type accessType
|
||||||
_cid(col->id()),
|
): transaction::Methods(transactionContext),
|
||||||
|
_cid(dataSource.id()),
|
||||||
_trxCollection(nullptr),
|
_trxCollection(nullptr),
|
||||||
_documentCollection(nullptr),
|
_documentCollection(nullptr),
|
||||||
_accessType(accessType) {
|
_accessType(accessType) {
|
||||||
|
// add the (sole) data-source
|
||||||
// add the (sole) collection
|
addCollection(dataSource.id(), dataSource.name(), _accessType);
|
||||||
addCollection(col->id(), col->name(), _accessType);
|
|
||||||
addHint(transaction::Hints::Hint::NO_DLD);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// @brief create the transaction, using a collection id
|
|
||||||
SingleCollectionTransaction::SingleCollectionTransaction(
|
|
||||||
std::shared_ptr<transaction::Context> const& transactionContext,
|
|
||||||
LogicalView const& view, AccessMode::Type accessType)
|
|
||||||
: transaction::Methods(transactionContext),
|
|
||||||
_cid(view.id()),
|
|
||||||
_trxCollection(nullptr),
|
|
||||||
_documentCollection(nullptr),
|
|
||||||
_accessType(accessType) {
|
|
||||||
|
|
||||||
// add the (sole) view
|
|
||||||
addCollection(view.id(), view.name(), _accessType);
|
|
||||||
addHint(transaction::Hints::Hint::NO_DLD);
|
addHint(transaction::Hints::Hint::NO_DLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,3 +95,5 @@ std::string SingleCollectionTransaction::name() {
|
||||||
// will ensure we have the _trxCollection object set
|
// will ensure we have the _trxCollection object set
|
||||||
return resolveTrxCollection()->collectionName();
|
return resolveTrxCollection()->collectionName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // arangodb
|
|
@ -30,60 +30,54 @@
|
||||||
#include "VocBase/voc-types.h"
|
#include "VocBase/voc-types.h"
|
||||||
|
|
||||||
namespace arangodb {
|
namespace arangodb {
|
||||||
|
|
||||||
namespace transaction {
|
namespace transaction {
|
||||||
|
|
||||||
class Context;
|
class Context;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SingleCollectionTransaction final : public transaction::Methods {
|
class SingleCollectionTransaction final : public transaction::Methods {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief create the transaction, using a collection
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
SingleCollectionTransaction(std::shared_ptr<transaction::Context> const&,
|
|
||||||
LogicalCollection const*, AccessMode::Type);
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief create the transaction, using a view
|
/// @brief create the transaction, using a data-source
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
SingleCollectionTransaction(
|
||||||
SingleCollectionTransaction(std::shared_ptr<transaction::Context> const&,
|
std::shared_ptr<transaction::Context> const& transactionContext,
|
||||||
LogicalView const&, AccessMode::Type);
|
LogicalDataSource const& collection,
|
||||||
|
AccessMode::Type accessType
|
||||||
|
);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief create the transaction, using a collection name
|
/// @brief create the transaction, using a collection name
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SingleCollectionTransaction(std::shared_ptr<transaction::Context> const&,
|
SingleCollectionTransaction(std::shared_ptr<transaction::Context> const&,
|
||||||
std::string const&, AccessMode::Type);
|
std::string const&, AccessMode::Type);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief end the transaction
|
/// @brief end the transaction
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
~SingleCollectionTransaction() = default;
|
~SingleCollectionTransaction() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief get the underlying transaction collection
|
/// @brief get the underlying transaction collection
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TransactionCollection* resolveTrxCollection();
|
TransactionCollection* resolveTrxCollection();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief get the underlying document collection
|
/// @brief get the underlying document collection
|
||||||
/// note that we have two identical versions because this is called
|
/// note that we have two identical versions because this is called
|
||||||
/// in two different situations
|
/// in two different situations
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
LogicalCollection* documentCollection();
|
LogicalCollection* documentCollection();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief get the underlying collection's id
|
/// @brief get the underlying collection's id
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
inline TRI_voc_cid_t cid() const { return _cid; }
|
inline TRI_voc_cid_t cid() const { return _cid; }
|
||||||
|
|
||||||
#ifdef USE_ENTERPRISE
|
#ifdef USE_ENTERPRISE
|
||||||
|
@ -102,30 +96,28 @@ class SingleCollectionTransaction final : public transaction::Methods {
|
||||||
std::string name();
|
std::string name();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief collection id
|
/// @brief collection id
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TRI_voc_cid_t _cid;
|
TRI_voc_cid_t _cid;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief trxCollection cache
|
/// @brief trxCollection cache
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TransactionCollection* _trxCollection;
|
TransactionCollection* _trxCollection;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief LogicalCollection* cache
|
/// @brief LogicalCollection* cache
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
LogicalCollection* _documentCollection;
|
LogicalCollection* _documentCollection;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief collection access type
|
/// @brief collection access type
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
AccessMode::Type _accessType;
|
AccessMode::Type _accessType;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -990,7 +990,7 @@ static void JS_FiguresVocbaseCol(
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::V8Context::Create(collection->vocbase(), true),
|
transaction::V8Context::Create(collection->vocbase(), true),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::READ
|
AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -1385,7 +1385,7 @@ static void JS_PropertiesVocbaseCol(
|
||||||
consoleColl->name(),
|
consoleColl->name(),
|
||||||
[&](LogicalCollection& coll)->void {
|
[&](LogicalCollection& coll)->void {
|
||||||
VPackObjectBuilder object(&builder, true);
|
VPackObjectBuilder object(&builder, true);
|
||||||
methods::Collections::Context ctxt(coll.vocbase(), &coll);
|
methods::Collections::Context ctxt(coll.vocbase(), coll);
|
||||||
Result res = methods::Collections::properties(ctxt, builder);
|
Result res = methods::Collections::properties(ctxt, builder);
|
||||||
|
|
||||||
if (res.fail()) {
|
if (res.fail()) {
|
||||||
|
@ -2124,7 +2124,7 @@ static void JS_RevisionVocbaseCol(
|
||||||
|
|
||||||
TRI_voc_rid_t revisionId;
|
TRI_voc_rid_t revisionId;
|
||||||
|
|
||||||
methods::Collections::Context ctxt(collection->vocbase(), collection);
|
methods::Collections::Context ctxt(collection->vocbase(), *collection);
|
||||||
auto res = methods::Collections::revisionId(ctxt, revisionId);
|
auto res = methods::Collections::revisionId(ctxt, revisionId);
|
||||||
|
|
||||||
if (res.fail()) {
|
if (res.fail()) {
|
||||||
|
@ -2301,7 +2301,7 @@ static void InsertVocbaseCol(v8::Isolate* isolate,
|
||||||
auto transactionContext =
|
auto transactionContext =
|
||||||
std::make_shared<transaction::V8Context>(collection->vocbase(), true);
|
std::make_shared<transaction::V8Context>(collection->vocbase(), true);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transactionContext, collection, AccessMode::Type::WRITE
|
transactionContext, *collection, AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!payloadIsArray && !options.overwrite) {
|
if (!payloadIsArray && !options.overwrite) {
|
||||||
|
@ -2451,7 +2451,7 @@ static void JS_TruncateVocbaseCol(
|
||||||
|
|
||||||
auto ctx = transaction::V8Context::Create(collection->vocbase(), true);
|
auto ctx = transaction::V8Context::Create(collection->vocbase(), true);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
ctx, collection, AccessMode::Type::EXCLUSIVE
|
ctx, *collection, AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
|
@ -2880,7 +2880,7 @@ static void JS_WarmupVocbaseCol(
|
||||||
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto res = methods::Collections::warmup(collection->vocbase(), collection);
|
auto res = methods::Collections::warmup(collection->vocbase(), *collection);
|
||||||
|
|
||||||
if (res.fail()) {
|
if (res.fail()) {
|
||||||
TRI_V8_THROW_EXCEPTION(res);
|
TRI_V8_THROW_EXCEPTION(res);
|
||||||
|
|
|
@ -219,7 +219,7 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||||
std::shared_ptr<transaction::V8Context> transactionContext =
|
std::shared_ptr<transaction::V8Context> transactionContext =
|
||||||
transaction::V8Context::Create(collection->vocbase(), true);
|
transaction::V8Context::Create(collection->vocbase(), true);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transactionContext, collection, AccessMode::Type::READ
|
transactionContext, *collection, AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ static void JS_AnyQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||||
std::shared_ptr<transaction::V8Context> transactionContext =
|
std::shared_ptr<transaction::V8Context> transactionContext =
|
||||||
transaction::V8Context::Create(col->vocbase(), true);
|
transaction::V8Context::Create(col->vocbase(), true);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transactionContext, col, AccessMode::Type::READ
|
transactionContext, *col, AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ VPackSlice LogicalCollection::keyOptions() const {
|
||||||
|
|
||||||
ChecksumResult LogicalCollection::checksum(bool withRevisions, bool withData) const {
|
ChecksumResult LogicalCollection::checksum(bool withRevisions, bool withData) const {
|
||||||
auto ctx = transaction::StandaloneContext::Create(vocbase());
|
auto ctx = transaction::StandaloneContext::Create(vocbase());
|
||||||
SingleCollectionTransaction trx(ctx, this, AccessMode::Type::READ);
|
SingleCollectionTransaction trx(ctx, *this, AccessMode::Type::READ);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
if (!res.ok()) {
|
if (!res.ok()) {
|
||||||
|
|
|
@ -59,16 +59,17 @@ using namespace arangodb;
|
||||||
using namespace arangodb::basics;
|
using namespace arangodb::basics;
|
||||||
using namespace arangodb::methods;
|
using namespace arangodb::methods;
|
||||||
|
|
||||||
Collections::Context::Context(TRI_vocbase_t& vocbase, LogicalCollection* coll)
|
Collections::Context::Context(TRI_vocbase_t& vocbase, LogicalCollection& coll)
|
||||||
: _vocbase(vocbase), _coll(coll), _trx(nullptr), _responsibleForTrx(true) {
|
: _vocbase(vocbase), _coll(coll), _trx(nullptr), _responsibleForTrx(true) {
|
||||||
TRI_ASSERT(_coll != nullptr);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Collections::Context::Context(TRI_vocbase_t& vocbase, LogicalCollection* coll,
|
Collections::Context::Context(
|
||||||
transaction::Methods* trx)
|
TRI_vocbase_t& vocbase,
|
||||||
|
LogicalCollection& coll,
|
||||||
|
transaction::Methods* trx
|
||||||
|
)
|
||||||
: _vocbase(vocbase), _coll(coll), _trx(trx), _responsibleForTrx(false) {
|
: _vocbase(vocbase), _coll(coll), _trx(trx), _responsibleForTrx(false) {
|
||||||
TRI_ASSERT(_trx != nullptr);
|
TRI_ASSERT(_trx != nullptr);
|
||||||
TRI_ASSERT(_coll != nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections::Context::~Context() {
|
Collections::Context::~Context() {
|
||||||
|
@ -109,7 +110,7 @@ TRI_vocbase_t& Collections::Context::vocbase() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalCollection* Collections::Context::coll() const {
|
LogicalCollection* Collections::Context::coll() const {
|
||||||
return _coll;
|
return &_coll;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Collections::enumerate(
|
void Collections::enumerate(
|
||||||
|
@ -322,8 +323,7 @@ Result Collections::load(TRI_vocbase_t& vocbase, LogicalCollection* coll) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ctx = transaction::V8Context::CreateWhenRequired(vocbase, true);
|
auto ctx = transaction::V8Context::CreateWhenRequired(vocbase, true);
|
||||||
SingleCollectionTransaction trx(ctx, coll, AccessMode::Type::READ);
|
SingleCollectionTransaction trx(ctx, *coll, AccessMode::Type::READ);
|
||||||
|
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
if (res.fail()) {
|
if (res.fail()) {
|
||||||
|
@ -411,9 +411,7 @@ Result Collections::updateProperties(LogicalCollection* coll,
|
||||||
} else {
|
} else {
|
||||||
auto ctx =
|
auto ctx =
|
||||||
transaction::V8Context::CreateWhenRequired(coll->vocbase(), false);
|
transaction::V8Context::CreateWhenRequired(coll->vocbase(), false);
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(ctx, *coll, AccessMode::Type::EXCLUSIVE);
|
||||||
ctx, coll, AccessMode::Type::EXCLUSIVE
|
|
||||||
);
|
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
||||||
if (!res.ok()) {
|
if (!res.ok()) {
|
||||||
|
@ -573,7 +571,10 @@ Result Collections::drop(TRI_vocbase_t* vocbase, LogicalCollection* coll,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result Collections::warmup(TRI_vocbase_t& vocbase, LogicalCollection* coll) {
|
Result Collections::warmup(
|
||||||
|
TRI_vocbase_t& vocbase,
|
||||||
|
LogicalCollection const& coll
|
||||||
|
) {
|
||||||
ExecContext const* exec = ExecContext::CURRENT; // disallow expensive ops
|
ExecContext const* exec = ExecContext::CURRENT; // disallow expensive ops
|
||||||
|
|
||||||
if (!exec->isSuperuser() && ServerState::readOnly()) {
|
if (!exec->isSuperuser() && ServerState::readOnly()) {
|
||||||
|
@ -582,7 +583,7 @@ Result Collections::warmup(TRI_vocbase_t& vocbase, LogicalCollection* coll) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ServerState::instance()->isCoordinator()) {
|
if (ServerState::instance()->isCoordinator()) {
|
||||||
auto cid = std::to_string(coll->id());
|
auto cid = std::to_string(coll.id());
|
||||||
|
|
||||||
return warmupOnCoordinator(vocbase.name(), cid);
|
return warmupOnCoordinator(vocbase.name(), cid);
|
||||||
}
|
}
|
||||||
|
@ -595,11 +596,10 @@ Result Collections::warmup(TRI_vocbase_t& vocbase, LogicalCollection* coll) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto idxs = coll->getIndexes();
|
auto idxs = coll.getIndexes();
|
||||||
auto poster = [](std::function<void()> fn) -> void {
|
auto poster = [](std::function<void()> fn) -> void {
|
||||||
SchedulerFeature::SCHEDULER->post(fn);
|
SchedulerFeature::SCHEDULER->post(fn);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto queue = std::make_shared<basics::LocalTaskQueue>(poster);
|
auto queue = std::make_shared<basics::LocalTaskQueue>(poster);
|
||||||
|
|
||||||
for (auto& idx : idxs) {
|
for (auto& idx : idxs) {
|
||||||
|
|
|
@ -44,9 +44,12 @@ namespace methods {
|
||||||
/// Common code for collection REST handler and v8-collections
|
/// Common code for collection REST handler and v8-collections
|
||||||
struct Collections {
|
struct Collections {
|
||||||
struct Context {
|
struct Context {
|
||||||
Context(TRI_vocbase_t& vocbase, LogicalCollection* coll);
|
Context(TRI_vocbase_t& vocbase, LogicalCollection& coll);
|
||||||
Context(TRI_vocbase_t& vocbase, LogicalCollection* coll,
|
Context(
|
||||||
transaction::Methods* trx);
|
TRI_vocbase_t& vocbase,
|
||||||
|
LogicalCollection& coll,
|
||||||
|
transaction::Methods* trx
|
||||||
|
);
|
||||||
|
|
||||||
~Context();
|
~Context();
|
||||||
|
|
||||||
|
@ -57,7 +60,7 @@ struct Collections {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TRI_vocbase_t& _vocbase;
|
TRI_vocbase_t& _vocbase;
|
||||||
LogicalCollection* _coll;
|
LogicalCollection& _coll;
|
||||||
transaction::Methods* _trx;
|
transaction::Methods* _trx;
|
||||||
bool const _responsibleForTrx;
|
bool const _responsibleForTrx;
|
||||||
};
|
};
|
||||||
|
@ -91,7 +94,7 @@ struct Collections {
|
||||||
static Result drop(TRI_vocbase_t*, LogicalCollection* coll,
|
static Result drop(TRI_vocbase_t*, LogicalCollection* coll,
|
||||||
bool allowDropSystem, double timeout);
|
bool allowDropSystem, double timeout);
|
||||||
|
|
||||||
static Result warmup(TRI_vocbase_t& vocbase, LogicalCollection* coll);
|
static Result warmup(TRI_vocbase_t& vocbase, LogicalCollection const& coll);
|
||||||
|
|
||||||
static Result revisionId(Context& ctxt, TRI_voc_rid_t& rid);
|
static Result revisionId(Context& ctxt, TRI_voc_rid_t& rid);
|
||||||
|
|
||||||
|
@ -109,4 +112,5 @@ Result DropColCoordinatorEnterprise(LogicalCollection* collection,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -138,7 +138,7 @@ arangodb::Result Indexes::getAll(LogicalCollection const* collection,
|
||||||
} else {
|
} else {
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::StandaloneContext::Create(collection->vocbase()),
|
transaction::StandaloneContext::Create(collection->vocbase()),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::READ
|
AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ static Result EnsureIndexLocal(arangodb::LogicalCollection* collection,
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::V8Context::CreateWhenRequired(collection->vocbase(), false),
|
transaction::V8Context::CreateWhenRequired(collection->vocbase(), false),
|
||||||
collection,
|
*collection,
|
||||||
create ? AccessMode::Type::EXCLUSIVE : AccessMode::Type::READ
|
create ? AccessMode::Type::EXCLUSIVE : AccessMode::Type::READ
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
@ -271,6 +271,7 @@ static Result EnsureIndexLocal(arangodb::LogicalCollection* collection,
|
||||||
|
|
||||||
bool created = false;
|
bool created = false;
|
||||||
std::shared_ptr<arangodb::Index> idx;
|
std::shared_ptr<arangodb::Index> idx;
|
||||||
|
|
||||||
if (create) {
|
if (create) {
|
||||||
try {
|
try {
|
||||||
idx = collection->createIndex(&trx, definition, created);
|
idx = collection->createIndex(&trx, definition, created);
|
||||||
|
@ -592,7 +593,7 @@ arangodb::Result Indexes::drop(LogicalCollection const* collection,
|
||||||
|
|
||||||
SingleCollectionTransaction trx(
|
SingleCollectionTransaction trx(
|
||||||
transaction::V8Context::CreateWhenRequired(collection->vocbase(), false),
|
transaction::V8Context::CreateWhenRequired(collection->vocbase(), false),
|
||||||
collection,
|
*collection,
|
||||||
AccessMode::Type::EXCLUSIVE
|
AccessMode::Type::EXCLUSIVE
|
||||||
);
|
);
|
||||||
Result res = trx.begin();
|
Result res = trx.begin();
|
||||||
|
|
|
@ -139,18 +139,19 @@ arangodb::Result recreateGeoIndex(TRI_vocbase_t& vocbase,
|
||||||
overw.close();
|
overw.close();
|
||||||
|
|
||||||
VPackBuilder newDesc = VPackCollection::merge(oldDesc.slice(), overw.slice(), false);
|
VPackBuilder newDesc = VPackCollection::merge(oldDesc.slice(), overw.slice(), false);
|
||||||
|
|
||||||
bool dropped = collection.dropIndex(iid);
|
bool dropped = collection.dropIndex(iid);
|
||||||
|
|
||||||
if (!dropped) {
|
if (!dropped) {
|
||||||
res.reset(TRI_ERROR_INTERNAL);
|
res.reset(TRI_ERROR_INTERNAL);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool created = false;
|
bool created = false;
|
||||||
auto ctx = arangodb::transaction::StandaloneContext::Create(vocbase);
|
auto ctx = arangodb::transaction::StandaloneContext::Create(vocbase);
|
||||||
arangodb::SingleCollectionTransaction trx(ctx, &collection,
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::AccessMode::Type::EXCLUSIVE);
|
ctx, collection, arangodb::AccessMode::Type::EXCLUSIVE
|
||||||
|
);
|
||||||
|
|
||||||
res = trx.begin();
|
res = trx.begin();
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,7 @@ SECTION("test_async_index") {
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(collection0->vocbase()),
|
arangodb::transaction::StandaloneContext::Create(collection0->vocbase()),
|
||||||
collection0,
|
*collection0,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
resThread0 = trx.begin().ok();
|
resThread0 = trx.begin().ok();
|
||||||
|
@ -571,7 +571,7 @@ SECTION("test_async_index") {
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(collection1->vocbase()),
|
arangodb::transaction::StandaloneContext::Create(collection1->vocbase()),
|
||||||
collection1,
|
*collection1,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
resThread1 = trx.begin().ok();
|
resThread1 = trx.begin().ok();
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestAggregate", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestAggregate", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestAnd", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestAnd", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -202,7 +202,7 @@ TEST_CASE("IResearchQueryTestBooleanTerm", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -236,7 +236,7 @@ TEST_CASE("IResearchQueryTestBooleanTerm", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestComplexBoolean", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestComplexBoolean", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -206,7 +206,7 @@ TEST_CASE("IResearchQueryTestExists", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -238,7 +238,7 @@ TEST_CASE("IResearchQueryTestExists", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -1464,7 +1464,7 @@ TEST_CASE("IResearchQueryTestExistsStoreMaskPartially", "[iresearch][iresearch-q
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -1496,7 +1496,7 @@ TEST_CASE("IResearchQueryTestExistsStoreMaskPartially", "[iresearch][iresearch-q
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestIn", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestIn", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -200,7 +200,7 @@ TEST_CASE("IResearchQueryTestNullTerm", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -234,7 +234,7 @@ TEST_CASE("IResearchQueryTestNullTerm", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestPhrase", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestPhrase", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -205,7 +205,7 @@ TEST_CASE("IResearchQueryTestTokens", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -237,7 +237,7 @@ TEST_CASE("IResearchQueryTestTokens", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -198,7 +198,7 @@ TEST_CASE("IResearchQueryTestTraversal", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -230,7 +230,7 @@ TEST_CASE("IResearchQueryTestTraversal", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -252,7 +252,7 @@ TEST_CASE("IResearchQueryTestTraversal", "[iresearch][iresearch-query]") {
|
||||||
|
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
|
@ -197,7 +197,7 @@ TEST_CASE("IResearchQueryTestValue", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
@ -229,7 +229,7 @@ TEST_CASE("IResearchQueryTestValue", "[iresearch][iresearch-query]") {
|
||||||
options.returnNew = true;
|
options.returnNew = true;
|
||||||
arangodb::SingleCollectionTransaction trx(
|
arangodb::SingleCollectionTransaction trx(
|
||||||
arangodb::transaction::StandaloneContext::Create(vocbase),
|
arangodb::transaction::StandaloneContext::Create(vocbase),
|
||||||
collection,
|
*collection,
|
||||||
arangodb::AccessMode::Type::WRITE
|
arangodb::AccessMode::Type::WRITE
|
||||||
);
|
);
|
||||||
CHECK((trx.begin().ok()));
|
CHECK((trx.begin().ok()));
|
||||||
|
|
Loading…
Reference in New Issue