mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'engine-api' of github.com:arangodb/arangodb into engine-api
This commit is contained in:
commit
13a1f15116
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
139
bootstrap.sh
139
bootstrap.sh
|
@ -1,139 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# usage:
|
||||
# ./boostrap.sh [--git] [--asan] [--clang] source_destination
|
||||
# @author Jan Christoph Uhde - 2017
|
||||
|
||||
arg_git=false
|
||||
arg_asan=false
|
||||
|
||||
https_url="https://github.com/arangodb/arangodb.git"
|
||||
git_url="git@github.com:arangodb/arangodb.git"
|
||||
|
||||
build_type="RelWithDebInfo"
|
||||
compiler=gcc
|
||||
|
||||
args=()
|
||||
for arg in "$@"; do
|
||||
if [[ $arg == "--" ]]; then
|
||||
break
|
||||
fi
|
||||
case $arg in
|
||||
--git)
|
||||
arg_git=true
|
||||
;;
|
||||
--asan)
|
||||
arg_asan=true
|
||||
;;
|
||||
--clang)
|
||||
compiler=clang
|
||||
;;
|
||||
--gcc-arango)
|
||||
compiler=gcc-arango
|
||||
;;
|
||||
*)
|
||||
args+=( "$arg" )
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
configure_build(){
|
||||
local source_dir="$1"
|
||||
|
||||
local asan=""
|
||||
if $arg_asan; then
|
||||
asan="-fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fno-sanitize=vptr"
|
||||
fi
|
||||
|
||||
case "$compiler" in
|
||||
clang)
|
||||
flags="$asan"
|
||||
cxx="/usr/bin/clang++"
|
||||
cc="/usr/bin/clang"
|
||||
;;
|
||||
gcc-arango)
|
||||
flags=" -lpthread $asan"
|
||||
cxx="/opt/arangodb/bin/g++"
|
||||
cc="/opt/arangodb/bin/gcc"
|
||||
;;
|
||||
gcc)
|
||||
flags=" -lpthread $asan"
|
||||
cxx="/usr/bin/g++"
|
||||
cc="/usr/bin/gcc"
|
||||
;;
|
||||
esac
|
||||
|
||||
cxx_flags="$flags -std=c++11"
|
||||
CXX=$cxx \
|
||||
CC=$cc \
|
||||
CXXFLAGS="$cxx_flags" \
|
||||
CFLAGS="$flags" \
|
||||
cmake -DCMAKE_BUILD_TYPE=$build_type \
|
||||
-DUSE_MAINTAINER_MODE=On \
|
||||
-DUSE_BOOST_UNITTESTS=On \
|
||||
-DUSE_FAILURE_TESTS=On \
|
||||
-DUSE_ENTERPRISE=OFF \
|
||||
"$source_dir"
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "configuration successful (in $(pwd))"
|
||||
make -j $(nproc)
|
||||
else
|
||||
echo "failed to configure (in $(pwd))"
|
||||
fi
|
||||
}
|
||||
|
||||
bootstrap(){
|
||||
local branch="$2"
|
||||
|
||||
local source_dir="$1"
|
||||
local build_dir="${source_dir}-build"
|
||||
mkdir -p "$build_dir"
|
||||
|
||||
local url="$https_url"
|
||||
if $git; then
|
||||
url="$git_url"
|
||||
fi
|
||||
|
||||
#store path
|
||||
current_dir="$(pwd)"
|
||||
|
||||
if [[ -e $source_dir ]]; then
|
||||
echo "A file/directory already exists in the chosen location!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "cloning '$url' into '$source_dir'"
|
||||
git clone "$url" "$source_dir"
|
||||
|
||||
echo "changing into '$source_dir'"
|
||||
cd $source_dir || { echo "can not change into $source_dir"; exit 1; }
|
||||
|
||||
if [[ -n "$branch" ]]; then
|
||||
echo "checking out '$branch'"
|
||||
git checkout "$branch" || { echo "can not change into $source_dir"; exit 1; }
|
||||
fi
|
||||
|
||||
# TODO more error handling instead of: 'set -e'
|
||||
set -e
|
||||
echo "initialize submodules"
|
||||
git submodule init
|
||||
git submodule update --recursive
|
||||
cd 3rdParty/V8/v8
|
||||
git submodule init
|
||||
git submodule update --recursive
|
||||
|
||||
echo "linking $current_dir/$build_dir to build"
|
||||
ln -s "$current_dir/$build_dir" "$current_dir/$source_dir/build"
|
||||
|
||||
cd "$current_dir/$build_dir"
|
||||
set +e
|
||||
|
||||
configure_build "$current_dir/$source_dir"
|
||||
|
||||
# in a better language the build command should be here but by
|
||||
# putting it at the end of configure_build unnecessary parsing is
|
||||
# avoided.
|
||||
}
|
||||
|
||||
bootstrap "${args[@]}"
|
|
@ -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&);
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -77,17 +77,11 @@ class LoggerStream {
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
friend LoggerStream& operator<<(LoggerStream& out, T const& obj) {
|
||||
out << obj;
|
||||
return out;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
LoggerStream& operator<<(std::pair<T1, T2> const& obj) {
|
||||
_out << '(' << obj.first << ", " << obj.second << ')';
|
||||
LoggerStream& operator<<(T const& obj) {
|
||||
_out << obj;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::stringstream _out;
|
||||
size_t _topicId;
|
||||
|
|
Loading…
Reference in New Issue