Package org.eclipse.mat.parser.index
Class IndexReader.IntIndexReader
java.lang.Object
org.eclipse.mat.parser.index.IndexReader.IntIndexReader
- All Implemented Interfaces:
IIndexReader
,IIndexReader.IOne2OneIndex
- Enclosing class:
- IndexReader
An int to int index reader.
Disk file structure:
Page 0: ArrayIntCompressed Page 1: ArrayIntCompressed ... Page n: ArrayIntCompressed page 0 start in file (8) page 1 start in file (8) ... page n start in file (8) page n+1 start in file (8) (i.e. location of 'page 0 start in file' field) page size (4) total size (4)Experimental for version 1.2: The disk format has been enhanced to allow more than 2^31 entries by using the page n+1 start pointer to find the start of the page offsets, and so the number of pages, and the size field is then negative and used to measure the number of entries on the last page (from 1 to page size). This is experimental and index files with 2^31 entries or more are not compatible with 1.1 or earlier and might not be compatible with 1.3 or later.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.mat.parser.index.IIndexReader
IIndexReader.IOne2LongIndex, IIndexReader.IOne2ManyIndex, IIndexReader.IOne2ManyObjectsIndex, IIndexReader.IOne2OneIndex, IIndexReader.IOne2SizeIndex
-
Field Summary
Modifier and TypeFieldDescriptionFor use reading the actual index fileThe lock to protect the read from concurrent access -
Constructor Summary
ConstructorDescriptionIntIndexReader
(File indexFile) IntIndexReader
(File indexFile, org.eclipse.mat.parser.index.IndexWriter.Pages<SoftReference<ArrayIntCompressed>> pages, int size, int pageSize, long[] pageStart) IntIndexReader
(SimpleBufferedRandomAccessInputStream in, long start, long length) -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.mat.parser.index.IIndexReader
size
Methods inherited from interface org.eclipse.mat.parser.index.IIndexReader.IOne2OneIndex
get, getAll, getNext
-
Field Details
-
LOCK
The lock to protect the read from concurrent access -
in
For use reading the actual index file
-
-
Constructor Details
-
IntIndexReader
public IntIndexReader(File indexFile, org.eclipse.mat.parser.index.IndexWriter.Pages<SoftReference<ArrayIntCompressed>> pages, int size, int pageSize, long[] pageStart) -
IntIndexReader
- Throws:
IOException
-
IntIndexReader
public IntIndexReader(SimpleBufferedRandomAccessInputStream in, long start, long length) throws IOException - Throws:
IOException
-
-
Method Details
-
unload
public void unload()Description copied from interface:IIndexReader
Clear the caches. Used when the indexes are not current in use and the memory needs to be reclaimed such as when building the dominator tree.- Specified by:
unload
in interfaceIIndexReader
-
close
public void close()Description copied from interface:IIndexReader
Close the backing file.- Specified by:
close
in interfaceIIndexReader
-
delete
public void delete()Description copied from interface:IIndexReader
Delete the backing file.- Specified by:
delete
in interfaceIIndexReader
-
get
public int get(int index) -
getNext
public int[] getNext(int index, int length) -
getAll
public int[] getAll(int[] index) -
set
public void set(int index, int value) -
size
public int size() -
iterator
-