private static int getSerializedParamSizeForApplyBinaryLog ( int streamCount , int remotePartitionCount , int concatLogSize ) { int serializedParamSize = 2 + 1 + 4 // placeholder byte[0] + 1 + 4 // producerClusterId Integer + 1 + 4 + 4 + ( 4 + 8 * remotePartitionCount ) * streamCount // concatLogIds byte[] + 1 + 4 + 4 + ( 4 + 8 + 8 + 4 + 4 + 16 ) * streamCount // concatTrackerBufs (DRConsumerDrIdTracker) byte[] + 1 + 4 + 4 + 4 * streamCount + concatLogSize // concatLogs byte[] + 1 + 1 // extraOption Byte + 1 + 4 ; // extraParameters byte[0] return serializedParamSize ; }
calculate based on BinaryLogHelper and ParameterSet . fromArrayNoCopy