@Override RecordStore<?> getRecordStore( StoreAccess storeAccess ) { return storeAccess.getRelationshipStore(); } },
@Override public RecordReference<RelationshipRecord> relationship( long id ) { return referenceTo( access.getRelationshipStore(), id ); }
tasks.add( create( CheckStage.Stage2_RS_Labels.name(), nativeStores.getRelationshipStore(), processor, ROUND_ROBIN ) ); multiPass.reDecorateRelationship( processor, RelationshipRecordCheck.relationshipRecordCheckBackwardPass( new PropertyChain<>( mandatoryProperties.forRelationships( reporter ) ) ) ); tasks.add( create( CheckStage.Stage4_RS_NextRel.name(), nativeStores.getRelationshipStore(), processor, ROUND_ROBIN ) ); multiPass.reDecorateRelationship( processor, RelationshipRecordCheck.relationshipRecordCheckSourceChain() ); tasks.add( create( CheckStage.Stage6_RS_Forward.name(), nativeStores.getRelationshipStore(), processor, QueueDistribution.RELATIONSHIPS ) ); multiPass.reDecorateRelationship( processor, RelationshipRecordCheck.relationshipRecordCheckSourceChain() ); tasks.add( create( CheckStage.Stage7_RS_Backward.name(), nativeStores.getRelationshipStore(), processor, QueueDistribution.RELATIONSHIPS ) ); new IterableStore<>( nativeStores.getRelationshipStore(), true ), new RelationshipIndexProcessor( reporter, indexes, propertyReader, relationshipIndexes ), CheckStage.Stage9_RS_Indexes,
@Test public void shouldLoadAllConnectedRelationshipRecordsAndTheirFullChainsOfRelationshipRecords() { // given RecordStore<RelationshipRecord> relationshipStore = store.getRelationshipStore(); // when int relationshipIdInMiddleOfChain = 10; RecordSet<RelationshipRecord> records = new RelationshipChainExplorer( relationshipStore ) .exploreRelationshipRecordChainsToDepthTwo( relationshipStore.getRecord( relationshipIdInMiddleOfChain, relationshipStore.newRecord(), NORMAL ) ); // then assertEquals( degreeTwoNodes * 2, records.size() ); }
@Test public void shouldCopeWithAChainThatReferencesNotInUseZeroValueRecords() { // given RecordStore<RelationshipRecord> relationshipStore = store.getRelationshipStore(); breakTheChain( relationshipStore ); // when int relationshipIdInMiddleOfChain = 10; RecordSet<RelationshipRecord> records = new RelationshipChainExplorer( relationshipStore ) .exploreRelationshipRecordChainsToDepthTwo( relationshipStore.getRecord( relationshipIdInMiddleOfChain, relationshipStore.newRecord(), NORMAL ) ); // then int recordsInaccessibleBecauseOfBrokenChain = 3; assertEquals( degreeTwoNodes * 2 - recordsInaccessibleBecauseOfBrokenChain, records.size() ); }
labelId = (int) stores.getLabelTokenStore().getHighId(); nodeLabelsId = stores.getNodeDynamicLabelStore().getHighId(); relId = stores.getRelationshipStore().getHighId(); relGroupId = stores.getRelationshipGroupStore().getHighId(); propId = (int) stores.getPropertyStore().getHighId();
@Test public void shouldLoadAllConnectedRelationshipRecordsAndTheirFullChainsOfRelationshipRecords() throws Exception { // given RecordStore<RelationshipRecord> relationshipStore = store.getRelationshipStore(); // when int relationshipIdInMiddleOfChain = 10; RecordSet<RelationshipRecord> records = new RelationshipChainExplorer( relationshipStore ) .exploreRelationshipRecordChainsToDepthTwo( relationshipStore.getRecord( relationshipIdInMiddleOfChain ) ); // then assertEquals( NDegreeTwoNodes * 2, records.size() ); }
@Test public void shouldCopeWithAChainThatReferencesNotInUseZeroValueRecords() throws Exception { // given RecordStore<RelationshipRecord> relationshipStore = store.getRelationshipStore(); breakTheChain( relationshipStore ); // when int relationshipIdInMiddleOfChain = 10; RecordSet<RelationshipRecord> records = new RelationshipChainExplorer( relationshipStore ) .exploreRelationshipRecordChainsToDepthTwo( relationshipStore.getRecord( relationshipIdInMiddleOfChain ) ); // then int recordsInaccessibleBecauseOfBrokenChain = 3; assertEquals( NDegreeTwoNodes * 2 - recordsInaccessibleBecauseOfBrokenChain, records.size() ); }
private void generateInitialData() { GraphDatabaseBuilder builder = new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder( directory ); GraphDatabaseAPI graphDb = (GraphDatabaseAPI) builder.newGraphDatabase(); try { generateInitialData( graphDb ); StoreAccess stores = new StoreAccess( graphDb ).initialize(); schemaId = stores.getSchemaStore().getHighId(); nodeId = stores.getNodeStore().getHighId(); labelId = (int) stores.getLabelTokenStore().getHighId(); nodeLabelsId = stores.getNodeDynamicLabelStore().getHighId(); relId = stores.getRelationshipStore().getHighId(); relGroupId = stores.getRelationshipGroupStore().getHighId(); propId = (int) stores.getPropertyStore().getHighId(); stringPropId = stores.getStringStore().getHighId(); arrayPropId = stores.getArrayStore().getHighId(); relTypeId = (int) stores.getRelationshipTypeTokenStore().getHighId(); propKeyId = (int) stores.getPropertyKeyNameStore().getHighId(); } finally { graphDb.shutdown(); } }