Skip to content

Commit e9d33bf

Browse files
committed
document and fix style
1 parent c9e46d5 commit e9d33bf

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/Disks/IDisk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ class IDisk : public Space
442442

443443
virtual bool isReadOnly() const { return false; }
444444

445+
/// If the disk is plain object storage.
445446
virtual bool isPlain() const { return false; }
446447

447448
virtual bool isWriteOnce() const { return false; }

src/Disks/IStoragePolicy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class IStoragePolicy
5959
VolumePtr getVolumeByName(const String & volume_name) const;
6060
/// Checks if storage policy can be replaced by another one.
6161
virtual void checkCompatibleWith(const StoragePolicyPtr & new_storage_policy) const = 0;
62-
///
62+
/// If the policy allows table partition operations (move, replace) with the other storage policy.
6363
virtual bool isCompatibleForPartitionOps(const StoragePolicyPtr & other) const = 0;
6464
/// Finds a volume index, which contains disk
6565
virtual std::optional<size_t> tryGetVolumeIndexByDiskName(const String & disk_name) const = 0;

src/Disks/StoragePolicy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class StoragePolicy : public IStoragePolicy
8282
/// Checks if storage policy can be replaced by another one.
8383
void checkCompatibleWith(const StoragePolicyPtr & new_storage_policy) const override;
8484

85-
///
85+
/// If the policy allows table partition operations (move, replace) with the other storage policy.
8686
bool isCompatibleForPartitionOps(const StoragePolicyPtr & other) const override;
8787

8888
/// Check if we have any volume with stopped merges

src/Storages/StorageMergeTree.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ void StorageMergeTree::replacePartitionFrom(const StoragePtr & source_table, con
22682268

22692269
static const String TMP_PREFIX = "tmp_replace_from_";
22702270

2271-
bool are_policies_partition_compatible = getStoragePolicy()->isCompatibleForPartitionOps(source_table->getStoragePolicy());
2271+
bool are_policies_partition_op_compatible = getStoragePolicy()->isCompatibleForPartitionOps(source_table->getStoragePolicy());
22722272
for (const DataPartPtr & src_part : src_parts)
22732273
{
22742274
if (is_all)
@@ -2295,7 +2295,7 @@ void StorageMergeTree::replacePartitionFrom(const StoragePtr & source_table, con
22952295
clone_params,
22962296
local_context->getReadSettings(),
22972297
local_context->getWriteSettings(),
2298-
!are_policies_partition_compatible /*must_on_same_disk*/);
2298+
!are_policies_partition_op_compatible /*must_on_same_disk*/);
22992299
dst_parts.emplace_back(std::move(dst_part));
23002300
dst_parts_locks.emplace_back(std::move(part_lock));
23012301
}
@@ -2372,12 +2372,13 @@ void StorageMergeTree::movePartitionToTable(const StoragePtr & dest_table, const
23722372
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
23732373
"Table {} supports movePartitionToTable only for MergeTree family of table engines. Got {}",
23742374
getStorageID().getNameForLogs(), dest_table->getName());
2375-
bool are_policies_partition_compatible = getStoragePolicy()->isCompatibleForPartitionOps(dest_table_storage->getStoragePolicy());
2375+
bool are_policies_partition_op_compatible = getStoragePolicy()->isCompatibleForPartitionOps(dest_table_storage->getStoragePolicy());
23762376

2377-
if (!are_policies_partition_compatible)
2377+
if (!are_policies_partition_op_compatible)
23782378
throw Exception(
23792379
ErrorCodes::UNKNOWN_POLICY,
2380-
"Destination table {} should have the same or partition compatible storage policy of source table {}. {}: {}, {}: {}",
2380+
"Destination table {} should have the same storage policy of source table, or the policies must be compatible for partition "
2381+
"operations {}. {}: {}, {}: {}",
23812382
dest_table_storage->getStorageID().getNameForLogs(),
23822383
getStorageID().getNameForLogs(),
23832384
getStorageID().getNameForLogs(),
@@ -2443,7 +2444,7 @@ void StorageMergeTree::movePartitionToTable(const StoragePtr & dest_table, const
24432444
clone_params,
24442445
local_context->getReadSettings(),
24452446
local_context->getWriteSettings(),
2446-
!are_policies_partition_compatible /*must_on_same_disk*/
2447+
!are_policies_partition_op_compatible /*must_on_same_disk*/
24472448
);
24482449

24492450
dst_parts.emplace_back(std::move(dst_part));

0 commit comments

Comments
 (0)