use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method getTopologySource.
public TopologySource getTopologySource(Long topologyId, Long sourceId, Long versionId) {
TopologySource topologySource = new TopologySource();
topologySource.setId(sourceId);
topologySource.setVersionId(versionId);
TopologySource source = dao.get(new StorableKey(TOPOLOGY_SOURCE_NAMESPACE, topologySource.getPrimaryKey()));
if (source == null || !source.getTopologyId().equals(topologyId)) {
return null;
}
fillSourceStreams(source);
return source;
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method getWindow.
public TopologyWindow getWindow(Long topologyId, Long windowId, Long versionId) {
TopologyWindow topologyTopologyWindow = new TopologyWindow();
topologyTopologyWindow.setId(windowId);
topologyTopologyWindow.setVersionId(versionId);
TopologyWindow windowInfo = dao.get(new StorableKey(TOPOLOGY_WINDOWINFO_NAMESPACE, topologyTopologyWindow.getPrimaryKey()));
if (windowInfo == null || !windowInfo.getTopologyId().equals(topologyId)) {
return null;
}
windowInfo.setVersionTimestamp(getVersionTimestamp(versionId));
return windowInfo;
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method removeTopologyVersionInfo.
public TopologyVersion removeTopologyVersionInfo(Long versionId) {
TopologyVersion topologyVersion = new TopologyVersion();
topologyVersion.setId(versionId);
return dao.remove(new StorableKey(TOPOLOGY_VERSIONINFO_NAMESPACE, topologyVersion.getPrimaryKey()));
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method removeTopologySource.
public TopologySource removeTopologySource(Long topologyId, Long sourceId, Long versionId, boolean removeEdges) {
TopologySource topologySource = getTopologySource(topologyId, sourceId, versionId);
if (topologySource != null) {
if (removeEdges) {
removeAllEdges(topologySource);
}
removeSourceStreamMapping(topologySource);
removeAllTopologyTestSources(topologySource);
topologySource = dao.<TopologySource>remove(new StorableKey(TOPOLOGY_SOURCE_NAMESPACE, topologySource.getPrimaryKey()));
topologySource.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
}
return topologySource;
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method getBranchRule.
public TopologyBranchRule getBranchRule(Long topologyId, Long ruleId, Long versionId) {
TopologyBranchRule topologyBranchRule = new TopologyBranchRule();
topologyBranchRule.setId(ruleId);
topologyBranchRule.setVersionId(versionId);
topologyBranchRule = dao.get(new StorableKey(TOPOLOGY_BRANCHRULEINFO_NAMESPACE, topologyBranchRule.getPrimaryKey()));
if (topologyBranchRule == null || !topologyBranchRule.getTopologyId().equals(topologyId)) {
return null;
}
topologyBranchRule.setVersionTimestamp(getVersionTimestamp(versionId));
return topologyBranchRule;
}
Aggregations