More correct version

This commit is contained in:
alesapin 2019-06-19 14:59:08 +03:00
parent d1de7431e1
commit f0c273ee4c
3 changed files with 7 additions and 9 deletions

View File

@ -138,7 +138,7 @@ MergeTreeDataPart::MergeTreeDataPart(MergeTreeData & storage_, const String & na
: storage(storage_)
, name(name_)
, info(MergeTreePartInfo::fromPartName(name_, storage.format_version))
, index_granularity_info(storage.settings, storage.format_version)
, index_granularity_info(storage.settings)
{
}
@ -146,7 +146,7 @@ MergeTreeDataPart::MergeTreeDataPart(const MergeTreeData & storage_, const Strin
: storage(storage_)
, name(name_)
, info(info_)
, index_granularity_info(storage.settings, storage.format_version)
, index_granularity_info(storage.settings)
{
}

View File

@ -22,12 +22,11 @@ std::optional<std::string> MergeTreeIndexGranularityInfo::getMrkExtensionFromFS(
}
MergeTreeIndexGranularityInfo::MergeTreeIndexGranularityInfo(
const MergeTreeSettings & storage_settings,
const MergeTreeDataFormatVersion & format)
const MergeTreeSettings & storage_settings)
{
fixed_index_granularity = storage_settings.index_granularity;
/// Granularity is fixed
if (storage_settings.index_granularity_bytes == 0 || format < MERGE_TREE_DATA_MIN_FORMAT_VERSION_WITH_CUSTOM_PARTITIONING)
if (storage_settings.index_granularity_bytes == 0)
setNonAdaptive();
else
setAdaptive(storage_settings.index_granularity_bytes);
@ -43,7 +42,7 @@ void MergeTreeIndexGranularityInfo::changeGranularityIfRequired(const std::strin
void MergeTreeIndexGranularityInfo::setAdaptive(size_t index_granularity_bytes_)
{
is_adaptive = false;
is_adaptive = true;
mark_size_in_bytes = getAdaptiveMrkSize();
marks_file_extension = getAdaptiveMrkExtension();
index_granularity_bytes = index_granularity_bytes_;
@ -51,7 +50,7 @@ void MergeTreeIndexGranularityInfo::setAdaptive(size_t index_granularity_bytes_)
void MergeTreeIndexGranularityInfo::setNonAdaptive()
{
is_adaptive = true;
is_adaptive = false;
mark_size_in_bytes = getNonAdaptiveMrkSize();
marks_file_extension = getNonAdaptiveMrkExtension();
index_granularity_bytes = 0;

View File

@ -27,8 +27,7 @@ public:
size_t index_granularity_bytes;
MergeTreeIndexGranularityInfo(
const MergeTreeSettings & storage_settings,
const MergeTreeDataFormatVersion & format);
const MergeTreeSettings & storage_settings);
void changeGranularityIfRequired(const std::string & path_to_part);