예제 #1
0
        public override void Write(Chunk chunk)
        {
            int chunkId = chunk.Id;

            if (!WriteOperations.ContainsKey(chunkId))
            {
                WriteOperation writeOperation = new WriteOperation();
                WriteOperations.Add(chunkId, writeOperation);

                writeOperation.Run(chunk, Directory);
                //FLogger.Log(LogType.Message, "ChunkWriter: Writing " + chunk.FileName);
                //IOMessages.CurrentState = "Writing" + chunk.FileName;
            }
            else
            {
                WriteOperation writeOperation = (WriteOperation)WriteOperations[chunkId];
                if (writeOperation.IsCompleted)
                {
                    writeOperation.Run(chunk, Directory);
                    //FLogger.Log(LogType.Message, "ChunkWriter: ReWriting " + chunk.FileName);
                    //IOMessages.CurrentState = "ReWriting" + chunk.FileName;
                }
            }
        }