use of org.neo4j.kernel.spi.legacyindex.IndexImplementation in project neo4j by neo4j.
the class LegacyIndexTransactionStateImpl method relationshipChanges.
@Override
public LegacyIndex relationshipChanges(String indexName) throws LegacyIndexNotFoundKernelException {
Map<String, String> configuration = indexConfigStore.get(Relationship.class, indexName);
if (configuration == null) {
throw new LegacyIndexNotFoundKernelException("Relationship index '" + indexName + " not found");
}
String providerName = configuration.get(IndexManager.PROVIDER);
IndexImplementation provider = providerLookup.apply(providerName);
LegacyIndexProviderTransaction transaction = transactions.get(providerName);
if (transaction == null) {
transactions.put(providerName, transaction = provider.newTransaction(this));
}
return transaction.relationshipIndex(indexName, configuration);
}
use of org.neo4j.kernel.spi.legacyindex.IndexImplementation in project neo4j by neo4j.
the class RecordStorageEngine method flushAndForce.
@Override
public void flushAndForce(IOLimiter limiter) {
indexingService.forceAll();
labelScanStore.force(limiter);
for (IndexImplementation index : legacyIndexProviderLookup.all()) {
index.force();
}
neoStores.flush(limiter);
}
use of org.neo4j.kernel.spi.legacyindex.IndexImplementation in project neo4j by neo4j.
the class NeoStoreFileListing method gatherLegacyIndexFiles.
private Resource gatherLegacyIndexFiles(Collection<StoreFileMetadata> files) throws IOException {
final Collection<ResourceIterator<File>> snapshots = new ArrayList<>();
for (IndexImplementation indexProvider : legacyIndexProviders.all()) {
ResourceIterator<File> snapshot = indexProvider.listStoreFiles();
snapshots.add(snapshot);
snapshot.stream().map(toNotAStoreTypeFile).collect(Collectors.toCollection(() -> files));
}
// the targetFiles list.
return new MultiResource(snapshots);
}
use of org.neo4j.kernel.spi.legacyindex.IndexImplementation in project neo4j by neo4j.
the class LegacyIndexMigratorTest method logErrorWithIndexNameOnIndexMigrationException.
@Test
public void logErrorWithIndexNameOnIndexMigrationException() throws IOException {
Log log = mock(Log.class);
when(logProvider.getLog(TestLegacyIndexMigrator.class)).thenReturn(log);
HashMap<String, IndexImplementation> indexProviders = getIndexProviders();
try {
LegacyIndexMigrator indexMigrator = new TestLegacyIndexMigrator(fs, indexProviders, logProvider, false);
indexMigrator.migrate(storeDir, migrationDir, progressMonitor, StandardV2_3.STORE_VERSION, StandardV3_0.STORE_VERSION);
fail("Index migration should fail");
} catch (IOException e) {
// ignored
}
verify(log).error(eq("Migration of legacy indexes failed. Index: testIndex can't be migrated."), any(Throwable.class));
}
Aggregations