Skip to content

Commit

Permalink
remove unused code (apache#8517)
Browse files Browse the repository at this point in the history
Deleted some code that was not used at all
  • Loading branch information
315157973 authored Nov 11, 2020
1 parent 714dc67 commit c3764e2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2952,9 +2952,6 @@ public static CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMet
throw ex;
}

String path = path(PARTITIONED_TOPIC_PATH_ZNODE, topicName.getNamespace(), topicName.getDomain().toString(),
topicName.getEncodedLocalName());

// validates global-namespace contains local/peer cluster: if peer/local cluster present then lookup can
// serve/redirect request else fail partitioned-metadata-request so, client fails while creating
// producer/consumer
Expand Down Expand Up @@ -2984,9 +2981,6 @@ public static CompletableFuture<PartitionedTopicMetadata> unsafeGetPartitionedTo
PulsarService pulsar, TopicName topicName) {
CompletableFuture<PartitionedTopicMetadata> metadataFuture = new CompletableFuture();

String path = path(PARTITIONED_TOPIC_PATH_ZNODE, topicName.getNamespace(),
topicName.getDomain().toString(), topicName.getEncodedLocalName());

// validates global-namespace contains local/peer cluster: if peer/local cluster present then lookup can
// serve/redirect request else fail partitioned-metadata-request so, client fails while creating
// producer/consumer
Expand Down Expand Up @@ -3108,7 +3102,6 @@ private CompletableFuture<Void> updatePartitionedTopic(TopicName topicName, int
* : number partitions for the topics
*/
private CompletableFuture<Void> createSubscriptions(TopicName topicName, int numPartitions) {
String path = path(PARTITIONED_TOPIC_PATH_ZNODE, topicName.getPersistenceNamingEncoding());
CompletableFuture<Void> result = new CompletableFuture<>();
pulsar().getBrokerService().fetchPartitionedTopicMetadataAsync(topicName).thenAccept(partitionMetadata -> {
if (partitionMetadata.partitions < 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ public SimpleLoadManagerImpl(PulsarService pulsar) {
public void start() throws PulsarServerException {
try {
// Register the brokers in zk list
ServiceConfiguration conf = pulsar.getConfiguration();
if (pulsar.getZkClient().exists(LOADBALANCE_BROKERS_ROOT, false) == null) {
try {
ZkUtils.createFullPathOptimistic(pulsar.getZkClient(), LOADBALANCE_BROKERS_ROOT, new byte[0],
Expand Down Expand Up @@ -608,7 +607,6 @@ private synchronized void updateRealtimeResourceQuota() {
// update realtime quota for each bundle
Map<String, ResourceQuota> newQuotas = new HashMap<>();
for (Map.Entry<ResourceUnit, LoadReport> entry : currentLoadReports.entrySet()) {
ResourceUnit resourceUnit = entry.getKey();
LoadReport loadReport = entry.getValue();
Map<String, NamespaceBundleStats> bundleStats = loadReport.getBundleStats();
if (bundleStats == null) {
Expand Down Expand Up @@ -839,7 +837,6 @@ private synchronized ResourceUnit findBrokerForPlacement(Multimap<Long, Resource
continue;
}

String resourceUnitId = candidate.getResourceId();
ResourceUnitRanking ranking = resourceUnitRankings.get(candidate);

// check if this ServiceUnit is already loaded
Expand Down Expand Up @@ -1240,7 +1237,6 @@ public void writeLoadReportOnZookeeper() throws Exception {
long maxCapacity = ResourceUnitRanking.calculateBrokerMaxCapacity(
lastLoadReport.getSystemResourceUsage(),
pulsar.getLocalZkCacheService().getResourceQuotaCache().getDefaultQuota());
double bundlePercentageChange = (maxCapacity > 0) ? (bundleCountChange * 100 / maxCapacity) : 0;
if (newBundleCount != oldBundleCount) {
needUpdate = true;
}
Expand Down

0 comments on commit c3764e2

Please sign in to comment.