mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Removed unrelated data.
This commit is contained in:
parent
02958c1c7f
commit
c3827a29eb
66
contrib/libpoco/Foundation/include/Poco/ScopedUnlock.h
Normal file
66
contrib/libpoco/Foundation/include/Poco/ScopedUnlock.h
Normal file
@ -0,0 +1,66 @@
|
||||
//
|
||||
// ScopedUnlock.h
|
||||
//
|
||||
// $Id: //poco/1.4/Foundation/include/Poco/ScopedUnlock.h#1 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Mutex
|
||||
//
|
||||
// Definition of the ScopedUnlock template class.
|
||||
//
|
||||
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_ScopedUnlock_INCLUDED
|
||||
#define Foundation_ScopedUnlock_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
template <class M>
|
||||
class ScopedUnlock
|
||||
/// A class that simplifies thread synchronization
|
||||
/// with a mutex.
|
||||
/// The constructor accepts a Mutex and unlocks it.
|
||||
/// The destructor locks the mutex.
|
||||
{
|
||||
public:
|
||||
inline ScopedUnlock(M& mutex, bool unlockNow = true): _mutex(mutex)
|
||||
{
|
||||
if (unlockNow)
|
||||
_mutex.unlock();
|
||||
}
|
||||
inline ~ScopedUnlock()
|
||||
{
|
||||
try
|
||||
{
|
||||
_mutex.lock();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
poco_unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
M& _mutex;
|
||||
|
||||
ScopedUnlock();
|
||||
ScopedUnlock(const ScopedUnlock&);
|
||||
ScopedUnlock& operator = (const ScopedUnlock&);
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_ScopedUnlock_INCLUDED
|
25
dbms/src/Core/tests/exception.cpp
Normal file
25
dbms/src/Core/tests/exception.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <Poco/Net/NetException.h>
|
||||
|
||||
#include <DB/Common/Exception.h>
|
||||
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
try
|
||||
{
|
||||
//throw Poco::Net::ConnectionRefusedException();
|
||||
throw DB::Exception(Poco::Net::ConnectionRefusedException());
|
||||
}
|
||||
catch (const DB::Exception & e)
|
||||
{
|
||||
std::cerr << e.displayText() << std::endl;
|
||||
}
|
||||
catch (const Poco::Exception & e)
|
||||
{
|
||||
std::cerr << e.displayText() << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
1
debian/clickhouse-benchmark-metrika-yandex.install
vendored
Normal file
1
debian/clickhouse-benchmark-metrika-yandex.install
vendored
Normal file
@ -0,0 +1 @@
|
||||
/usr/bin/clickhouse-benchmark
|
2
debian/clickhouse-client.install
vendored
Normal file
2
debian/clickhouse-client.install
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/etc/clickhouse-client/config.xml
|
||||
/usr/bin/clickhouse-client
|
5
debian/clickhouse-server-base.install
vendored
Normal file
5
debian/clickhouse-server-base.install
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/usr/bin/clickhouse-server
|
||||
/etc/logrotate.d/clickhouse-server.logrt
|
||||
/etc/cron.d/clickhouse-server
|
||||
/etc/security/limits.d/metrika.conf
|
||||
/usr/share/clickhouse/*
|
24
debian/clickhouse-server-base.postinst
vendored
Normal file
24
debian/clickhouse-server-base.postinst
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -x "/etc/init.d/clickhouse-server" ]; then
|
||||
update-rc.d clickhouse-server defaults 19 19 >/dev/null || exit $?
|
||||
fi
|
||||
|
||||
useradd -p "" metrika ||:
|
||||
|
||||
if id metrika > /dev/null 2>&1; then
|
||||
mkdir -p /opt/clickhouse/data/default/
|
||||
mkdir -p /opt/clickhouse/metadata/default/
|
||||
mkdir -p /opt/cores/
|
||||
chown metrika: /opt/clickhouse /opt/cores /opt/clickhouse/data /opt/clickhouse/metadata /opt/clickhouse/data/default /opt/clickhouse/metadata/default
|
||||
# Очистка старых результатов динамической компиляции.
|
||||
if [ -d "/opt/clickhouse/build" ]; then
|
||||
rm -f /opt/clickhouse/build/*.cpp /opt/clickhouse/build/*.so ||:
|
||||
fi
|
||||
else
|
||||
echo "User metrika doesn't exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
2
debian/clickhouse-server-common.install
vendored
Normal file
2
debian/clickhouse-server-common.install
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
etc/clickhouse-server/config.xml etc/clickhouse-server
|
||||
etc/clickhouse-server/users.xml etc/clickhouse-server
|
2
debian/clickhouse-server-metrika.install
vendored
Normal file
2
debian/clickhouse-server-metrika.install
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
etc/clickhouse-server/metrika/config.xml etc/clickhouse-server
|
||||
etc/clickhouse-server/metrika/users.xml etc/clickhouse-server
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
||||
5
|
1
debian/compressor-metrika-yandex.install
vendored
Normal file
1
debian/compressor-metrika-yandex.install
vendored
Normal file
@ -0,0 +1 @@
|
||||
/usr/bin/compressor
|
1
debian/config-processor-metrika-yandex.install
vendored
Normal file
1
debian/config-processor-metrika-yandex.install
vendored
Normal file
@ -0,0 +1 @@
|
||||
/usr/bin/config-processor
|
19
debian/copy_clang_binaries.sh
vendored
Executable file
19
debian/copy_clang_binaries.sh
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Копирует бинарник clang а также shared-библиотеку libstdc++ в указанную директорию.
|
||||
# Так повезло, что этого достаточно, чтобы затем собирать код на удалённом сервере с совпадающей версией Ubuntu, но без установленного компилятора.
|
||||
|
||||
DST=${1:-.};
|
||||
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH"
|
||||
CLANG=$(command -v clang)
|
||||
|
||||
if [ ! -x "$CLANG" ]; then
|
||||
echo "Not found executable clang."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp "$CLANG" $DST
|
||||
|
||||
STDCPP=$(ldd $(command -v clang) | grep -oE '/[^ ]+libstdc++[^ ]+')
|
||||
|
||||
[ -f "$STDCPP" ] && cp "$STDCPP" $DST
|
8
debian/copyright
vendored
Normal file
8
debian/copyright
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
This package was debianized by Razuvaev Michael <razuvaev@yandex-team.ru> on
|
||||
Thu, 27 Nov 2008 18:28:05 +0300
|
||||
|
||||
It is Yandex property
|
||||
|
||||
Upstream Authors: Yandex Metrika Team
|
||||
|
||||
Copyright: Yandex
|
162
debian/rules
vendored
Executable file
162
debian/rules
vendored
Executable file
@ -0,0 +1,162 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
ifndef THREADS_COUNT
|
||||
THREADS_COUNT=24
|
||||
endif
|
||||
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
rm -rf build
|
||||
make clean 1> /dev/null 2>&1 || echo "Nothing to clean"
|
||||
rm -f CMakeCache.txt
|
||||
mkdir -p build
|
||||
touch configure-stamp
|
||||
|
||||
build: build-stamp
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
# если не задан тип сборки запускаем cmake без указания типа, если задан - передаём его
|
||||
# для сборки в Debug нужно запустить так: debuild -e CMAKE_BUILD_TYPE=Debug
|
||||
cd build && pwd && if [ -z CMAKE_BUILD_TYPE ]; then cmake ..; else cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) ..; fi
|
||||
# TODO: возможно надо исправить
|
||||
# последовательно зкапускаем make для каждой из целей.
|
||||
# т.к. при параллельном запуске (make target1 target2) несколько раз одновременно создаются бинарники
|
||||
# и возникает raise с custom_command, использующие эти бинарники
|
||||
for daemon in ${DAEMONS}; do $(MAKE) -j$(THREADS_COUNT) -C build $$daemon; done
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f configure-stamp
|
||||
rm -f build-stamp
|
||||
rm -rf build
|
||||
# Удалим созданные для dh_installinit файлы
|
||||
find ./debian/ -name "*.init" -type l -delete
|
||||
# Удалим созданные для dh_installcron файлы
|
||||
find ./debian/ -name "*.cron.d" -type f -delete
|
||||
# Удалим созданные для dh_installlogrotate файлы
|
||||
find ./debian/ -name "*.logrotate" -type f -delete
|
||||
# Удалим созданные *.install файлы
|
||||
for DAEMON_PKG in ${DAEMONS}; do AUTO=`grep "# automatically created" debian/$$DAEMON_PKG-metrika-yandex.install`; if [ "x$$AUTO" != "x" ]; then rm -f debian/$$DAEMON_PKG-metrika-yandex.install; fi; done
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_prep
|
||||
cd build && \
|
||||
for daemon in ${DAEMONS}; do\
|
||||
DESTDIR=../debian/tmp cmake -DCOMPONENT=$$daemon -P cmake_install.cmake;\
|
||||
done
|
||||
|
||||
# Создаём нужные файлы для dh_installinit, т.к. он их понимает только внутри debian/
|
||||
for I in debian/tmp/etc/init.d/*; do echo $$I; ln -s tmp/etc/init.d/`basename $$I` debian/`basename $$I`.init; done
|
||||
# Хотим, чтобы для пакета clickhouse-server-base init file назывался clickhouse-server
|
||||
if [ -e debian/tmp/etc/init.d/clickhouse-server ]; then ln -s tmp/etc/init.d/clickhouse-server debian/clickhouse-server-base.clickhouse-server.init; fi
|
||||
|
||||
# создаем дефолтный cron, если нет крон-файла созданного пользователем
|
||||
# cron_name имеет вид daemonname-metrika-yandex
|
||||
# logrotate_name имеет вид daemonname
|
||||
# Для ClickHouse не должно быть лишних зависимостей.
|
||||
for I in debian/tmp/etc/init.d/*; \
|
||||
do \
|
||||
cron_name=`basename $$I`; \
|
||||
if [ ! -d debian/tmp/etc/cron.d ]; then \
|
||||
mkdir -p debian/tmp/etc/cron.d; \
|
||||
fi; \
|
||||
if [ ! -f debian/tmp/etc/cron.d/$$cron_name ]; then \
|
||||
echo "#*/10 * * * * root /etc/init.d/$$cron_name condstart 1>/dev/null 2>&1" > debian/tmp/etc/cron.d/$$cron_name; \
|
||||
logrotate_name=`basename $$I | sed 's/-metrika-yandex//'`; \
|
||||
if [ -f debian/tmp/etc/logrotate.d/$$logrotate_name.logrt ]; then \
|
||||
if [ -e debian/tmp/etc/init.d/clickhouse-server ]; then \
|
||||
echo "#23 * * * * root flock -w 200 /var/run/lock/metrika-logrotate -c '/usr/sbin/logrotate /etc/logrotate.d/$$logrotate_name.logrt'" >> debian/tmp/etc/cron.d/$$cron_name; \
|
||||
else \
|
||||
echo "#23 * * * * root /usr/local/bin/metrika-logrotate /etc/logrotate.d/$$logrotate_name.logrt" >> debian/tmp/etc/cron.d/$$cron_name; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
# Создаём нужные *.install файлы
|
||||
# Только для демонов, т.к. пакеты ClickHouse не имеют суффикса metrika-yandex
|
||||
for DAEMON_PKG in ${DAEMONS}; do \
|
||||
if [ ! -e "debian/$$DAEMON_PKG-metrika-yandex.install" ]; then \
|
||||
echo "# automatically created" > debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
echo "/etc/$$DAEMON_PKG/config.xml" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
echo "/usr/bin/$$DAEMON_PKG" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
echo "/etc/logrotate.d/$$DAEMON_PKG.logrt" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
echo "/etc/cron.d/$$DAEMON_PKG-metrika-yandex" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
if [ -e "debian/tmp/etc/monrun/conf.d/$$DAEMON_PKG.conf" ]; then \
|
||||
echo "/etc/monrun/conf.d/$$DAEMON_PKG.conf" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
|
||||
fi;\
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Создаём нужные *.postinst файлы
|
||||
# Note: Только для демонов, т.к. пакеты ClickHouse не имеют суффикса metrika-yandex
|
||||
for DAEMON_PKG in ${DAEMONS}; do \
|
||||
if [ ! -e "debian/$$DAEMON_PKG-metrika-yandex.postinst" ]; then \
|
||||
echo "# automatically created" > debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
echo "chown metrika: /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
if [ -e "debian/tmp/etc/init.d/$$DAEMON_PKG-metrika-yandex" ]; then \
|
||||
if echo $$DAEMON_PKG | grep server > /dev/null; then\
|
||||
echo "update-rc.d $$DAEMON_PKG-metrika-yandex defaults > /dev/null || exit \$?" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
else\
|
||||
echo "update-rc.d $$DAEMON_PKG-metrika-yandex start 30 2 3 4 5 . stop 70 0 1 6 . > /dev/null || exit \$?" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
fi\
|
||||
fi\
|
||||
\
|
||||
else \
|
||||
echo >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d; chown metrika: /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
|
||||
# В случае сборки clickhouse-server, добавим в пакет бинарник clang-а и заголовочные файлы - для динамической компиляции.
|
||||
if [ -e debian/tmp/etc/init.d/clickhouse-server ]; then \
|
||||
mkdir -p debian/tmp/usr/share/clickhouse/bin debian/tmp/usr/share/clickhouse/headers; \
|
||||
debian/copy_clang_binaries.sh debian/tmp/usr/share/clickhouse/bin/; \
|
||||
./copy_headers.sh . debian/tmp/usr/share/clickhouse/headers; \
|
||||
fi;
|
||||
|
||||
|
||||
# Список бинариев, для которых делаем strip. Это делается из-за того, что на некоторых серверах мало места.
|
||||
$(eval STRIP_LIST=\
|
||||
clickhouse-client \
|
||||
)
|
||||
|
||||
for DAEMON in ${STRIP_LIST}; do \
|
||||
if [ -e debian/tmp/usr/bin/$$DAEMON ]; then strip debian/tmp/usr/bin/$$DAEMON; fi; \
|
||||
done
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installinit --no-start --no-package=clickhouse-server-base
|
||||
dh_installinit --no-start --package=clickhouse-server-base --name=clickhouse-server
|
||||
dh_installcron
|
||||
dh_installdirs
|
||||
dh_installchangelogs
|
||||
dh_install --sourcedir=debian/tmp
|
||||
dh_link
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_shlibdeps --exclude=clang --exclude=stdc
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb -- -z3
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install
|
5
detect_distributive.cmake
Normal file
5
detect_distributive.cmake
Normal file
@ -0,0 +1,5 @@
|
||||
IF(NOT DISTRIB_CODENAME)
|
||||
EXEC_PROGRAM(". /etc/lsb-release ; echo $DISTRIB_CODENAME"
|
||||
OUTPUT_VARIABLE DISTRIB_CODENAME)
|
||||
SET(DISTRIB_CODENAME "${DISTRIB_CODENAME}" CACHE STRING "Distributive Codename")
|
||||
ENDIF(NOT DISTRIB_CODENAME)
|
27
release
Executable file
27
release
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
source release_lib.sh
|
||||
|
||||
CONTROL=debian/control
|
||||
CHLOG=debian/changelog
|
||||
CHDATE=$(LC_ALL=C date -R | sed -e 's/,/\\,/g') # Заменим запятую на '\,'
|
||||
|
||||
# Список демонов для сборки может быть указан в аргументах командной строки.
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
DAEMONS="$@"
|
||||
else
|
||||
DAEMONS="$(echo `cat debian/daemons`)"
|
||||
fi
|
||||
|
||||
gen_revision_author
|
||||
echo -e "\nCurrent revision is $REVISION"
|
||||
|
||||
make_control "$CONTROL" "$DAEMONS"
|
||||
|
||||
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG" "$DAEMONS"
|
||||
|
||||
# Сборка (только бинарных пакетов).
|
||||
debuild -e DAEMONS="${DAEMONS}" -b
|
||||
|
||||
upload_debs "$REVISION" "$DAEMONS"
|
25
release_test
Executable file
25
release_test
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
source release_lib.sh
|
||||
|
||||
CONTROL=debian/control
|
||||
CHLOG=debian/changelog
|
||||
CHDATE=$(LC_ALL=C date -R | sed -e 's/,/\\,/g') # Заменим запятую на '\,'
|
||||
|
||||
# Список демонов для сборки может быть указан в аргументах командной строки.
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
DAEMONS="$@"
|
||||
else
|
||||
DAEMONS="$(echo `cat debian/daemons`)"
|
||||
fi
|
||||
|
||||
REVISION="99999"
|
||||
echo -e "\nCurrent revision is $REVISION"
|
||||
|
||||
make_control "$CONTROL" "$DAEMONS"
|
||||
|
||||
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG" "$DAEMONS"
|
||||
|
||||
# Сборка (только бинарных пакетов).
|
||||
debuild -e THREADS_COUNT=7 -e DAEMONS="${DAEMONS}" -b -uc -us
|
Loading…
Reference in New Issue
Block a user