You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/04/21 02:42:29 UTC

[GitHub] [pulsar] zplinuxlover commented on a change in pull request #6758: change test case code org.apache.pulsar.io.PulsarFunctionE2ETest#testFunctionAutomaticSubCleanup

zplinuxlover commented on a change in pull request #6758:
URL: https://github.com/apache/pulsar/pull/6758#discussion_r411826825



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
##########
@@ -2552,9 +2552,10 @@ protected void internalSetOffloadPolicies(AsyncResponse asyncResponse, OffloadPo
             final String path = path(POLICIES, namespaceName.toString());
             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)) {
+            // there is possibility that `offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis()` is null.
+            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)) {

Review comment:
       the change of code is pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java, 
   `pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java` is another problem, why the code appear here? 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org