1
0
Fork 0

Removed dead code.

This commit is contained in:
Michael Hackstein 2016-06-28 13:40:09 +02:00
parent 36b4512e4f
commit 12dc78450f
4 changed files with 11 additions and 71 deletions

View File

@ -589,30 +589,6 @@ int HashIndex::sizeHint(arangodb::Transaction* trx, size_t size) {
return _multiArray->_hashArray->resize(trx, size);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief Transforms search definition [{eq: v1},{eq: v2},...] to
/// Index key [v1, v2, ...]
/// Throws if input is invalid or there is an operator other than eq.
////////////////////////////////////////////////////////////////////////////////
void HashIndex::transformSearchValues(VPackSlice const values,
VPackBuilder& result) const {
if (!values.isArray()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, "Index lookup requires an array of values as input.");
}
if (values.length() != _fields.size()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, "Index lookup covers too few elements.");
}
VPackArrayBuilder guard(&result);
for (auto const& v : VPackArrayIterator(values)) {
if (!v.isObject() || !v.hasKey(StaticStrings::IndexEq)) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, "Hash index only allows == comparison.");
}
result.add(v.get(StaticStrings::IndexEq));
}
}
////////////////////////////////////////////////////////////////////////////////
/// @brief locates entries in the hash index given VelocyPack slices
////////////////////////////////////////////////////////////////////////////////

View File

@ -248,15 +248,6 @@ class HashIndex final : public PathBasedIndex {
arangodb::aql::Variable const* reference,
std::unordered_set<size_t>& found) const;
////////////////////////////////////////////////////////////////////////////////
/// @brief Transforms search definition [{eq: v1},{eq: v2},...] to
/// Index key [v1, v2, ...]
/// Throws if input is invalid or there is an operator other than eq.
////////////////////////////////////////////////////////////////////////////////
void transformSearchValues(arangodb::velocypack::Slice const,
arangodb::velocypack::Builder&) const;
//////////////////////////////////////////////////////////////////////////////
/// @brief given an element generates a hash integer
//////////////////////////////////////////////////////////////////////////////

View File

@ -226,7 +226,6 @@ int PrimaryIndex::remove(arangodb::Transaction*, TRI_doc_mptr_t const*, bool) {
TRI_doc_mptr_t* PrimaryIndex::lookup(arangodb::Transaction* trx,
VPackSlice const& slice) const {
TRI_ASSERT(slice.isArray() && slice.length() == 1);
VPackSlice tmp = slice.at(0);
TRI_ASSERT(tmp.isObject() && tmp.hasKey(StaticStrings::IndexEq));
tmp = tmp.get(StaticStrings::IndexEq);
@ -243,22 +242,6 @@ TRI_doc_mptr_t* PrimaryIndex::lookupKey(arangodb::Transaction* trx,
return _primaryIndex->findByKey(trx, key.begin());
}
////////////////////////////////////////////////////////////////////////////////
/// @brief a method to iterate over all elements in the index in
/// a random order.
/// Returns nullptr if all documents have been returned.
/// Convention: step === 0 indicates a new start.
/// DEPRECATED
////////////////////////////////////////////////////////////////////////////////
TRI_doc_mptr_t* PrimaryIndex::lookupRandom(
arangodb::Transaction* trx,
arangodb::basics::BucketPosition& initialPosition,
arangodb::basics::BucketPosition& position, uint64_t& step,
uint64_t& total) {
return _primaryIndex->findRandom(trx, initialPosition, position, step, total);
}
////////////////////////////////////////////////////////////////////////////////
/// @brief a method to iterate over all elements in the index in
/// a sequential order.

View File

@ -117,6 +117,8 @@ class AnyIndexIterator final : public IndexIterator {
};
class PrimaryIndex final : public Index {
friend class PrimaryIndexIterator;
public:
PrimaryIndex() = delete;
@ -158,29 +160,9 @@ class PrimaryIndex final : public Index {
int remove(arangodb::Transaction*, TRI_doc_mptr_t const*,
bool) override final;
//////////////////////////////////////////////////////////////////////////////
/// @brief looks up an element given a request Slice. Key has to have the format
/// [{eq: _key}]
//////////////////////////////////////////////////////////////////////////////
TRI_doc_mptr_t* lookup(arangodb::Transaction*, VPackSlice const&) const;
public:
TRI_doc_mptr_t* lookupKey(arangodb::Transaction*, VPackSlice const&) const;
//////////////////////////////////////////////////////////////////////////////
/// @brief a method to iterate over all elements in the index in
/// a random order.
/// Returns nullptr if all documents have been returned.
/// Convention: step === 0 indicates a new start.
/// DEPRECATED
//////////////////////////////////////////////////////////////////////////////
TRI_doc_mptr_t* lookupRandom(
arangodb::Transaction*, arangodb::basics::BucketPosition& initialPosition,
arangodb::basics::BucketPosition& position, uint64_t& step,
uint64_t& total);
//////////////////////////////////////////////////////////////////////////////
/// @brief a method to iterate over all elements in the index in
/// a sequential order.
@ -259,6 +241,14 @@ class PrimaryIndex final : public Index {
arangodb::aql::AstNode*, arangodb::aql::Variable const*) const override;
private:
//////////////////////////////////////////////////////////////////////////////
/// @brief looks up an element given a request Slice. The slice has to be
/// of type string.
//////////////////////////////////////////////////////////////////////////////
TRI_doc_mptr_t* lookup(arangodb::Transaction*, VPackSlice const&) const;
//////////////////////////////////////////////////////////////////////////////
/// @brief create the iterator, for a single attribute, IN operator
//////////////////////////////////////////////////////////////////////////////