@@ -178,7 +178,7 @@ public List<StoreScan<NodeLabelIndexCursor>> entityCursorScan(
178178 int batchSize ,
179179 boolean allowPartitionedScan
180180 ) {
181- return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
181+ return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
182182 }
183183
184184 @ Override
@@ -187,7 +187,7 @@ public List<StoreScan<NodeLabelIndexCursor>> partitionedCursorScan(
187187 int batchSize ,
188188 int ... labelIds
189189 ) {
190- return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
190+ return PartitionedStoreScan .createScans (transaction , batchSize , this , labelIds );
191191 }
192192
193193 @ Override
@@ -453,44 +453,49 @@ public Long pageCacheMemoryValue(String value) {
453453 public long getHighestPossibleNodeCount (
454454 Read read , IdGeneratorFactory idGeneratorFactory
455455 ) {
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+ );
457462 }
458463
459464 @ Override
460465 public long getHighestPossibleRelationshipCount (
461466 Read read , IdGeneratorFactory idGeneratorFactory
462467 ) {
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+ );
464474 }
465475
466476 private static final class BlockFormat {
467477 private static final BlockFormat INSTANCE = new BlockFormat ();
468478
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 ;
471483
472484 BlockFormat () {
473- org .neo4j .internal .id .IdType nodeType = null ;
474- org .neo4j .internal .id .IdType relationshipType = null ;
475-
476485 try {
477486 var blockIdType = Class .forName ("com.neo4j.internal.blockformat.BlockIdType" );
478487 var blockTypes = Objects .requireNonNull (blockIdType .getEnumConstants ());
479488 for (Object blockType : blockTypes ) {
480489 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 ;
485495 }
486496 }
487- } catch (ClassNotFoundException | NullPointerException | ClassCastException e ) {
488- nodeType = null ;
489- relationshipType = null ;
497+ } catch (ClassNotFoundException | NullPointerException | ClassCastException ignored ) {
490498 }
491-
492- this .nodeType = Objects .requireNonNullElse (nodeType , RecordIdType .NODE );
493- this .relationshipType = Objects .requireNonNullElse (relationshipType , RecordIdType .RELATIONSHIP );
494499 }
495500 }
496501
0 commit comments