diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-18 06:19:10 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-18 06:36:12 +0000 |
commit | d0d1bd1090e5dcd778eb86ee1c1b1714fd633cae (patch) | |
tree | ca9f4535c4c4c1afe7ab3f85749c691581745354 /persistencetypes/src | |
parent | fc9c0dcbbff209d47ea1b04f86f36f2ccb0c0ad2 (diff) |
Collapse persistencetypes into persistence
Diffstat (limited to 'persistencetypes/src')
7 files changed, 0 insertions, 141 deletions
diff --git a/persistencetypes/src/.gitignore b/persistencetypes/src/.gitignore deleted file mode 100644 index 2e8e6fd906a..00000000000 --- a/persistencetypes/src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/Makefile.ini -/config_command.sh -/project.dsw diff --git a/persistencetypes/src/vespa/persistence/.gitignore b/persistencetypes/src/vespa/persistence/.gitignore deleted file mode 100644 index 444f5c50077..00000000000 --- a/persistencetypes/src/vespa/persistence/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.depend -/Makefile -/libpersistencetypes.so.5.1 diff --git a/persistencetypes/src/vespa/persistence/CMakeLists.txt b/persistencetypes/src/vespa/persistence/CMakeLists.txt deleted file mode 100644 index 2ea62581c4e..00000000000 --- a/persistencetypes/src/vespa/persistence/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_library(persistencetypes - SOURCES - $<TARGET_OBJECTS:persistencetypes_spi> - INSTALL lib64 - DEPENDS -) diff --git a/persistencetypes/src/vespa/persistence/spi/.gitignore b/persistencetypes/src/vespa/persistence/spi/.gitignore deleted file mode 100644 index 7e7c0fe7fae..00000000000 --- a/persistencetypes/src/vespa/persistence/spi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.depend -/Makefile diff --git a/persistencetypes/src/vespa/persistence/spi/CMakeLists.txt b/persistencetypes/src/vespa/persistence/spi/CMakeLists.txt deleted file mode 100644 index 5a5f335ef40..00000000000 --- a/persistencetypes/src/vespa/persistence/spi/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_library(persistencetypes_spi OBJECT - SOURCES - types.cpp - DEPENDS -) diff --git a/persistencetypes/src/vespa/persistence/spi/types.cpp b/persistencetypes/src/vespa/persistence/spi/types.cpp deleted file mode 100644 index 260355213d9..00000000000 --- a/persistencetypes/src/vespa/persistence/spi/types.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "types.h" -#include <vespa/vespalib/objects/nbostream.h> - -namespace storage::spi { - -DEFINE_PRIMITIVE_WRAPPER_NBOSTREAM(NodeIndex); -DEFINE_PRIMITIVE_WRAPPER_NBOSTREAM(IteratorId); -DEFINE_PRIMITIVE_WRAPPER_NBOSTREAM(Timestamp); -DEFINE_PRIMITIVE_WRAPPER_NBOSTREAM(BucketChecksum); - -} diff --git a/persistencetypes/src/vespa/persistence/spi/types.h b/persistencetypes/src/vespa/persistence/spi/types.h deleted file mode 100644 index a75b977c14a..00000000000 --- a/persistencetypes/src/vespa/persistence/spi/types.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include <vespa/vespalib/stllike/string.h> -#include <vector> -#include <memory> - -namespace vespalib { - class nbostream; -} - -namespace document { - class GlobalId; - class Document; - class DocumentId; - class DocumentUpdate; -} - -/** - * We create small wrapper classes for number values for the following reasons: - * - Being able to create functions taking in several of them, without risking - * caller using numbers in wrong order. - * - We can identify type by typename instead of variable name. - */ -#define DEFINE_PRIMITIVE_WRAPPER(type, name) \ - class name { \ - type _value; \ - public: \ - typedef type Type; \ - name() noexcept : _value() {} \ - explicit name(type v) noexcept : _value(v) {} \ - operator type() const noexcept { return _value; } \ - operator type&() noexcept { return _value; } \ - type getValue() const noexcept { return _value; } \ - name& operator=(type val) noexcept { _value = val; return *this; } \ - friend vespalib::nbostream & \ - operator<<(vespalib::nbostream &os, const name &wrapped); \ - friend vespalib::nbostream & \ - operator>>(vespalib::nbostream &is, name &wrapped); \ - }; \ - -#define DEFINE_PRIMITIVE_WRAPPER_NBOSTREAM(name) \ - vespalib::nbostream & \ - operator<<(vespalib::nbostream &os, const name &wrapped) \ - { \ - os << wrapped._value; \ - return os; \ - } \ - \ - vespalib::nbostream & \ - operator>>(vespalib::nbostream &is, name &wrapped) \ - { \ - is >> wrapped._value; \ - return is; \ - } \ - -namespace storage::spi { - -/** - * \class storage::spi::NodeIndex - * \ingroup spi - */ -DEFINE_PRIMITIVE_WRAPPER(uint16_t, NodeIndex); - -/** - * \class storage::spi::IteratorId - * \ingroup spi - */ -DEFINE_PRIMITIVE_WRAPPER(uint64_t, IteratorId); - -/** - * \class storage::spi::Timestamp - * \ingroup spi - */ -DEFINE_PRIMITIVE_WRAPPER(uint64_t, Timestamp); - -/** - * \class storage::spi::BucketChecksum - * \ingroup spi - */ -DEFINE_PRIMITIVE_WRAPPER(uint32_t, BucketChecksum); - -// Import critical dependencies into SPI namespace. This makes interface look -// cleaner, and makes it easy to exchange actual implementation. -using Document = document::Document; -using DocumentUpdate = document::DocumentUpdate; -using DocumentId = document::DocumentId; -using GlobalId = document::GlobalId; -using TimestampList = std::vector<Timestamp>; -using string = vespalib::string; -using DocumentUP = std::unique_ptr<document::Document>; -using DocumentIdUP = std::unique_ptr<document::DocumentId>; -using DocumentSP = std::shared_ptr<document::Document>; -using DocumentUpdateSP = std::shared_ptr<document::DocumentUpdate>; - -enum IncludedVersions { - NEWEST_DOCUMENT_ONLY, - NEWEST_DOCUMENT_OR_REMOVE, - ALL_VERSIONS -}; - -enum MaintenanceLevel { - LOW, - HIGH -}; - -} |