Skip to content

Commit

Permalink
Use UNKNOWN intermediate id in high limit case
Browse files Browse the repository at this point in the history
The assumption was that this fails with high limit
as the label information builder needs to be sized.
However, the label information builder uses a growing
bit set, which is - as the name suggests - growing.
  • Loading branch information
s1ck committed Sep 25, 2024
1 parent 6818837 commit 983334f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ static NodesBuilder nodesBuilder(
// If the requested id map is high limit, we need to make sure that
// internal data structures are sized accordingly. Using the highest
// original id will potentially fail due to size limitations.
if (nodeCount.isPresent()) {
maxIntermediateId = nodeCount.get() - 1;
} else {
throw new IllegalArgumentException("Cannot use high limit id map without node count.");
}
// If the node count is not given, we fall back to an unknown max id,
// which is fine since label building relies on growing bitsets.
maxIntermediateId = nodeCount.map(nc -> nc - 1).orElse(NodesBuilder.UNKNOWN_MAX_ID);

if (deduplicate) {
// We internally use HABS for deduplication, which is being initialized
// with max original id. This is fine for all id maps except high limit,
Expand Down

0 comments on commit 983334f

Please sign in to comment.