diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-06-20 10:17:42 +0200 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-06-20 10:17:42 +0200 |
commit | 2915ddaa1c176a47d6c62d3b25bad9bb369c1448 (patch) | |
tree | 3706af052360b9ef219d34ebf041d788cb92dd3d /storage | |
parent | 44fc1380b66867958f89c47ac8752926b3787a4d (diff) |
add and use HDR_ABORT instead
Diffstat (limited to 'storage')
4 files changed, 13 insertions, 9 deletions
diff --git a/storage/src/vespa/storage/bucketdb/judymultimap.hpp b/storage/src/vespa/storage/bucketdb/judymultimap.hpp index 81a58582073..0d80bcfb28e 100644 --- a/storage/src/vespa/storage/bucketdb/judymultimap.hpp +++ b/storage/src/vespa/storage/bucketdb/judymultimap.hpp @@ -2,7 +2,7 @@ #pragma once #include "judymultimap.h" -#include <vespa/log/log.h> +#include <vespa/vespalib/util/hdr_abort.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/array.hpp> #include <set> @@ -151,7 +151,7 @@ JudyMultiMap<T0, T1, T2, T3>::operator[](key_type key) case 1: return _values1[getIndex(it.value())]; case 2: return _values2[getIndex(it.value())]; case 3: return _values3[getIndex(it.value())]; - default: LOG_ABORT("should not be reached"); + default: HDR_ABORT("should not be reached"); } return T0(); // Avoid warning of no return } @@ -290,8 +290,7 @@ JudyMultiMap<T0, T1, T2, T3>::ConstIterator::operator*() const case 3: return value_type( _iterator.key(), _parent->_values3[getIndex(_iterator.value())]); default: - assert(false); - LOG_ABORT("should not be reached"); + HDR_ABORT("should not be reached"); } } @@ -300,11 +299,12 @@ typename JudyMultiMap<T0, T1, T2, T3>::mapped_type JudyMultiMap<T0, T1, T2, T3>::ConstIterator::value() const { switch (getType(_iterator.value())) { - default: assert(false); case 0: return _parent->_values0[getIndex(_iterator.value())]; case 1: return _parent->_values1[getIndex(_iterator.value())]; case 2: return _parent->_values2[getIndex(_iterator.value())]; case 3: return _parent->_values3[getIndex(_iterator.value())]; + default: + HDR_ABORT("should not be reached"); } } diff --git a/storage/src/vespa/storage/bucketdb/lockablemap.hpp b/storage/src/vespa/storage/bucketdb/lockablemap.hpp index f370a792145..6d700cd6049 100644 --- a/storage/src/vespa/storage/bucketdb/lockablemap.hpp +++ b/storage/src/vespa/storage/bucketdb/lockablemap.hpp @@ -2,6 +2,7 @@ #pragma once #include "lockablemap.h" +#include <vespa/vespalib/util/hdr_abort.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/stllike/hash_map.hpp> #include <vespa/vespalib/stllike/hash_set.hpp> @@ -264,7 +265,8 @@ LockableMap<Map>::handleDecision(key_type& key, mapped_type& val, break; case ABORT: return true; case CONTINUE: break; - default: assert(false); + default: + HDR_ABORT("should not be reached"); } return false; } diff --git a/storage/src/vespa/storage/distributor/operations/external/statbucketlistoperation.h b/storage/src/vespa/storage/distributor/operations/external/statbucketlistoperation.h index 0fbf3bb9e81..c977ea78f67 100644 --- a/storage/src/vespa/storage/distributor/operations/external/statbucketlistoperation.h +++ b/storage/src/vespa/storage/distributor/operations/external/statbucketlistoperation.h @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include <vespa/vespalib/util/hdr_abort.h> #include <vespa/storage/distributor/operations/operation.h> #include <vespa/storage/bucketdb/bucketdatabase.h> #include <vespa/vespalib/util/sync.h> @@ -30,7 +31,7 @@ public: void onReceive(DistributorMessageSender&, const std::shared_ptr<api::StorageReply>&) override { // Never called. - assert(false); + HDR_ABORT("should not be reached"); } void onClose(DistributorMessageSender&) override {} diff --git a/storage/src/vespa/storage/distributor/throttlingoperationstarter.h b/storage/src/vespa/storage/distributor/throttlingoperationstarter.h index c6e39a083b1..0b6d89e0570 100644 --- a/storage/src/vespa/storage/distributor/throttlingoperationstarter.h +++ b/storage/src/vespa/storage/distributor/throttlingoperationstarter.h @@ -2,6 +2,7 @@ #pragma once #include "operationstarter.h" +#include <vespa/vespalib/util/hdr_abort.h> #include <vespa/storage/distributor/operations/operation.h> namespace storage::distributor { @@ -49,11 +50,11 @@ class ThrottlingOperationStarter : public OperationStarter void onStart(DistributorMessageSender&) override { // Should never be called directly on the throttled operation // instance, but rather on its wrapped implementation. - assert(false); + HDR_ABORT("should not be reached"); } void onReceive(DistributorMessageSender&, const std::shared_ptr<api::StorageReply>&) override { - assert(false); + HDR_ABORT("should not be reached"); } }; |