protected internal RelationshipImporter(BatchingNeoStores stores, IdMapper idMapper, DataStatistics typeDistribution, Monitor monitor, Collector badCollector, bool validateRelationshipData, bool doubleRecordUnits) : base(stores, monitor) { this._doubleRecordUnits = doubleRecordUnits; this._relationshipTypeTokenRepository = stores.RelationshipTypeRepository; this._idMapper = idMapper; this._badCollector = badCollector; this._validateRelationshipData = validateRelationshipData; this._relationshipStore = stores.RelationshipStore; this._relationshipRecord = _relationshipStore.newRecord(); this._relationshipIds = new BatchingIdGetter(_relationshipStore); this._typeCounts = typeDistribution.NewClient(); this._prepareIdSequence = PrepareIdSequence.of(doubleRecordUnits).apply(stores.RelationshipStore); _relationshipRecord.InUse = true; }
private void InstantiateStores() { _neoStores = NewStoreFactory(_databaseLayout).openAllNeoStores(true); _propertyKeyRepository = new BatchingPropertyKeyTokenRepository(_neoStores.PropertyKeyTokenStore); _labelRepository = new BatchingLabelTokenRepository(_neoStores.LabelTokenStore); _relationshipTypeRepository = new BatchingRelationshipTypeTokenRepository(_neoStores.RelationshipTypeTokenStore); _temporaryNeoStores = InstantiateTempStores(); InstantiateKernelExtensions(); // Delete the id generators because makeStoreOk isn't atomic in the sense that there's a possibility of an unlucky timing such // that if the process is killed at the right time some store may end up with a .id file that looks to be CLEAN and has highId=0, // i.e. effectively making the store look empty on the next start. Normal recovery of a db is sort of protected by this recovery // recognizing that the db needs recovery when it looks at the tx log and also calling deleteIdGenerators. In the import case // there are no tx logs at all, and therefore we do this manually right here. _neoStores.deleteIdGenerators(); _temporaryNeoStores.deleteIdGenerators(); _neoStores.makeStoreOk(); _temporaryNeoStores.makeStoreOk(); }