mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
c0a390aefe
|
@ -24,8 +24,8 @@ addons:
|
|||
- ubuntu-toolchain-r-test
|
||||
- george-edison55-precise-backports
|
||||
packages:
|
||||
- g++-4.9
|
||||
- gcc-4.9
|
||||
- g++-5
|
||||
- gcc-5
|
||||
- binutils-gold
|
||||
- gdb
|
||||
- cmake-data
|
||||
|
|
|
@ -50,6 +50,8 @@ struct HexDump {
|
|||
|
||||
static std::string toHex(uint8_t value);
|
||||
|
||||
friend std::ostream& operator<<(std::ostream&, HexDump const&);
|
||||
|
||||
Slice const slice;
|
||||
int valuesPerLine;
|
||||
std::string separator;
|
||||
|
@ -58,8 +60,4 @@ struct HexDump {
|
|||
} // namespace arangodb::velocypack
|
||||
} // namespace arangodb
|
||||
|
||||
std::ostream& operator<<(std::ostream&, arangodb::velocypack::HexDump const*);
|
||||
|
||||
std::ostream& operator<<(std::ostream&, arangodb::velocypack::HexDump const&);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,14 +42,17 @@ std::string HexDump::toHex(uint8_t value) {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, HexDump const* hexdump) {
|
||||
namespace arangodb {
|
||||
namespace velocypack {
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, HexDump const& hexdump) {
|
||||
int current = 0;
|
||||
|
||||
for (uint8_t it : hexdump->slice) {
|
||||
for (uint8_t it : hexdump.slice) {
|
||||
if (current != 0) {
|
||||
stream << hexdump->separator;
|
||||
stream << hexdump.separator;
|
||||
|
||||
if (hexdump->valuesPerLine > 0 && current == hexdump->valuesPerLine) {
|
||||
if (hexdump.valuesPerLine > 0 && current == hexdump.valuesPerLine) {
|
||||
stream << std::endl;
|
||||
current = 0;
|
||||
}
|
||||
|
@ -62,6 +65,5 @@ std::ostream& operator<<(std::ostream& stream, HexDump const* hexdump) {
|
|||
return stream;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, HexDump const& hexdump) {
|
||||
return operator<<(stream, &hexdump);
|
||||
}
|
||||
}
|
||||
|
|
10
CHANGELOG
10
CHANGELOG
|
@ -1,6 +1,8 @@
|
|||
devel
|
||||
-----
|
||||
|
||||
* fixed variables parsing in GraphQL
|
||||
|
||||
* added `--translate` option for arangoimp to translate attribute names from
|
||||
the input files to attriubte names expected by ArangoDB
|
||||
|
||||
|
@ -26,11 +28,11 @@ devel
|
|||
for debugging.
|
||||
|
||||
* always validate incoming JSON HTTP requests for duplicate attribute names
|
||||
|
||||
|
||||
Incoming JSON data with duplicate attribute names will now be rejected as
|
||||
invalid. Previous versions of ArangoDB only validated the uniqueness of
|
||||
attribute names inside incoming JSON for some API endpoints, but not
|
||||
consistently for all APIs.
|
||||
consistently for all APIs.
|
||||
|
||||
* don't let read-only transactions block the WAL collector
|
||||
|
||||
|
@ -112,6 +114,10 @@ v3.2.alpha1 (2017-02-05)
|
|||
v3.1.13 (XXXX-XX-XX)
|
||||
--------------------
|
||||
|
||||
* fixed variables parsing in GraphQL
|
||||
|
||||
* fixed issue #2214
|
||||
|
||||
* fixed issue #2342
|
||||
|
||||
* changed thread handling to queue only user requests on coordinator
|
||||
|
|
|
@ -918,8 +918,8 @@ list(INSERT SYSTEM_LIBRARIES 0
|
|||
${OPENSSL_LIBRARIES}
|
||||
libcurl
|
||||
${BASE_LIBS}
|
||||
${CMAKE_DL_LIBS}
|
||||
${SYS_LIBS}
|
||||
${CMAKE_DL_LIBS}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ The name of the edge collection to be used.
|
|||
One or many vertex collections that can contain source vertices.
|
||||
|
||||
@RESTBODYPARAM{to,array,required,string}
|
||||
One or many edge collections that can contain target vertices.
|
||||
One or many vertex collections that can contain target vertices.
|
||||
|
||||
@RESTRETURNCODES
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ The name of the edge collection to be used.
|
|||
One or many vertex collections that can contain source vertices.
|
||||
|
||||
@RESTBODYPARAM{to,array,required,string}
|
||||
One or many edge collections that can contain target vertices.
|
||||
One or many vertex collections that can contain target vertices.
|
||||
|
||||
@RESTRETURNCODES
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ mkdir -p $HOME/bin/gold
|
|||
chmod a+x $HOME/bin/gold/ld
|
||||
|
||||
# prepare CCACHE
|
||||
(echo '#!/bin/bash'; echo 'ccache /usr/bin/gcc-4.9 "$@"') > $HOME/bin/gcc
|
||||
(echo '#!/bin/bash'; echo 'ccache /usr/bin/gcc-5 "$@"') > $HOME/bin/gcc
|
||||
chmod a+x $HOME/bin/gcc
|
||||
|
||||
(echo '#!/bin/bash'; echo 'ccache /usr/bin/g++-4.9 "$@"') > $HOME/bin/g++
|
||||
(echo '#!/bin/bash'; echo 'ccache /usr/bin/g++-5 "$@"') > $HOME/bin/g++
|
||||
chmod a+x $HOME/bin/g++
|
||||
|
||||
# prepare files for unit test
|
||||
|
|
|
@ -424,9 +424,9 @@ target_link_libraries(${BIN_ARANGOD}
|
|||
${MSVC_LIBS}
|
||||
${V8_LIBS}
|
||||
${ROCKSDB_LIBS}
|
||||
${SYSTEM_LIBRARIES}
|
||||
boost_boost
|
||||
boost_system
|
||||
${SYSTEM_LIBRARIES}
|
||||
)
|
||||
|
||||
install(
|
||||
|
|
|
@ -142,12 +142,11 @@ uint64_t Cache::usage() {
|
|||
}
|
||||
|
||||
std::pair<double, double> Cache::hitRates() {
|
||||
double lifetimeRate = std::nan("");
|
||||
double windowedRate = std::nan("");
|
||||
|
||||
uint64_t currentMisses = _findMisses.load();
|
||||
uint64_t currentHits = _findHits.load();
|
||||
lifetimeRate = 100 * (static_cast<double>(currentHits) /
|
||||
double lifetimeRate = 100 * (static_cast<double>(currentHits) /
|
||||
static_cast<double>(currentHits + currentMisses));
|
||||
|
||||
if (_enableWindowedStats && _findStats.get() != nullptr) {
|
||||
|
|
|
@ -100,7 +100,7 @@ class FrequencyBuffer {
|
|||
/// @brief Return a list of (event, count) pairs for each recorded event in
|
||||
/// ascending order.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
std::shared_ptr<FrequencyBuffer::stats_t> getFrequencies() const {
|
||||
std::shared_ptr<typename FrequencyBuffer::stats_t> getFrequencies() const {
|
||||
// calculate frequencies
|
||||
std::unordered_map<T, uint64_t> frequencies;
|
||||
for (size_t i = 0; i < _capacity; i++) {
|
||||
|
|
|
@ -197,12 +197,10 @@ uint64_t Manager::globalAllocation() {
|
|||
}
|
||||
|
||||
std::pair<double, double> Manager::globalHitRates() {
|
||||
double lifetimeRate = std::nan("");
|
||||
double windowedRate = std::nan("");
|
||||
|
||||
uint64_t currentMisses = _findMisses.load();
|
||||
uint64_t currentHits = _findHits.load();
|
||||
lifetimeRate = 100 * (static_cast<double>(currentHits) /
|
||||
double lifetimeRate = 100 * (static_cast<double>(currentHits) /
|
||||
static_cast<double>(currentHits + currentMisses));
|
||||
|
||||
if (_enableWindowedStats && _findStats.get() != nullptr) {
|
||||
|
|
|
@ -570,7 +570,7 @@ void HttpCommTask::processRequest(std::unique_ptr<HttpRequest> request) {
|
|||
<< "\"http-request-begin\",\"" << (void*)this << "\",\""
|
||||
<< _connectionInfo.clientAddress << "\",\""
|
||||
<< HttpRequest::translateMethod(_requestType) << "\",\""
|
||||
<< HttpRequest::translateVersion(_protocolVersion) << "\"," << _fullUrl
|
||||
<< HttpRequest::translateVersion(_protocolVersion) << "\",\"" << _fullUrl
|
||||
<< "\"";
|
||||
|
||||
std::string const& body = request->body();
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <limits>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <velocypack/HexDump.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
@ -52,6 +53,38 @@ using namespace arangodb;
|
|||
using namespace arangodb::basics;
|
||||
using namespace arangodb::rest;
|
||||
|
||||
inline std::size_t validateAndCount(char const* vpStart,
|
||||
char const* vpEnd) {
|
||||
VPackOptions validationOptions = VPackOptions::Defaults;
|
||||
validationOptions.validateUtf8Strings = true;
|
||||
VPackValidator validator(&validationOptions);
|
||||
|
||||
std::size_t numPayloads = 0;
|
||||
|
||||
try {
|
||||
// check for slice start to the end of Chunk
|
||||
// isSubPart allows the slice to be shorter than the checked buffer.
|
||||
do {
|
||||
validator.validate(vpStart, std::distance(vpStart, vpEnd),
|
||||
/*isSubPart =*/true);
|
||||
|
||||
// get offset to next
|
||||
VPackSlice tmp(vpStart);
|
||||
vpStart += tmp.byteSize();
|
||||
numPayloads++;
|
||||
} while (vpStart != vpEnd);
|
||||
return numPayloads - 1;
|
||||
} catch (std::exception const& e) {
|
||||
VPackSlice slice(vpStart);
|
||||
VPackHexDump dump(slice);
|
||||
LOG_TOPIC(DEBUG, Logger::COMMUNICATION)
|
||||
<< "len: " << std::distance(vpStart, vpEnd) << " - " << dump ;
|
||||
throw std::runtime_error(
|
||||
std::string("error during validation of incoming VPack: ") + e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VppCommTask::VppCommTask(EventLoop loop, GeneralServer* server,
|
||||
std::unique_ptr<Socket> socket, ConnectionInfo&& info,
|
||||
double timeout, bool skipInit)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <velocypack/Options.h>
|
||||
#include <velocypack/Slice.h>
|
||||
#include <velocypack/Validator.h>
|
||||
#include <velocypack/HexDump.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
#include <memory>
|
||||
|
@ -39,37 +38,6 @@
|
|||
|
||||
namespace arangodb {
|
||||
|
||||
inline std::size_t validateAndCount(char const* vpStart,
|
||||
char const* vpEnd) {
|
||||
VPackOptions validationOptions = VPackOptions::Defaults;
|
||||
validationOptions.validateUtf8Strings = true;
|
||||
VPackValidator validator(&validationOptions);
|
||||
|
||||
std::size_t numPayloads = 0;
|
||||
|
||||
try {
|
||||
// check for slice start to the end of Chunk
|
||||
// isSubPart allows the slice to be shorter than the checked buffer.
|
||||
do {
|
||||
validator.validate(vpStart, std::distance(vpStart, vpEnd),
|
||||
/*isSubPart =*/true);
|
||||
|
||||
// get offset to next
|
||||
VPackSlice tmp(vpStart);
|
||||
vpStart += tmp.byteSize();
|
||||
numPayloads++;
|
||||
} while (vpStart != vpEnd);
|
||||
return numPayloads - 1;
|
||||
} catch (std::exception const& e) {
|
||||
VPackSlice slice(vpStart);
|
||||
VPackHexDump dump(slice);
|
||||
LOG_TOPIC(DEBUG, Logger::COMMUNICATION)
|
||||
<< "len: " << std::distance(vpStart, vpEnd) << " - " << dump ;
|
||||
throw std::runtime_error(
|
||||
std::string("error during validation of incoming VPack: ") + e.what());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::size_t appendToBuffer(basics::StringBuffer* buffer, T& value) {
|
||||
constexpr std::size_t len = sizeof(T);
|
||||
|
|
|
@ -634,4 +634,4 @@ function getFieldDef(schema, parentType, fieldName) {
|
|||
return _introspection.TypeNameMetaFieldDef;
|
||||
}
|
||||
return parentType.getFields()[fieldName];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,4 +186,4 @@ function coerceValue(type, value) {
|
|||
if (!(0, _isNullish2.default)(parsed)) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,4 +66,4 @@ function graphql(schema, requestString, rootValue, contextValue, variableValues,
|
|||
*
|
||||
* `data` is the result of a successful execution of the query.
|
||||
* `errors` is included when any errors occurred as a non-empty array.
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = function graphql (cfg) {
|
|||
return variables;
|
||||
}
|
||||
try {
|
||||
return JSON.stringify(variables);
|
||||
return JSON.parse(variables);
|
||||
} catch (e) {
|
||||
res.throw(400, 'Variables are invalid JSON', e);
|
||||
}
|
||||
|
|
|
@ -210,19 +210,6 @@ bool arangodb::basics::TRI_AttributeNamesHaveExpansion(
|
|||
/// @brief append the attribute name to an output stream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream,
|
||||
arangodb::basics::AttributeName const* name) {
|
||||
stream << name->name;
|
||||
if (name->shouldExpand) {
|
||||
stream << "[*]";
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief append the attribute name to an output stream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream,
|
||||
arangodb::basics::AttributeName const& name) {
|
||||
stream << name.name;
|
||||
|
@ -236,23 +223,6 @@ std::ostream& operator<<(std::ostream& stream,
|
|||
/// @brief append the attribute names to an output stream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::ostream& operator<<(
|
||||
std::ostream& stream,
|
||||
std::vector<arangodb::basics::AttributeName> const* attributes) {
|
||||
size_t const n = attributes->size();
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
if (i > 0) {
|
||||
stream << ".";
|
||||
}
|
||||
stream << attributes[i];
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief append the attribute names to an output stream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::ostream& operator<<(
|
||||
std::ostream& stream,
|
||||
std::vector<arangodb::basics::AttributeName> const& attributes) {
|
||||
|
|
|
@ -129,10 +129,7 @@ bool TRI_AttributeNamesHaveExpansion(std::vector<AttributeName> const& input);
|
|||
}
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream&, arangodb::basics::AttributeName const*);
|
||||
std::ostream& operator<<(std::ostream&, arangodb::basics::AttributeName const&);
|
||||
std::ostream& operator<<(std::ostream&,
|
||||
std::vector<arangodb::basics::AttributeName> const*);
|
||||
std::ostream& operator<<(std::ostream&,
|
||||
std::vector<arangodb::basics::AttributeName> const&);
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "Basics/Common.h"
|
||||
#include "Basics/Exceptions.h"
|
||||
#include "Logger/Logger.h"
|
||||
#include "Zip/zip.h"
|
||||
|
||||
#include <sstream>
|
||||
|
|
|
@ -114,6 +114,16 @@ void TRI_ShutdownDebugging();
|
|||
void TRI_FlushDebugging();
|
||||
void TRI_FlushDebugging(char const* file, int line, char const* message);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump pair contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T1, typename T2>
|
||||
std::ostream& operator<<(std::ostream& stream, std::pair<T1, T2> const& obj) {
|
||||
stream << '(' << obj.first << ", " << obj.second << ')';
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump vector contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -209,7 +219,7 @@ std::ostream& operator<<(std::ostream& stream,
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump unordered_map contents to an ostream
|
||||
/// @brief dump map contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename K, typename V>
|
||||
|
|
|
@ -82,12 +82,6 @@ class LoggerStream {
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
LoggerStream& operator<<(std::pair<T1, T2> const& obj) {
|
||||
_out << '(' << obj.first << ", " << obj.second << ')';
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
std::stringstream _out;
|
||||
size_t _topicId;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "Basics/StringUtils.h"
|
||||
#include "GeneralRequest.h"
|
||||
#include "Endpoint/Endpoint.h"
|
||||
#include "Logger/Logger.h"
|
||||
#include "Rest/CommonDefines.h"
|
||||
|
||||
namespace arangodb {
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include "Basics/socket-utils.h"
|
||||
#include "Logger/Logger.h"
|
||||
#include "Ssl/ssl-helper.h"
|
||||
|
||||
#undef TRACE_SSL_CONNECTIONS
|
||||
|
|
Loading…
Reference in New Issue