This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 0951828 Add null check for offload policy(#6775)
0951828 is described below
commit 0951828d66430b587fdb9e5642a8fb24a106e17a
Author: luceneReader <[email protected]>
AuthorDate: Thu Apr 30 21:23:54 2020 +0800
Add null check for offload policy(#6775)
---
.../java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
index bb584a7..5de3915 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
@@ -2557,8 +2557,9 @@ public abstract class NamespacesBase extends
AdminResource {
byte[] content = globalZk().getData(path, null, nodeStat);
Policies policies = jsonMapper().readValue(content,
Policies.class);
- if (offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis()
-
.equals(OffloadPolicies.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS)) {
+ if (offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis()
== null && OffloadPolicies.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS == null
+ ||
offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis() != null
+ &&
offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis().equals(OffloadPolicies.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS))
{
offloadPolicies.setManagedLedgerOffloadDeletionLagInMillis(policies.offload_deletion_lag_ms);
} else {
policies.offload_deletion_lag_ms =
offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis();