mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge branch 'master' of github.com:yandex/ClickHouse
This commit is contained in:
commit
d305f6190e
@ -441,13 +441,7 @@ int32_t ZooKeeper::existsImpl(const std::string & path, Stat * stat_, WatchCallb
|
||||
|
||||
bool ZooKeeper::exists(const std::string & path, Stat * stat_, const EventPtr & watch)
|
||||
{
|
||||
int32_t code = retry(std::bind(&ZooKeeper::existsImpl, this, path, stat_, callbackForEvent(watch)));
|
||||
|
||||
if (!(code == ZOK || code == ZNONODE))
|
||||
throw KeeperException(code, path);
|
||||
if (code == ZNONODE)
|
||||
return false;
|
||||
return true;
|
||||
return existsWatch(path, stat_, callbackForEvent(watch));
|
||||
}
|
||||
|
||||
bool ZooKeeper::existsWatch(const std::string & path, Stat * stat_, const WatchCallback & watch_callback)
|
||||
@ -507,15 +501,7 @@ std::string ZooKeeper::get(const std::string & path, Stat * stat, const EventPtr
|
||||
|
||||
bool ZooKeeper::tryGet(const std::string & path, std::string & res, Stat * stat_, const EventPtr & watch, int * return_code)
|
||||
{
|
||||
int32_t code = retry(std::bind(&ZooKeeper::getImpl, this, std::ref(path), std::ref(res), stat_, callbackForEvent(watch)));
|
||||
|
||||
if (!(code == ZOK || code == ZNONODE))
|
||||
throw KeeperException(code, path);
|
||||
|
||||
if (return_code)
|
||||
*return_code = code;
|
||||
|
||||
return code == ZOK;
|
||||
return tryGetWatch(path, res, stat_, callbackForEvent(watch), return_code);
|
||||
}
|
||||
|
||||
bool ZooKeeper::tryGetWatch(const std::string & path, std::string & res, Stat * stat_, const WatchCallback & watch_callback, int * return_code)
|
||||
|
6
debian/clickhouse-server-base.postinst
vendored
6
debian/clickhouse-server-base.postinst
vendored
@ -8,10 +8,14 @@ CLICKHOUSE_LOGDIR=/var/log/clickhouse-server
|
||||
|
||||
|
||||
if [ "$1" = configure ]; then
|
||||
|
||||
if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ]; then
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl enable clickhouse-server
|
||||
else
|
||||
if [ -x "/etc/init.d/clickhouse-server" ]; then
|
||||
update-rc.d clickhouse-server defaults 19 19 >/dev/null || exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure the administrative user exists
|
||||
if ! getent passwd ${CLICKHOUSE_USER} > /dev/null; then
|
||||
|
15
debian/clickhouse-server.service
vendored
Normal file
15
debian/clickhouse-server.service
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=ClickHouse Server (analytic DBMS for big data)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=clickhouse
|
||||
Group=clickhouse
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml
|
||||
LimitCORE=infinity
|
||||
LimitNOFILE=500000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
4
debian/rules
vendored
4
debian/rules
vendored
@ -77,6 +77,10 @@ override_dh_install:
|
||||
# todo: remove after renaming package:
|
||||
mkdir -p $(DESTDIR)/etc/init.d
|
||||
cp debian/clickhouse-server.init $(DESTDIR)/etc/init.d/clickhouse-server
|
||||
# systemd compatibility
|
||||
mkdir -p $(DESTDIR)/etc/systemd/system/
|
||||
cp debian/clickhouse-server.service $(DESTDIR)/etc/systemd/system/
|
||||
|
||||
mkdir -p $(DESTDIR)/etc/cron.d
|
||||
cp debian/clickhouse-server.cron.d $(DESTDIR)/etc/cron.d/clickhouse-server
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user