use of org.neo4j.kernel.extension.KernelExtensionFactory in project neo4j by neo4j.
the class GraphDatabaseDependencies method newDependencies.
public static GraphDatabaseDependencies newDependencies() {
List<KernelExtensionFactory<?>> kernelExtensions = new ArrayList<>();
for (KernelExtensionFactory factory : Service.load(KernelExtensionFactory.class)) {
kernelExtensions.add(factory);
}
Map<String, URLAccessRule> urlAccessRules = new HashMap<>();
urlAccessRules.put("http", URLAccessRules.alwaysPermitted());
urlAccessRules.put("https", URLAccessRules.alwaysPermitted());
urlAccessRules.put("ftp", URLAccessRules.alwaysPermitted());
urlAccessRules.put("file", URLAccessRules.fileAccess());
List<QueryEngineProvider> queryEngineProviders = asList(Service.load(QueryEngineProvider.class));
return new GraphDatabaseDependencies(null, null, new ArrayList<>(), kernelExtensions, urlAccessRules, queryEngineProviders);
}
use of org.neo4j.kernel.extension.KernelExtensionFactory in project neo4j by neo4j.
the class LabelScanStoreHaIT method setUp.
@Before
public void setUp() {
KernelExtensionFactory<?> testExtension = labelScanStoreExtension(monitor);
TestHighlyAvailableGraphDatabaseFactory factory = new TestHighlyAvailableGraphDatabaseFactory();
factory.removeKernelExtensions(extension -> extension.getClass().getName().contains("LabelScan"));
factory.addKernelExtension(testExtension);
ClusterManager clusterManager = new ClusterManager.Builder(testDirectory.directory("root")).withDbFactory(factory).withSharedSetting(GraphDatabaseSettings.label_index, labelIndexSettingName()).withStoreDirInitializer((serverId, storeDir) -> {
if (serverId == 1) {
GraphDatabaseService db = new TestGraphDatabaseFactory().addKernelExtension(testExtension).newEmbeddedDatabaseBuilder(storeDir.getAbsoluteFile()).setConfig(GraphDatabaseSettings.label_index, labelIndexSettingName()).newGraphDatabase();
try {
createSomeLabeledNodes(db, new Label[] { Labels.First }, new Label[] { Labels.First, Labels.Second }, new Label[] { Labels.Second });
} finally {
db.shutdown();
}
}
}).build();
life.add(clusterManager);
life.start();
cluster = clusterManager.getCluster();
cluster.await(allSeesAllAsAvailable());
cluster.await(allAvailabilityGuardsReleased());
}
use of org.neo4j.kernel.extension.KernelExtensionFactory in project neo4j by neo4j.
the class UniqueIndexRecoveryTests method before.
@Before
public void before() {
List<KernelExtensionFactory<?>> extensionFactories = new ArrayList<>();
extensionFactories.add(kernelExtensionFactory);
extensionFactories.add(new LuceneLabelScanStoreExtension());
factory.setKernelExtensions(extensionFactories);
db = newDb();
}
use of org.neo4j.kernel.extension.KernelExtensionFactory in project neo4j by neo4j.
the class AbstractInProcessServerBuilder method newServer.
@Override
public ServerControls newServer() {
try (FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction()) {
final OutputStream logOutputStream;
try {
logOutputStream = createOrOpenAsOuputStream(fileSystem, new File(serverFolder, "neo4j.log"), true);
} catch (IOException e) {
throw new RuntimeException("Unable to create log file", e);
}
config.put(ServerSettings.third_party_packages.name(), toStringForThirdPartyPackageProperty(extensions.toList()));
final FormattedLogProvider userLogProvider = FormattedLogProvider.toOutputStream(logOutputStream);
GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies();
Iterable<KernelExtensionFactory<?>> kernelExtensions = append(new Neo4jHarnessExtensions(procedures), dependencies.kernelExtensions());
dependencies = dependencies.kernelExtensions(kernelExtensions).userLogProvider(userLogProvider);
AbstractNeoServer neoServer = createNeoServer(config, dependencies, userLogProvider);
InProcessServerControls controls = new InProcessServerControls(serverFolder, neoServer, logOutputStream);
controls.start();
try {
fixtures.applyTo(controls);
} catch (Exception e) {
controls.close();
throw Exceptions.launderedException(e);
}
return controls;
} catch (IOException e) {
throw Exceptions.launderedException(e);
}
}
Aggregations