/** * @return number of memory segments in the smallest partition */ private int getMinPartition() { int minPartition = Integer.MAX_VALUE; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() < minPartition) { minPartition = p1.getBlockCount(); } } return minPartition; }
/** * Size of all memory segments owned by the partitions of this hash table excluding the compaction partition * * @return size in bytes */ private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
/** * @return number of memory segments in the largest partition */ private int getMaxPartition() { int maxPartition = 0; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() > maxPartition) { maxPartition = p1.getBlockCount(); } } return maxPartition; }
/** * Size of all memory segments owned by the partitions of this hash table excluding the compaction partition * * @return size in bytes */ private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
/** * @return number of memory segments in the smallest partition */ private int getMinPartition() { int minPartition = Integer.MAX_VALUE; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() < minPartition) { minPartition = p1.getBlockCount(); } } return minPartition; }
/** * @return number of memory segments in the smallest partition */ private int getMinPartition() { int minPartition = Integer.MAX_VALUE; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() < minPartition) { minPartition = p1.getBlockCount(); } } return minPartition; }
/** * @return number of memory segments in the largest partition */ private int getMaxPartition() { int maxPartition = 0; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() > maxPartition) { maxPartition = p1.getBlockCount(); } } return maxPartition; }
/** * Size of all memory segments owned by the partitions of this hash table excluding the compaction partition * * @return size in bytes */ private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
/** * @return number of memory segments in the largest partition */ private int getMaxPartition() { int maxPartition = 0; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() > maxPartition) { maxPartition = p1.getBlockCount(); } } return maxPartition; }
/** * Size of all memory segments owned by the partitions of this hash table excluding the compaction partition * * @return size in bytes */ private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
/** * @return number of memory segments in the smallest partition */ private int getMinPartition() { int minPartition = Integer.MAX_VALUE; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() < minPartition) { minPartition = p1.getBlockCount(); } } return minPartition; }
/** * @return number of memory segments in the largest partition */ private int getMaxPartition() { int maxPartition = 0; for(InMemoryPartition<T> p1 : this.partitions) { if(p1.getBlockCount() > maxPartition) { maxPartition = p1.getBlockCount(); } } return maxPartition; }
/** * Size of all memory segments owned by this hash table * * @return size in bytes */ private long getSize() { long numSegments = 0; numSegments += this.availableMemory.size(); numSegments += this.buckets.length; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); numSegments += p.numOverflowSegments; } numSegments += this.compactionMemory.getBlockCount(); return numSegments*this.segmentSize; }
/** * Size of all memory segments owned by this hash table * * @return size in bytes */ private long getSize() { long numSegments = 0; numSegments += this.availableMemory.size(); numSegments += this.buckets.length; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); numSegments += p.numOverflowSegments; } numSegments += this.compactionMemory.getBlockCount(); return numSegments*this.segmentSize; }
/** * attempts to allocate specified number of segments and should only be used by compaction partition * fails silently if not enough segments are available since next compaction could still succeed * * @param numberOfSegments allocation count */ public void allocateSegments(int numberOfSegments) { while (getBlockCount() < numberOfSegments) { MemorySegment next = this.availableMemory.nextSegment(); if (next != null) { this.partitionPages.add(next); } else { return; } } }
/** * attempts to allocate specified number of segments and should only be used by compaction partition * fails silently if not enough segments are available since next compaction could still succeed * * @param numberOfSegments allocation count */ public void allocateSegments(int numberOfSegments) { while (getBlockCount() < numberOfSegments) { MemorySegment next = this.availableMemory.nextSegment(); if (next != null) { this.partitionPages.add(next); } else { return; } } }
@Override public String toString() { return String.format("Partition %d - %d records, %d partition blocks, %d bucket overflow blocks", getPartitionNumber(), getRecordCount(), getBlockCount(), this.numOverflowSegments); }
@Override public String toString() { return String.format("Partition %d - %d records, %d partition blocks, %d bucket overflow blocks", getPartitionNumber(), getRecordCount(), getBlockCount(), this.numOverflowSegments); }
@Override public String toString() { return String.format("Partition %d - %d records, %d partition blocks, %d bucket overflow blocks", getPartitionNumber(), getRecordCount(), getBlockCount(), this.numOverflowSegments); }
@Override public String toString() { return String.format("Partition %d - %d records, %d partition blocks, %d bucket overflow blocks", getPartitionNumber(), getRecordCount(), getBlockCount(), this.numOverflowSegments); }