MCPcopy Create free account
hub / github.com/apache/impala / BlockingPut

Method BlockingPut

be/src/kudu/util/blocking_queue.h:186–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 // https://en.cppreference.com/w/cpp/utility/forward for details.
185 template<typename U>
186 Status BlockingPut(U&& val, MonoTime deadline = {}) {
187 if (PREDICT_FALSE(deadline.Initialized() && MonoTime::Now() > deadline)) {
188 return Status::TimedOut("");
189 }
190 MutexLock l(lock_);
191 while (true) {
192 if (PREDICT_FALSE(shutdown_)) {
193 return Status::Aborted("");
194 }
195 if (size_ < max_size_) {
196 increment_size_unlocked(val);
197 queue_.emplace_back(std::forward<U>(val));
198 l.Unlock();
199 not_empty_.Signal();
200 return Status::OK();
201 }
202 if (!deadline.Initialized()) {
203 not_full_.Wait();
204 } else if (PREDICT_FALSE(!not_full_.WaitUntil(deadline))) {
205 return Status::TimedOut("");
206 }
207 }
208 }
209
210 // Shuts down the queue.
211 //

Callers 3

TESTFunction · 0.45
InserterThreadMethod · 0.45
BlockingPutTaskMethod · 0.45

Calls 8

TimedOutFunction · 0.85
AbortedFunction · 0.85
OKFunction · 0.85
InitializedMethod · 0.45
UnlockMethod · 0.45
SignalMethod · 0.45
WaitMethod · 0.45
WaitUntilMethod · 0.45

Tested by 3

TESTFunction · 0.36
InserterThreadMethod · 0.36
BlockingPutTaskMethod · 0.36