Ejemplo n.º 1
0
 public static void CommitFinished(MasterCheckpointer masterCheckpointer)
 {
     if (Log.IsEnabled(LogLevel.Debug))
     {
         Log.LogDebug((int)EventIds.CommitFinished, "[MasterCheckpointerCommitFinished] {0}", GetContextString(masterCheckpointer));
     }
 }
Ejemplo n.º 2
0
 public static void CommitStarted(MasterCheckpointer masterCheckpointer, int successfulCount, int remainingCount)
 {
     if (Log.IsEnabled(LogLevel.Debug))
     {
         Log.LogDebug((int)EventIds.CommitStarted, "[MasterCheckpointerCommitStarted] SuccessfulCount: {0}, RemainingCount: {1}, {2}", successfulCount, remainingCount, GetContextString(masterCheckpointer));
     }
 }
Ejemplo n.º 3
0
 public static void Admit(MasterCheckpointer masterCheckpointer, long messageOffset, bool isClosed)
 {
     if (Log.IsEnabled(LogLevel.Debug))
     {
         Log.LogDebug((int)EventIds.Admit, "[MasterCheckpointerAdmit] jMessageOffset: {0}, IsClosed: {1}, {2}", messageOffset, isClosed, GetContextString(masterCheckpointer));
     }
 }
Ejemplo n.º 4
0
 public static void CreateChildFinished(MasterCheckpointer masterCheckpointer, string id)
 {
     if (Log.IsEnabled(LogLevel.Debug))
     {
         Log.LogDebug((int)EventIds.CreateChildFinished, "[ChildCheckpointerCreateFinished] ChildCheckpointerId: {0}, {1}", id, GetContextString(masterCheckpointer));
     }
 }
Ejemplo n.º 5
0
        public static async Task <MasterCheckpointer> CreateAsync(string id, ICheckpointStore store)
        {
            Preconditions.CheckNotNull(id);
            Preconditions.CheckNotNull(store);

            Events.CreateStart(id);

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

            long offset             = checkpointData.Offset;
            var  masterCheckpointer = new MasterCheckpointer(id, store, offset);

            Events.CreateFinished(masterCheckpointer);

            return(masterCheckpointer);
        }
Ejemplo n.º 6
0
 static string GetContextString(MasterCheckpointer masterCheckpointer)
 {
     return(Invariant($"MasterCheckpointerId: {masterCheckpointer.Id}, MasterCheckpointerOffset: {masterCheckpointer.Offset}, ChildCheckpointersCount: {masterCheckpointer.ChildCheckpointers.Count}"));
 }
Ejemplo n.º 7
0
 public static void Close(MasterCheckpointer masterCheckpointer)
 {
     Log.LogInformation((int)EventIds.Close, "[MasterCheckpointerClose] {0}", GetContextString(masterCheckpointer));
 }
Ejemplo n.º 8
0
 public static void ProposeFailed(MasterCheckpointer masterCheckpointer, string id, Exception exception)
 {
     Log.LogError((int)EventIds.ProposeFailed, exception, "[ChildCheckpointerProposeFailed] ChildCheckpointId: {0}, {1}", id, GetContextString(masterCheckpointer));
 }
Ejemplo n.º 9
0
 public static void CreateChildStart(MasterCheckpointer masterCheckpointer, string id)
 {
     Log.LogDebug((int)EventIds.CreateChildStart, "[ChildCheckpointerCreateStart] ChildCheckpointerId: {0}, {1}", id, GetContextString(masterCheckpointer));
 }
Ejemplo n.º 10
0
 public static void CreateFinished(MasterCheckpointer masterCheckpointer)
 {
     Log.LogDebug((int)EventIds.CreateFinished, "[MasterCheckpointerCreateFinished] {0}", GetContextString(masterCheckpointer));
 }
Ejemplo n.º 11
0
 public ChildCheckpointer(MasterCheckpointer master, ICheckpointer underlying)
 {
     this.master     = Preconditions.CheckNotNull(master);
     this.underlying = Preconditions.CheckNotNull(underlying);
 }