提交 51bd7775 编写于 作者: A Alexey Milovidov

Using LZ4 by default [#CONV-4594].

上级 65b1caa9
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
public: public:
CompressedWriteBuffer( CompressedWriteBuffer(
WriteBuffer & out_, WriteBuffer & out_,
CompressionMethod::Enum method_ = CompressionMethod::QuickLZ, CompressionMethod::Enum method_ = CompressionMethod::LZ4,
size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE) size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE)
: BufferWithOwnMemory<WriteBuffer>(buf_size), out(out_), method(method_), qlz_state(new qlz_state_compress) {} : BufferWithOwnMemory<WriteBuffer>(buf_size), out(out_), method(method_), qlz_state(new qlz_state_compress) {}
......
...@@ -75,7 +75,7 @@ private: ...@@ -75,7 +75,7 @@ private:
{ {
Stream(const std::string & data_path, const std::string & marks_path) : Stream(const std::string & data_path, const std::string & marks_path) :
plain(data_path, DBMS_DEFAULT_BUFFER_SIZE, O_APPEND | O_CREAT | O_WRONLY), plain(data_path, DBMS_DEFAULT_BUFFER_SIZE, O_APPEND | O_CREAT | O_WRONLY),
compressed(plain, CompressionMethod::LZ4), compressed(plain),
marks(marks_path, DBMS_DEFAULT_BUFFER_SIZE, O_APPEND | O_CREAT | O_WRONLY) {} marks(marks_path, DBMS_DEFAULT_BUFFER_SIZE, O_APPEND | O_CREAT | O_WRONLY) {}
WriteBufferFromFile plain; WriteBufferFromFile plain;
......
...@@ -14,21 +14,21 @@ int main(int argc, char ** argv) ...@@ -14,21 +14,21 @@ int main(int argc, char ** argv)
try try
{ {
bool decompress = false; bool decompress = false;
bool use_lz4 = false; bool use_qlz = false;
if (argc == 2) if (argc == 2)
{ {
decompress = 0 == strcmp(argv[1], "-d"); decompress = 0 == strcmp(argv[1], "-d");
use_lz4 = 0 == strcmp(argv[1], "--lz4"); use_qlz = 0 == strcmp(argv[1], "--qlz");
} }
if (argc > 2 || (argc == 2 && !decompress && !use_lz4)) if (argc > 2 || (argc == 2 && !decompress && !use_qlz))
{ {
std::cerr << "Usage: " << argv[0] << " [-d|--lz4] < in > out" << std::endl; std::cerr << "Usage: " << argv[0] << " [-d|--qlz] < in > out" << std::endl;
return 1; return 1;
} }
DB::CompressionMethod::Enum method = use_lz4 ? DB::CompressionMethod::LZ4 : DB::CompressionMethod::QuickLZ; DB::CompressionMethod::Enum method = use_qlz ? DB::CompressionMethod::QuickLZ : DB::CompressionMethod::LZ4;
Poco::SharedPtr<DB::ReadBuffer> rb = new DB::ReadBufferFromFileDescriptor(STDIN_FILENO); Poco::SharedPtr<DB::ReadBuffer> rb = new DB::ReadBufferFromFileDescriptor(STDIN_FILENO);
Poco::SharedPtr<DB::WriteBuffer> wb = new DB::WriteBufferFromFileDescriptor(STDOUT_FILENO); Poco::SharedPtr<DB::WriteBuffer> wb = new DB::WriteBufferFromFileDescriptor(STDOUT_FILENO);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册