public ReduceObject <InterKey, InterVal> GetNextReduceObject() { var read_key = IntermediateRecord <InterKey, InterVal> .ReadKey(inputStream); List <InterVal> vals; var last_chunk = IntermediateRecord <InterKey, InterVal> .ReadValueList(inputStream, out vals); var iterator = new ReduceObject <InterKey, InterVal>(read_key, vals, this, last_chunk); return(iterator); }
public byte ReadNextChunk(InterKey key, out List <InterVal> list) { InterKey _key = (InterKey)key; var read_key = IntermediateRecord <InterKey, InterVal> .ReadKey(inputStream); List <InterVal> vals; var last_chunk = IntermediateRecord <InterKey, InterVal> .ReadValueList(inputStream, out vals); list = vals; if (!read_key.Equals(_key)) { throw new InvalidOperationException("We have reached a different key!"); } return(last_chunk); }