Differential D1822 Diff 6149 java/server/src/main/java/org/softwareheritage/graph/backend/MapFile.java
Changeset View
Changeset View
Standalone View
Standalone View
java/server/src/main/java/org/softwareheritage/graph/backend/MapFile.java
package org.softwareheritage.graph.backend; | package org.softwareheritage.graph.backend; | ||||
import java.io.File; | import java.io.File; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.RandomAccessFile; | import java.io.RandomAccessFile; | ||||
import java.nio.channels.FileChannel; | import java.nio.channels.FileChannel; | ||||
import it.unimi.dsi.io.ByteBufferInputStream; | import it.unimi.dsi.io.ByteBufferInputStream; | ||||
/** | /** | ||||
* Wrapper class around very big mmap()-ed file. | * Wrapper class around very big mmap()-ed file. | ||||
* <p> | |||||
* Java has a limit for mmap()-ed files because of unsupported 64-bit indexing. The <a | |||||
* href="http://dsiutils.di.unimi.it/">dsiutils</a> ByteBufferInputStream is used to overcome this | |||||
* Java limit. | |||||
* | * | ||||
* @author Thibault Allançon | * @author Thibault Allançon | ||||
* @version 0.0.1 | * @version 0.0.1 | ||||
* @since 0.0.1 | * @since 0.0.1 | ||||
*/ | */ | ||||
public class MapFile { | public class MapFile { | ||||
/** | /** Memory-mapped file buffer */ | ||||
* Memory-mapped file buffer | |||||
* @see it.unimi.dsi.io.ByteBufferInputStream | |||||
*/ | |||||
ByteBufferInputStream bufferMap; | ByteBufferInputStream bufferMap; | ||||
/** Fixed line length of the mmap()-ed file */ | /** Fixed line length of the mmap()-ed file */ | ||||
int lineLength; | int lineLength; | ||||
/** | /** | ||||
* Constructor. | * Constructor. | ||||
* | * | ||||
* @param path file path to mmap() | * @param path file path to mmap() | ||||
Show All 34 Lines |