code: func (fs *FileSorter) Input(key []types.Datum, val []types.Datum, handle int64) error {
  	if fs.closed {
  		return errors.New("FileSorter has been closed")
  	}
  	if fs.fetched {
  		return errors.New("call input after output")
  	}
  
  	// Sanity checks
  	if len(key) != fs.keySize {
  		return errors.New("mismatch in key size and key slice")
  	}
  	if len(val) != fs.valSize {
  		return errors.New("mismatch in value size and val slice")
  	}
  
  	if len(fs.buf) >= fs.bufSize {
  		err := fs.flushToFile()
  		if err != nil {
  			return errors.Trace(err)
  		}
  	}
  
  	row := &comparableRow{
  		key:    key,
  		val:    val,
  		handle: handle,
  	}
  	fs.buf = append(fs.buf, row)
  	return nil
  }
docs: // Input adds one row into FileSorter.
  // Caller should not call Input after calling Output.