cleanup unused sync method in NamespacesBase
@@ -1147,25 +1147,6 @@ public abstract class NamespacesBase extends AdminResource {
policies.publishMaxMessageRate.get(pulsar().getConfiguration().getClusterName()));
}
- @SuppressWarnings("deprecation")
- protected void internalSetTopicDispatchRate(DispatchRateImpl dispatchRate) {
- validateSuperUserAccess();
- log.info("[{}] Set namespace dispatch-rate {}/{}", clientAppId(), namespaceName, dispatchRate);
- try {
- updatePolicies(namespaceName, policies -> {
- policies.topicDispatchRate.put(pulsar().getConfiguration().getClusterName(), dispatchRate);
- policies.clusterDispatchRate.put(pulsar().getConfiguration().getClusterName(), dispatchRate);
- return policies;
- });
- log.info("[{}] Successfully updated the dispatchRate for cluster on namespace {}", clientAppId(),
- namespaceName);
- } catch (Exception e) {
- log.error("[{}] Failed to update the dispatchRate for cluster on namespace {}", clientAppId(),
- namespaceName, e);
- throw new RestException(e);
- }
- }
-
@SuppressWarnings("deprecation")
protected CompletableFuture<Void> internalSetTopicDispatchRateAsync(DispatchRateImpl dispatchRate) {
log.info("[{}] Set namespace dispatch-rate {}/{}", clientAppId(), namespaceName, dispatchRate);
@@ -1821,39 +1802,6 @@ public abstract class NamespacesBase extends AdminResource {
.build();
}
- private void validatePolicies(NamespaceName ns, Policies policies) {
- if (ns.isV2() && policies.replication_clusters.isEmpty()) {
- // Default to local cluster
- policies.replication_clusters = Collections.singleton(config().getClusterName());
- }
-
- // Validate cluster names and permissions
- policies.replication_clusters.forEach(cluster -> validateClusterForTenant(ns.getTenant(), cluster));
-
- if (policies.message_ttl_in_seconds != null && policies.message_ttl_in_seconds < 0) {
- throw new RestException(Status.PRECONDITION_FAILED, "Invalid value for message TTL");
- }
-
- if (policies.bundles != null && policies.bundles.getNumBundles() > 0) {
- if (policies.bundles.getBoundaries() == null || policies.bundles.getBoundaries().size() == 0) {
- policies.bundles = getBundles(policies.bundles.getNumBundles());
- } else {
- policies.bundles = validateBundlesData(policies.bundles);
- }
- } else {
- int defaultNumberOfBundles = config().getDefaultNumberOfNamespaceBundles();
- policies.bundles = getBundles(defaultNumberOfBundles);
- }
-
- if (policies.persistence != null) {
- validatePersistencePolicies(policies.persistence);
- }
-
- if (policies.retention_policies != null) {
- validateRetentionPolicies(policies.retention_policies);
- }
- }
-
private CompletableFuture<Void> validatePoliciesAsync(NamespaceName ns, Policies policies) {
if (ns.isV2() && policies.replication_clusters.isEmpty()) {
// Default to local cluster
