public Job(string dataDir, uint id = 0, bool readOnly = false) { if (!Directory.Exists(dataDir)) { throw new Exception("Data directory does not exist."); } if (id == 0) { throw new Exception("Job must have non-zero id."); } _dataDir = dataDir; _dataFilename = _dataDir + @"\" + id.ToString() + ".csv"; if (readOnly && !File.Exists(_dataFilename)) { throw new FileNotFoundException("File not found: " + _dataFilename); } _metaData = new MetaData(dataDir, id); _summary = new Summary(dataDir, this); // if the summary is rebuilt, it will load all the data, // which we can forget for now. if (_data != null) { _data.Dispose(); _data = null; } _cache = new JobCache(dataDir, this); }
internal Job(string dataDir) { if (!Directory.Exists(dataDir)) { throw new Exception("Data directory does not exist."); } _readOnly = true; _dataDir = dataDir; _metaData = null; _summary = null; _data = null; _cache = null; }
public void Dispose() { RebuildSummary(); _dataDir = null; _dataFilename = null; if (_data != null) { _data.Dispose(); } _data = null; _metaData = null; _summary = null; if (_cache != null) { _cache.Dispose(); } _cache = null; }
public void Dispose() { if (_needSummaryRebuild) { _summary.Rebuild(this); _needSummaryRebuild = false; } if (_data != null) { _data.Dispose(); } _data = null; _metaData = null; _summary = null; if (_cache != null) { _cache.Dispose(); } _cache = null; }
public Job(string dataDir, uint id = 0, bool readOnly = false) { if (!Directory.Exists(dataDir)) { throw new Exception("Data directory does not exist."); } if (id == 0) { throw new Exception("Job must have non-zero id."); } _readOnly = readOnly; _dataDir = dataDir; _metaData = new MetaData(dataDir, id); _summary = new Summary(dataDir, this); // if the summary is rebuilt, it will load all the data, // which we can forget for now. if (_data != null) { _data.Dispose(); _data = null; } _cache = new JobCache(dataDir, this); }