Skip to content

Commit

Permalink
[improve][broker] Improve the extensibility of the TopicBundleAssignm…
Browse files Browse the repository at this point in the history
…entStrategy interface class (apache#23773)
  • Loading branch information
rayluoluo committed Jan 13, 2025
1 parent bf72d86 commit 7d80b4f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import com.google.common.base.Charsets;
import com.google.common.collect.BoundType;
import com.google.common.collect.Range;
import com.google.common.hash.Hashing;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
Expand Down Expand Up @@ -139,7 +139,7 @@ public long calculateBundleHashCode(TopicName topicName) {
// use topic name without partition id to decide the first hash value
long currentPartitionTopicHash =
pulsar.getNamespaceService().getNamespaceBundleFactory().getHashFunc()
.hashString(topicName.getPartitionedTopicName(), Charsets.UTF_8).padToLong();
.hashString(topicName.getPartitionedTopicName(), StandardCharsets.UTF_8).padToLong();

// if the topic is a non partition topic, use topic name to calculate the hashcode
if (!topicName.isPartitioned()) {
Expand Down

0 comments on commit 7d80b4f

Please sign in to comment.