@Override public TransactionApplier startTx( CommandsToApply transaction ) { return new HighIdTransactionApplier( neoStores ); } }
private void track( RecordStore<?> store, Collection<? extends AbstractBaseRecord> records ) { for ( AbstractBaseRecord record : records ) { track( store, record ); } }
@Override public boolean visitRelationshipTypeTokenCommand( RelationshipTypeTokenCommand command ) { trackToken( neoStores.getRelationshipTypeTokenStore(), command ); return false; }
HighIdTransactionApplier tracker = new HighIdTransactionApplier( neoStores ); tracker.visitNodeCommand( Commands.createNode( 10, 2, 3 ) ); tracker.visitNodeCommand( Commands.createNode( 20, 4, 5 ) ); tracker.visitRelationshipCommand( Commands.createRelationship( 4, 10, 20, 0 ) ); tracker.visitRelationshipCommand( Commands.createRelationship( 45, 10, 20, 1 ) ); tracker.visitLabelTokenCommand( Commands.createLabelToken( 3, 0 ) ); tracker.visitLabelTokenCommand( Commands.createLabelToken( 5, 1 ) ); tracker.visitPropertyKeyTokenCommand( Commands.createPropertyKeyToken( 3, 0 ) ); tracker.visitPropertyKeyTokenCommand( Commands.createPropertyKeyToken( 5, 1 ) ); tracker.visitRelationshipTypeTokenCommand( Commands.createRelationshipTypeToken( 3, 0 ) ); tracker.visitRelationshipTypeTokenCommand( Commands.createRelationshipTypeToken( 5, 1 ) ); tracker.visitRelationshipGroupCommand( Commands.createRelationshipGroup( 10, 1 ) ); tracker.visitRelationshipGroupCommand( Commands.createRelationshipGroup( 20, 2 ) ); tracker.visitSchemaRuleCommand( Commands.createIndexRule( EMPTY.getProviderDescriptor(), 10, SchemaDescriptorFactory.forLabel( 0, 1 ) ) ); tracker.visitSchemaRuleCommand( Commands.createIndexRule( EMPTY.getProviderDescriptor(), 20, SchemaDescriptorFactory.forLabel( 1, 2 ) ) ); tracker.visitPropertyCommand( Commands.createProperty( 10, PropertyType.STRING, 0, 6, 7 ) ); tracker.visitPropertyCommand( Commands.createProperty( 20, PropertyType.ARRAY, 1, 8, 9 ) ); tracker.close();
HighIdTransactionApplier tracker = new HighIdTransactionApplier( neoStores ); tracker.visitNodeCommand( new NodeCommand( new NodeRecord( node.getId() ), node ) ); tracker.visitRelationshipCommand( new RelationshipCommand( new RelationshipRecord( relationship.getId() ), relationship ) ); tracker.visitRelationshipGroupCommand( new RelationshipGroupCommand( new RelationshipGroupRecord( relationshipGroup.getId() ), relationshipGroup ) ); tracker.close();
@Override public boolean visitRelationshipCommand( RelationshipCommand command ) { track( neoStores.getRelationshipStore(), command ); return false; }
@Override public TransactionApplier startTx( CommandsToApply transaction ) { return new HighIdTransactionApplier( neoStores ); } }
@Override public boolean visitLabelTokenCommand( LabelTokenCommand command ) { trackToken( neoStores.getLabelTokenStore(), command ); return false; }
@Override public boolean visitRelationshipGroupCommand( RelationshipGroupCommand command ) { track( neoStores.getRelationshipGroupStore(), command ); return false; }
@Override public boolean visitPropertyKeyTokenCommand( PropertyKeyTokenCommand command ) { trackToken( neoStores.getPropertyKeyTokenStore(), command ); return false; }
private <RECORD extends AbstractBaseRecord> void track( RecordStore<RECORD> store, BaseCommand<RECORD> command ) { track( store, command.getAfter() ); }
@Override public boolean visitRelationshipTypeTokenCommand( RelationshipTypeTokenCommand command ) { trackToken( neoStores.getRelationshipTypeTokenStore(), command ); return false; }
@Override public boolean visitSchemaRuleCommand( SchemaRuleCommand command ) { SchemaStore schemaStore = neoStores.getSchemaStore(); for ( DynamicRecord record : command.getRecordsAfter() ) { track( schemaStore, record ); } return false; }
@Override public boolean visitPropertyKeyTokenCommand( PropertyKeyTokenCommand command ) { trackToken( neoStores.getPropertyKeyTokenStore(), command ); return false; }
@Override public boolean visitLabelTokenCommand( LabelTokenCommand command ) { trackToken( neoStores.getLabelTokenStore(), command ); return false; }
@Override public boolean visitPropertyCommand( PropertyCommand command ) { PropertyStore propertyStore = neoStores.getPropertyStore(); track( propertyStore, command ); for ( PropertyBlock block : command.getAfter() ) { switch ( block.getType() ) { case STRING: track( propertyStore.getStringStore(), block.getValueRecords() ); break; case ARRAY: track( propertyStore.getArrayStore(), block.getValueRecords() ); break; default: // Not needed, no dynamic records then break; } } return false; }
private void track( RecordStore<?> store, Collection<? extends AbstractBaseRecord> records ) { for ( AbstractBaseRecord record : records ) { track( store, record ); } }
@Override public boolean visitRelationshipCommand( RelationshipCommand command ) { track( neoStores.getRelationshipStore(), command ); return false; }