Пример #1
0
 // Time interval for the move thread.
 //History job cleaner interval
 /// <exception cref="System.Exception"/>
 protected override void ServiceInit(Configuration conf)
 {
     Log.Info("JobHistory Init");
     this.conf         = conf;
     this.appID        = ApplicationId.NewInstance(0, 0);
     this.appAttemptID = RecordFactoryProvider.GetRecordFactory(conf).NewRecordInstance
                         <ApplicationAttemptId>();
     moveThreadInterval = conf.GetLong(JHAdminConfig.MrHistoryMoveIntervalMs, JHAdminConfig
                                       .DefaultMrHistoryMoveIntervalMs);
     hsManager = CreateHistoryFileManager();
     hsManager.Init(conf);
     try
     {
         hsManager.InitExisting();
     }
     catch (IOException e)
     {
         throw new YarnRuntimeException("Failed to intialize existing directories", e);
     }
     storage = CreateHistoryStorage();
     if (storage is Org.Apache.Hadoop.Service.Service)
     {
         ((Org.Apache.Hadoop.Service.Service)storage).Init(conf);
     }
     storage.SetHistoryFileManager(hsManager);
     base.ServiceInit(conf);
 }
 private void BackupHistoric(HistoryStorage historyStorage, string historicDb)
 {
     this.BackupDatabase(historyStorage, historicDb);
 }
Пример #3
0
 private void Store(string message)
 {
     HistoryStorage.Store(new HistoryModel {
         DateCreated = DateTime.Now, Details = message, Name = Name
     });
 }
Пример #4
0
 public virtual IEnumerable <HistoryModel> LoadHistory(DateTime? @from = null, DateTime?to = null)
 {
     return(HistoryStorage.Load(Name, from, to));
 }