Example #1
0
        public void present(Output output)
        {
            OutputDictionary outputDictionary = (OutputDictionary)output;

            String response = (String)outputDictionary.getResponse();

            Console.WriteLine("Operation: " + outputDictionary.Operation);
            Console.WriteLine(response + "\n");
        }
Example #2
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 #3
0
        //Method to reset the op
        public static void ResetOperation()
        {
            Start    = 0;
            Stop     = 0;
            Children = null;
            Size     = 0;
            Current  = 0;

            OutputDictionary.Clear();
            RealOutputDictionary.Clear();
        }
Example #4
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 #5
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 #6
0
 //Method for clearing the dictionary
 public static void ClearOutput()
 {
     OutputDictionary.Clear();
 }
Example #7
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;
 }