class type sorter =
The amount of data that can be put into a sorter is limited by
max_sort_size. It is the task of the caller to stick to this
method name :
method eff_sort_limit :
method sort_lines_limit :
int -> int
method set_key_extraction :
(string -> int * int) -> unit
extract_keyreturns, see below.
method put_records :
string Queue.t -> unit
method sort :
Mapred_io.record_writer -> unit
sort, the sorter is cleared, and can be used for new data.
method sort_time :
method close :
unit -> unit
method hash :
string -> int -> int -> int
hash record key_index key_len: Takes
key = String.sub record index key_lenas key, and returns the hash value. (If the sorter does not work with hashes, the method must return 0 instead.)
Hash values must be between 0 and 2^30-1 (i.e. 30 bits max).
method cmp :
string -> int -> int -> string -> int -> int -> int
cmp s1 i1 l1 s2 i2 l2: Compare two keys as the sorter does. The first key is passed in by the string
s1and the start index
i1and the length
l1. The other key is made available via
cmp is only called if
cmphash returns 0.
It is essential that
cmp does not store the passed strings