// Funtion checks if current page has enough space to fit the new serialized tuple // If not it flushes the current buffer and gets a new page // TODO: The code does not ensure that pages are optimally packed. // It only tries to fill up the current page as much as possbile, if its // exhausted it requests a new page. Instead it would be nice to load the next page // that could fit the new value. private void ensureSpace(byte[] value) { if (!byteMap.canFit(value)) { // Flush current buffer byteMap.flushBuffer(); // Get next page byteMap = MappedByteBufferMap.newMappedByteBufferMap(thresholdBytes, spillFile); // Create new bloomfilter bFilters.add(BloomFilter.create(Funnels.byteArrayFunnel(), 1000)); } }