docs: protected int spillPartition() throws IOException {
  		// find the largest partition
  		ArrayList<HashPartition<BT, PT>> partitions = this.partitionsBeingBuilt;
  		int largestNumBlocks = 0;
  		int largestPartNum = -1;
  		
  		for (int i = 0; i < partitions.size(); i++) {
  			HashPartition<BT, PT> p = partitions.get(i);
  			if (p.isInMemory() && p.getNumOccupiedMemorySegments() > largestNumBlocks) {
  				largestNumBlocks = p.getNumOccupiedMemorySegments();
  				largestPartNum = i;
  			}
  		}
  		final HashPartition<BT, PT> p = partitions.get(largestPartNum);
  		
  		if (useBloomFilters) {
  			buildBloomFilterForBucketsInPartition(largestPartNum, p);
  		}
  		
  		// spill the partition
  		int numBuffersFreed = p.spillPartition(this.availableMemory, this.ioManager, 
  										this.currentEnumerator.next(), this.writeBehindBuffers);
  		this.writeBehindBuffersAvailable += numBuffersFreed;
  		// grab as many buffers as are available directly
  		MemorySegment currBuff;
  		while (this.writeBehindBuffersAvailable > 0 && (currBuff = this.writeBehindBuffers.poll()) != null) {
  			this.availableMemory.add(currBuff);
  			this.writeBehindBuffersAvailable--;
  		}
  		return largestPartNum;
  	}