use of org.neo4j.kernel.impl.store.PropertyKeyTokenStore in project neo4j by neo4j.
the class PropertyDeduplicator method resolveConflicts.
private void resolveConflicts(final PrimitiveLongObjectMap<List<DuplicateCluster>> duplicateClusters, PropertyStore propertyStore, final NodeStore nodeStore, SchemaStore schemaStore, File storeDir) throws IOException {
if (duplicateClusters.isEmpty()) {
// Happiest of cases.
return;
}
// whose nextProp() is amongst our duplicateClusters is potentially interesting.
if (!isIndexStorageEmpty(storeDir)) {
try (IndexLookup indexLookup = new IndexLookup(schemaStore, schemaIndexProvider);
IndexedConflictsResolver indexedConflictsResolver = new IndexedConflictsResolver(duplicateClusters, indexLookup, nodeStore, propertyStore)) {
if (indexLookup.hasAnyIndexes()) {
nodeStore.scanAllRecords(indexedConflictsResolver);
}
}
}
// Then resolve all duplicateClusters by changing the propertyKey for the first conflicting property block, to
// one that is prefixed with "__DUPLICATE_<key>".
PropertyKeyTokenStore keyTokenStore = propertyStore.getPropertyKeyTokenStore();
NonIndexedConflictResolver resolver = new NonIndexedConflictResolver(keyTokenStore, propertyStore);
duplicateClusters.visitEntries(resolver);
}
Aggregations