diff options
author | Sage Weil <sage@inktank.com> | 2013-01-21 14:52:54 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-01-22 14:47:41 -0800 |
commit | c549a0cf6fae78c8418a3b4b0702fd8a1e4ce482 (patch) | |
tree | 15030d2016fad6327766db8922ad88858a6c8c3a | |
parent | 128fcfcac7d3fb66ca2c799df521591a98b82e05 (diff) | |
download | ceph-c549a0cf6fae78c8418a3b4b0702fd8a1e4ce482.tar.gz |
common/PrioritizedQueue: buckets -> tokens
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/common/PrioritizedQueue.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/PrioritizedQueue.h b/src/common/PrioritizedQueue.h index 9c27ddc3860..6ada0660124 100644 --- a/src/common/PrioritizedQueue.h +++ b/src/common/PrioritizedQueue.h @@ -76,22 +76,22 @@ class PrioritizedQueue { struct SubQueue { private: map<K, list<pair<unsigned, T> > > q; - unsigned bucket; + unsigned tokens; int64_t size; typename map<K, list<pair<unsigned, T> > >::iterator cur; public: SubQueue(const SubQueue &other) - : q(other.q), bucket(other.bucket), size(other.size), + : q(other.q), tokens(other.tokens), size(other.size), cur(q.begin()) {} - SubQueue() : bucket(0), size(0), cur(q.begin()) {} + SubQueue() : tokens(0), size(0), cur(q.begin()) {} unsigned num_tokens() const { - return bucket; + return tokens; } - void put_tokens(unsigned tokens) { - bucket += tokens; + void put_tokens(unsigned t) { + tokens += t; } - void take_tokens(unsigned tokens) { - bucket -= tokens; + void take_tokens(unsigned t) { + tokens -= t; } void enqueue(K cl, unsigned cost, T item) { q[cl].push_back(make_pair(cost, item)); |