use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.
the class StreamCatalogService method removeAllTopologyTestSources.
private void removeAllTopologyTestSources(TopologySource topologySource) {
QueryParam sourceIdQuery = new QueryParam("sourceId", String.valueOf(topologySource.getId()));
Collection<TopologyTestRunCaseSource> sources = listTopologyTestRunCaseSource(Collections.singletonList(sourceIdQuery));
if (sources != null) {
sources.forEach(s -> removeTopologyTestRunCaseSource(s.getId()));
}
}
use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.
the class StreamCatalogService method getTopologyTestRunCaseSourceBySourceId.
public TopologyTestRunCaseSource getTopologyTestRunCaseSourceBySourceId(Long testCaseId, Long sourceId) {
TopologyTestRunCaseSource testCaseSource = new TopologyTestRunCaseSource();
testCaseSource.setId(testCaseId);
Collection<TopologyTestRunCaseSource> sources = dao.find(TopologyTestRunCaseSource.NAMESPACE, Lists.newArrayList(new QueryParam("testCaseId", testCaseId.toString()), new QueryParam("sourceId", sourceId.toString())));
if (sources == null || sources.isEmpty()) {
return null;
} else if (sources.size() > 1) {
LOG.warn("More than one test run case source entity for same test case and source. test case id: " + testCaseId + " , source id: " + sourceId);
LOG.warn("Returning first one...");
}
return sources.iterator().next();
}
use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.
the class StreamCatalogService method addCustomProcessorInfoAsBundle.
public CustomProcessorInfo addCustomProcessorInfoAsBundle(CustomProcessorInfo customProcessorInfo, InputStream jarFile) throws IOException, ComponentConfigException, NoSuchAlgorithmException {
List<QueryParam> queryParams = new ArrayList<>();
queryParams.add(new QueryParam(CustomProcessorInfo.NAME, customProcessorInfo.getName()));
Collection<TopologyComponentBundle> result = this.listCustomProcessorBundlesWithFilter(queryParams);
if (!result.isEmpty()) {
throw new IOException("Custom processor already exists with name:" + customProcessorInfo.getName());
}
this.handleCustomProcessorJar(jarFile, customProcessorInfo, true);
TopologyComponentBundle topologyComponentBundle = customProcessorInfo.toTopologyComponentBundle();
this.addTopologyComponentBundle(topologyComponentBundle, null);
return customProcessorInfo;
}
use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.
the class StreamCatalogService method listTopologyTestRunCaseSource.
public Collection<TopologyTestRunCaseSource> listTopologyTestRunCaseSource(Long testCaseId) {
List<QueryParam> queryParams = new ArrayList<>();
queryParams.add(new QueryParam("testCaseId", String.valueOf(testCaseId)));
return dao.find(TopologyTestRunCaseSource.NAMESPACE, queryParams);
}
use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.
the class StreamCatalogService method listTopologyEditorMetadata.
public Collection<TopologyEditorMetadata> listTopologyEditorMetadata() {
List<TopologyEditorMetadata> metadatas = new ArrayList<>();
Collection<TopologyVersion> currentVersions = listCurrentTopologyVersionInfos();
for (TopologyVersion version : currentVersions) {
List<QueryParam> queryParams = WSUtils.buildTopologyIdAndVersionIdAwareQueryParams(version.getTopologyId(), version.getId(), null);
metadatas.addAll(listTopologyEditorMetadata(queryParams));
}
return metadatas;
}
Aggregations