< Summary

Class:Microsoft.Azure.EventHubs.Processor.Checkpoint
Assembly:Microsoft.Azure.EventHubs.Processor
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\Checkpoint.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:59
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-0%100%
.ctor(...)-0%100%
get_Offset()-0%100%
get_SequenceNumber()-0%100%
get_PartitionId()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Microsoft.Azure.EventHubs.Processor\src\Checkpoint.cs

#LineLine coverage
 1// Copyright (c) Microsoft. All rights reserved.
 2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 3
 4namespace Microsoft.Azure.EventHubs.Processor
 5{
 6    /// <summary>
 7    /// The context object used to preserve state in the stream.
 8    /// </summary>
 9    public class Checkpoint
 10    {
 11        /// <summary>
 12        /// Creates a new Checkpoint for a particular partition ID.
 13        /// </summary>
 14        /// <param name="partitionId">The partition ID for the checkpoint</param>
 15        public Checkpoint(string partitionId)
 016            : this(partitionId, EventPosition.FromStart().Offset, 0)
 17        {
 018        }
 19
 20        /// <summary>
 21        /// Creates a new Checkpoint for a particular partition ID, with the offset and sequence number.
 22        /// </summary>
 23        /// <param name="partitionId">The partition ID for the checkpoint</param>
 24        /// <param name="offset">The offset for the last processed <see cref="EventData"/></param>
 25        /// <param name="sequenceNumber">The sequence number of the last processed <see cref="EventData"/></param>
 026        public Checkpoint(string partitionId, string offset, long sequenceNumber)
 27        {
 028            this.PartitionId = partitionId;
 029            this.Offset = offset;
 030            this.SequenceNumber = sequenceNumber;
 031        }
 32
 33        /// <summary>
 34        /// Creates a new Checkpoint from an existing checkpoint.
 35        /// </summary>
 36        /// <param name="source">The existing checkpoint to copy</param>
 037        public Checkpoint(Checkpoint source)
 38        {
 039            this.PartitionId = source.PartitionId;
 040            this.Offset = source.Offset;
 041            this.SequenceNumber = source.SequenceNumber;
 042        }
 43
 44        /// <summary>
 45        /// Gets or sets the offset of the last processed <see cref="EventData"/>.
 46        /// </summary>
 047        public string Offset { get; set; }
 48
 49        /// <summary>
 50        /// Gets or sets the sequence number of the last processed <see cref="EventData"/>.
 51        /// </summary>
 052        public long SequenceNumber { get; set; }
 53
 54        /// <summary>
 55        /// Gets the partition ID for the corresponding checkpoint.
 56        /// </summary>
 057        public string PartitionId { get; }
 58    }
 59}