Exemple #1
0
        internal LocalReminderService(
            SiloAddress addr,
            GrainId id,
            IConsistentRingProvider ring,
            OrleansTaskScheduler localScheduler,
            IReminderTable reminderTable,
            GlobalConfiguration config,
            TimeSpan initTimeout)
            : base(id, addr)
        {
            logger = TraceLogger.GetLogger("ReminderService", TraceLogger.LoggerType.Runtime);

            localReminders     = new Dictionary <ReminderIdentity, LocalReminderData>();
            this.ring          = ring;
            scheduler          = localScheduler;
            this.reminderTable = reminderTable;
            this.config        = config;
            this.initTimeout   = initTimeout;
            status             = ReminderServiceStatus.Booting;
            myRange            = null;
            localTableSequence = 0;
            tardinessStat      = AverageTimeSpanStatistic.FindOrCreate(StatisticNames.REMINDERS_AVERAGE_TARDINESS_SECONDS);
            IntValueStatistic.FindOrCreate(StatisticNames.REMINDERS_NUMBER_ACTIVE_REMINDERS, () => localReminders.Count);
            ticksDeliveredStat = CounterStatistic.FindOrCreate(StatisticNames.REMINDERS_COUNTERS_TICKS_DELIVERED);
            startedTask        = new TaskCompletionSource <bool>();
        }
Exemple #2
0
 internal LocalReminderService(
     Silo silo,
     GrainId id,
     IReminderTable reminderTable,
     GlobalConfiguration config,
     TimeSpan initTimeout)
     : base(id, silo, null)
 {
     localReminders     = new Dictionary <ReminderIdentity, LocalReminderData>();
     this.reminderTable = reminderTable;
     this.config        = config;
     this.initTimeout   = initTimeout;
     localTableSequence = 0;
     tardinessStat      = AverageTimeSpanStatistic.FindOrCreate(StatisticNames.REMINDERS_AVERAGE_TARDINESS_SECONDS);
     IntValueStatistic.FindOrCreate(StatisticNames.REMINDERS_NUMBER_ACTIVE_REMINDERS, () => localReminders.Count);
     ticksDeliveredStat = CounterStatistic.FindOrCreate(StatisticNames.REMINDERS_COUNTERS_TICKS_DELIVERED);
     startedTask        = new TaskCompletionSource <bool>();
 }
Exemple #3
0
 internal LocalReminderService(
     Silo silo,
     IReminderTable reminderTable,
     TimeSpan initTimeout,
     ILoggerFactory loggerFactory)
     : base(GetGrainId(), silo, loggerFactory)
 {
     this.timerLogger   = loggerFactory.CreateLogger <GrainTimer>();
     localReminders     = new Dictionary <ReminderIdentity, LocalReminderData>();
     this.reminderTable = reminderTable;
     this.initTimeout   = initTimeout;
     localTableSequence = 0;
     this.loggerFactory = loggerFactory;
     tardinessStat      = AverageTimeSpanStatistic.FindOrCreate(StatisticNames.REMINDERS_AVERAGE_TARDINESS_SECONDS);
     IntValueStatistic.FindOrCreate(StatisticNames.REMINDERS_NUMBER_ACTIVE_REMINDERS, () => localReminders.Count);
     ticksDeliveredStat = CounterStatistic.FindOrCreate(StatisticNames.REMINDERS_COUNTERS_TICKS_DELIVERED);
     startedTask        = new TaskCompletionSource <bool>();
     this.logger        = this.loggerFactory.CreateLogger <LocalReminderService>();
 }
Exemple #4
0
 internal LocalReminderService(
     Silo silo,
     IReminderTable reminderTable,
     TimeSpan initTimeout,
     ILoggerFactory loggerFactory,
     IAsyncTimerFactory asyncTimerFactory)
     : base(SystemTargetGrainId.CreateGrainServiceGrainId(GrainInterfaceUtils.GetGrainClassTypeCode(typeof(IReminderService)), null, silo.SiloAddress), silo, loggerFactory)
 {
     localReminders         = new Dictionary <ReminderIdentity, LocalReminderData>();
     this.reminderTable     = reminderTable;
     this.initTimeout       = initTimeout;
     this.asyncTimerFactory = asyncTimerFactory;
     localTableSequence     = 0;
     tardinessStat          = AverageTimeSpanStatistic.FindOrCreate(StatisticNames.REMINDERS_AVERAGE_TARDINESS_SECONDS);
     IntValueStatistic.FindOrCreate(StatisticNames.REMINDERS_NUMBER_ACTIVE_REMINDERS, () => localReminders.Count);
     ticksDeliveredStat    = CounterStatistic.FindOrCreate(StatisticNames.REMINDERS_COUNTERS_TICKS_DELIVERED);
     startedTask           = new TaskCompletionSource <bool>(TaskCreationOptions.RunContinuationsAsynchronously);
     this.logger           = loggerFactory.CreateLogger <LocalReminderService>();
     this.listRefreshTimer = asyncTimerFactory.Create(Constants.RefreshReminderList, "ReminderService.ReminderListRefresher");
 }