コード例 #1
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
        public static async Task <Checkpointer> CreateAsync(string id, ICheckpointStore store)
        {
            Preconditions.CheckNotNull(id);
            Preconditions.CheckNotNull(store);

            Events.CreateStart(id);
            CheckpointData checkpointData = await store.GetCheckpointDataAsync(id, CancellationToken.None);

            var checkpointer = new Checkpointer(id, store, checkpointData);

            Events.CreateFinished(checkpointer);
            return(checkpointer);
        }
コード例 #2
0
        public async Task <ICheckpointer> CreateAsync(string id)
        {
            Events.CreateChildStart(this, id);

            Checkpointer checkpointer = await Checkpointer.CreateAsync(id, this.store);

            var child = new ChildCheckpointer(this, checkpointer);

            await this.AddChild(child);

            Events.CreateChildFinished(this, id);

            return(child);
        }
コード例 #3
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
 public static void SetQueueLength(Checkpointer checkpointer) => QueueLength.Set(checkpointer.Proposed - checkpointer.Offset, new[] { checkpointer.EndpointId, checkpointer.Priority });
コード例 #4
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
 static string GetContextString(Checkpointer checkpointer)
 {
     return(Invariant($"CheckpointerId: {checkpointer.Id}, Offset: {checkpointer.Offset}, Proposed: {checkpointer.Proposed}"));
 }
コード例 #5
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
 public static void Close(Checkpointer checkpointer)
 {
     Log.LogInformation((int)EventIds.Close, "[CheckpointerClose] {conetxt}", GetContextString(checkpointer));
 }
コード例 #6
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
 public static void CommitFinished(Checkpointer checkpointer)
 {
     Log.LogInformation((int)EventIds.CommitFinished, "[CheckpointerCommitFinishedo] {context}", GetContextString(checkpointer));
 }
コード例 #7
0
ファイル: Checkpointer.cs プロジェクト: veyalla/iotedge
 public static void CommitStarted(Checkpointer checkpointer, int successfulCount, int remainingCount)
 {
     Log.LogInformation((int)EventIds.CommitStarted, "[CheckpointerCommitStarted] SuccessfulCount: {0}, RemainingCount: {1}, {2}", successfulCount, remainingCount, GetContextString(checkpointer));
 }
コード例 #8
0
ファイル: Checkpointer.cs プロジェクト: vvv37912/iotedge
 public static void SetQueueLength(Checkpointer checkpointer) => QueueLength.Set(checkpointer.Proposed - checkpointer.Offset, new[] { checkpointer.Id });
コード例 #9
0
 private static double CalculateQueueLength(Checkpointer checkpointer) => CalculateQueueLength(checkpointer.Proposed - checkpointer.Offset);
コード例 #10
0
 public static void SetQueueLength(Checkpointer checkpointer) => SetQueueLength(CalculateQueueLength(checkpointer), checkpointer.EndpointId, checkpointer.Priority);