-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement dequeue count for sessions and activities
- Loading branch information
1 parent
3989fb0
commit 92151ad
Showing
13 changed files
with
215 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/DurableTask.Netherite/Events/PartitionEvents/Internal/RecoveryCompleted.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace DurableTask.Netherite | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using DurableTask.Core; | ||
|
||
[DataContract] | ||
class RecoveryCompleted : PartitionUpdateEvent | ||
{ | ||
[DataMember] | ||
public long RecoveredPosition { get; set; } | ||
|
||
[DataMember] | ||
public DateTime Timestamp { get; set; } | ||
|
||
[DataMember] | ||
public string WorkerId { get; set; } | ||
|
||
[DataMember] | ||
public int NumActivities { get; set; } | ||
|
||
[DataMember] | ||
public int MaxActivityDequeueCount { get; set; } | ||
|
||
[DataMember] | ||
public int NumSessions { get; set; } | ||
|
||
[DataMember] | ||
public int MaxSessionDequeueCount { get; set; } | ||
|
||
[IgnoreDataMember] | ||
public bool RequiresStateUpdate => (this.NumSessions + this.NumActivities) > 0; // orchestrations and activities must increment the dequeue count | ||
|
||
public override void ApplyTo(TrackedObject trackedObject, EffectTracker effects) | ||
{ | ||
trackedObject.Process(this, effects); | ||
} | ||
|
||
protected override void ExtraTraceInformation(StringBuilder s) | ||
{ | ||
s.Append(" RecoveredPosition="); | ||
s.Append(this.RecoveredPosition); | ||
s.Append(" NumActivities="); | ||
s.Append(this.NumActivities); | ||
s.Append(" MaxActivityDequeueCount="); | ||
s.Append(this.MaxActivityDequeueCount); | ||
s.Append(" NumSessions="); | ||
s.Append(this.NumSessions); | ||
s.Append(" MaxSessionDequeueCount="); | ||
s.Append(this.MaxSessionDequeueCount); | ||
} | ||
|
||
[IgnoreDataMember] | ||
public override EventId EventId => EventId.MakePartitionInternalEventId($"Recovered-{this.WorkerId}-{this.Timestamp:o}"); | ||
|
||
public override void DetermineEffects(EffectTracker effects) | ||
{ | ||
effects.Add(TrackedObjectKey.Activities); | ||
effects.Add(TrackedObjectKey.Sessions); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.