//Method for writing the output public static void WriteOutput(long index, long output) { try { OutputDictionary.Add(index, output); } catch (Exception e) { Reporter.WriteContent("ERROR IN WRITEOUTPUT", 1); } }
protected override void Process(int threadId) { try { while (InputQueue.TryDequeue(out Chunk chunk) && !hasError) { var decompressedChunkData = GZip.DecompressBlock(chunk.Bytes); OutputDictionary.Add(chunk.Id, decompressedChunkData); } processEvents[threadId].Set(); } catch (Exception e) { hasError = true; } }
protected override void Process(int processEventId) { try { while (InputQueue.Dequeue(out Chunk chunk) && HasError == null) { var compressChunk = GZip.GZip.CompressByBlocks(chunk.Bytes); if (compressChunk == null) { throw new OutOfMemoryException(); } OutputDictionary.Add(chunk.Id, compressChunk); } ProcessEvents[processEventId].Set(); } catch (Exception e) { SingleLogger.log.Error($"(Your exception is :{e.Message} , send a log file for us from the folder /bin/Debug/myapp.log"); SingleLogger.log.Debug($"(Your exception is :{e.Message} , send a log file for us from the folder /bin/Debug/myapp.log"); HasError = e; } }
//When the op sends another job out, the current gets increased public static void IncreaseCurrent(long i, Child id) { OutputDictionary.Add(Current, new Tuple <Child, int>(id, 0)); Current += i; }