eolivelli commented on a change in pull request #12078:
URL: https://github.com/apache/pulsar/pull/12078#discussion_r711360195
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
##########
@@ -419,12 +418,12 @@ public void
testCreatePartitionedTopicHavingNonPartitionTopicWithPartitionSuffix
final String nonPartitionTopicName1 = "standard-topic";
final String nonPartitionTopicName2 = "special-topic-partition-123";
final String partitionedTopicName = "special-topic";
- LocalZooKeeperCacheService mockLocalZooKeeperCacheService =
mock(LocalZooKeeperCacheService.class);
- ZooKeeperManagedLedgerCache mockZooKeeperChildrenCache =
mock(ZooKeeperManagedLedgerCache.class);
-
doReturn(mockLocalZooKeeperCacheService).when(pulsar).getLocalZkCacheService();
-
doReturn(mockZooKeeperChildrenCache).when(mockLocalZooKeeperCacheService).managedLedgerListCache();
- doReturn(ImmutableSet.of(nonPartitionTopicName1,
nonPartitionTopicName2)).when(mockZooKeeperChildrenCache).get(anyString());
-
doReturn(CompletableFuture.completedFuture(ImmutableSet.of(nonPartitionTopicName1,
nonPartitionTopicName2))).when(mockZooKeeperChildrenCache).getAsync(anyString());
+// LocalZooKeeperCacheService mockLocalZooKeeperCacheService =
mock(LocalZooKeeperCacheService.class);
Review comment:
Nit: remove
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/TopicResources.java
##########
@@ -29,7 +29,9 @@
import org.apache.pulsar.metadata.api.MetadataStore;
import org.apache.pulsar.metadata.api.MetadataStoreException;
-public class TopicResources {
+public class
Review comment:
Nit: fix formatting
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/DispatchRateLimiter.java
##########
@@ -324,18 +320,12 @@ public DispatchRate getPoliciesDispatchRate(BrokerService
brokerService) {
public static Optional<Policies> getPolicies(BrokerService brokerService,
String topicName) {
final NamespaceName namespace =
TopicName.get(topicName).getNamespaceObject();
- final String path = path(POLICIES, namespace.toString());
- Optional<Policies> policies = Optional.empty();
try {
- ConfigurationCacheService configurationCacheService =
brokerService.pulsar().getConfigurationCache();
- if (configurationCacheService != null) {
- policies =
configurationCacheService.policiesCache().getAsync(path)
-
.get(brokerService.pulsar().getConfiguration().getZooKeeperOperationTimeoutSeconds(),
SECONDS);
- }
+ return
brokerService.pulsar().getPulsarResources().getNamespaceResources().getPolicies(namespace);
} catch (Exception e) {
log.warn("Failed to get message-rate for {} ", topicName, e);
+ return Optional.empty();
Review comment:
Do we want to keep catch `Exception` ?
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
##########
@@ -357,6 +350,7 @@ protected void validateClusterOwnership(String cluster)
throws WebApplicationExc
} catch (WebApplicationException wae) {
throw wae;
} catch (Exception e) {
+ e.printStackTrace();
Review comment:
Remove
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]