private < R > boolean requiresFinalizer ( boolean parallelPublisher , Set < K > keysToInclude , DeliveryGuarantee deliveryGuarantee ) { // Parallel publisher has to use the finalizer to consolidate intermediate values on the remote nodes return parallelPublisher || // Using segments with exactly once does one segment at a time and requires consolidation keysToInclude == null && deliveryGuarantee == DeliveryGuarantee . EXACTLY_ONCE ; }
This method is used to determine if a finalizer is required to be sent remotely . For cases we don t have to we don t want to serialize it for nothing