The idea for this class is credited to Stu Thompson. More...
Public Member Functions | |
LargeByteBuffer (FileChannel in, int headerSz, int recordSz) throws IOException | |
byte | get (long position) throws IOException |
int | getInt (long position) throws IOException |
long | getLong (long position) throws IOException |
double | getDouble (long position) throws IOException |
char | getChar (long position) throws IOException |
String | getString (long position, long length) throws IOException |
float | getFloat (long position) throws IOException |
short | getShort (long position) throws IOException |
long | size () |
void | dispose () |
Private Member Functions | |
long | getCurrentSize (long index) throws IOException |
MappedByteBuffer | setBuffer (int page) throws IOException |
MappedByteBuffer | getBuffer (int page) throws IOException |
Static Private Member Functions | |
static long | gcd (long a, long b) |
static long | lcm (long a, long b) |
Private Attributes | |
MappedByteBuffer[] | masterBuffer |
The masterBuffer holds a vector of all bytebuffers. | |
long | length |
final FileChannel | fcInput |
long | pageSize |
The idea for this class is credited to Stu Thompson.
stackoverflow.com/questions/736556/binary-search-in-a-sorted-memory-mapped-file-in-java
The implementation is credited to
Definition at line 14 of file LargeByteBuffer.java.
edu.rice.cs.hpc.data.util.LargeByteBuffer.LargeByteBuffer | ( | FileChannel | in, | |
int | headerSz, | |||
int | recordSz | |||
) | throws IOException |
Definition at line 36 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.fcInput, edu.rice.cs.hpc.data.util.LargeByteBuffer.lcm(), edu.rice.cs.hpc.data.util.LargeByteBuffer.length, edu.rice.cs.hpc.data.util.LargeByteBuffer.masterBuffer, and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
void edu.rice.cs.hpc.data.util.LargeByteBuffer.dispose | ( | ) |
Definition at line 164 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.fcInput, and edu.rice.cs.hpc.data.util.LargeByteBuffer.masterBuffer.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.FileDB2.dispose().
static long edu.rice.cs.hpc.data.util.LargeByteBuffer.gcd | ( | long | a, | |
long | b | |||
) | [static, private] |
Definition at line 182 of file LargeByteBuffer.java.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.lcm().
byte edu.rice.cs.hpc.data.util.LargeByteBuffer.get | ( | long | position | ) | throws IOException |
Definition at line 88 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
MappedByteBuffer edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer | ( | int | page | ) | throws IOException [private] |
Definition at line 79 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.masterBuffer, and edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer().
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.get(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getChar(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getDouble(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getFloat(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getInt(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getLong(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.getShort().
char edu.rice.cs.hpc.data.util.LargeByteBuffer.getChar | ( | long | position | ) | throws IOException |
Definition at line 125 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
long edu.rice.cs.hpc.data.util.LargeByteBuffer.getCurrentSize | ( | long | index | ) | throws IOException [private] |
Definition at line 53 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.length, and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer().
double edu.rice.cs.hpc.data.util.LargeByteBuffer.getDouble | ( | long | position | ) | throws IOException |
Definition at line 114 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.AbstractBaseData.getDouble(), and edu.rice.cs.hpc.viewer.metric.ThreadLevelDataFile.DataReadThread.run().
float edu.rice.cs.hpc.data.util.LargeByteBuffer.getFloat | ( | long | position | ) | throws IOException |
Definition at line 142 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
int edu.rice.cs.hpc.data.util.LargeByteBuffer.getInt | ( | long | position | ) | throws IOException |
Definition at line 96 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.AbstractBaseData.getInt(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getLong(), and edu.rice.cs.hpc.data.experiment.extdata.FileDB2.setData().
long edu.rice.cs.hpc.data.util.LargeByteBuffer.getLong | ( | long | position | ) | throws IOException |
Definition at line 103 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getInt(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.AbstractBaseData.getLong(), and edu.rice.cs.hpc.data.experiment.extdata.FileDB2.setData().
short edu.rice.cs.hpc.data.util.LargeByteBuffer.getShort | ( | long | position | ) | throws IOException |
Definition at line 149 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
String edu.rice.cs.hpc.data.util.LargeByteBuffer.getString | ( | long | position, | |
long | length | |||
) | throws IOException |
Definition at line 132 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.length.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.AbstractBaseData.getString().
static long edu.rice.cs.hpc.data.util.LargeByteBuffer.lcm | ( | long | a, | |
long | b | |||
) | [static, private] |
Definition at line 200 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.gcd().
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.LargeByteBuffer().
MappedByteBuffer edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer | ( | int | page | ) | throws IOException [private] |
Definition at line 69 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.fcInput, edu.rice.cs.hpc.data.util.LargeByteBuffer.getCurrentSize(), edu.rice.cs.hpc.data.util.LargeByteBuffer.masterBuffer, and edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer().
long edu.rice.cs.hpc.data.util.LargeByteBuffer.size | ( | ) |
Definition at line 156 of file LargeByteBuffer.java.
References edu.rice.cs.hpc.data.util.LargeByteBuffer.length.
Referenced by edu.rice.cs.hpc.data.experiment.extdata.FilteredBaseData.getMaxLoc(), and edu.rice.cs.hpc.data.experiment.extdata.BaseData.getMaxLoc().
final FileChannel edu.rice.cs.hpc.data.util.LargeByteBuffer.fcInput [private] |
Definition at line 22 of file LargeByteBuffer.java.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.dispose(), edu.rice.cs.hpc.data.util.LargeByteBuffer.LargeByteBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer().
long edu.rice.cs.hpc.data.util.LargeByteBuffer.length [private] |
MappedByteBuffer [] edu.rice.cs.hpc.data.util.LargeByteBuffer.masterBuffer [private] |
The masterBuffer holds a vector of all bytebuffers.
Definition at line 18 of file LargeByteBuffer.java.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.dispose(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getBuffer(), edu.rice.cs.hpc.data.util.LargeByteBuffer.LargeByteBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer().
long edu.rice.cs.hpc.data.util.LargeByteBuffer.pageSize [private] |
Definition at line 26 of file LargeByteBuffer.java.
Referenced by edu.rice.cs.hpc.data.util.LargeByteBuffer.get(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getChar(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getCurrentSize(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getDouble(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getFloat(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getInt(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getLong(), edu.rice.cs.hpc.data.util.LargeByteBuffer.getShort(), edu.rice.cs.hpc.data.util.LargeByteBuffer.LargeByteBuffer(), and edu.rice.cs.hpc.data.util.LargeByteBuffer.setBuffer().