private void equalizeEntryCountWithPrimary ( ) { int diff = recordStore . size ( ) - primaryEntryCount ; if ( diff > 0 ) { recordStore . sampleAndForceRemoveEntries ( diff ) ; assert recordStore . size ( ) == primaryEntryCount : String . format ( "Failed" + " to remove %d entries while attempting to match" + " primary entry count %d," + " recordStore size is now %d" , diff , primaryEntryCount , recordStore . size ( ) ) ; } }
Equalizes backup entry count with primary in order to have identical memory occupancy .