use of com.hortonworks.streamline.registries.model.client.MLModelRegistryClient in project streamline by hortonworks.
the class StreamsModule method getResources.
@Override
public List<Object> getResources() {
List<Object> result = new ArrayList<>();
String catalogRootUrl = (String) config.get(Constants.CONFIG_CATALOG_ROOT_URL);
// Authorized subject
final Subject subject = (Subject) config.get(Constants.CONFIG_SUBJECT);
MLModelRegistryClient modelRegistryClient = new MLModelRegistryClient(catalogRootUrl, subject);
final StreamCatalogService streamcatalogService = new StreamCatalogService(storageManager, fileStorage, modelRegistryClient);
final EnvironmentService environmentService = new EnvironmentService(storageManager);
TagClient tagClient = new TagClient(catalogRootUrl);
final CatalogService catalogService = new CatalogService(storageManager, fileStorage, tagClient);
final TopologyActionsService topologyActionsService = new TopologyActionsService(streamcatalogService, environmentService, fileStorage, modelRegistryClient, config, subject, transactionManager);
final TopologyMetricsService topologyMetricsService = new TopologyMetricsService(environmentService, subject);
final TopologyLogSearchService topologyLogSearchService = new TopologyLogSearchService(environmentService, subject);
environmentService.addNamespaceAwareContainer(topologyActionsService);
environmentService.addNamespaceAwareContainer(topologyMetricsService);
environmentService.addNamespaceAwareContainer(topologyLogSearchService);
// authorizer
final StreamlineAuthorizer authorizer = (StreamlineAuthorizer) config.get(Constants.CONFIG_AUTHORIZER);
if (authorizer == null) {
throw new IllegalStateException("Authorizer not set");
}
final SecurityCatalogService securityCatalogService = (SecurityCatalogService) config.get(Constants.CONFIG_SECURITY_CATALOG_SERVICE);
result.addAll(getAuthorizerResources(authorizer, securityCatalogService));
result.add(new MetricsResource(authorizer, streamcatalogService, topologyMetricsService));
result.addAll(getClusterRelatedResources(authorizer, environmentService));
result.add(new FileCatalogResource(authorizer, catalogService));
result.addAll(getTopologyRelatedResources(authorizer, streamcatalogService, environmentService, topologyActionsService, topologyMetricsService, topologyLogSearchService, securityCatalogService, subject));
result.add(new UDFCatalogResource(authorizer, streamcatalogService, fileStorage));
result.addAll(getNotificationsRelatedResources(authorizer, streamcatalogService));
result.add(new SchemaResource(createSchemaRegistryClient()));
result.addAll(getServiceMetadataResources(authorizer, environmentService, subject));
result.add(new NamespaceCatalogResource(authorizer, streamcatalogService, topologyActionsService, environmentService));
result.add(new SearchCatalogResource(authorizer, streamcatalogService, environmentService, topologyActionsService, topologyMetricsService));
watchFiles(streamcatalogService);
setupPlaceholderEntities(streamcatalogService, environmentService);
return result;
}
Aggregations