/// <summary> /// Set the BaseStreamMetadataBody properties /// </summary> /// <param name="metadataKind">Kind of StreamMetadata</param> /// <param name="streamName">Name of the stream </param> /// <param name="partnerId">Partner Id</param> /// <param name="currentState">Current persistent state of the stream</param> /// <param name="closeMessageSequenceNumber">Closing sequence number of the message</param> protected void InitializeBaseParameters( StreamMetadataKind metadataKind, Uri streamName, PartitionKey partnerId, PersistentStreamState currentState, long closeMessageSequenceNumber) { this.MetadataKind = metadataKind; this.StreamName = streamName; this.PartnerId = partnerId; this.CurrentState = currentState; this.CloseMessageSequenceNumber = closeMessageSequenceNumber; var encoder = new StringEncoder(this.StreamName.OriginalString); this.BaseEncodeLength = (sizeof(int) * 2) + (sizeof(long) * 2) + encoder.EncodingByteCount + this.PartnerId.EncodingByteCount; }
internal InboundStreamStableParameters(Uri streamName, PartitionKey partnerId, PersistentStreamState currentState) { this.InitializeBaseParameters( StreamMetadataKind.InboundStableParameters, streamName, partnerId, currentState, StreamConstants.InitialValueOfLastSequenceNumberInStream); }