Remove unused methods

This commit is contained in:
alesapin 2020-09-30 16:56:44 +03:00
parent 14a7a25c4b
commit 77f5841a46
2 changed files with 5 additions and 15 deletions

View File

@ -870,17 +870,6 @@ std::optional<StorageMergeTree::MergeMutateSelectedEntry> StorageMergeTree::sele
return {}; return {};
} }
bool StorageMergeTree::tryMutatePart()
{
StorageMetadataPtr metadata_snapshot = getInMemoryMetadataPtr();
auto merge_mutate_entry = selectPartsToMutate(metadata_snapshot, nullptr);
if (!merge_mutate_entry)
return false;
return mutateSelectedPart(metadata_snapshot, *merge_mutate_entry);
}
bool StorageMergeTree::mutateSelectedPart(const StorageMetadataPtr & metadata_snapshot, MergeMutateSelectedEntry & merge_mutate_entry) bool StorageMergeTree::mutateSelectedPart(const StorageMetadataPtr & metadata_snapshot, MergeMutateSelectedEntry & merge_mutate_entry)
{ {
auto table_lock_holder = lockForShare(RWLockImpl::NO_QUERY, getSettings()->lock_acquire_timeout_for_background_operations); auto table_lock_holder = lockForShare(RWLockImpl::NO_QUERY, getSettings()->lock_acquire_timeout_for_background_operations);
@ -945,11 +934,14 @@ BackgroundProcessingPoolTaskResult StorageMergeTree::mergeMutateTask()
clearOldMutations(); clearOldMutations();
} }
auto metadata_snapshot = getInMemoryMetadataPtr();
auto merge_entry = selectPartsToMerge(metadata_snapshot, false, {}, false, nullptr);
///TODO: read deduplicate option from table config ///TODO: read deduplicate option from table config
if (merge(false /*aggressive*/, {} /*partition_id*/, false /*final*/, false /*deduplicate*/)) if (merge_entry && mergeSelectedParts(metadata_snapshot, false, *merge_entry))
return BackgroundProcessingPoolTaskResult::SUCCESS; return BackgroundProcessingPoolTaskResult::SUCCESS;
if (tryMutatePart()) auto mutate_entry = selectPartsToMutate(metadata_snapshot, nullptr);
if (mutate_entry && mutateSelectedPart(metadata_snapshot, *mutate_entry))
return BackgroundProcessingPoolTaskResult::SUCCESS; return BackgroundProcessingPoolTaskResult::SUCCESS;
return BackgroundProcessingPoolTaskResult::ERROR; return BackgroundProcessingPoolTaskResult::ERROR;

View File

@ -140,8 +140,6 @@ private:
/// Wait until mutation with version will finish mutation for all parts /// Wait until mutation with version will finish mutation for all parts
void waitForMutation(Int64 version, const String & file_name); void waitForMutation(Int64 version, const String & file_name);
/// Try and find a single part to mutate and mutate it. If some part was successfully mutated, return true.
bool tryMutatePart();
friend struct CurrentlyMergingPartsTagger; friend struct CurrentlyMergingPartsTagger;
using CurrentlyMergingPartsTaggerPtr = std::unique_ptr<CurrentlyMergingPartsTagger>; using CurrentlyMergingPartsTaggerPtr = std::unique_ptr<CurrentlyMergingPartsTagger>;