aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/common/metricstest.cpp2
-rw-r--r--storage/src/tests/storageserver/statereportertest.cpp2
-rw-r--r--storage/src/vespa/storage/storageserver/CMakeLists.txt1
-rw-r--r--storage/src/vespa/storage/storageserver/messagesink.cpp83
-rw-r--r--storage/src/vespa/storage/storageserver/messagesink.h33
-rw-r--r--storage/src/vespa/storageapi/mbusprot/serializationhelper.h34
-rw-r--r--storage/src/vespa/storageframework/generic/component/component.h12
7 files changed, 8 insertions, 159 deletions
diff --git a/storage/src/tests/common/metricstest.cpp b/storage/src/tests/common/metricstest.cpp
index 76c6a9cf991..7231a071319 100644
--- a/storage/src/tests/common/metricstest.cpp
+++ b/storage/src/tests/common/metricstest.cpp
@@ -52,7 +52,7 @@ namespace {
{
framework::Clock& _clock;
explicit MetricClock(framework::Clock& c) : _clock(c) {}
- [[nodiscard]] time_t getTime() const override { return vespalib::count_s(_clock.getMonotonicTime().time_since_epoch()); }
+ [[nodiscard]] metrics::time_point getTime() const override { return _clock.getSystemTime(); }
};
}
diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp
index 2570b5232eb..3a772c1ddde 100644
--- a/storage/src/tests/storageserver/statereportertest.cpp
+++ b/storage/src/tests/storageserver/statereportertest.cpp
@@ -53,7 +53,7 @@ struct MetricClock : public metrics::MetricManager::Timer
{
framework::Clock& _clock;
explicit MetricClock(framework::Clock& c) : _clock(c) {}
- [[nodiscard]] time_t getTime() const override { return vespalib::count_s(_clock.getMonotonicTime().time_since_epoch()); }
+ [[nodiscard]] metrics::time_point getTime() const override { return _clock.getSystemTime(); }
};
}
diff --git a/storage/src/vespa/storage/storageserver/CMakeLists.txt b/storage/src/vespa/storage/storageserver/CMakeLists.txt
index 8b82bb251b2..009f8170669 100644
--- a/storage/src/vespa/storage/storageserver/CMakeLists.txt
+++ b/storage/src/vespa/storage/storageserver/CMakeLists.txt
@@ -14,7 +14,6 @@ vespa_add_library(storage_storageserver OBJECT
documentapiconverter.cpp
fnet_metrics_wrapper.cpp
mergethrottler.cpp
- messagesink.cpp
opslogger.cpp
priorityconverter.cpp
rpcrequestwrapper.cpp
diff --git a/storage/src/vespa/storage/storageserver/messagesink.cpp b/storage/src/vespa/storage/storageserver/messagesink.cpp
deleted file mode 100644
index 94762e545d9..00000000000
--- a/storage/src/vespa/storage/storageserver/messagesink.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "messagesink.h"
-#include <vespa/storageapi/message/persistence.h>
-#include <ostream>
-
-using std::shared_ptr;
-
-namespace storage {
-
-MessageSink::MessageSink()
- : StorageLink("Message Sink")
-{
-}
-
-MessageSink::~MessageSink()
-{
- closeNextLink();
-}
-
-void
-MessageSink::print(std::ostream& out, bool verbose,
- const std::string& indent) const
-{
- (void) verbose; (void) indent;
- out << "MessageSink";
-}
-
-namespace {
-#if 0
- std::string getTimeString() {
- char timeBuf[200];
- time_t tm;
- struct tm tms;
- time(&tm);
- gmtime_r(&tm, &tms);
- strftime(timeBuf, sizeof(timeBuf), "%Y-%m-%d:%H:%M:%S %Z", &tms);
- return std::string(timeBuf);
- }
-#endif
-}
-
-IMPL_MSG_COMMAND_H(MessageSink, Get)
-{
- //LOG(event, "[%s] Get %s", getTimeString().c_str(),
- // cmd->getDocumentId()->toString());
- shared_ptr<api::StorageReply> rmsg(new api::GetReply(*cmd));
- rmsg->setResult(api::ReturnCode::NOT_IMPLEMENTED);
- sendUp(rmsg);
- return true;
-}
-
-IMPL_MSG_COMMAND_H(MessageSink, Put)
-{
- //LOG(event, "[%s] Put %s", getTimeString().c_str(),
- // cmd->getDocumentId()->toString());
- shared_ptr<api::StorageReply> rmsg(new api::PutReply(*cmd));
- rmsg->setResult(api::ReturnCode::OK);
- sendUp(rmsg);
- return true;
-}
-
-IMPL_MSG_COMMAND_H(MessageSink, Remove)
-{
- //LOG(event, "[%s] Remove %s", getTimeString().c_str(),
- // cmd->getDocumentId()->toString());
- shared_ptr<api::StorageReply> rmsg(new api::RemoveReply(*cmd));
- rmsg->setResult(api::ReturnCode::OK);
- sendUp(rmsg);
- return true;
-}
-
-IMPL_MSG_COMMAND_H(MessageSink, Revert)
-{
- //LOG(event, "[%s] Revert %s", getTimeString().c_str(),
- // cmd->getDocumentId()->toString());
- shared_ptr<api::StorageReply> rmsg(new api::RevertReply(*cmd));
- rmsg->setResult(api::ReturnCode::OK);
- sendUp(rmsg);
- return true;
-}
-
-} // storage
diff --git a/storage/src/vespa/storage/storageserver/messagesink.h b/storage/src/vespa/storage/storageserver/messagesink.h
deleted file mode 100644
index d98d0439b48..00000000000
--- a/storage/src/vespa/storage/storageserver/messagesink.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-/**
- * @class storage::MessageSink
- * @ingroup storageserver
- *
- * @brief This class grabs persistence messages, and answers them without doing anything.
- *
- * @version $Id$
- */
-
-#pragma once
-
-#include <vespa/storage/common/storagelink.h>
-
-namespace storage {
-
-class MessageSink : public StorageLink {
-public:
- explicit MessageSink();
- MessageSink(const MessageSink &) = delete;
- MessageSink& operator=(const MessageSink &) = delete;
- ~MessageSink();
-
- void print(std::ostream& out, bool verbose, const std::string& indent) const override;
-
-private:
- DEF_MSG_COMMAND_H(Get);
- DEF_MSG_COMMAND_H(Put);
- DEF_MSG_COMMAND_H(Remove);
- DEF_MSG_COMMAND_H(Revert);
-};
-
-}
diff --git a/storage/src/vespa/storageapi/mbusprot/serializationhelper.h b/storage/src/vespa/storageapi/mbusprot/serializationhelper.h
index 457a6178704..671ffbddd6f 100644
--- a/storage/src/vespa/storageapi/mbusprot/serializationhelper.h
+++ b/storage/src/vespa/storageapi/mbusprot/serializationhelper.h
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/fastos/types.h>
#include <vespa/document/base/globalid.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/util/bytebuffer.h>
@@ -13,12 +12,6 @@ namespace storage::mbusprot {
class SerializationHelper
{
public:
- static int64_t getLong(document::ByteBuffer& buf) {
- int64_t tmp;
- buf.getLongNetwork(tmp);
- return tmp;
- }
-
static int32_t getInt(document::ByteBuffer& buf) {
int32_t tmp;
buf.getIntNetwork(tmp);
@@ -46,26 +39,6 @@ public:
return s;
}
- static bool getBoolean(document::ByteBuffer& buf) {
- uint8_t tmp;
- buf.getByte(tmp);
- return (tmp == 1);
- }
-
- static api::ReturnCode getReturnCode(document::ByteBuffer& buf) {
- api::ReturnCode::Result result = (api::ReturnCode::Result) getInt(buf);
- vespalib::stringref message = getString(buf);
- return api::ReturnCode(result, message);
- }
-
- static void putReturnCode(const api::ReturnCode& code, vespalib::GrowableByteBuffer& buf)
- {
- buf.putInt(code.getResult());
- buf.putString(code.getMessage());
- }
-
- static const uint32_t BUCKET_INFO_SERIALIZED_SIZE = sizeof(uint32_t) * 3;
-
static document::GlobalId getGlobalId(document::ByteBuffer& buf) {
std::vector<char> buffer(getShort(buf));
for (uint32_t i=0; i<buffer.size(); ++i) {
@@ -74,13 +47,6 @@ public:
return document::GlobalId(&buffer[0]);
}
- static void putGlobalId(const document::GlobalId& gid, vespalib::GrowableByteBuffer& buf)
- {
- buf.putShort(document::GlobalId::LENGTH);
- for (uint32_t i=0; i<document::GlobalId::LENGTH; ++i) {
- buf.putByte(gid.get()[i]);
- }
- }
static document::Document::UP getDocument(document::ByteBuffer& buf, const document::DocumentTypeRepo& repo)
{
uint32_t size = getInt(buf);
diff --git a/storage/src/vespa/storageframework/generic/component/component.h b/storage/src/vespa/storageframework/generic/component/component.h
index 9a5e524e504..47469cce05d 100644
--- a/storage/src/vespa/storageframework/generic/component/component.h
+++ b/storage/src/vespa/storageframework/generic/component/component.h
@@ -45,12 +45,12 @@
* optimize clock fetching as we see fit later.
*
* - A thread pool is given. This makes us able to use a thread pool.
- * (Allthough currently we don't really need a thread pool, as threads
- * typically live for the whole lifetime of the server. But currently we are
- * forced to use a thread pool due to fastos.) Another feature of this is
- * that the thread interface has built in information needed to detect
- * deadlocks and report status about thread behavior, such that deadlock
- * detecting and thread status can be shown without the threads themselves
+ * (Allthough currently we don't really need a thread pool, as
+ * threads typically live for the whole lifetime of the
+ * server. Another feature of this is that the thread interface has
+ * built in information needed to detect deadlocks and report
+ * status about thread behavior, such that deadlock detecting and
+ * thread status can be shown without the threads themselves
* depending on how this is done.
*
* - A memory manager may also be provided, allowing components to request