8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into fea… · arangodb/arangodb@1b11426 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b11426

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17
* 'devel' of https://github.com/arangodb/arangodb: nightly frontend build Remove unused variable check from arangodump. (#6529) fixed JavaScript error added a reserve call Bug fix/simplify things (#6516) catch 501 (not implemented) in the query editor (ui) (#6523) return error codes in case a babies remove operation fails (#6527) Use physical collection directly (#6526) Feature/aql item block compression (#6514) move tests to the right location take over selectivity estimates (#6505) Properly check syncer erros, catch more exceptions (#6520) prevent out-of-bounds array access Fix deduplication in IndexBlock (#6508)
2 parents 4b38f0a + 0dd277d commit 1b11426
  • RocksDBEngine
  • Transaction
  • VocBase
  • arangosh/Dump
  • js
  • tests
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    69 files changed

    +992
    -1052
    lines changed

    CHANGELOG

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,9 @@
    11
    devel
    22
    -----
    33

    4+
    * the query editor within the web ui is now catching http 501 responses
    5+
    propertly.
    6+
    47
    * upgraded JEMalloc version to 5.1.0
    58

    69
    * use `-std=c++14` for ArangoDB compilation

    arangod/Agency/ActiveFailoverJob.cpp

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -281,7 +281,7 @@ std::string ActiveFailoverJob::findBestFollower() {
    281281
    if (!isAvailable) {
    282282
    continue; // skip inaccessible servers
    283283
    }
    284-
    TRI_ASSERT(srvUUID != _server);
    284+
    TRI_ASSERT(srvUUID != _server); // assumption: _server is unhealthy
    285285

    286286
    VPackSlice leader = pair.value.get("leader"); // broken leader
    287287
    VPackSlice lastTick = pair.value.get("lastTick");

    arangod/Aql/Aggregator.cpp

    Lines changed: 23 additions & 10 deletions
    Original file line numberDiff line numberDiff line change
    @@ -259,11 +259,9 @@ struct AggregatorSum final : public Aggregator {
    259259
    return AqlValue(AqlValueHintNull());
    260260
    }
    261261

    262-
    builder.clear();
    263-
    builder.add(VPackValue(sum));
    264-
    AqlValue temp(builder.slice());
    262+
    double v = sum;
    265263
    reset();
    266-
    return temp;
    264+
    return AqlValue(AqlValueHintDouble(v));
    267265
    }
    268266

    269267
    double sum;
    @@ -343,6 +341,8 @@ struct AggregatorAverageStep1 final : public AggregatorAverage {
    343341
    reset();
    344342
    return temp;
    345343
    }
    344+
    345+
    arangodb::velocypack::Builder builder;
    346346
    };
    347347

    348348
    /// @brief the coordinator variant of AVERAGE, aggregating partial sums and counts
    @@ -475,6 +475,8 @@ struct AggregatorVarianceBaseStep1 final : public AggregatorVarianceBase {
    475475
    reset();
    476476
    return temp;
    477477
    }
    478+
    479+
    arangodb::velocypack::Builder builder;
    478480
    };
    479481

    480482
    /// @brief the coordinator variant of VARIANCE
    @@ -663,6 +665,7 @@ struct AggregatorUnique : public Aggregator {
    663665

    664666
    MemoryBlockAllocator allocator;
    665667
    std::unordered_set<velocypack::Slice, basics::VelocyPackHelper::VPackHash, basics::VelocyPackHelper::VPackEqual> seen;
    668+
    arangodb::velocypack::Builder builder;
    666669
    };
    667670

    668671
    /// @brief the coordinator variant of UNIQUE
    @@ -740,6 +743,7 @@ struct AggregatorSortedUnique : public Aggregator {
    740743

    741744
    MemoryBlockAllocator allocator;
    742745
    std::set<velocypack::Slice, basics::VelocyPackHelper::VPackLess<true>> seen;
    746+
    arangodb::velocypack::Builder builder;
    743747
    };
    744748

    745749
    /// @brief the coordinator variant of SORTED_UNIQUE
    @@ -804,6 +808,7 @@ struct AggregatorCountDistinct : public Aggregator {
    804808

    805809
    MemoryBlockAllocator allocator;
    806810
    std::unordered_set<velocypack::Slice, basics::VelocyPackHelper::VPackHash, basics::VelocyPackHelper::VPackEqual> seen;
    811+
    arangodb::velocypack::Builder builder;
    807812
    };
    808813

    809814
    /// @brief the coordinator variant of COUNT_DISTINCT
    @@ -1000,13 +1005,11 @@ std::unordered_map<std::string, std::string> const aliases = {
    10001005

    10011006
    std::unique_ptr<Aggregator> Aggregator::fromTypeString(transaction::Methods* trx,
    10021007
    std::string const& type) {
    1003-
    auto it = ::aggregators.find(translateAlias(type));
    1008+
    // will always return a valid generator function or throw an exception
    1009+
    auto generator = Aggregator::factoryFromTypeString(type);
    1010+
    TRI_ASSERT(generator != nullptr);
    10041011

    1005-
    if (it != ::aggregators.end()) {
    1006-
    return (*it).second.generator(trx);
    1007-
    }
    1008-
    // aggregator function name should have been validated before
    1009-
    THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid aggregator type");
    1012+
    return (*generator)(trx);
    10101013
    }
    10111014

    10121015
    std::unique_ptr<Aggregator> Aggregator::fromVPack(transaction::Methods* trx,
    @@ -1020,6 +1023,16 @@ std::unique_ptr<Aggregator> Aggregator::fromVPack(transaction::Methods* trx,
    10201023
    THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid aggregator type");
    10211024
    }
    10221025

    1026+
    std::function<std::unique_ptr<Aggregator>(transaction::Methods*)> const* Aggregator::factoryFromTypeString(std::string const& type) {
    1027+
    auto it = ::aggregators.find(translateAlias(type));
    1028+
    1029+
    if (it != ::aggregators.end()) {
    1030+
    return &((*it).second.generator);
    1031+
    }
    1032+
    // aggregator function name should have been validated before
    1033+
    THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid aggregator type");
    1034+
    }
    1035+
    10231036
    std::string Aggregator::translateAlias(std::string const& name) {
    10241037
    auto it = ::aliases.find(name);
    10251038

    arangod/Aql/Aggregator.h

    Lines changed: 5 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,7 +27,6 @@
    2727
    #include "Basics/Common.h"
    2828
    #include "Aql/AqlValue.h"
    2929

    30-
    #include <velocypack/Builder.h>
    3130
    #include <velocypack/Slice.h>
    3231

    3332
    namespace arangodb {
    @@ -51,10 +50,14 @@ struct Aggregator {
    5150
    /// @brief creates an aggregator from a name string
    5251
    static std::unique_ptr<Aggregator> fromTypeString(transaction::Methods*,
    5352
    std::string const& type);
    54-
    53+
    5554
    /// @brief creates an aggregator from a velocypack slice
    5655
    static std::unique_ptr<Aggregator> fromVPack(transaction::Methods*,
    5756
    arangodb::velocypack::Slice const&, char const* nameAttribute);
    57+
    58+
    /// @brief return a pointer to an aggregator factory for an aggregator type
    59+
    /// throws if the aggregator cannot be found
    60+
    static std::function<std::unique_ptr<Aggregator>(transaction::Methods*)> const* factoryFromTypeString(std::string const& type);
    5861

    5962
    /// @brief translates an alias to an actual aggregator name
    6063
    /// returns the original value if the name was not an alias
    @@ -87,8 +90,6 @@ struct Aggregator {
    8790

    8891
    protected:
    8992
    transaction::Methods* trx;
    90-
    91-
    arangodb::velocypack::Builder builder;
    9293
    };
    9394

    9495
    } // namespace arangodb::aql

    0 commit comments

    Comments
     (0)
    0