Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-graph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Lambert
swh-graph
Commits
37e9188e
Commit
37e9188e
authored
2 years ago
by
vlorentz
Committed by
vlorentz
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Check in constructor instead of size64()
parent
39ed0d17
No related branches found
Branches containing commit
Tags
v6.3.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java
+8
-7
8 additions, 7 deletions
.../main/java/org/softwareheritage/graph/maps/NodeIdMap.java
with
8 additions
and
7 deletions
java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java
+
8
−
7
View file @
37e9188e
...
...
@@ -66,6 +66,13 @@ public class NodeIdMap implements Size64 {
this
.
nodeToSwhMap
=
ByteMappedBigList
.
map
(
raf
.
getChannel
());
}
long
byte_size
=
this
.
nodeToSwhMap
.
size64
();
if
(
byte_size
%
SWHID_BIN_SIZE
!=
0
)
{
throw
new
RuntimeException
(
String
.
format
(
"%s%s has size %d bytes, which is not a multiple of SWHID_BIN_SIZE (%d)"
,
graphPath
,
NODE_TO_SWHID
,
byte_size
,
SWHID_BIN_SIZE
));
}
// SWHID -> node
this
.
mph
=
loadMph
(
graphPath
+
".mph"
);
try
(
RandomAccessFile
mapFile
=
new
RandomAccessFile
(
new
File
(
graphPath
+
".order"
),
"r"
))
{
...
...
@@ -190,12 +197,6 @@ public class NodeIdMap implements Size64 {
/** Return the number of nodes in the map. */
@Override
public
long
size64
()
{
long
byte_size
=
nodeToSwhMap
.
size64
();
if
(
byte_size
%
SWHID_BIN_SIZE
!=
0
)
{
throw
new
RuntimeException
(
String
.
format
(
"%s%s has size %d bytes, which is not a multiple of SWHID_BIN_SIZE (%d)"
,
graphPath
,
NODE_TO_SWHID
,
byte_size
,
SWHID_BIN_SIZE
));
}
return
byte_size
/
SWHID_BIN_SIZE
;
return
nodeToSwhMap
.
size64
()
/
SWHID_BIN_SIZE
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment