1
0
Fork 0

Renamed => getMoreMptr in OpCursor to getMoreTokens, Removed default Parameter

This commit is contained in:
Michael Hackstein 2017-01-25 10:46:37 +01:00
parent 15bbfc7b0c
commit 78b83eefc4
10 changed files with 22 additions and 23 deletions

View File

@ -14,10 +14,13 @@ done
- remove ReadCache - remove ReadCache
- Index API - Index API
- Indexes always return std::vector<TOKEN> - Indexes always return std::vector<TOKEN>
- Rename OperationCursor->getMoreMptr => getMoreTokens, "returns" std::vector<TOKEN>&
in progress in progress
----------- -----------
- Rename OperationCursor->getMoreMptr => getMoreTokens, "returns" std::vector<TOKEN>& - GeoIndex hands out TRI_revision instead of Tokens
- FulltextIndex hands out TRI_revision instead of Tokens
- trx::InvokeOnAllElements : uses SimpleIndexLookupElements => Has to use Tokens instead?
- move engine-specific parts of transaction.cpp into engine - move engine-specific parts of transaction.cpp into engine
- transaction API - transaction API
@ -37,6 +40,3 @@ to do
- slice() => looksup the value in the Database - slice() => looksup the value in the Database
- We need to keep in mind the cluster. If a DBServer creates this token-type it has to be translated BEFORE the register is teleported to coordinator - We need to keep in mind the cluster. If a DBServer creates this token-type it has to be translated BEFORE the register is teleported to coordinator
- Remove temporary wrapper LogCol::readDocument() - Remove temporary wrapper LogCol::readDocument()
- GeoIndex hands out TRI_revision instead of Tokens
- FulltextIndex hands out TRI_revision instead of Tokens
- trx::InvokeOnAllElements : uses SimpleIndexLookupElements => Has to use Tokens instead?

View File

@ -49,7 +49,7 @@ void CollectionScanner::scan(std::vector<arangodb::DocumentIdentifierToken>& res
return; return;
} }
_cursor->getMoreMptr(result, batchSize); _cursor->getMoreTokens(result, batchSize);
} }
int CollectionScanner::forward(size_t batchSize, uint64_t& skipped) { int CollectionScanner::forward(size_t batchSize, uint64_t& skipped) {

View File

@ -412,7 +412,7 @@ bool IndexBlock::readIndex(size_t atMost) {
} }
LogicalCollection* collection = _cursor->collection(); LogicalCollection* collection = _cursor->collection();
_cursor->getMoreMptr(_result, atMost); _cursor->getMoreTokens(_result, atMost);
size_t length = _result.size(); size_t length = _result.size();

View File

@ -96,7 +96,7 @@ struct ConstDistanceExpanderLocal {
_cursor.clear(); _cursor.clear();
LogicalCollection* collection = edgeCursor->collection(); LogicalCollection* collection = edgeCursor->collection();
while (edgeCursor->hasMore()) { while (edgeCursor->hasMore()) {
edgeCursor->getMoreMptr(_cursor, 1000); edgeCursor->getMoreTokens(_cursor, 1000);
for (auto const& element : _cursor) { for (auto const& element : _cursor) {
if (collection->readDocument(_block->transaction(), *mmdr, element)) { if (collection->readDocument(_block->transaction(), *mmdr, element)) {
VPackSlice edge(mmdr->vpack()); VPackSlice edge(mmdr->vpack());
@ -239,7 +239,7 @@ struct EdgeWeightExpanderLocal {
cursor.clear(); cursor.clear();
LogicalCollection* collection = edgeCursor->collection(); LogicalCollection* collection = edgeCursor->collection();
while (edgeCursor->hasMore()) { while (edgeCursor->hasMore()) {
edgeCursor->getMoreMptr(cursor, 1000); edgeCursor->getMoreTokens(cursor, 1000);
for (auto const& element : cursor) { for (auto const& element : cursor) {
if (collection->readDocument(_block->transaction(), *mmdr, element)) { if (collection->readDocument(_block->transaction(), *mmdr, element)) {
VPackSlice edge(mmdr->vpack()); VPackSlice edge(mmdr->vpack());

View File

@ -95,7 +95,7 @@ bool RestEdgesHandler::getEdgesForVertexList(
ManagedDocumentResult mmdr; ManagedDocumentResult mmdr;
auto collection = trx.documentCollection(); auto collection = trx.documentCollection();
while (cursor->hasMore()) { while (cursor->hasMore()) {
cursor->getMoreMptr(batch); cursor->getMoreTokens(batch, 1000);
scannedIndex += batch.size(); scannedIndex += batch.size();
for (auto const& it : batch) { for (auto const& it : batch) {
@ -132,7 +132,7 @@ bool RestEdgesHandler::getEdgesForVertex(
ManagedDocumentResult mmdr; ManagedDocumentResult mmdr;
auto collection = trx.documentCollection(); auto collection = trx.documentCollection();
while (cursor->hasMore()) { while (cursor->hasMore()) {
cursor->getMoreMptr(batch); cursor->getMoreTokens(batch, 1000);
scannedIndex += batch.size(); scannedIndex += batch.size();
for (auto const& it : batch) { for (auto const& it : batch) {

View File

@ -41,20 +41,20 @@ void OperationCursor::reset() {
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief Get next batchSize many elements. mptr variant /// @brief Get next batchSize many DocumentTokens.
/// Defaults to _batchSize /// Defaults to _batchSize
/// Check hasMore()==true before using this /// Check hasMore()==true before using this
/// NOTE: This will throw on OUT_OF_MEMORY /// NOTE: This will throw on OUT_OF_MEMORY
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
std::vector<DocumentIdentifierToken> OperationCursor::getMoreMptr(uint64_t batchSize) { std::vector<DocumentIdentifierToken> OperationCursor::getMoreTokens(uint64_t batchSize) {
std::vector<DocumentIdentifierToken> res; std::vector<DocumentIdentifierToken> res;
getMoreMptr(res, batchSize); getMoreTokens(res, batchSize);
return res; return res;
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief Get next batchSize many elements. mptr variant /// @brief Get next batchSize many DocumentTokens.
/// Defaults to _batchSize /// Defaults to _batchSize
/// Check hasMore()==true before using this /// Check hasMore()==true before using this
/// NOTE: This will throw on OUT_OF_MEMORY /// NOTE: This will throw on OUT_OF_MEMORY
@ -62,7 +62,7 @@ std::vector<DocumentIdentifierToken> OperationCursor::getMoreMptr(uint64_t batch
/// The caller shall NOT modify it. /// The caller shall NOT modify it.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void OperationCursor::getMoreMptr(std::vector<DocumentIdentifierToken>& result, void OperationCursor::getMoreTokens(std::vector<DocumentIdentifierToken>& result,
uint64_t batchSize) { uint64_t batchSize) {
if (!hasMore()) { if (!hasMore()) {
TRI_ASSERT(false); TRI_ASSERT(false);

View File

@ -108,7 +108,7 @@ struct OperationCursor {
/// NOTE: This will throw on OUT_OF_MEMORY /// NOTE: This will throw on OUT_OF_MEMORY
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
std::vector<DocumentIdentifierToken> getMoreMptr(uint64_t batchSize = 1000); std::vector<DocumentIdentifierToken> getMoreTokens(uint64_t batchSize);
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief Get next batchSize many elements. mptr variant /// @brief Get next batchSize many elements. mptr variant
@ -118,7 +118,7 @@ struct OperationCursor {
/// NOTE: The result vector handed in will be cleared. /// NOTE: The result vector handed in will be cleared.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
void getMoreMptr(std::vector<DocumentIdentifierToken>& result, uint64_t batchSize = 1000); void getMoreTokens(std::vector<DocumentIdentifierToken>& result, uint64_t batchSize);
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// @brief Skip the next toSkip many elements. /// @brief Skip the next toSkip many elements.

View File

@ -1290,7 +1290,7 @@ OperationResult Transaction::anyLocal(std::string const& collectionName,
while (cursor->hasMore()) { while (cursor->hasMore()) {
result.clear(); result.clear();
cursor->getMoreMptr(result); cursor->getMoreTokens(result, 1000);
for (auto const& element : result) { for (auto const& element : result) {
if (collection->readDocument(this, mmdr, element)) { if (collection->readDocument(this, mmdr, element)) {
uint8_t const* vpack = mmdr.vpack(); uint8_t const* vpack = mmdr.vpack();
@ -2679,7 +2679,7 @@ OperationResult Transaction::allLocal(std::string const& collectionName,
result.reserve(1000); result.reserve(1000);
while (cursor->hasMore()) { while (cursor->hasMore()) {
cursor->getMoreMptr(result, 1000); cursor->getMoreTokens(result, 1000);
for (auto const& element : result) { for (auto const& element : result) {
if (collection->readDocument(this, mmdr, element)) { if (collection->readDocument(this, mmdr, element)) {
uint8_t const* vpack = mmdr.vpack(); uint8_t const* vpack = mmdr.vpack();

View File

@ -259,8 +259,7 @@ static void JS_AllQuery(v8::FunctionCallbackInfo<v8::Value> const& args) {
VPackBuilder resultBuilder; VPackBuilder resultBuilder;
resultBuilder.openArray(); resultBuilder.openArray();
while (opCursor->hasMore()) { while (opCursor->hasMore()) {
opCursor->getMoreMptr(batch); opCursor->getMoreTokens(batch, 1000);
// We only need this one call, limit == batchsize
for (auto const& it : batch) { for (auto const& it : batch) {
if (collection->readDocument(&trx, mmdr, it)) { if (collection->readDocument(&trx, mmdr, it)) {
resultBuilder.add(VPackSlice(mmdr.vpack())); resultBuilder.add(VPackSlice(mmdr.vpack()));

View File

@ -121,7 +121,7 @@ bool SingleServerEdgeCursor::next(std::vector<VPackSlice>& result,
// If we switch the cursor. We have to clear the cache. // If we switch the cursor. We have to clear the cache.
_cache.clear(); _cache.clear();
} else { } else {
cursor->getMoreMptr(_cache); cursor->getMoreTokens(_cache, 1000);
} }
} while (_cache.empty()); } while (_cache.empty());
@ -158,7 +158,7 @@ bool SingleServerEdgeCursor::readAll(std::unordered_set<VPackSlice>& result,
while (cursor->hasMore()) { while (cursor->hasMore()) {
// NOTE: We cannot clear the cache, // NOTE: We cannot clear the cache,
// because the cursor expect's it to be filled. // because the cursor expect's it to be filled.
cursor->getMoreMptr(_cache); cursor->getMoreTokens(_cache, 1000);
for (auto const& element : _cache) { for (auto const& element : _cache) {
if (collection->readDocument(_trx, *_mmdr, element)) { if (collection->readDocument(_trx, *_mmdr, element)) {
result.emplace(_mmdr->vpack()); result.emplace(_mmdr->vpack());