Click or drag to resize

SortSpillRecordWriterT Class

Multi record writer that collects the records in an in-memory buffer, and periodically spills the records to disk when the buffer is full. The final output is sorted.
Inheritance Hierarchy
SystemObject
  Ookii.Jumbo.IORecordWriterT
    Ookii.Jumbo.Jet.ChannelsSpillRecordWriterT
      Ookii.Jumbo.Jet.ChannelsSortSpillRecordWriterT

Namespace:  Ookii.Jumbo.Jet.Channels
Assembly:  Ookii.Jumbo.Jet (in Ookii.Jumbo.Jet.dll) Version: 2.0.0
Syntax
public sealed class SortSpillRecordWriter<T> : SpillRecordWriter<T>

Type Parameters

T
The type of the records.

The SortSpillRecordWriterT type exposes the following members.

Constructors
  NameDescription
Public methodSortSpillRecordWriterT
Initializes a new instance of the SortSpillRecordWriterT class.
Top
Properties
  NameDescription
Public propertyBytesRead
Gets the number of bytes read during merging.
Public propertyBytesWritten
Gets the number of bytes that were actually written to the output.
(Overrides SpillRecordWriterTBytesWritten.)
Public propertyHasFinishedWriting
Gets a value indicating whether FinishWriting method has been called.
(Inherited from RecordWriterT.)
Public propertyOutputBytes
Gets the size of the written records after serialization.
(Inherited from SpillRecordWriterT.)
Public propertyPartitioner
Gets the partitioner.
(Inherited from SpillRecordWriterT.)
Public propertyRecordsWritten
Gets the total number of records written by this record writer.
(Inherited from RecordWriterT.)
Public propertySpillCount
Gets the number of spills performed.
(Inherited from SpillRecordWriterT.)
Public propertyWriteTime
Gets the time spent writing.
(Inherited from RecordWriterT.)
Top
Methods
  NameDescription
Public methodDispose
Cleans up all resources held by this RecordWriter{T}.
(Inherited from RecordWriterT.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFinishWriting
Informs the record writer that no further records will be written.
(Overrides SpillRecordWriterTFinishWriting.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteRecord
Writes a record.
(Inherited from RecordWriterT.)
Public methodWriteRecords
Writes the specified sequence of records.
(Inherited from RecordWriterT.)
Top
Remarks

Each spill is written to its own file, and each partition is sorted using IndexedQuicksort before being spilled. When FinishWriting is called, the individual spills are merged using MergeHelperT into the final output file.

It is possible to specify a combiner task that will be run on the records of each spill after sorting. Use this to reduce the size of the output records after sorting. The combiner must be a ITaskTInput, TOutput where both the input and output record type are T. The Run(RecordReaderTInput, RecordWriterTOutput) method will be called multiple times (once for each spill), so the task must be prepared for. You can use a ReduceTaskTKey, TValue, TOutput for Map-Reduce style combining.

See Also