diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-26 09:36:10 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-26 09:36:10 +0000 |
commit | 1a8bb7c6ab57373d1fe33a56ffc1165bd358398c (patch) | |
tree | 6b87c82ce6c69d9cfc9ceebc40440feaa24fcc53 /searchlib | |
parent | c2dfd2918b6ca7f531326df134ec300aeca48d39 (diff) |
_inFlight -> _numChunksPosted
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/storebybucket.cpp | 32 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/storebybucket.h | 4 |
2 files changed, 18 insertions, 18 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp index b2d74684c78..13de5687ee0 100644 --- a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp +++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp @@ -12,16 +12,16 @@ using document::BucketId; using vespalib::makeTask; using vespalib::makeClosure; -StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression) : - _chunkSerial(0), - _current(), - _where(), - _backingMemory(backingMemory), - _executor(executor), - _monitor(), - _inFlight(0), - _chunks(), - _compression(compression) +StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression) + : _chunkSerial(0), + _current(), + _where(), + _backingMemory(backingMemory), + _executor(executor), + _monitor(), + _numChunksPosted(0), + _chunks(), + _compression(compression) { createChunk().swap(_current); } @@ -34,7 +34,7 @@ StoreByBucket::add(BucketId bucketId, uint32_t chunkId, uint32_t lid, const void if ( ! _current->hasRoom(sz)) { Chunk::UP tmpChunk = createChunk(); _current.swap(tmpChunk); - incInFlight(); + incChunksPosted(); _executor.execute(makeTask(makeClosure(this, &StoreByBucket::closeChunk, std::move(tmpChunk)))); } Index idx(bucketId, _current->getId(), chunkId, lid); @@ -63,21 +63,21 @@ StoreByBucket::closeChunk(Chunk::UP chunk) ConstBufferRef bufferRef(_backingMemory.push_back(buffer.getData(), buffer.getDataLen()).data(), buffer.getDataLen()); vespalib::MonitorGuard guard(_monitor); _chunks[chunk->getId()] = bufferRef; - if (_inFlight == _chunks.size()) { + if (_numChunksPosted == _chunks.size()) { guard.signal(); } } void -StoreByBucket::incInFlight() { +StoreByBucket::incChunksPosted() { vespalib::MonitorGuard guard(_monitor); - _inFlight++; + _numChunksPosted++; } void StoreByBucket::waitAllProcessed() { vespalib::MonitorGuard guard(_monitor); - while (_inFlight != _chunks.size()) { + while (_numChunksPosted != _chunks.size()) { guard.wait(); } } @@ -85,7 +85,7 @@ StoreByBucket::waitAllProcessed() { void StoreByBucket::drain(IWrite & drainer) { - incInFlight(); + incChunksPosted(); _executor.execute(makeTask(makeClosure(this, &StoreByBucket::closeChunk, std::move(_current)))); waitAllProcessed(); std::vector<Chunk::UP> chunks; diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.h b/searchlib/src/vespa/searchlib/docstore/storebybucket.h index a4a488e3d65..8be0610b588 100644 --- a/searchlib/src/vespa/searchlib/docstore/storebybucket.h +++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.h @@ -46,7 +46,7 @@ public: return lidCount; } private: - void incInFlight(); + void incChunksPosted(); void waitAllProcessed(); Chunk::UP createChunk(); void closeChunk(Chunk::UP chunk); @@ -70,7 +70,7 @@ private: MemoryDataStore & _backingMemory; Executor & _executor; vespalib::Monitor _monitor; - size_t _inFlight; + size_t _numChunksPosted; vespalib::hash_map<uint64_t, ConstBufferRef> _chunks; CompressionConfig _compression; }; |