Exemple #1
0
        public SpillFile(string filename, int bufferLength, SerializedMessageEncoder <T> spillEncoder, SerializedMessageEncoder <T> logEncoder, SerializedMessageDecoder <T> decoder, int pageSize)
        {
            this.typedBuffer = new CircularBuffer <T>(bufferLength);

            this.encoder = spillEncoder;
            this.encoder.CompletedMessage += encoder_CompletedMessage;

            this.decoder = decoder;

            this.spillStream   = new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.ReadWrite, 1 << 20);//, FileOptions.WriteThrough);
            this.consumeStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

            this.rereadMessageHeaderBuffer = new byte[MessageHeader.SizeOf];
            this.rereadMessageBodyBuffer   = new byte[pageSize];

            this.logAllElements = logEncoder != null;
            if (this.logAllElements)
            {
                this.logEncoder = logEncoder;
                this.logEncoder.CompletedMessage += logEncoder_CompletedMessage;
            }
        }
Exemple #2
0
 public SpillFile(string filename, int bufferLength, SerializedMessageEncoder <T> encoder, SerializedMessageDecoder <T> decoder, int pageSize, NaiadSerialization <MessageHeader> headerSerializer)
     : this(filename, bufferLength, encoder, null, decoder, pageSize, headerSerializer)
 {
 }
Exemple #3
0
 public SpillFile(string filename, int bufferLength, SerializedMessageEncoder <T> encoder, SerializedMessageDecoder <T> decoder, int pageSize)
     : this(filename, bufferLength, encoder, null, decoder, pageSize)
 {
 }