/// <exception cref="System.Exception"/> public T Run() { FileSystem fs = this._enclosing.CreateFileSystem(conf); Instrumentation instrumentation = this._enclosing.GetServer().Get <Instrumentation >(); Instrumentation.Cron cron = instrumentation.CreateCron(); try { this._enclosing.CheckNameNodeHealth(fs); cron.Start(); return(executor.Execute(fs)); } finally { cron.Stop(); instrumentation.AddCron(FileSystemAccessService.InstrumentationGroup, executor.GetType ().Name, cron); this._enclosing.CloseFileSystem(fs); } }
public void Run() { string instrName = callable.GetType().Name; Instrumentation instr = this._enclosing.GetServer().Get <Instrumentation>(); if (this._enclosing.GetServer().GetStatus() == Server.Status.Halted) { Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.Log.Debug("Skipping [{}], server status [{}]" , callable, this._enclosing.GetServer().GetStatus()); instr.Incr(Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.InstGroup, instrName + ".skips", 1); } else { Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.Log.Debug("Executing [{}]" , callable); instr.Incr(Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.InstGroup, instrName + ".execs", 1); Instrumentation.Cron cron = instr.CreateCron().Start(); try { callable.Call(); } catch (Exception ex) { instr.Incr(Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.InstGroup, instrName + ".fails", 1); Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.Log.Error("Error executing [{}], {}" , new object[] { callable, ex.Message, ex }); } finally { instr.AddCron(Org.Apache.Hadoop.Lib.Service.Scheduler.SchedulerService.InstGroup, instrName, cron.Stop()); } } }