コード例 #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public void scheduleSamplingJob(final IndexSamplingJob samplingJob)
        public virtual void ScheduleSamplingJob(IndexSamplingJob samplingJob)
        {
            @lock.@lock();
            try
            {
                if (_stopped)
                {
                    return;
                }

                long indexId = samplingJob.IndexId();
                if (_executingJobs.Contains(indexId))
                {
                    return;
                }

                _executingJobs.Add(indexId);
                _jobScheduler.schedule(Group.INDEX_SAMPLING, () =>
                {
                    try
                    {
                        samplingJob.run();
                    }
                    finally
                    {
                        SamplingJobCompleted(samplingJob);
                    }
                });
            }
            finally
            {
                @lock.unlock();
            }
        }
コード例 #2
0
 private void SamplingJobCompleted(IndexSamplingJob samplingJob)
 {
     @lock.@lock();
     try
     {
         _executingJobs.remove(samplingJob.IndexId());
         _canSchedule.signalAll();
         _allJobsFinished.signalAll();
     }
     finally
     {
         @lock.unlock();
     }
 }