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