diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java index 82a1449845fde..1eae97f825463 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java @@ -57,7 +57,7 @@ public void checkReference( DynamicRecord record, NodeRecord nodeRecord, { // if this node record is in use but doesn't point to the dynamic label record // that label record has an invalid owner - long recordId = record.getLongId(); + long recordId = record.getId(); if ( fieldPointsToDynamicRecordOfLabels( nodeRecord.getLabelField() ) ) { long dynamicLabelRecordId = firstDynamicLabelRecordId( nodeRecord.getLabelField() ); diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/CountsBuilderDecorator.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/CountsBuilderDecorator.java index bfded8752058c..dcac2187af5b9 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/CountsBuilderDecorator.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/CountsBuilderDecorator.java @@ -318,7 +318,7 @@ public boolean test( T record ) return false; } - if ( record.getLongId() == 0 ) + if ( record.getId() == 0 ) { if ( started ) { diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/DynamicOwner.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/DynamicOwner.java index 2001a76dd8748..0b4dde19c585d 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/DynamicOwner.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/checking/full/DynamicOwner.java @@ -193,7 +193,7 @@ static class PropertyKey extends NameOwner implements Iterable +class RecordSet implements Iterable { - private Map map = new HashMap(); + private final Map map = new HashMap(); void add( R record ) { @@ -84,7 +84,7 @@ public String toString() return builder.append( "]\n" ).toString(); } - public static RecordSet asSet( R... records ) + public static RecordSet asSet( R... records ) { RecordSet set = new RecordSet(); for ( R record : records ) diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/report/ConsistencyReporter.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/report/ConsistencyReporter.java index 82674ce4599ec..7022176a8419d 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/report/ConsistencyReporter.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/report/ConsistencyReporter.java @@ -277,7 +277,7 @@ static class ReportHandler @Override long recordId() { - return record.getLongId(); + return record.getId(); } @Override @@ -329,7 +329,7 @@ private DiffReportHandler( InconsistencyReport report, ProxyFactory fact @Override long recordId() { - return newRecord.getLongId(); + return newRecord.getId(); } @Override diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/CountsEntry.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/CountsEntry.java index 0ea69544e17e8..9ee679cdbeb6d 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/CountsEntry.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/CountsEntry.java @@ -37,6 +37,7 @@ public class CountsEntry extends AbstractBaseRecord public CountsEntry( CountsKey key, long count ) { + super( -1 ); this.key = key; this.count = count; setInUse( true ); @@ -57,7 +58,7 @@ public String toString() } @Override - public long getLongId() + public long getId() { throw new UnsupportedOperationException(); } diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/IndexEntry.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/IndexEntry.java index ee4c9fbd260e2..5c064ee5f0b14 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/IndexEntry.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/IndexEntry.java @@ -19,13 +19,13 @@ */ package org.neo4j.legacy.consistency.store.synthetic; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; /** * Synthetic record type that stands in for a real record to fit in conveniently * with consistency checking */ -public class IndexEntry extends Abstract64BitRecord +public class IndexEntry extends AbstractBaseRecord { public IndexEntry( long nodeId ) { diff --git a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/LabelScanDocument.java b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/LabelScanDocument.java index d21d762cb503e..e032186883e68 100644 --- a/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/LabelScanDocument.java +++ b/community/consistency-check-legacy/src/main/java/org/neo4j/legacy/consistency/store/synthetic/LabelScanDocument.java @@ -20,13 +20,13 @@ package org.neo4j.legacy.consistency.store.synthetic; import org.neo4j.kernel.api.labelscan.NodeLabelRange; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; /** * Synthetic record type that stands in for a real record to fit in conveniently * with consistency checking */ -public class LabelScanDocument extends Abstract64BitRecord +public class LabelScanDocument extends AbstractBaseRecord { private NodeLabelRange nodeLabelRange; diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/TransactionWriter.java b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/TransactionWriter.java index c14f677d94aa7..865d6de7f552c 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/TransactionWriter.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/TransactionWriter.java @@ -107,13 +107,13 @@ public void create( NodeRecord node ) public void create( LabelTokenRecord labelToken ) { labelToken.setCreated(); - update( new LabelTokenRecord( labelToken.getId() ), labelToken ); + update( new LabelTokenRecord( labelToken.getIntId() ), labelToken ); } public void create( PropertyKeyTokenRecord token ) { token.setCreated(); - update( new PropertyKeyTokenRecord( token.getId() ), token ); + update( new PropertyKeyTokenRecord( token.getIntId() ), token ); } public void create( RelationshipGroupRecord group ) @@ -193,7 +193,7 @@ public void delete( RelationshipRecord record ) public void create( PropertyRecord property ) { property.setCreated(); - PropertyRecord before = new PropertyRecord( property.getLongId() ); + PropertyRecord before = new PropertyRecord( property.getId() ); if ( property.isNodeSet() ) { before.setNodeId( property.getNodeId() ); diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/ExecutionOrderIntegrationTest.java b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/ExecutionOrderIntegrationTest.java index fde1338b69a38..32c17976149b4 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/ExecutionOrderIntegrationTest.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/ExecutionOrderIntegrationTest.java @@ -172,7 +172,7 @@ void log( PendingReferenceCheck check, InvocationOnMock invocation ) { AbstractBaseRecord record = (AbstractBaseRecord) arg; entry.append( ',' ).append( record.getClass().getSimpleName() ) - .append( '[' ).append( record.getLongId() ).append( ']' ); + .append( '[' ).append( record.getId() ).append( ']' ); } } String message = entry.append( ')' ).toString(); diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java index 3566f97766b0a..3413812c3c886 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/checking/full/FullCheckIntegrationTest.java @@ -300,7 +300,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, NodeRecord nodeRecord = new NodeRecord( next.node(), false, -1, -1 ); DynamicRecord record = inUse( new DynamicRecord( next.nodeLabel() ) ); Collection newRecords = new ArrayList<>(); - allocateFromNumbers( newRecords, prependNodeId( nodeRecord.getLongId(), new long[]{42l} ), + allocateFromNumbers( newRecords, prependNodeId( nodeRecord.getId(), new long[]{42l} ), iterator( record ), new PreAllocatedRecords( 60 ) ); nodeRecord.setLabelField( dynamicPointer( newRecords ), newRecords ); @@ -750,7 +750,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, DynamicRecord record1 = inUse( new DynamicRecord( next.nodeLabel() ) ); DynamicRecord record2 = inUse( new DynamicRecord( next.nodeLabel() ) ); DynamicRecord record3 = inUse( new DynamicRecord( next.nodeLabel() ) ); - labels[0] = nodeRecord.getLongId(); // the first id should not be a label id, but the id of the node + labels[0] = nodeRecord.getId(); // the first id should not be a label id, but the id of the node PreAllocatedRecords allocator = new PreAllocatedRecords( 60 ); allocateFromNumbers( chain, labels, iterator( record1, record2, record3 ), allocator ); @@ -778,7 +778,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, DynamicRecord record = inUse( new DynamicRecord( next.nodeLabel() ) ); Collection newRecords = new ArrayList<>(); allocateFromNumbers( newRecords, - prependNodeId( nodeRecord.getLongId(), new long[]{42l, 42l} ), + prependNodeId( nodeRecord.getId(), new long[]{42l, 42l} ), iterator( record ), new PreAllocatedRecords( 60 ) ); nodeRecord.setLabelField( dynamicPointer( newRecords ), newRecords ); diff --git a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/store/RecordAccessStub.java b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/store/RecordAccessStub.java index f8f62e8089525..5c78bae6b8520 100644 --- a/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/store/RecordAccessStub.java +++ b/community/consistency-check-legacy/src/test/java/org/neo4j/legacy/consistency/store/RecordAccessStub.java @@ -234,13 +234,13 @@ R get( Delta delta ) private static R add( Map> records, R record ) { - records.put( record.getLongId(), new Delta<>( record ) ); + records.put( record.getId(), new Delta<>( record ) ); return record; } private static void add( Map> records, R oldRecord, R newRecord ) { - records.put( newRecord.getLongId(), new Delta<>( oldRecord, newRecord ) ); + records.put( newRecord.getId(), new Delta<>( oldRecord, newRecord ) ); } public DynamicRecord addSchema( DynamicRecord schema ) diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java index 0d14c0a628f58..973200cde0a99 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/NodeDynamicLabelOrphanChainStartCheck.java @@ -57,7 +57,7 @@ public void checkReference( DynamicRecord record, NodeRecord nodeRecord, { // if this node record is in use but doesn't point to the dynamic label record // that label record has an invalid owner - long recordId = record.getLongId(); + long recordId = record.getId(); if ( fieldPointsToDynamicRecordOfLabels( nodeRecord.getLabelField() ) ) { long dynamicLabelRecordId = firstDynamicLabelRecordId( nodeRecord.getLabelField() ); diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/CountsBuilderDecorator.java b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/CountsBuilderDecorator.java index 07202411e8317..a09db2817c87b 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/CountsBuilderDecorator.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/CountsBuilderDecorator.java @@ -344,12 +344,12 @@ public boolean test( T record ) { return false; } - if ( record.getLongId() == terminationId ) + if ( record.getId() == terminationId ) { done = true; return true; } - if ( record.getLongId() == 0 ) + if ( record.getId() == 0 ) { if ( started ) { diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/DynamicOwner.java b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/DynamicOwner.java index ba8c209fc26a9..95bcf9d1a2608 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/DynamicOwner.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/checking/full/DynamicOwner.java @@ -193,7 +193,7 @@ static class PropertyKey extends NameOwner record( RecordAccess records ) return skipReference(); } + @Override public void checkOrphanage() { PendingReferenceCheck reporter = pop(); diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/repair/RecordSet.java b/community/consistency-check/src/main/java/org/neo4j/consistency/repair/RecordSet.java index 36b0a9d2407dd..392cd8969897f 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/repair/RecordSet.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/repair/RecordSet.java @@ -23,11 +23,11 @@ import java.util.Iterator; import java.util.Map; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; -class RecordSet implements Iterable +class RecordSet implements Iterable { - private Map map = new HashMap(); + private final Map map = new HashMap(); void add( R record ) { @@ -84,7 +84,7 @@ public String toString() return builder.append( "]\n" ).toString(); } - public static RecordSet asSet( R... records ) + public static RecordSet asSet( R... records ) { RecordSet set = new RecordSet(); for ( R record : records ) diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReporter.java b/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReporter.java index 9764e63a6b3e0..e598453930e22 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReporter.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/report/ConsistencyReporter.java @@ -341,7 +341,7 @@ public ReportHandler( InconsistencyReport report, ProxyFactory factory, @Override long recordId() { - return record.getLongId(); + return record.getId(); } @Override @@ -394,7 +394,7 @@ private DiffReportHandler( InconsistencyReport report, ProxyFactory fact @Override long recordId() { - return newRecord.getLongId(); + return newRecord.getId(); } @Override diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/CountsEntry.java b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/CountsEntry.java index f8ee22f6c19ca..62554a6245f58 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/CountsEntry.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/CountsEntry.java @@ -36,10 +36,12 @@ public class CountsEntry extends AbstractBaseRecord // ========= TRANSITIONAL CONSTRUCTORS ============= public CountsEntry() { + super( -1 ); } public CountsEntry( CountsKey key, long count ) { + super( -1 ); initialize( key, count ); } // ========= TRANSITIONAL CONSTRUCTORS ============= @@ -73,7 +75,7 @@ public void setId( long id ) } @Override - public long getLongId() + public long getId() { throw new UnsupportedOperationException(); } diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/IndexEntry.java b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/IndexEntry.java index 3ab2a3c3e7dc3..fcbd7e93077ee 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/IndexEntry.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/IndexEntry.java @@ -19,13 +19,13 @@ */ package org.neo4j.consistency.store.synthetic; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; /** * Synthetic record type that stands in for a real record to fit in conveniently * with consistency checking */ -public class IndexEntry extends Abstract64BitRecord +public class IndexEntry extends AbstractBaseRecord { public IndexEntry( long nodeId ) { diff --git a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/LabelScanDocument.java b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/LabelScanDocument.java index af2e41bc382d6..fd7d82881f7a5 100644 --- a/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/LabelScanDocument.java +++ b/community/consistency-check/src/main/java/org/neo4j/consistency/store/synthetic/LabelScanDocument.java @@ -20,13 +20,13 @@ package org.neo4j.consistency.store.synthetic; import org.neo4j.kernel.api.labelscan.NodeLabelRange; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; /** * Synthetic record type that stands in for a real record to fit in conveniently * with consistency checking */ -public class LabelScanDocument extends Abstract64BitRecord +public class LabelScanDocument extends AbstractBaseRecord { private NodeLabelRange nodeLabelRange; diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/TransactionWriter.java b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/TransactionWriter.java index 414f5c5fb0607..f4db88f1703b8 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/TransactionWriter.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/TransactionWriter.java @@ -107,13 +107,13 @@ public void create( NodeRecord node ) public void create( LabelTokenRecord labelToken ) { labelToken.setCreated(); - update( new LabelTokenRecord( labelToken.getId() ), labelToken ); + update( new LabelTokenRecord( labelToken.getIntId() ), labelToken ); } public void create( PropertyKeyTokenRecord token ) { token.setCreated(); - update( new PropertyKeyTokenRecord( token.getId() ), token ); + update( new PropertyKeyTokenRecord( token.getIntId() ), token ); } public void create( RelationshipGroupRecord group ) @@ -193,7 +193,7 @@ public void delete( RelationshipRecord record ) public void create( PropertyRecord property ) { property.setCreated(); - PropertyRecord before = new PropertyRecord( property.getLongId() ); + PropertyRecord before = new PropertyRecord( property.getId() ); if ( property.isNodeSet() ) { before.setNodeId( property.getNodeId() ); diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/ExecutionOrderIntegrationTest.java b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/ExecutionOrderIntegrationTest.java index b3570c158efc3..a41096951de97 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/ExecutionOrderIntegrationTest.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/ExecutionOrderIntegrationTest.java @@ -156,7 +156,7 @@ void log( PendingReferenceCheck check, InvocationOnMock invocation ) { AbstractBaseRecord record = (AbstractBaseRecord) arg; entry.append( ',' ).append( record.getClass().getSimpleName() ) - .append( '[' ).append( record.getLongId() ).append( ']' ); + .append( '[' ).append( record.getId() ).append( ']' ); } } String message = entry.append( ')' ).toString(); diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java index 14e2945372cd2..5fd83acb25f29 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/checking/full/FullCheckIntegrationTest.java @@ -341,7 +341,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, NodeRecord nodeRecord = new NodeRecord( next.node(), false, -1, -1 ); DynamicRecord record = inUse( new DynamicRecord( next.nodeLabel() ) ); Collection newRecords = new ArrayList<>(); - allocateFromNumbers( newRecords, prependNodeId( nodeRecord.getLongId(), new long[]{42l} ), + allocateFromNumbers( newRecords, prependNodeId( nodeRecord.getId(), new long[]{42l} ), iterator( record ), new PreAllocatedRecords( 60 ) ); nodeRecord.setLabelField( dynamicPointer( newRecords ), newRecords ); @@ -791,7 +791,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, DynamicRecord record1 = inUse( new DynamicRecord( next.nodeLabel() ) ); DynamicRecord record2 = inUse( new DynamicRecord( next.nodeLabel() ) ); DynamicRecord record3 = inUse( new DynamicRecord( next.nodeLabel() ) ); - labels[0] = nodeRecord.getLongId(); // the first id should not be a label id, but the id of the node + labels[0] = nodeRecord.getId(); // the first id should not be a label id, but the id of the node PreAllocatedRecords allocator = new PreAllocatedRecords( 60 ); allocateFromNumbers( chain, labels, iterator( record1, record2, record3 ), allocator ); @@ -819,7 +819,7 @@ protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, DynamicRecord record = inUse( new DynamicRecord( next.nodeLabel() ) ); Collection newRecords = new ArrayList<>(); allocateFromNumbers( newRecords, - prependNodeId( nodeRecord.getLongId(), new long[]{42l, 42l} ), + prependNodeId( nodeRecord.getId(), new long[]{42l, 42l} ), iterator( record ), new PreAllocatedRecords( 60 ) ); nodeRecord.setLabelField( dynamicPointer( newRecords ), newRecords ); diff --git a/community/consistency-check/src/test/java/org/neo4j/consistency/store/RecordAccessStub.java b/community/consistency-check/src/test/java/org/neo4j/consistency/store/RecordAccessStub.java index a0f9d9712e943..56183571e0cf0 100644 --- a/community/consistency-check/src/test/java/org/neo4j/consistency/store/RecordAccessStub.java +++ b/community/consistency-check/src/test/java/org/neo4j/consistency/store/RecordAccessStub.java @@ -272,13 +272,13 @@ R get( Delta delta ) private static R add( Map> records, R record ) { - records.put( record.getLongId(), new Delta<>( record ) ); + records.put( record.getId(), new Delta<>( record ) ); return record; } private static void add( Map> records, R oldRecord, R newRecord ) { - records.put( newRecord.getLongId(), new Delta<>( oldRecord, newRecord ) ); + records.put( newRecord.getId(), new Delta<>( oldRecord, newRecord ) ); } public DynamicRecord addSchema( DynamicRecord schema ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/CommonAbstractStore.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/CommonAbstractStore.java index 644dad7e2dd5a..27a82aa3b3772 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/CommonAbstractStore.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/CommonAbstractStore.java @@ -828,6 +828,7 @@ public long getHighestPossibleIdInUse() * * @param highId The highest id in use to set. */ + @Override public void setHighestPossibleIdInUse( long highId ) { setHighId( highId + 1 ); @@ -987,7 +988,7 @@ protected void readRecordWithRetry( PageCursor cursor, long id, RECORD record, R @Override public void updateRecord( RECORD record ) { - long id = record.getLongId(); + long id = record.getId(); long pageId = pageIdForRecord( id ); int offset = offsetForId( id ); try ( PageCursor cursor = storeFile.io( pageId, PF_SHARED_WRITE_LOCK ) ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/RecordStore.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/RecordStore.java index eb740a26407b5..4c7b1f16f0101 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/RecordStore.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/RecordStore.java @@ -448,7 +448,7 @@ private void apply( RecordStore store, Progres } store.accept( this, record ); - progressListener.set( record.getLongId() ); + progressListener.set( record.getId() ); } progressListener.done(); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/TokenStore.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/TokenStore.java index 0ea27f63fce97..3f46096193a7c 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/TokenStore.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/TokenStore.java @@ -106,7 +106,7 @@ public List getTokens( int maxCount ) public TOKEN getToken( int id ) { RECORD record = getRecord( id, newRecord(), NORMAL ); - return tokenFactory.newToken( getStringFor( record ), record.getId() ); + return tokenFactory.newToken( getStringFor( record ), record.getIntId() ); } public Collection allocateNameRecords( byte[] chars ) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/Abstract64BitRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/Abstract64BitRecord.java deleted file mode 100644 index 2d00192fa1e2d..0000000000000 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/Abstract64BitRecord.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2002-2016 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.kernel.impl.store.record; - -public abstract class Abstract64BitRecord extends AbstractBaseRecord -{ - private long id; - - public Abstract64BitRecord( long id ) - { - this.id = id; - clear(); - } - - @Override - protected Abstract64BitRecord initialize( boolean inUse ) - { - super.initialize( inUse ); - return this; - } - - public long getId() - { - return id; - } - - @Override - public void setId( long id ) - { - this.id = id; - } - - @Override - public long getLongId() - { - return getId(); - } -} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractBaseRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractBaseRecord.java index 0c4b848c7c878..338512df3f4e8 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractBaseRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractBaseRecord.java @@ -30,9 +30,16 @@ */ public abstract class AbstractBaseRecord implements CloneableInPublic { + private long id; private boolean inUse; private boolean created; + protected AbstractBaseRecord( long id ) + { + this.id = id; + clear(); + } + protected AbstractBaseRecord initialize( boolean inUse ) { this.inUse = inUse; @@ -52,9 +59,20 @@ public void clear() created = false; } - public abstract long getLongId(); + public long getId() + { + return id; + } + + public int getIntId() + { + return Math.toIntExact( id ); + } - public abstract void setId( long id ); + public void setId( long id ) + { + this.id = id; + } public final boolean inUse() { @@ -79,7 +97,6 @@ public final boolean isCreated() @Override public int hashCode() { - long id = getLongId(); return (int) (( id >>> 32 ) ^ id ); } @@ -93,7 +110,7 @@ public boolean equals( Object obj ) if ( getClass() != obj.getClass() ) return false; AbstractBaseRecord other = (AbstractBaseRecord) obj; - if ( getLongId() != other.getLongId() ) + if ( id != other.id ) return false; return true; } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractRecord.java deleted file mode 100644 index d52a3ccc28886..0000000000000 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/AbstractRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2002-2016 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.kernel.impl.store.record; - -import org.neo4j.unsafe.impl.batchimport.Utils; - -public abstract class AbstractRecord extends AbstractBaseRecord -{ - private int id; - - public AbstractRecord( int id ) - { - this.id = id; - clear(); - } - - public int getId() - { - return id; - } - - @Override - public void setId( long id ) - { - this.id = Utils.safeCastLongToInt( id ); - } - - @Override - public long getLongId() - { - return id; - } -} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/DynamicRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/DynamicRecord.java index e47d531e32039..d1499ef40e3f0 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/DynamicRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/DynamicRecord.java @@ -22,7 +22,7 @@ import org.neo4j.kernel.impl.store.PropertyStore; import org.neo4j.kernel.impl.store.PropertyType; -public class DynamicRecord extends Abstract64BitRecord +public class DynamicRecord extends AbstractBaseRecord { private static final byte[] NO_DATA = new byte[0]; private static final int MAX_BYTES_IN_TO_STRING = 8, MAX_CHARS_IN_TO_STRING = 16; @@ -176,7 +176,7 @@ public String toString() @Override public DynamicRecord clone() { - DynamicRecord clone = new DynamicRecord( getLongId() ).initialize( inUse(), + DynamicRecord clone = new DynamicRecord( getId() ).initialize( inUse(), startRecord, nextBlock, type, length ); if ( data != null ) { diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/LabelTokenRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/LabelTokenRecord.java index 6db7698536cd3..b124776780c75 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/LabelTokenRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/LabelTokenRecord.java @@ -42,7 +42,7 @@ protected String simpleName() @Override public LabelTokenRecord clone() { - LabelTokenRecord labelTokenRecord = new LabelTokenRecord( getId() ); + LabelTokenRecord labelTokenRecord = new LabelTokenRecord( getIntId() ); labelTokenRecord.setInUse( inUse() ); if ( isCreated() ) { diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/NeoStoreActualRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/NeoStoreActualRecord.java index e1fe80282e862..b6e0b691765ac 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/NeoStoreActualRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/NeoStoreActualRecord.java @@ -19,7 +19,7 @@ */ package org.neo4j.kernel.impl.store.record; -public class NeoStoreActualRecord extends Abstract64BitRecord +public class NeoStoreActualRecord extends AbstractBaseRecord { private long value; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PrimitiveRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PrimitiveRecord.java index 4b5306d5a297e..e5a4c1f2644cf 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PrimitiveRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PrimitiveRecord.java @@ -19,7 +19,7 @@ */ package org.neo4j.kernel.impl.store.record; -public abstract class PrimitiveRecord extends Abstract64BitRecord +public abstract class PrimitiveRecord extends AbstractBaseRecord { protected long nextProp; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyKeyTokenRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyKeyTokenRecord.java index 7e02cc76ec645..f120abb9584cf 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyKeyTokenRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyKeyTokenRecord.java @@ -74,7 +74,7 @@ protected void additionalToString( StringBuilder buf ) @Override public PropertyKeyTokenRecord clone() { - PropertyKeyTokenRecord propertyKeyTokenRecord = new PropertyKeyTokenRecord( getId() ); + PropertyKeyTokenRecord propertyKeyTokenRecord = new PropertyKeyTokenRecord( getIntId() ); propertyKeyTokenRecord.setInUse( inUse() ); if ( isCreated() ) { diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyRecord.java index 1b5dd7e748cc1..c0a21f8cb2a74 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/PropertyRecord.java @@ -38,7 +38,7 @@ * variable length, a full PropertyRecord can be holding just one * PropertyBlock. */ -public class PropertyRecord extends Abstract64BitRecord implements Iterable, Iterator +public class PropertyRecord extends AbstractBaseRecord implements Iterable, Iterator { private static final byte TYPE_NODE = 1; private static final byte TYPE_REL = 2; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipGroupRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipGroupRecord.java index e5fc370d954ad..b0fc61f6200bf 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipGroupRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipGroupRecord.java @@ -23,7 +23,7 @@ import java.util.Objects; -public class RelationshipGroupRecord extends Abstract64BitRecord +public class RelationshipGroupRecord extends AbstractBaseRecord { private int type; private long next; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipTypeTokenRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipTypeTokenRecord.java index 17cc5c19bd1d6..1b7c544eb9c77 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipTypeTokenRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/RelationshipTypeTokenRecord.java @@ -42,7 +42,7 @@ protected String simpleName() @Override public RelationshipTypeTokenRecord clone() { - RelationshipTypeTokenRecord relationshipTypeTokenRecord = new RelationshipTypeTokenRecord( getId() ); + RelationshipTypeTokenRecord relationshipTypeTokenRecord = new RelationshipTypeTokenRecord( getIntId() ); relationshipTypeTokenRecord.setInUse( inUse() ); if ( isCreated() ) { diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/SchemaRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/SchemaRecord.java index 249044e1dac4a..7b8327ea76c52 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/SchemaRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/SchemaRecord.java @@ -26,7 +26,7 @@ import static org.neo4j.kernel.impl.store.record.Record.NULL_REFERENCE; -public class SchemaRecord extends Abstract64BitRecord implements Iterable +public class SchemaRecord extends AbstractBaseRecord implements Iterable { private Collection records; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/TokenRecord.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/TokenRecord.java index 81e91b9b0f11a..e04993ba2c368 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/TokenRecord.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/store/record/TokenRecord.java @@ -23,7 +23,7 @@ import java.util.Collection; import java.util.List; -public abstract class TokenRecord extends AbstractRecord +public abstract class TokenRecord extends AbstractBaseRecord { private int nameId; private List nameRecords; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/Command.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/Command.java index 5b5eb5cd3170a..8ae12341787c1 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/Command.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/Command.java @@ -23,7 +23,6 @@ import java.util.Collection; import org.neo4j.kernel.impl.api.CommandVisitor; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.DynamicRecord; import org.neo4j.kernel.impl.store.record.LabelTokenRecord; @@ -170,7 +169,7 @@ void writeDynamicRecord( WritableChannel channel, DynamicRecord record ) throws } } - public static abstract class BaseCommand extends Command + public static abstract class BaseCommand extends Command { protected final RECORD before; protected final RECORD after; @@ -488,7 +487,7 @@ public boolean handle( CommandVisitor handler ) throws IOException public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.PROP_INDEX_COMMAND ); - channel.putInt( after.getId() ); + channel.putInt( after.getIntId() ); writePropertyKeyTokenRecord( channel, before ); writePropertyKeyTokenRecord( channel, after ); } @@ -529,7 +528,7 @@ public boolean handle( CommandVisitor handler ) throws IOException public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.REL_TYPE_COMMAND ); - channel.putInt( after.getId() ); + channel.putInt( after.getIntId() ); writeRelationshipTypeTokenRecord( channel, before ); writeRelationshipTypeTokenRecord( channel, after ); } @@ -569,7 +568,7 @@ public boolean handle( CommandVisitor handler ) throws IOException public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.LABEL_KEY_COMMAND ); - channel.putInt( after.getId() ); + channel.putInt( after.getIntId() ); writeLabelTokenRecord( channel, before ); writeLabelTokenRecord( channel, after ); } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/HighIdTransactionApplier.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/HighIdTransactionApplier.java index 2c70d7189e437..caca30cd5c123 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/HighIdTransactionApplier.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/command/HighIdTransactionApplier.java @@ -31,7 +31,7 @@ import org.neo4j.kernel.impl.store.RecordStore; import org.neo4j.kernel.impl.store.SchemaStore; import org.neo4j.kernel.impl.store.TokenStore; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.DynamicRecord; import org.neo4j.kernel.impl.store.record.PropertyBlock; import org.neo4j.kernel.impl.store.record.TokenRecord; @@ -163,9 +163,9 @@ private void track( RecordStore store, Command command ) track( store, command.getKey() ); } - private void track( RecordStore store, Collection records ) + private void track( RecordStore store, Collection records ) { - for ( Abstract64BitRecord record : records ) + for ( AbstractBaseRecord record : records ) { track( store, record.getId() ); } diff --git a/community/kernel/src/main/java/org/neo4j/unsafe/impl/batchimport/store/BatchingTokenRepository.java b/community/kernel/src/main/java/org/neo4j/unsafe/impl/batchimport/store/BatchingTokenRepository.java index 6dd082f851cd3..adc480702f899 100644 --- a/community/kernel/src/main/java/org/neo4j/unsafe/impl/batchimport/store/BatchingTokenRepository.java +++ b/community/kernel/src/main/java/org/neo4j/unsafe/impl/batchimport/store/BatchingTokenRepository.java @@ -142,7 +142,7 @@ protected RECORD createRecord( Integer key, Void additionalData ) for ( RECORD record : recordAccess.records() ) { store.updateRecord( record ); - highestId = max( highestId, record.getId() ); + highestId = max( highestId, record.getIntId() ); } store.setHighestPossibleIdInUse( highestId ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/RecordStoreConsistentReadTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/RecordStoreConsistentReadTest.java index f8fa41cf1104a..ae9faf9e8474b 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/RecordStoreConsistentReadTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/RecordStoreConsistentReadTest.java @@ -252,7 +252,7 @@ protected void assertRecordsEqual( RelationshipRecord actualRecord, Relationship assertThat( "isFirstInFirstChain", actualRecord.isFirstInFirstChain(), is( expectedRecord.isFirstInFirstChain() ) ); assertThat( "isFirstInSecondChain", actualRecord.isFirstInSecondChain(), is( expectedRecord.isFirstInSecondChain() ) ); assertThat( "getId", actualRecord.getId(), is( expectedRecord.getId() ) ); - assertThat( "getLongId", actualRecord.getLongId(), is( expectedRecord.getLongId() ) ); + assertThat( "getLongId", actualRecord.getId(), is( expectedRecord.getId() ) ); assertThat( "getNextProp", actualRecord.getNextProp(), is( expectedRecord.getNextProp() ) ); assertThat( "inUse", actualRecord.inUse(), is( expectedRecord.inUse() ) ); } @@ -325,7 +325,7 @@ protected void assertRecordsEqual( LabelTokenRecord actualRecord, LabelTokenReco assertNotNull( "expectedRecord", expectedRecord ); assertThat( "getNameId", actualRecord.getNameId(), is( expectedRecord.getNameId() ) ); assertThat( "getId", actualRecord.getId(), is( expectedRecord.getId() ) ); - assertThat( "getLongId", actualRecord.getLongId(), is( expectedRecord.getLongId() ) ); + assertThat( "getLongId", actualRecord.getId(), is( expectedRecord.getId() ) ); assertThat( "isLight", actualRecord.isLight(), is( expectedRecord.isLight() ) ); Collection actualNameRecords = actualRecord.getNameRecords(); @@ -344,7 +344,7 @@ protected void assertRecordsEqual( LabelTokenRecord actualRecord, LabelTokenReco assertThat( "[" + i + "]getNextBlock", actualNameRecord.getNextBlock(), is( expectedNameRecord.getNextBlock() ) ); assertThat( "[" + i + "]getType", actualNameRecord.getType(), is( expectedNameRecord.getType() ) ); assertThat( "[" + i + "]getId", actualNameRecord.getId(), is( expectedNameRecord.getId() ) ); - assertThat( "[" + i + "]getLongId", actualNameRecord.getLongId(), is( expectedNameRecord.getLongId() ) ); + assertThat( "[" + i + "]getLongId", actualNameRecord.getId(), is( expectedNameRecord.getId() ) ); assertThat( "[" + i + "]isStartRecord", actualNameRecord.isStartRecord(), is( expectedNameRecord.isStartRecord() ) ); assertThat( "[" + i + "]inUse", actualNameRecord.inUse(), is( expectedNameRecord.inUse() ) ); i++; @@ -401,7 +401,7 @@ protected void assertRecordsEqual( DynamicRecord actualRecord, DynamicRecord exp assertThat( "getNextBlock", actualRecord.getNextBlock(), is( expectedRecord.getNextBlock() ) ); assertThat( "getType", actualRecord.getType(), is( expectedRecord.getType() ) ); assertThat( "getId", actualRecord.getId(), is( expectedRecord.getId() ) ); - assertThat( "getLongId", actualRecord.getLongId(), is( expectedRecord.getLongId() ) ); + assertThat( "getLongId", actualRecord.getId(), is( expectedRecord.getId() ) ); assertThat( "isStartRecord", actualRecord.isStartRecord(), is( expectedRecord.isStartRecord() ) ); } } @@ -493,7 +493,7 @@ protected void assertRecordsEqual( PropertyRecord actualRecord, PropertyRecord e assertThat( "getPrevProp", actualRecord.getPrevProp(), is( expectedRecord.getPrevProp() ) ); assertThat( "getRelId", actualRecord.getRelId(), is( expectedRecord.getRelId() ) ); assertThat( "getId", actualRecord.getId(), is( expectedRecord.getId() ) ); - assertThat( "getLongId", actualRecord.getLongId(), is( expectedRecord.getLongId() ) ); + assertThat( "getLongId", actualRecord.getId(), is( expectedRecord.getId() ) ); List actualBlocks = asList( (Iterable) actualRecord ); List expectedBlocks = asList( (Iterable) expectedRecord ); @@ -533,7 +533,7 @@ private void assertPropertyBlocksEqual( int index, PropertyBlock actualBlock, Pr assertThat( "[" + index + "]getValueRecords[" + i + "]getNextBlock", actualValueRecord.getNextBlock(), is( expectedValueRecord.getNextBlock() ) ); assertThat( "[" + index + "]getValueRecords[" + i + "]getType", actualValueRecord.getType(), is( expectedValueRecord.getType() ) ); assertThat( "[" + index + "]getValueRecords[" + i + "]getId", actualValueRecord.getId(), is( expectedValueRecord.getId() ) ); - assertThat( "[" + index + "]getValueRecords[" + i + "]getLongId", actualValueRecord.getLongId(), is( expectedValueRecord.getLongId() ) ); + assertThat( "[" + index + "]getValueRecords[" + i + "]getLongId", actualValueRecord.getId(), is( expectedValueRecord.getId() ) ); assertThat( "[" + index + "]getValueRecords[" + i + "]isStartRecord", actualValueRecord.isStartRecord(), is( expectedValueRecord.isStartRecord() ) ); assertThat( "[" + index + "]getValueRecords[" + i + "]inUse", actualValueRecord.inUse(), is( expectedValueRecord.inUse() ) ); } diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/RecordFormatTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/RecordFormatTest.java index 6d48cdf41356d..285f3c1464d5e 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/RecordFormatTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/store/format/RecordFormatTest.java @@ -412,7 +412,7 @@ private void verifyWriteAndRead( Supplier RECORD inUse( RECORD record ) + private RECORD inUse( RECORD record ) { record.setInUse( true ); return record; } - private RECORD created( RECORD record ) + private RECORD created( RECORD record ) { record.setCreated(); return record; diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java index 7bdb0a3f65007..fbe17fcbb7628 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/state/NodeLabelsFieldTest.java @@ -285,7 +285,7 @@ public void shouldReadIdOfDynamicRecordFromDynamicLabelsField() throws Exception long dynRecordId = NodeLabelsField.firstDynamicLabelRecordId( node.getLabelField() ); // THEN - assertEquals( dynamicRecord.getLongId(), dynRecordId ); + assertEquals( dynamicRecord.getId(), dynRecordId ); } @Test diff --git a/enterprise/core-edge/src/main/java/org/neo4j/coreedge/raft/replication/token/ReplicatedTokenHolder.java b/enterprise/core-edge/src/main/java/org/neo4j/coreedge/raft/replication/token/ReplicatedTokenHolder.java index 5ef12f9a42ffd..c0beeff7b1729 100644 --- a/enterprise/core-edge/src/main/java/org/neo4j/coreedge/raft/replication/token/ReplicatedTokenHolder.java +++ b/enterprise/core-edge/src/main/java/org/neo4j/coreedge/raft/replication/token/ReplicatedTokenHolder.java @@ -275,7 +275,7 @@ private int extractTokenId( Collection commands ) throws NoSuchE { if( command instanceof Command.TokenCommand ) { - return ((Command.TokenCommand) command).getAfter().getId(); + return ((Command.TokenCommand) command).getAfter().getIntId(); } } throw new NoSuchEntryException( "Expected command not found" ); diff --git a/tools/src/main/java/org/neo4j/tools/txlog/CheckTxLogs.java b/tools/src/main/java/org/neo4j/tools/txlog/CheckTxLogs.java index 78d9514f8f80a..aea0caca81cc7 100644 --- a/tools/src/main/java/org/neo4j/tools/txlog/CheckTxLogs.java +++ b/tools/src/main/java/org/neo4j/tools/txlog/CheckTxLogs.java @@ -30,7 +30,7 @@ import org.neo4j.helpers.Args; import org.neo4j.io.fs.DefaultFileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.storemigration.LogFiles; import org.neo4j.kernel.impl.transaction.command.Command; import org.neo4j.kernel.impl.transaction.log.LogEntryCursor; @@ -104,7 +104,7 @@ class CommandAndLogVersion } } - private void scan( + private void scan( File[] logs, InconsistenciesHandler handler, CheckType check ) throws IOException { System.out.println( "Checking logs for " + check.name() + " inconsistencies" ); @@ -156,7 +156,7 @@ else if ( entry instanceof LogEntryCommit ) } } - private void checkAndHandleInconsistencies( CommandAndLogVersion txCommand, CheckType check, + private void checkAndHandleInconsistencies( CommandAndLogVersion txCommand, CheckType check, CommittedRecords state, long txId, InconsistenciesHandler handler ) { C command = check.commandClass().cast( txCommand.command ); diff --git a/tools/src/main/java/org/neo4j/tools/txlog/CommittedRecords.java b/tools/src/main/java/org/neo4j/tools/txlog/CommittedRecords.java index af1c98a393dd9..10fb2317e5b43 100644 --- a/tools/src/main/java/org/neo4j/tools/txlog/CommittedRecords.java +++ b/tools/src/main/java/org/neo4j/tools/txlog/CommittedRecords.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.Map; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.NodeRecord; import org.neo4j.kernel.impl.store.record.PropertyRecord; import org.neo4j.tools.txlog.checktypes.CheckType; @@ -35,7 +35,7 @@ * * @param the type of the record */ -class CommittedRecords +class CommittedRecords { private final CheckType checkType; private final Map> recordsById; diff --git a/tools/src/main/java/org/neo4j/tools/txlog/RecordInfo.java b/tools/src/main/java/org/neo4j/tools/txlog/RecordInfo.java index ddc2d1b4398e3..0afba154f509a 100644 --- a/tools/src/main/java/org/neo4j/tools/txlog/RecordInfo.java +++ b/tools/src/main/java/org/neo4j/tools/txlog/RecordInfo.java @@ -19,7 +19,7 @@ */ package org.neo4j.tools.txlog; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.NodeRecord; import org.neo4j.kernel.impl.store.record.PropertyRecord; @@ -29,7 +29,7 @@ * * @param the type of the record */ -public class RecordInfo +public class RecordInfo { private final R record; private final long logVersion; diff --git a/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckType.java b/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckType.java index 999ec40ee30dc..748a0d0b5bf2b 100644 --- a/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckType.java +++ b/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckType.java @@ -19,7 +19,7 @@ */ package org.neo4j.tools.txlog.checktypes; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.transaction.command.Command; import org.neo4j.kernel.impl.transaction.command.Command.NodeCommand; import org.neo4j.kernel.impl.transaction.command.Command.PropertyCommand; @@ -27,13 +27,13 @@ /** * Type of command ({@link NodeCommand}, {@link PropertyCommand}, ...) to check during transaction log verification. * This class exists to mitigate the absence of interfaces for commands with before and after state. - * It also provides an alternative equality check instead of {@link Abstract64BitRecord#equals(Object)} that only - * checks {@linkplain Abstract64BitRecord#getLongId() entity id}. + * It also provides an alternative equality check instead of {@link AbstractBaseRecord#equals(Object)} that only + * checks {@linkplain AbstractBaseRecord#getId() entity id}. * * @param the type of command to check * @param the type of records that this command contains */ -public abstract class CheckType +public abstract class CheckType { private final Class recordClass; diff --git a/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckTypes.java b/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckTypes.java index bd56939686c1b..c58dd0ddcd5f8 100644 --- a/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckTypes.java +++ b/tools/src/main/java/org/neo4j/tools/txlog/checktypes/CheckTypes.java @@ -19,7 +19,7 @@ */ package org.neo4j.tools.txlog.checktypes; -import org.neo4j.kernel.impl.store.record.Abstract64BitRecord; +import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.transaction.command.Command; public class CheckTypes @@ -31,10 +31,10 @@ public class CheckTypes public static final NeoStoreCheckType NEO_STORE = new NeoStoreCheckType(); @SuppressWarnings( "unchecked" ) - public static final CheckType[] CHECK_TYPES = + public static final CheckType[] CHECK_TYPES = new CheckType[]{NODE, PROPERTY, RELATIONSHIP, RELATIONSHIP_GROUP, NEO_STORE}; - public static CheckType fromName( String name ) + public static CheckType fromName( String name ) { for ( CheckType checkType : CHECK_TYPES ) {