numBytes bytes to the given {@link IndexOutput}.
* Index: lucene/src/java/org/apache/lucene/store/MMapDirectory.java --- lucene/src/java/org/apache/lucene/store/MMapDirectory.java Wed Jun 15 05:22:04 2011 -0400 +++ lucene/src/java/org/apache/lucene/store/MMapDirectory.java Sat Jun 18 12:23:31 2011 -0400 @@ -21,6 +21,7 @@ import java.io.File; import java.io.RandomAccessFile; import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; import java.nio.BufferUnderflowException; import java.nio.channels.ClosedChannelException; // javadoc @link import java.nio.channels.FileChannel; @@ -213,7 +214,7 @@ File f = new File(getDirectory(), name); RandomAccessFile raf = new RandomAccessFile(f, "r"); try { - return new MMapIndexInput(raf, chunkSizePower); + return new MMapIndexInput(raf, chunkSizePower, name); } finally { raf.close(); } @@ -235,7 +236,7 @@ private boolean isClone = false; - MMapIndexInput(RandomAccessFile raf, int chunkSizePower) throws IOException { + MMapIndexInput(RandomAccessFile raf, int chunkSizePower, String name) throws IOException { this.length = raf.length(); this.chunkSizePower = chunkSizePower; this.chunkSize = 1L << chunkSizePower; @@ -262,10 +263,20 @@ : (length - bufferStart) ); this.buffers[bufNr] = rafc.map(MapMode.READ_ONLY, bufferStart, bufSize); + // nocommit + //if (name.endsWith("_1.tib")) { + //System.out.println("FORCE LOAD " + name); + //((MappedByteBuffer) this.buffers[bufNr]).load(); + //} bufferStart += bufSize; } seek(0L); } + + // nocommit + public ByteBuffer[] getByteBuffers() { + return buffers; + } @Override public byte readByte() throws IOException {