Merge branch 'master' of github.com:yandex/ClickHouse

This commit is contained in:
Alexey Milovidov 2019-08-03 22:52:24 +03:00
commit 367fc1c5c7
3 changed files with 37 additions and 11 deletions

View File

@ -27,19 +27,20 @@ private:
VectorType & vector; VectorType & vector;
bool is_finished = false; bool is_finished = false;
static constexpr size_t initial_size = 32;
static constexpr size_t size_multiplier = 2;
void nextImpl() override void nextImpl() override
{ {
if (is_finished) if (is_finished)
throw Exception("WriteBufferFromVector is finished", ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER); throw Exception("WriteBufferFromVector is finished", ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER);
size_t old_size = vector.size(); size_t old_size = vector.size();
vector.resize(old_size * 2); vector.resize(old_size * size_multiplier);
internal_buffer = Buffer(reinterpret_cast<Position>(vector.data() + old_size), reinterpret_cast<Position>(vector.data() + vector.size())); internal_buffer = Buffer(reinterpret_cast<Position>(vector.data() + old_size), reinterpret_cast<Position>(vector.data() + vector.size()));
working_buffer = internal_buffer; working_buffer = internal_buffer;
} }
static constexpr size_t initial_size = 32;
public: public:
WriteBufferFromVector(VectorType & vector_) WriteBufferFromVector(VectorType & vector_)
: WriteBuffer(reinterpret_cast<Position>(vector_.data()), vector_.size()), vector(vector_) : WriteBuffer(reinterpret_cast<Position>(vector_.data()), vector_.size()), vector(vector_)
@ -57,8 +58,11 @@ public:
: WriteBuffer(nullptr, 0), vector(vector_) : WriteBuffer(nullptr, 0), vector(vector_)
{ {
size_t old_size = vector.size(); size_t old_size = vector.size();
vector.resize(std::max(vector.size() + initial_size, vector.capacity())); size_t size = (old_size < initial_size) ? initial_size
set(reinterpret_cast<Position>(vector.data() + old_size), (vector.size() - old_size) * sizeof(typename VectorType::value_type)); : ((old_size < vector.capacity()) ? vector.capacity()
: vector.capacity() * size_multiplier);
vector.resize(size);
set(reinterpret_cast<Position>(vector.data() + old_size), (size - old_size) * sizeof(typename VectorType::value_type));
} }
void finish() void finish()

View File

@ -236,6 +236,9 @@ void Compiler::compile(
" -fuse-ld=" << compiler_executable_root << INTERNAL_LINKER_EXECUTABLE " -fuse-ld=" << compiler_executable_root << INTERNAL_LINKER_EXECUTABLE
" -fdiagnostics-color=never" " -fdiagnostics-color=never"
/// Do not use libgcc and startup files. The library will work nevertheless and we avoid extra dependency.
" -nodefaultlibs -nostartfiles"
#if INTERNAL_COMPILER_CUSTOM_ROOT #if INTERNAL_COMPILER_CUSTOM_ROOT
/// To get correct order merge this results carefully: /// To get correct order merge this results carefully:
/// echo | clang -x c++ -E -Wp,-v - /// echo | clang -x c++ -E -Wp,-v -

View File

@ -22,7 +22,7 @@ To install official packages add the Yandex repository in `/etc/apt/sources.list
deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ deb http://repo.yandex.ru/clickhouse/deb/stable/ main/
``` ```
If you want to use the most recent version, replace `stable` with `testing` (this is not recommended for production environments). If you want to use the most recent version, replace `stable` with `testing` (this is recommended for your testing environments).
Then run these commands to actually install packages: Then run these commands to actually install packages:
@ -37,13 +37,25 @@ You can also download and install packages manually from here: <https://repo.yan
### From RPM Packages ### From RPM Packages
Yandex does not run ClickHouse on `rpm` based Linux distributions and `rpm` packages are not as thoroughly tested. So use them at your own risk, but there are many other companies that do successfully run them in production without any major issues. Yandex ClickHouse team recommends using official pre-compiled `rpm` packages for CentOS, RedHat and all other rpm-based distributions.
For CentOS, RHEL or Fedora there are the following options: First you need to add our repository:
* Packages from <https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/> are generated from official `deb` packages by Yandex and have byte-identical binaries. ```bash
* Packages from <https://github.com/Altinity/clickhouse-rpm-install> are built by independent company Altinity, but are used widely without any complaints. sudo yum install yum-utils
* Or you can use Docker (see below). sudo rpm --import https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
```
If you want to use the most recent version, replace `stable` with `testing` (this is recommended for your testing environments).
Then run these commands to actually install packages:
```bash
sudo yum install clickhouse-server clickhouse-client
```
You can also download and install packages manually from here: <https://repo.yandex.ru/clickhouse/rpm/stable/x86_64>.
### From Docker Image ### From Docker Image
@ -76,6 +88,13 @@ To start the server as a daemon, run:
$ sudo service clickhouse-server start $ sudo service clickhouse-server start
``` ```
If you don't have `service` command, run as
``` bash
$ sudo /etc/init.d/clickhouse-server start
```
See the logs in the `/var/log/clickhouse-server/` directory. See the logs in the `/var/log/clickhouse-server/` directory.
If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml`. If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml`.