public BinaryRow append ( LookupInfo info , BinaryRow value ) throws IOException { try { if ( numElements >= growthThreshold ) { growAndRehash ( ) ; //update info's bucketSegmentIndex and bucketOffset lookup ( info . key ) ; } BinaryRow toAppend = hashSetMode ? reusedValue : value ; long pointerToAppended = recordArea . appendRecord ( info . key , toAppend ) ; bucketSegments . get ( info . bucketSegmentIndex ) . putLong ( info . bucketOffset , pointerToAppended ) ; bucketSegments . get ( info . bucketSegmentIndex ) . putInt ( info . bucketOffset + ELEMENT_POINT_LENGTH , info . keyHashCode ) ; numElements ++ ; recordArea . setReadPosition ( pointerToAppended ) ; recordArea . skipKey ( ) ; return recordArea . readValue ( reusedValue ) ; } catch ( EOFException e ) { numSpillFiles ++ ; spillInBytes += recordArea . segments . size ( ) * ( ( long ) segmentSize ) ; throw e ; } }
Append an value into the hash map s record area .