Skip to content

Commit

Permalink
[opt](table) Remove unnecessary locks (#44416)
Browse files Browse the repository at this point in the history
`OlapTable`.`getPartitionIds` not need get readLock, Because it only
returns the ID list without any traversal or other operations. If the
caller needs to keep the partition of the table unchanged after
obtaining the ID list, they should lock it themselves
  • Loading branch information
zddr authored Nov 22, 2024
1 parent 127e597 commit d8215d7
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1385,12 +1385,7 @@ public List<String> getEqualPartitionNames(List<Long> partitionIds1, List<Long>
}

public List<Long> getPartitionIds() {
readLock();
try {
return new ArrayList<>(idToPartition.keySet());
} finally {
readUnlock();
}
return new ArrayList<>(idToPartition.keySet());
}

public Set<String> getCopiedBfColumns() {
Expand Down

0 comments on commit d8215d7

Please sign in to comment.