Search in sources :

Example 16 with TopologySink

use of com.hortonworks.streamline.streams.catalog.TopologySink in project streamline by hortonworks.

the class TopologyTestRunResource method getAssociatedTopologySink.

private TopologySink getAssociatedTopologySink(Long topologyId, Long testCaseId, Long topologySinkId) {
    TopologyTestRunCase testCase = catalogService.getTopologyTestRunCase(topologyId, testCaseId);
    if (testCase == null) {
        throw EntityNotFoundException.byId("Topology test case with topology id " + topologyId + " and test case id " + testCaseId);
    }
    TopologySink topologySink = catalogService.getTopologySink(topologyId, topologySinkId, testCase.getVersionId());
    if (topologySink == null) {
        throw EntityNotFoundException.byId("Topology sink with topology id " + topologyId + " and version id " + testCase.getVersionId());
    } else if (!testCase.getVersionId().equals(topologySink.getVersionId())) {
        throw new IllegalStateException("Test case and topology sink point to the different version id: " + "version id of test case: " + testCase.getVersionId() + " / " + "version id of topology sink: " + topologySink.getVersionId());
    }
    return topologySink;
}
Also used : TopologySink(com.hortonworks.streamline.streams.catalog.TopologySink) TopologyTestRunCase(com.hortonworks.streamline.streams.catalog.TopologyTestRunCase)

Aggregations

TopologySink (com.hortonworks.streamline.streams.catalog.TopologySink)16 Path (javax.ws.rs.Path)7 Timed (com.codahale.metrics.annotation.Timed)5 TopologyProcessor (com.hortonworks.streamline.streams.catalog.TopologyProcessor)5 TopologyTestRunCaseSink (com.hortonworks.streamline.streams.catalog.TopologyTestRunCaseSink)5 TopologyTestRunCase (com.hortonworks.streamline.streams.catalog.TopologyTestRunCase)4 QueryParam (com.hortonworks.registries.common.QueryParam)3 StorableKey (com.hortonworks.registries.storage.StorableKey)3 WSUtils.buildEdgesFromQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam)3 WSUtils.buildEdgesToQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam)3 WSUtils.currentVersionQueryParam (com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam)3 WSUtils.versionIdQueryParam (com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam)3 BaseTopologyRule (com.hortonworks.streamline.streams.catalog.BaseTopologyRule)2 TopologyBranchRule (com.hortonworks.streamline.streams.catalog.TopologyBranchRule)2 TopologyEdge (com.hortonworks.streamline.streams.catalog.TopologyEdge)2 TopologyRule (com.hortonworks.streamline.streams.catalog.TopologyRule)2 TopologySource (com.hortonworks.streamline.streams.catalog.TopologySource)2 TopologyTestRunCaseSource (com.hortonworks.streamline.streams.catalog.TopologyTestRunCaseSource)2 TopologyWindow (com.hortonworks.streamline.streams.catalog.TopologyWindow)2 GET (javax.ws.rs.GET)2