1.describe :
class IndexHeader attribute indexCount initial value is 1 not 0,so index pos not begin 0 but begin 1,therefore IndexFile only 19999999 Indexes can be stored, not 20000000 Indexes
-
What did you see instead?
class IndexHeader attribute indexCount as follows :
private AtomicInteger indexCount = new AtomicInteger(1);
Original code as follows :
int absIndexPos = IndexHeader.INDEX_HEADER_SIZE + this.hashSlotNum * hashSlotSize
+ this.indexHeader.getIndexCount() * indexSize;
this.mappedByteBuffer.putInt(absIndexPos, keyHash);
this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset);
this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff);
this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue);
this.mappedByteBuffer.putInt(absSlotPos, this.indexHeader.getIndexCount());
-
What did you expect to see?
class IndexHeader attribute indexCount as follows :
private AtomicInteger indexCount = new AtomicInteger(0);
1.describe :
class IndexHeader attribute indexCount initial value is 1 not 0,so index pos not begin 0 but begin 1,therefore IndexFile only 19999999 Indexes can be stored, not 20000000 Indexes
What did you see instead?
class IndexHeader attribute indexCount as follows :
private AtomicInteger indexCount = new AtomicInteger(1);
Original code as follows :
int absIndexPos = IndexHeader.INDEX_HEADER_SIZE + this.hashSlotNum * hashSlotSize
+ this.indexHeader.getIndexCount() * indexSize;
this.mappedByteBuffer.putInt(absIndexPos, keyHash);
this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset);
this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff);
this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue);
this.mappedByteBuffer.putInt(absSlotPos, this.indexHeader.getIndexCount());
What did you expect to see?
class IndexHeader attribute indexCount as follows :
private AtomicInteger indexCount = new AtomicInteger(0);