Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | public static Object2LongFunction<byte[]> loadMph(String path) throws IOException { | ||||
*/ | */ | ||||
} | } | ||||
// End of backward-compatibility block | // End of backward-compatibility block | ||||
return res; | return res; | ||||
} | } | ||||
/** | /** | ||||
* Converts byte-form SWHID to corresponding long node id. | * Converts byte-form SWHID to corresponding long node id. Low-level function, does not check if the | ||||
* Low-level function, does not check if the SWHID is valid. | * SWHID is valid. | ||||
* | * | ||||
* @param swhid node represented as bytes | * @param swhid node represented as bytes | ||||
* @return corresponding node as a long id | * @return corresponding node as a long id | ||||
*/ | */ | ||||
public long getNodeId(byte[] swhid) { | public long getNodeId(byte[] swhid) { | ||||
// 1. Hash the SWHID with the MPH to get its original ID | // 1. Hash the SWHID with the MPH to get its original ID | ||||
long origNodeId = mph.getLong(swhid); | long origNodeId = mph.getLong(swhid); | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |