Example #1
0
        /// <summary>Execute an on-demand cleaner task.</summary>
        protected internal virtual void RunCleanerTask()
        {
            Runnable task = CleanerTask.Create(conf, store, metrics, cleanerTaskLock);

            // this is a non-blocking call (it simply submits the task to the executor
            // queue and returns)
            this.scheduledExecutor.Execute(task);
        }
Example #2
0
        /// <exception cref="System.Exception"/>
        protected override void ServiceStart()
        {
            if (!WriteGlobalCleanerPidFile())
            {
                throw new YarnException("The global cleaner pid file already exists! " + "It appears there is another CleanerService running in the cluster"
                                        );
            }
            this.metrics = CleanerMetrics.GetInstance();
            // Start dependent services (i.e. AppChecker)
            base.ServiceStart();
            Runnable task            = CleanerTask.Create(conf, store, metrics, cleanerTaskLock);
            long     periodInMinutes = GetPeriod(conf);

            scheduledExecutor.ScheduleAtFixedRate(task, GetInitialDelay(conf), periodInMinutes
                                                  , TimeUnit.Minutes);
            Log.Info("Scheduled the shared cache cleaner task to run every " + periodInMinutes
                     + " minutes.");
        }