Documentation ¶
Overview ¶
Package emsort provides a facility for performing disk-based external merge sorts.
see https://en.wikipedia.org/wiki/External_sorting#External_merge_sort see http://faculty.simpson.edu/lydia.sinapova/www/cmsc250/LN250_Weiss/L17-ExternalSortEX2.htm
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
Chunk is a function that chunks data read from the given io.Reader into items for sorting.
type Less ¶
Less is a function that compares two byte arrays and determines whether a is less than b.
type SortedWriter ¶
type SortedWriter interface { Write(b []byte) (int, error) // Close implements the method from io.Closer. It's important to call this // because this is where the final sorting happens. Close() error }
SortedWriter is an io.WriteCloser that sorts its output on writing. Each []byte passed to the Write method is treated as a single item to sort. Since these []byte are kept in memory, they must not be pooled/shared!