Example #1
0
 //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);
     }
 }
Example #2
0
 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;
     }
 }
Example #3
0
 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;
     }
 }
Example #4
0
 //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;
 }