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); }
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); }
public static void SetQueueLength(Checkpointer checkpointer) => QueueLength.Set(checkpointer.Proposed - checkpointer.Offset, new[] { checkpointer.EndpointId, checkpointer.Priority });
static string GetContextString(Checkpointer checkpointer) { return(Invariant($"CheckpointerId: {checkpointer.Id}, Offset: {checkpointer.Offset}, Proposed: {checkpointer.Proposed}")); }
public static void Close(Checkpointer checkpointer) { Log.LogInformation((int)EventIds.Close, "[CheckpointerClose] {conetxt}", GetContextString(checkpointer)); }
public static void CommitFinished(Checkpointer checkpointer) { Log.LogInformation((int)EventIds.CommitFinished, "[CheckpointerCommitFinishedo] {context}", GetContextString(checkpointer)); }
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)); }
public static void SetQueueLength(Checkpointer checkpointer) => QueueLength.Set(checkpointer.Proposed - checkpointer.Offset, new[] { checkpointer.Id });
private static double CalculateQueueLength(Checkpointer checkpointer) => CalculateQueueLength(checkpointer.Proposed - checkpointer.Offset);
public static void SetQueueLength(Checkpointer checkpointer) => SetQueueLength(CalculateQueueLength(checkpointer), checkpointer.EndpointId, checkpointer.Priority);