Trash commits

This commit is contained in:
alesapin 2018-11-29 16:50:34 +03:00
parent 497a09c41b
commit 8e8bc6b1e0
3 changed files with 18 additions and 13 deletions

View File

@ -31,14 +31,17 @@ IMergedBlockOutputStream::IMergedBlockOutputStream(
size_t min_compress_block_size_,
size_t max_compress_block_size_,
CompressionSettings compression_settings_,
size_t aio_threshold_)
size_t aio_threshold_,
const std::vector<size_t> & index_granularity_)
: storage(storage_),
min_compress_block_size(min_compress_block_size_),
max_compress_block_size(max_compress_block_size_),
aio_threshold(aio_threshold_),
compression_settings(compression_settings_),
marks_file_extension(storage.index_granularity_bytes == 0 ? FIXED_MARKS_FILE_EXTENSION : ADAPTIVE_MARKS_FILE_EXTENSION),
mark_size_in_bytes(storage.index_granularity_bytes == 0 ? FIXED_MARK_BYTE_SIZE : ADAPTIVE_MARK_BYTE_SIZE)
mark_size_in_bytes(storage.index_granularity_bytes == 0 ? FIXED_MARK_BYTE_SIZE : ADAPTIVE_MARK_BYTE_SIZE),
index_granularity(index_granularity_),
compute_granularity_unknown(index_granularity.empty())
{
}
@ -570,11 +573,11 @@ void MergedColumnOnlyOutputStream::write(const Block & block)
for (size_t i = 0; i < block.columns(); ++i)
{
const ColumnWithTypeAndName & column = block.safeGetByPosition(i);
writeData(column.name, *column.type, *column.column, offset_columns, skip_offsets, serialization_states[i], current_block_index_granularity);
writeData(column.name, *column.type, *column.column, offset_columns, skip_offsets, serialization_states[i], storage.index_granularity);
}
size_t written_for_last_mark = (current_block_index_granularity - index_offset + rows) % current_block_index_granularity;
index_offset = (current_block_index_granularity - written_for_last_mark) % current_block_index_granularity;
// size_t written_for_last_mark = (current_block_index_granularity - index_offset + rows) % current_block_index_granularity;
// index_offset = (current_block_index_granularity - written_for_last_mark) % current_block_index_granularity;
}
void MergedColumnOnlyOutputStream::writeSuffix()

View File

@ -21,7 +21,8 @@ public:
size_t min_compress_block_size_,
size_t max_compress_block_size_,
CompressionSettings compression_settings_,
size_t aio_threshold_);
size_t aio_threshold_,
const std::vector<size_t> & index_granularity_ = {});
using WrittenOffsetColumns = std::set<std::string>;
@ -91,8 +92,11 @@ protected:
CompressionSettings compression_settings;
std::vector<size_t> index_granularity;
std::string marks_file_extension;
size_t mark_size_in_bytes;
bool compute_granularity_unknown;
};
@ -151,7 +155,6 @@ private:
size_t rows_count = 0;
size_t marks_count = 0;
std::vector<size_t> marks_index_granularity;
std::unique_ptr<WriteBufferFromFile> index_file_stream;
std::unique_ptr<HashingWriteBuffer> index_stream;

View File

@ -27,4 +27,3 @@ target_link_libraries (get_current_inserts_in_replicated PRIVATE dbms clickhouse
add_executable (get_abandonable_lock_in_all_partitions get_abandonable_lock_in_all_partitions.cpp)
target_link_libraries (get_abandonable_lock_in_all_partitions PRIVATE dbms clickhouse_common_config clickhouse_common_zookeeper)
target_link_libraries (get_abandonable_lock_in_all_partitions dbms)