示例#1
0
        public void DeleteCountsRepo()
        {
            Debug.WriteLine($"Starting to delete the old repo: {RepoFilename} at {DateTime.Now.ToString(DiagTimeFormat)}.");
            if (_countsRepo != null)
            {
                _countsRepo.Dispose();
                _countsRepo = null;
            }

            ValueRecords <RectangleInt, MapSectionWorkResult> .DeleteRepo(RepoFilename);

            Debug.WriteLine($"Completed deleting the old repo: {RepoFilename} at {DateTime.Now.ToString(DiagTimeFormat)}.");
        }
示例#2
0
文件: Job.cs 项目: drminor/FGenQD
        private bool disposedValue = false;         // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // Dispose managed state (managed objects).
                    if (_countsRepo != null)
                    {
                        _countsRepo.Dispose();
                    }

                    //if(DeleteRepoOnDispose)
                    //{
                    //	ValueRecords<KPoint, SubJobResult>.DeleteRepo(RepoFilename);
                    //}

                    if (FGenerator != null)
                    {
                        FGenerator.Dispose();
                        Debug.WriteLine($"Job: {JobId} has just called Dispose on it''s FGenerator.");
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
示例#3
0
文件: Job.cs 项目: drminor/FGenQD
        //public IEnumerable<Tuple<MapSectionResult, bool>> ReplayResults()
        //{
        //	SubJob subJob = GetNextSubJob();

        //	while (subJob != null)
        //	{
        //		MapSection ms = subJob.MapSectionWorkRequest.MapSection;
        //		RectangleInt riKey = ms.GetRectangleInt();
        //		MapSectionWorkResult workResult = GetEmptyResult(riKey);

        //		if (RetrieveWorkResultFromRepo(riKey, workResult))
        //		{
        //			MapSectionResult msr = new MapSectionResult(JobId, ms, workResult.Counts);

        //			Tuple<MapSectionResult, bool> item = new Tuple<MapSectionResult, bool>(msr, IsLastSubJob);
        //			DecrementSubJobsRemainingToBeSent();

        //			subJob = GetNextSubJob();
        //			yield return item;
        //		}
        //		else
        //		{
        //			yield return null;
        //		}
        //	}
        //}

        private void CloseCountsRepo(bool deleteRepo)
        {
            Debug.WriteLine($"Starting to close the repo: {RepoFilename} at {DateTime.Now.ToString(DiagTimeFormat)}.");
            if (_countsRepo != null)
            {
                ValueRecords <KPoint, SubJobResult> repo = _countsRepo;
                _countsRepo = null;
                repo.Dispose();
            }
            if (deleteRepo)
            {
                ValueRecords <KPoint, SubJobResult> .DeleteRepo(RepoFilename);

                Debug.WriteLine($"Completed deleting the repo: {RepoFilename} at {DateTime.Now.ToString(DiagTimeFormat)}.");
            }
            else
            {
                Debug.WriteLine($"Completed closing the repo: {RepoFilename} at {DateTime.Now.ToString(DiagTimeFormat)}.");
            }
        }