aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2017-10-10 15:20:00 +0200
committerGitHub <noreply@github.com>2017-10-10 15:20:00 +0200
commit64dc18c66319310fe2ba45fe60268e0b59046bc1 (patch)
treeca01b56b4f1bc688b328c486fdb78f4db8300796 /vespalib
parent577922cb7f9f1a7a8770f32bfcd732890cc62cd1 (diff)
parent2af8da3f4f0290889d8594d99a9eb78d179943f8 (diff)
Merge pull request #3692 from vespa-engine/toregge/remove-diskindex-checkpointing
Remove disk index checkpointing
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/objects/nbostream/nbostream_test.cpp16
-rw-r--r--vespalib/src/vespa/vespalib/objects/nbostream.cpp12
-rw-r--r--vespalib/src/vespa/vespalib/objects/nbostream.h10
-rw-r--r--vespalib/src/vespa/vespalib/objects/nbostream.hpp41
4 files changed, 2 insertions, 77 deletions
diff --git a/vespalib/src/tests/objects/nbostream/nbostream_test.cpp b/vespalib/src/tests/objects/nbostream/nbostream_test.cpp
index f2e24f5acdc..8b9ccb8a848 100644
--- a/vespalib/src/tests/objects/nbostream/nbostream_test.cpp
+++ b/vespalib/src/tests/objects/nbostream/nbostream_test.cpp
@@ -201,22 +201,6 @@ TEST_F("Test serializing std::pair", Fixture)
f.assertSerialize(exp, val);
}
-TEST_F("Test saveVector", Fixture)
-{
- std::vector<int16_t> val({ 0x0123, 0x4567 });
- val.reserve(16);
- ExpBuffer exp({ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- 0x01, 0x23, 0x45, 0x67 });
- f._stream.saveVector(val);
- EXPECT_EQUAL(exp, f._stream);
- std::vector<int16_t> checkVal;
- f._stream.restoreVector(checkVal);
- EXPECT_EQUAL(val, checkVal);
- EXPECT_EQUAL(val.capacity(), checkVal.capacity());
-}
-
-
TEST_F("Test write", Fixture)
{
f._stream.write("Hello", 5);
diff --git a/vespalib/src/vespa/vespalib/objects/nbostream.cpp b/vespalib/src/vespa/vespalib/objects/nbostream.cpp
index d8e35a69d16..0225b788e68 100644
--- a/vespalib/src/vespa/vespalib/objects/nbostream.cpp
+++ b/vespalib/src/vespa/vespalib/objects/nbostream.cpp
@@ -1,8 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include "nbostream.hpp"
+#include "nbostream.h"
#include "hexdump.h"
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <cassert>
namespace vespalib {
@@ -135,13 +136,4 @@ void nbostream::swap(nbostream & os)
std::swap(_rbuf, os._rbuf);
}
-template nbostream& nbostream::saveVector<int16_t>(const std::vector<int16_t> &);
-template nbostream& nbostream::restoreVector<int16_t>(std::vector<int16_t> &);
-template nbostream& nbostream::saveVector<int32_t>(const std::vector<int32_t> &);
-template nbostream& nbostream::restoreVector<int32_t>(std::vector<int32_t> &);
-template nbostream& nbostream::saveVector<uint32_t>(const std::vector<uint32_t> &);
-template nbostream& nbostream::restoreVector<uint32_t>(std::vector<uint32_t> &);
-template nbostream& nbostream::saveVector<uint64_t>(const std::vector<uint64_t> &);
-template nbostream& nbostream::restoreVector<uint64_t>(std::vector<uint64_t> &);
-
}
diff --git a/vespalib/src/vespa/vespalib/objects/nbostream.h b/vespalib/src/vespa/vespalib/objects/nbostream.h
index 75d3bc03313..70a590f79d1 100644
--- a/vespalib/src/vespa/vespalib/objects/nbostream.h
+++ b/vespalib/src/vespa/vespalib/objects/nbostream.h
@@ -138,16 +138,6 @@ public:
return *this;
}
- // For checkpointing where capacity should be restored
- template <typename T>
- nbostream &
- saveVector(const std::vector<T> &val);
-
- // For checkpointing where capacity should be restored
- template <typename T>
- nbostream &
- restoreVector(std::vector<T> &val);
-
size_t size() const { return left(); }
size_t capacity() const { return _wbuf.size(); }
bool empty() const { return size() == 0; }
diff --git a/vespalib/src/vespa/vespalib/objects/nbostream.hpp b/vespalib/src/vespa/vespalib/objects/nbostream.hpp
deleted file mode 100644
index 8b045f517a1..00000000000
--- a/vespalib/src/vespa/vespalib/objects/nbostream.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#pragma once
-
-#include "nbostream.h"
-#include <cassert>
-
-namespace vespalib {
-
-template <typename T>
-nbostream &
-nbostream::saveVector(const std::vector<T> &val)
-{
- size_t valCapacity = val.capacity();
- size_t valSize = val.size();
- assert(valCapacity >= valSize);
- *this << valCapacity << valSize;
- for (const T & v : val) {
- *this << v;
- }
- return *this;
-}
-
-template <typename T>
-nbostream &
-nbostream::restoreVector(std::vector<T> &val)
-{
- size_t valCapacity = 0;
- size_t valSize = 0;
- *this >> valCapacity >> valSize;
- assert(valCapacity >= valSize);
- val.reserve(valCapacity);
- val.clear();
- T i;
- for (size_t j = 0; j < valSize; ++j) {
- *this >> i;
- val.push_back(i);
- }
- return *this;
-}
-
-}