Skip to content

Commit 54cbde9

Browse files
committed
trying to clean up a bit
1 parent f57b85b commit 54cbde9

File tree

1 file changed

+36
-41
lines changed

1 file changed

+36
-41
lines changed

procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/OpenGraphDataScienceExtensionBuilder.java

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,11 @@ public Lifecycle build() {
250250
log.info("Building Graph Data Science extension...");
251251
registerGraphDataScienceComponent();
252252

253-
// register legacy bits
253+
registerComponentsNeededByBaseProc(metrics, taskRegistryFactoryService, taskStoreService, userLogServices);
254+
255+
// register legacy bits, as I remember it these are used internally. I lose track tho. Awful design.
254256
registerLicenseStateComponent(licenseState);
255-
registerMetricsComponent(metrics);
256257
registerModelCatalogComponent(modelCatalog);
257-
registerTaskRegistryFactoryComponent(taskRegistryFactoryService);
258-
registerTaskStoreComponent(taskStoreService);
259-
registerUserLogRegistryFactoryComponent(userLogServices);
260258
log.info("Graph Data Science extension built.");
261259

262260
var lifeSupport = new LifeSupport();
@@ -281,51 +279,32 @@ private void registerGraphDataScienceComponent() {
281279
}
282280

283281
/**
284-
* @deprecated Legacy stuff, will go away one day
282+
* We need BaseProc to power Pregel (current design, could change one day).
283+
* Therefore, we need to pass these ideally internal things to Neo4j's component registry,
284+
* so that BaseProc can look them up later.
285285
*/
286-
@Deprecated
287-
private void registerLicenseStateComponent(LicenseState licenseState) {
288-
componentRegistration.registerComponent("License State", LicenseState.class, __ -> licenseState);
289-
290-
componentRegistration.setUpDependency(licenseState);
286+
private void registerComponentsNeededByBaseProc(
287+
Metrics metrics,
288+
TaskRegistryFactoryService taskRegistryFactoryService,
289+
TaskStoreService taskStoreService,
290+
UserLogServices userLogServices
291+
) {
292+
registerMetricsComponent(metrics);
293+
registerTaskRegistryFactoryComponent(taskRegistryFactoryService);
294+
registerTaskStoreComponent(taskStoreService);
295+
registerUserLogRegistryFactoryComponent(userLogServices);
291296
}
292297

293-
/**
294-
* We register metrics as a component as a way of dependency injecting into spec framework.
295-
* As long as we keep that around, this hack needs to persist.
296-
*
297-
* @deprecated Legacy stuff, will go away one day
298-
*/
299-
@Deprecated
300298
private void registerMetricsComponent(Metrics metrics) {
301299
componentRegistration.registerComponent("Metrics", Metrics.class, __ -> metrics);
302300
}
303301

304-
/**
305-
* @deprecated Legacy stuff, will go away one day
306-
*/
307-
@Deprecated
308-
private void registerModelCatalogComponent(ModelCatalog modelCatalog) {
309-
componentRegistration.registerComponent("Model Catalog", ModelCatalog.class, __ -> modelCatalog);
310-
311-
componentRegistration.setUpDependency(modelCatalog);
312-
}
313-
314-
/**
315-
* @param taskStoreService
316-
* @deprecated Legacy stuff, will go away one day
317-
*/
318-
@Deprecated
319302
private void registerTaskStoreComponent(TaskStoreService taskStoreService) {
320303
var taskStoreProvider = new TaskStoreProvider(taskStoreService);
321304

322305
componentRegistration.registerComponent("Task Store", TaskStore.class, taskStoreProvider);
323306
}
324307

325-
/**
326-
* @deprecated Legacy stuff, will go away one day
327-
*/
328-
@Deprecated
329308
private void registerTaskRegistryFactoryComponent(TaskRegistryFactoryService taskRegistryFactoryService) {
330309
var taskRegistryFactoryProvider = new TaskRegistryFactoryProvider(taskRegistryFactoryService);
331310

@@ -336,10 +315,6 @@ private void registerTaskRegistryFactoryComponent(TaskRegistryFactoryService tas
336315
);
337316
}
338317

339-
/** appedfklvjhlfv
340-
* @deprecated Legacy stuff, will go away one day
341-
*/
342-
@Deprecated
343318
private void registerUserLogRegistryFactoryComponent(UserLogServices userLogServices) {
344319
var userLogRegistryFactoryProvider = new UserLogRegistryFactoryProvider(userLogServices);
345320

@@ -349,4 +324,24 @@ private void registerUserLogRegistryFactoryComponent(UserLogServices userLogServ
349324
userLogRegistryFactoryProvider
350325
);
351326
}
327+
328+
/**
329+
* @deprecated Legacy stuff, will go away one day
330+
*/
331+
@Deprecated
332+
private void registerLicenseStateComponent(LicenseState licenseState) {
333+
componentRegistration.registerComponent("License State", LicenseState.class, __ -> licenseState);
334+
335+
componentRegistration.setUpDependency(licenseState);
336+
}
337+
338+
/**
339+
* @deprecated Legacy stuff, will go away one day
340+
*/
341+
@Deprecated
342+
private void registerModelCatalogComponent(ModelCatalog modelCatalog) {
343+
componentRegistration.registerComponent("Model Catalog", ModelCatalog.class, __ -> modelCatalog);
344+
345+
componentRegistration.setUpDependency(modelCatalog);
346+
}
352347
}

0 commit comments

Comments
 (0)