summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-16 10:42:38 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-16 10:42:38 +0000
commit6b816198bd0d8a518465c8015e6dc9ee40399cd2 (patch)
tree17f93abf032e2ef2f4100131f3b1075db1a23a37
parent7e0c1731e36eb7048977ad14d6457182fb5ec4c1 (diff)
Just use the stream method.
-rw-r--r--document/src/vespa/document/fieldvalue/document.cpp4
-rw-r--r--document/src/vespa/document/fieldvalue/referencefieldvalue.cpp2
-rw-r--r--document/src/vespa/document/select/valuenodes.cpp6
-rw-r--r--persistence/src/vespa/persistence/conformancetest/conformancetest.cpp2
-rw-r--r--persistence/src/vespa/persistence/spi/docentry.cpp22
-rw-r--r--storage/src/tests/persistence/testandsettest.cpp4
-rw-r--r--storage/src/vespa/storage/persistence/processallhandler.cpp4
-rw-r--r--storage/src/vespa/storage/persistence/splitbitdetector.cpp2
-rw-r--r--storage/src/vespa/storage/storageserver/opslogger.cpp8
-rw-r--r--storageapi/src/vespa/storageapi/message/persistence.cpp16
10 files changed, 35 insertions, 35 deletions
diff --git a/document/src/vespa/document/fieldvalue/document.cpp b/document/src/vespa/document/fieldvalue/document.cpp
index ae0cd5ed9eb..29414c901f8 100644
--- a/document/src/vespa/document/fieldvalue/document.cpp
+++ b/document/src/vespa/document/fieldvalue/document.cpp
@@ -226,9 +226,9 @@ Document::print(std::ostream& out, bool verbose,
const std::string& indent) const
{
if (!verbose) {
- out << "Document(" << getId().toString() << ", " << getType() << ")";
+ out << "Document(" << getId() << ", " << getType() << ")";
} else {
- out << "Document(" << getId().toString() << "\n" << indent << " ";
+ out << "Document(" << getId() << "\n" << indent << " ";
getType().print(out, true, indent + " ");
for (const_iterator it = begin(); it != end(); ++it) {
out << "\n" << indent << " " << it.field().getName() << ": ";
diff --git a/document/src/vespa/document/fieldvalue/referencefieldvalue.cpp b/document/src/vespa/document/fieldvalue/referencefieldvalue.cpp
index b642ebdc775..6c046c1787b 100644
--- a/document/src/vespa/document/fieldvalue/referencefieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/referencefieldvalue.cpp
@@ -104,7 +104,7 @@ int ReferenceFieldValue::compare(const FieldValue& rhs) const {
void ReferenceFieldValue::print(std::ostream& os, bool verbose, const std::string& indent) const {
(void) verbose;
assert(_dataType != nullptr);
- os << indent << "ReferenceFieldValue(" << *_dataType << ", DocumentId(" << _documentId.toString() << "))";
+ os << indent << "ReferenceFieldValue(" << *_dataType << ", DocumentId(" << _documentId << "))";
}
bool ReferenceFieldValue::hasChanged() const {
diff --git a/document/src/vespa/document/select/valuenodes.cpp b/document/src/vespa/document/select/valuenodes.cpp
index 70cdbc10e8b..9cfdae14de1 100644
--- a/document/src/vespa/document/select/valuenodes.cpp
+++ b/document/src/vespa/document/select/valuenodes.cpp
@@ -571,7 +571,7 @@ IdValueNode::traceValue(const DocumentId& id, std::ostream& out) const
value = id.getScheme().getDocType();
out << "Resolved id.type to value\"" << value << "\".\n";
} else {
- out << "Could not resolve type of doc " << id.toString() << ".\n";
+ out << "Could not resolve type of doc " << id << ".\n";
return std::make_unique<InvalidValue>();
}
break;
@@ -589,7 +589,7 @@ IdValueNode::traceValue(const DocumentId& id, std::ostream& out) const
out << "Resolved group of doc (type " << id.getScheme().getType()
<< ") to \"" << value << "\".\n";
} else {
- out << "Can't resolve group of doc \"" << id.toString() << "\".\n";
+ out << "Can't resolve group of doc \"" << id << "\".\n";
return std::make_unique<InvalidValue>();
}
break;
@@ -604,7 +604,7 @@ IdValueNode::traceValue(const DocumentId& id, std::ostream& out) const
<< " to " << *result << ".\n";
return result;
} else {
- out << "Could not resolve user of doc " << id.toString() << ".\n";
+ out << "Could not resolve user of doc " << id << ".\n";
return std::make_unique<InvalidValue>();
}
}
diff --git a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
index 3ae13d6b21c..937431fb7dd 100644
--- a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
+++ b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
@@ -405,7 +405,7 @@ TEST_F(ConformanceTest, testBasics)
timeDoc2 = result.getEntries()[i]->getTimestamp();
}
} else {
- FAIL() << "Unknown document " << did->toString();
+ FAIL() << "Unknown document " << *did;
}
}
diff --git a/persistence/src/vespa/persistence/spi/docentry.cpp b/persistence/src/vespa/persistence/spi/docentry.cpp
index 4c2707f3a5e..dac3761c6d2 100644
--- a/persistence/src/vespa/persistence/spi/docentry.cpp
+++ b/persistence/src/vespa/persistence/spi/docentry.cpp
@@ -90,9 +90,9 @@ DocEntry::toString() const
std::ostringstream out;
out << "DocEntry(" << _timestamp << ", " << _metaFlags << ", ";
if (_documentId.get() != 0) {
- out << _documentId->toString();
+ out << *_documentId;
} else if (_document.get()) {
- out << "Doc(" << _document->getId().toString() << ")";
+ out << "Doc(" << _document->getId() << ")";
} else {
out << "metadata only";
}
@@ -110,10 +110,10 @@ DocEntry::prettyPrint(std::ostream& out) const
out << "DocEntry(Timestamp: " << _timestamp
<< ", size " << getPersistedDocumentSize() << ", ";
- if (_documentId.get() != 0) {
- out << _documentId->toString();
+ if (_documentId) {
+ out << *_documentId;
} else if (_document.get()) {
- out << "Doc(" << _document->getId().toString() << ")";
+ out << "Doc(" << _document->getId() << ")";
} else {
out << "metadata only";
}
@@ -135,8 +135,8 @@ DocEntry::operator==(const DocEntry& entry) const {
return false;
}
- if (_documentId.get()) {
- if (!entry._documentId.get()) {
+ if (_documentId) {
+ if (!entry._documentId) {
return false;
}
@@ -144,13 +144,13 @@ DocEntry::operator==(const DocEntry& entry) const {
return false;
}
} else {
- if (entry._documentId.get()) {
+ if (entry._documentId) {
return false;
}
}
- if (_document.get()) {
- if (!entry._document.get()) {
+ if (_document) {
+ if (!entry._document) {
return false;
}
@@ -158,7 +158,7 @@ DocEntry::operator==(const DocEntry& entry) const {
return false;
}
} else {
- if (entry._document.get()) {
+ if (entry._document) {
return false;
}
}
diff --git a/storage/src/tests/persistence/testandsettest.cpp b/storage/src/tests/persistence/testandsettest.cpp
index fe10d346ba7..1507f0e8f0d 100644
--- a/storage/src/tests/persistence/testandsettest.cpp
+++ b/storage/src/tests/persistence/testandsettest.cpp
@@ -294,9 +294,9 @@ std::string TestAndSetTest::expectedDocEntryString(
ss << "DocEntry(" << timestamp << ", " << removeFlag << ", ";
if (removeFlag == spi::REMOVE_ENTRY) {
- ss << docId.toString() << ")\n";
+ ss << docId << ")\n";
} else {
- ss << "Doc(" << docId.toString() << "))\n";
+ ss << "Doc(" << docId << "))\n";
}
return ss.str();
diff --git a/storage/src/vespa/storage/persistence/processallhandler.cpp b/storage/src/vespa/storage/persistence/processallhandler.cpp
index 39708f33793..8c951a9f50d 100644
--- a/storage/src/vespa/storage/persistence/processallhandler.cpp
+++ b/storage/src/vespa/storage/persistence/processallhandler.cpp
@@ -57,11 +57,11 @@ public:
void process(spi::DocEntry& e) override {
ost << " Timestamp: " << e.getTimestamp() << ", ";
if (e.getDocument() != nullptr) {
- ost << "Doc(" << e.getDocument()->getId().toString() << ")"
+ ost << "Doc(" << e.getDocument()->getId() << ")"
<< ", " << e.getDocument()->getId().getGlobalId().toString()
<< ", size: " << e.getPersistedDocumentSize();
} else if (e.getDocumentId() != nullptr) {
- ost << e.getDocumentId()->toString()
+ ost << *e.getDocumentId()
<< ", " << e.getDocumentId()->getGlobalId().toString();
} else {
ost << "metadata only";
diff --git a/storage/src/vespa/storage/persistence/splitbitdetector.cpp b/storage/src/vespa/storage/persistence/splitbitdetector.cpp
index 3b91b5a52ea..0208b220b79 100644
--- a/storage/src/vespa/storage/persistence/splitbitdetector.cpp
+++ b/storage/src/vespa/storage/persistence/splitbitdetector.cpp
@@ -91,7 +91,7 @@ struct BucketVisitor : public BucketProcessor::EntryProcessor {
for (uint32_t i=0; i<_firstDocs.size(); ++i) {
out << "\n" << _firstDocs[i].timestamp << ' '
<< _firstDocs[i].bucketId << ' '
- << _firstDocs[i].docId.toString();
+ << _firstDocs[i].docId;
}
}
diff --git a/storage/src/vespa/storage/storageserver/opslogger.cpp b/storage/src/vespa/storage/storageserver/opslogger.cpp
index c67f956904d..6fc9795993e 100644
--- a/storage/src/vespa/storage/storageserver/opslogger.cpp
+++ b/storage/src/vespa/storage/storageserver/opslogger.cpp
@@ -76,7 +76,7 @@ OpsLogger::onPutReply(const std::shared_ptr<api::PutReply>& msg)
if (_targetFile == nullptr) return false;
std::ostringstream ost;
ost << _component.getClock().getTimeInSeconds().getTime()
- << "\tPUT\t" << msg->getDocumentId().toString() << "\t"
+ << "\tPUT\t" << msg->getDocumentId() << "\t"
<< msg->getResult().toString() << "\n";
{
vespalib::LockGuard lock(_lock);
@@ -93,7 +93,7 @@ OpsLogger::onUpdateReply(const std::shared_ptr<api::UpdateReply>& msg)
if (_targetFile == nullptr) return false;
std::ostringstream ost;
ost << _component.getClock().getTimeInSeconds().getTime()
- << "\tUPDATE\t" << msg->getDocumentId().toString() << "\t"
+ << "\tUPDATE\t" << msg->getDocumentId() << "\t"
<< msg->getResult().toString() << "\n";
{
vespalib::LockGuard lock(_lock);
@@ -110,7 +110,7 @@ OpsLogger::onRemoveReply(const std::shared_ptr<api::RemoveReply>& msg)
if (_targetFile == nullptr) return false;
std::ostringstream ost;
ost << _component.getClock().getTimeInSeconds().getTime()
- << "\tREMOVE\t" << msg->getDocumentId().toString() << "\t"
+ << "\tREMOVE\t" << msg->getDocumentId() << "\t"
<< msg->getResult().toString() << "\n";
{
vespalib::LockGuard lock(_lock);
@@ -127,7 +127,7 @@ OpsLogger::onGetReply(const std::shared_ptr<api::GetReply>& msg)
if (_targetFile == nullptr) return false;
std::ostringstream ost;
ost << _component.getClock().getTimeInSeconds().getTime()
- << "\tGET\t" << msg->getDocumentId().toString() << "\t"
+ << "\tGET\t" << msg->getDocumentId() << "\t"
<< msg->getResult().toString() << "\n";
{
vespalib::LockGuard lock(_lock);
diff --git a/storageapi/src/vespa/storageapi/message/persistence.cpp b/storageapi/src/vespa/storageapi/message/persistence.cpp
index 2ab73236ca6..54df92546a5 100644
--- a/storageapi/src/vespa/storageapi/message/persistence.cpp
+++ b/storageapi/src/vespa/storageapi/message/persistence.cpp
@@ -58,7 +58,7 @@ PutCommand::getSummary() const
void
PutCommand::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "Put(" << getBucketId() << ", " << _doc->getId().toString()
+ out << "Put(" << getBucketId() << ", " << _doc->getId()
<< ", timestamp " << _timestamp << ", size "
<< _doc->serialize()->getLength() << ")";
if (verbose) {
@@ -85,7 +85,7 @@ void
PutReply::print(std::ostream& out, bool verbose,
const std::string& indent) const
{
- out << "PutReply(" << _docId.toString() << ", " << getBucketId() << ", timestamp " << _timestamp;
+ out << "PutReply(" << _docId << ", " << getBucketId() << ", timestamp " << _timestamp;
if (hasBeenRemapped()) {
out << " (was remapped)";
@@ -132,7 +132,7 @@ UpdateCommand::getSummary() const {
void
UpdateCommand::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "Update(" << getBucketId() << ", " << _update->getId().toString() << ", timestamp " << _timestamp;
+ out << "Update(" << getBucketId() << ", " << _update->getId() << ", timestamp " << _timestamp;
if (_oldTimestamp != 0) {
out << ", old timestamp " << _oldTimestamp;
}
@@ -160,7 +160,7 @@ void
UpdateReply::print(std::ostream& out, bool verbose, const std::string& indent) const
{
out << "UpdateReply("
- << _docId.toString() << ", " << getBucketId() << ", timestamp "
+ << _docId << ", " << getBucketId() << ", timestamp "
<< _timestamp << ", timestamp of updated doc: " << _oldTimestamp;
if (_consistentNode != (uint16_t)-1) {
@@ -200,7 +200,7 @@ GetCommand::getSummary() const
void
GetCommand::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "Get(" << getBucketId() << ", " << _docId.toString() << ")";
+ out << "Get(" << getBucketId() << ", " << _docId << ")";
if (verbose) {
out << " : ";
BucketCommand::print(out, verbose, indent);
@@ -226,7 +226,7 @@ GetReply::~GetReply() = default;
void
GetReply::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "GetReply(" << getBucketId() << ", " << _docId.toString() << ", timestamp " << _lastModifiedTime << ")";
+ out << "GetReply(" << getBucketId() << ", " << _docId << ", timestamp " << _lastModifiedTime << ")";
if (verbose) {
out << " : ";
BucketReply::print(out, verbose, indent);
@@ -253,7 +253,7 @@ RemoveCommand::getSummary() const {
void
RemoveCommand::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "Remove(" << getBucketId() << ", " << _docId.toString() << ", timestamp " << _timestamp << ")";
+ out << "Remove(" << getBucketId() << ", " << _docId << ", timestamp " << _timestamp << ")";
if (verbose) {
out << " : ";
BucketInfoCommand::print(out, verbose, indent);
@@ -273,7 +273,7 @@ RemoveReply::~RemoveReply() = default;
void
RemoveReply::print(std::ostream& out, bool verbose, const std::string& indent) const
{
- out << "RemoveReply(" << getBucketId() << ", " << _docId.toString() << ", timestamp " << _timestamp;
+ out << "RemoveReply(" << getBucketId() << ", " << _docId << ", timestamp " << _timestamp;
if (_oldTimestamp != 0) {
out << ", removed doc from " << _oldTimestamp;
} else {