@@ -849,27 +849,28 @@ protected CompletableFuture<OffloadPoliciesImpl> internalGetOffloadPolicies(bool
849
849
.thenCompose (op -> {
850
850
TopicPolicies topicPolicies = op .orElseGet (TopicPolicies ::new );
851
851
OffloadPoliciesImpl currentOffloadPolicies = topicPolicies .getOffloadPolicies ();
852
- if (Objects .equals (offloadPolicies .getManagedLedgerOffloadDeletionLagInMillis (),
853
- OffloadPoliciesImpl .DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS )) {
854
- offloadPolicies .setManagedLedgerOffloadDeletionLagInMillis (
855
- currentOffloadPolicies .getManagedLedgerOffloadDeletionLagInMillis ());
856
- }
857
- if (Objects .equals (offloadPolicies .getManagedLedgerOffloadThresholdInBytes (),
858
- OffloadPoliciesImpl .DEFAULT_OFFLOAD_THRESHOLD_IN_BYTES )) {
859
- offloadPolicies .setManagedLedgerOffloadThresholdInBytes (
860
- currentOffloadPolicies .getManagedLedgerOffloadThresholdInBytes ());
861
- }
862
- if (Objects .equals (offloadPolicies .getManagedLedgerOffloadMaxBlockSizeInBytes (),
863
- OffloadPoliciesImpl .DEFAULT_MAX_BLOCK_SIZE_IN_BYTES )) {
864
- offloadPolicies .setManagedLedgerOffloadMaxBlockSizeInBytes (
865
- currentOffloadPolicies .getManagedLedgerOffloadMaxBlockSizeInBytes ());
866
- }
867
- if (Objects .equals (offloadPolicies .getManagedLedgerOffloadReadBufferSizeInBytes (),
868
- OffloadPoliciesImpl .DEFAULT_READ_BUFFER_SIZE_IN_BYTES )) {
869
- offloadPolicies .setManagedLedgerOffloadReadBufferSizeInBytes (
870
- currentOffloadPolicies .getManagedLedgerOffloadReadBufferSizeInBytes ());
852
+ if (currentOffloadPolicies != null && offloadPolicies != null ){
853
+ if (Objects .equals (offloadPolicies .getManagedLedgerOffloadDeletionLagInMillis (),
854
+ OffloadPoliciesImpl .DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS )) {
855
+ offloadPolicies .setManagedLedgerOffloadDeletionLagInMillis (
856
+ currentOffloadPolicies .getManagedLedgerOffloadDeletionLagInMillis ());
857
+ }
858
+ if (Objects .equals (offloadPolicies .getManagedLedgerOffloadThresholdInBytes (),
859
+ OffloadPoliciesImpl .DEFAULT_OFFLOAD_THRESHOLD_IN_BYTES )) {
860
+ offloadPolicies .setManagedLedgerOffloadThresholdInBytes (
861
+ currentOffloadPolicies .getManagedLedgerOffloadThresholdInBytes ());
862
+ }
863
+ if (Objects .equals (offloadPolicies .getManagedLedgerOffloadMaxBlockSizeInBytes (),
864
+ OffloadPoliciesImpl .DEFAULT_MAX_BLOCK_SIZE_IN_BYTES )) {
865
+ offloadPolicies .setManagedLedgerOffloadMaxBlockSizeInBytes (
866
+ currentOffloadPolicies .getManagedLedgerOffloadMaxBlockSizeInBytes ());
867
+ }
868
+ if (Objects .equals (offloadPolicies .getManagedLedgerOffloadReadBufferSizeInBytes (),
869
+ OffloadPoliciesImpl .DEFAULT_READ_BUFFER_SIZE_IN_BYTES )) {
870
+ offloadPolicies .setManagedLedgerOffloadReadBufferSizeInBytes (
871
+ currentOffloadPolicies .getManagedLedgerOffloadReadBufferSizeInBytes ());
872
+ }
871
873
}
872
-
873
874
topicPolicies .setOffloadPolicies (offloadPolicies );
874
875
topicPolicies .setIsGlobal (isGlobal );
875
876
return pulsar ().getTopicPoliciesService ().updateTopicPoliciesAsync (topicName , topicPolicies );
0 commit comments