Search in sources :

Example 46 with StorableKey

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;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologySource(com.hortonworks.streamline.streams.catalog.TopologySource)

Example 47 with StorableKey

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;
}
Also used : TopologyWindow(com.hortonworks.streamline.streams.catalog.TopologyWindow) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 48 with StorableKey

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()));
}
Also used : TopologyVersion(com.hortonworks.streamline.streams.catalog.TopologyVersion) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 49 with StorableKey

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;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologySource(com.hortonworks.streamline.streams.catalog.TopologySource)

Example 50 with StorableKey

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;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyBranchRule(com.hortonworks.streamline.streams.catalog.TopologyBranchRule)

Aggregations

StorableKey (com.hortonworks.registries.storage.StorableKey)72 Schema (com.hortonworks.registries.common.Schema)6 OrderByField (com.hortonworks.registries.storage.OrderByField)6 PrimaryKey (com.hortonworks.registries.storage.PrimaryKey)6 HashMap (java.util.HashMap)6 Test (org.junit.Test)5 QueryParam (com.hortonworks.registries.common.QueryParam)4 StorageManager (com.hortonworks.registries.storage.StorageManager)4 SchemaNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException)3 Storable (com.hortonworks.registries.storage.Storable)3 StorageException (com.hortonworks.registries.storage.exception.StorageException)3 Role (com.hortonworks.streamline.streams.security.catalog.Role)3 UserRole (com.hortonworks.streamline.streams.security.catalog.UserRole)3 CacheBuilder (com.google.common.cache.CacheBuilder)2 SchemaVersionInfoCache (com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache)2 CacheBackedStorageManager (com.hortonworks.registries.storage.CacheBackedStorageManager)2 StorageWriter (com.hortonworks.registries.storage.cache.writer.StorageWriter)2 AlreadyExistsException (com.hortonworks.registries.storage.exception.AlreadyExistsException)2 IllegalQueryParameterException (com.hortonworks.registries.storage.exception.IllegalQueryParameterException)2 MySqlSelectQuery (com.hortonworks.registries.storage.impl.jdbc.provider.mysql.query.MySqlSelectQuery)2