Skip to content

Commit

Permalink
Fty to fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
KochetovNicolai committed Nov 12, 2020
1 parent 2c637d2 commit 85a4849
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/IO/LZMADeflatingWriteBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <IO/LZMADeflatingWriteBuffer.h>

#if !defined(ARCADIA_BUILD)

namespace DB
{
Expand Down Expand Up @@ -123,3 +124,5 @@ void LZMADeflatingWriteBuffer::finish()
} while (lstr.avail_out == 0);
}
}

#endif
34 changes: 33 additions & 1 deletion src/IO/LZMADeflatingWriteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
#include <IO/BufferWithOwnMemory.h>
#include <IO/WriteBuffer.h>

#include <lzma.h>
#if !defined(ARCADIA_BUILD)
#include <lzma.h> // Y_IGNORE
#endif


namespace DB
{

#if !defined(ARCADIA_BUILD)

/// Performs compression using lzma library and writes compressed data to out_ WriteBuffer.
class LZMADeflatingWriteBuffer : public BufferWithOwnMemory<WriteBuffer>
{
Expand All @@ -29,4 +35,30 @@ class LZMADeflatingWriteBuffer : public BufferWithOwnMemory<WriteBuffer>
lzma_stream lstr;
bool finished = false;
};

#else

namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}

class LZMADeflatingWriteBuffer : public BufferWithOwnMemory<WriteBuffer>
{
public:
LZMADeflatingWriteBuffer(
std::unique_ptr<WriteBuffer> out_ [[maybe_unused]],
int compression_level [[maybe_unused]],
size_t buf_size [[maybe_unused]] = DBMS_DEFAULT_BUFFER_SIZE,
char * existing_memory [[maybe_unused]] = nullptr,
size_t alignment [[maybe_unused]] = 0)
{
throw Exception("LZMADeflatingWriteBuffer is not implemented for arcadia build", ErrorCodes::NOT_IMPLEMENTED);
}

private:
void nextImpl() override {}
};

#endif
}
2 changes: 2 additions & 0 deletions src/IO/LZMAInflatingReadBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <IO/LZMAInflatingReadBuffer.h>

#if !defined(ARCADIA_BUILD)
namespace DB
{
namespace ErrorCodes
Expand Down Expand Up @@ -87,3 +88,4 @@ bool LZMAInflatingReadBuffer::nextImpl()
return true;
}
}
#endif
33 changes: 29 additions & 4 deletions src/IO/LZMAInflatingReadBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#include <IO/BufferWithOwnMemory.h>
#include <IO/ReadBuffer.h>

#include <lzma.h>
#if !defined(ARCADIA_BUILD)
#include <lzma.h> // Y_IGNORE
#endif

namespace DB
{
namespace ErrorCodes
{
}

#if !defined(ARCADIA_BUILD)
class LZMAInflatingReadBuffer : public BufferWithOwnMemory<ReadBuffer>
{
public:
Expand All @@ -30,4 +30,29 @@ class LZMAInflatingReadBuffer : public BufferWithOwnMemory<ReadBuffer>

bool eof;
};

#else

namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}

class LZMAInflatingReadBuffer : public BufferWithOwnMemory<ReadBuffer>
{
public:
LZMAInflatingReadBuffer(
std::unique_ptr<ReadBuffer> in_ [[maybe_unused]],
size_t buf_size [[maybe_unused]] = DBMS_DEFAULT_BUFFER_SIZE,
char * existing_memory [[maybe_unused]] = nullptr,
size_t alignment [[maybe_unused]] = 0)
{
throw Exception("LZMADeflatingWriteBuffer is not implemented for arcadia build", ErrorCodes::NOT_IMPLEMENTED);
}

private:
bool nextImpl() override {}
};

#endif
}

0 comments on commit 85a4849

Please sign in to comment.