aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/distributor_status.cpp
blob: 7ad41d1b94594d8f41c618c7c0051e335699d52a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "distributor_status.h"
#include "delegatedstatusrequest.h"

namespace storage::distributor {

std::ostream& DistributorStatus::getStream() {
    return _request.outputStream;
}
const framework::HttpUrlPath& DistributorStatus::getPath() const {
    return _request.path;
}
const framework::StatusReporter& DistributorStatus::getReporter() const {
    return _request.reporter;
}

void DistributorStatus::notifyCompleted() {
    {
        std::lock_guard guard(_lock);
        _done = true;
    }
    _cond.notify_all();
}
void DistributorStatus::waitForCompletion() {
    std::unique_lock guard(_lock);
    while (!_done) {
        _cond.wait(guard);
    }
}

}