public override void Execute(ref bool destroyAfterExecute) { int outstadindChunkContexts; string key; CriteriaSetObj workingCriteria = Global.criteriaSets[criteriaIndex]; RawDataChunk workingData = Global.parsedRawData[dataIndex]; PreAggSpecs myPreSpecs = workingCriteria.preAggObj; AggSpecs myAggSpecs = workingCriteria.aggSpecsObj; PostAggSpecs myPostSpecs = workingCriteria.postAggObj; uint rawDataRowId; for (int i = 0; i < workingData.chunkDataParsed.Count; i++) { StockDataEntry currStockEntry = workingData.chunkDataParsed[i]; if (DataEntryWithinFilter(myPreSpecs, currStockEntry)) { rawDataRowId = ((uint)dataIndex << 16) | ((uint)i); key = myAggSpecs.CreateAggKeyWithAggValues(currStockEntry); workingCriteria.AddValueToDictionary(yesterdayData, key, currStockEntry.precentageSharesHeld, currStockEntry.sharesHeld, currStockEntry.value, rawDataRowId); } } outstadindChunkContexts = Interlocked.Decrement(ref chunkCount); if (outstadindChunkContexts == 0) { Global.mainThreadWait.Set(); } }
internal static void CombineStockDataEntryChunk(RawDataChunk chunkDataParsed) { lock (parsedRawData) { parsedRawData.Add(chunkDataParsed); } }
public DataChunkParser(int start, int end, bool firstChunk) { rangeStart = start; rangeEnd = end; globalFirstChunk = firstChunk; Interlocked.Add(ref outstadingDataChunkParsers, 1); parsedChunk = new RawDataChunk(); }