Differential D1908 Diff 6407 java/server/src/main/java/org/softwareheritage/graph/backend/NodeIdMap.java
Changeset View
Changeset View
Standalone View
Standalone View
java/server/src/main/java/org/softwareheritage/graph/backend/NodeIdMap.java
package org.softwareheritage.graph.backend; | package org.softwareheritage.graph.backend; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import org.softwareheritage.graph.Graph; | import org.softwareheritage.graph.Graph; | ||||
import org.softwareheritage.graph.SwhPID; | import org.softwareheritage.graph.SwhPID; | ||||
import org.softwareheritage.graph.backend.MapFile; | import org.softwareheritage.graph.backend.MapFile; | ||||
import org.softwareheritage.graph.backend.Setup; | import org.softwareheritage.graph.backend.Setup; | ||||
/** | /** | ||||
* Mapping between internal long node id and external SWH PID. | * Mapping between internal long node id and external SWH PID. | ||||
* <p> | * <p> | ||||
* Mappings in both directions are pre-computed and dumped on disk in the {@link Setup} class, then | * Mappings in both directions are pre-computed and dumped on disk in the {@link Setup} class, then | ||||
* they are loaded here using mmap(). | * they are loaded here using mmap(). | ||||
* | * | ||||
* @author Thibault Allançon | * @author Thibault Allançon | ||||
* @version 0.0.1 | |||||
* @since 0.0.1 | |||||
* @see org.softwareheritage.graph.backend.Setup | * @see org.softwareheritage.graph.backend.Setup | ||||
*/ | */ | ||||
public class NodeIdMap { | public class NodeIdMap { | ||||
/** Fixed length of full SWH PID */ | /** Fixed length of full SWH PID */ | ||||
public static final int SWH_ID_LENGTH = 50; | public static final int SWH_ID_LENGTH = 50; | ||||
/** Fixed length of long node id */ | /** Fixed length of long node id */ | ||||
public static final int NODE_ID_LENGTH = 20; | public static final int NODE_ID_LENGTH = 20; | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |