@@ -178,7 +178,7 @@ public List<StoreScan<NodeLabelIndexCursor>> entityCursorScan(
178
178
int batchSize ,
179
179
boolean allowPartitionedScan
180
180
) {
181
- return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
181
+ return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
182
182
}
183
183
184
184
@ Override
@@ -187,7 +187,7 @@ public List<StoreScan<NodeLabelIndexCursor>> partitionedCursorScan(
187
187
int batchSize ,
188
188
int ... labelIds
189
189
) {
190
- return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
190
+ return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
191
191
}
192
192
193
193
@ Override
@@ -453,44 +453,49 @@ public Long pageCacheMemoryValue(String value) {
453
453
public long getHighestPossibleNodeCount (
454
454
Read read , IdGeneratorFactory idGeneratorFactory
455
455
) {
456
- return countByIdGenerator (idGeneratorFactory , RecordIdType .NODE , BlockFormat .INSTANCE .nodeType );
456
+ return countByIdGenerator (
457
+ idGeneratorFactory ,
458
+ RecordIdType .NODE ,
459
+ BlockFormat .INSTANCE .nodeType ,
460
+ BlockFormat .INSTANCE .dynamicNodeType
461
+ );
457
462
}
458
463
459
464
@ Override
460
465
public long getHighestPossibleRelationshipCount (
461
466
Read read , IdGeneratorFactory idGeneratorFactory
462
467
) {
463
- return countByIdGenerator (idGeneratorFactory , RecordIdType .RELATIONSHIP , BlockFormat .INSTANCE .relationshipType );
468
+ return countByIdGenerator (
469
+ idGeneratorFactory ,
470
+ RecordIdType .RELATIONSHIP ,
471
+ BlockFormat .INSTANCE .relationshipType ,
472
+ BlockFormat .INSTANCE .dynamicRelationshipType
473
+ );
464
474
}
465
475
466
476
private static final class BlockFormat {
467
477
private static final BlockFormat INSTANCE = new BlockFormat ();
468
478
469
- private final org .neo4j .internal .id .IdType nodeType ;
470
- private final org .neo4j .internal .id .IdType relationshipType ;
479
+ private org .neo4j .internal .id .IdType nodeType = null ;
480
+ private org .neo4j .internal .id .IdType dynamicNodeType = null ;
481
+ private org .neo4j .internal .id .IdType relationshipType = null ;
482
+ private org .neo4j .internal .id .IdType dynamicRelationshipType = null ;
471
483
472
484
BlockFormat () {
473
- org .neo4j .internal .id .IdType nodeType = null ;
474
- org .neo4j .internal .id .IdType relationshipType = null ;
475
-
476
485
try {
477
486
var blockIdType = Class .forName ("com.neo4j.internal.blockformat.BlockIdType" );
478
487
var blockTypes = Objects .requireNonNull (blockIdType .getEnumConstants ());
479
488
for (Object blockType : blockTypes ) {
480
489
var type = (Enum <?>) blockType ;
481
- if (type .name ().equals ("NODE" )) {
482
- nodeType = (org .neo4j .internal .id .IdType ) type ;
483
- } else if (type .name ().equals ("RELATIONSHIP" )) {
484
- relationshipType = (org .neo4j .internal .id .IdType ) type ;
490
+ switch (type .name ()) {
491
+ case "NODE" -> this .nodeType = (org .neo4j .internal .id .IdType ) type ;
492
+ case "DYNAMIC_NODE" -> this .dynamicNodeType = (org .neo4j .internal .id .IdType ) type ;
493
+ case "RELATIONSHIP" -> this .relationshipType = (org .neo4j .internal .id .IdType ) type ;
494
+ case "DYNAMIC_RELATIONSHIP" -> this .dynamicRelationshipType = (org .neo4j .internal .id .IdType ) type ;
485
495
}
486
496
}
487
- } catch (ClassNotFoundException | NullPointerException | ClassCastException e ) {
488
- nodeType = null ;
489
- relationshipType = null ;
497
+ } catch (ClassNotFoundException | NullPointerException | ClassCastException ignored ) {
490
498
}
491
-
492
- this .nodeType = Objects .requireNonNullElse (nodeType , RecordIdType .NODE );
493
- this .relationshipType = Objects .requireNonNullElse (relationshipType , RecordIdType .RELATIONSHIP );
494
499
}
495
500
}
496
501
0 commit comments