aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/bucketdb/bucketcopy.cpp
blob: 69844c8957b97a9bc09908bce3c1128b7dfa6403 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketcopy.h"
#include <sstream>

namespace storage {

void
BucketCopy::print(std::ostream& out, bool /*verbose*/, const std::string&) const
{
    out << "node("
        << "idx=" << _node
        << ",crc=" << std::hex << "0x" << getChecksum() << std::dec
        << ",docs=" << getDocumentCount() << "/" << getMetaCount()
        << ",bytes=" << getTotalDocumentSize() << "/" << getUsedFileSize()
        << ",trusted=" << (trusted() ? "true" : "false")
        << ",active=" << (active() ? "true" : "false")
        << ",ready=" << (ready() ? "true" : "false")
        << ")";
}

std::string
BucketCopy::toString() const {
    std::ostringstream ost;
    print(ost, true, "");
    return ost.str();
}

}