Search in sources :

Example 66 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.

the class StreamCatalogService method removeTopologyProcessor.

public TopologyProcessor removeTopologyProcessor(Long topologyId, Long processorId, Long versionId, boolean removeEdges) {
    TopologyProcessor topologyProcessor = getTopologyProcessor(topologyId, processorId, versionId);
    if (topologyProcessor != null) {
        if (removeEdges) {
            removeAllEdges(topologyProcessor);
        }
        removeProcessorStreamMapping(topologyProcessor);
        topologyProcessor = dao.<TopologyProcessor>remove(new StorableKey(TOPOLOGY_PROCESSOR_NAMESPACE, topologyProcessor.getPrimaryKey()));
        topologyProcessor.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
    }
    return topologyProcessor;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyProcessor(com.hortonworks.streamline.streams.catalog.TopologyProcessor)

Example 67 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.

the class StreamCatalogService method removeTopologySink.

public TopologySink removeTopologySink(Long topologyId, Long sinkId, Long versionId, boolean removeEdges) {
    TopologySink topologySink = getTopologySink(topologyId, sinkId, versionId);
    if (topologySink != null) {
        if (removeEdges) {
            removeAllEdges(topologySink);
        }
        removeAllTopologyTestSinks(topologySink);
        topologySink = dao.<TopologySink>remove(new StorableKey(TOPOLOGY_SINK_NAMESPACE, topologySink.getPrimaryKey()));
        topologySink.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
    }
    return topologySink;
}
Also used : TopologySink(com.hortonworks.streamline.streams.catalog.TopologySink) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 68 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.

the class StreamCatalogService method getTopologyTestRunCase.

public TopologyTestRunCase getTopologyTestRunCase(Long topologyId, Long testcaseId) {
    TopologyTestRunCase testCase = new TopologyTestRunCase();
    testCase.setId(testcaseId);
    TopologyTestRunCase found = dao.get(new StorableKey(TopologyTestRunCase.NAMESPACE, testCase.getPrimaryKey()));
    if (found == null || !found.getTopologyId().equals(topologyId)) {
        return null;
    }
    return found;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyTestRunCase(com.hortonworks.streamline.streams.catalog.TopologyTestRunCase)

Example 69 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.

the class StreamCatalogService method removeTopologyEdge.

public TopologyEdge removeTopologyEdge(Long topologyId, Long edgeId, Long versionId) {
    TopologyEdge topologyEdge = getTopologyEdge(topologyId, edgeId, versionId);
    if (topologyEdge != null) {
        setReconfigureTarget(topologyEdge);
        topologyEdge = dao.remove(new StorableKey(TOPOLOGY_EDGE_NAMESPACE, topologyEdge.getPrimaryKey()));
        topologyEdge.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
    }
    return topologyEdge;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyEdge(com.hortonworks.streamline.streams.catalog.TopologyEdge)

Example 70 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.

the class StreamCatalogService method removeNotifierInfo.

public Notifier removeNotifierInfo(Long notifierId) {
    Notifier notifier = new Notifier();
    notifier.setId(notifierId);
    return dao.remove(new StorableKey(NOTIFIER_INFO_NAMESPACE, notifier.getPrimaryKey()));
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Notifier(com.hortonworks.streamline.streams.catalog.Notifier)

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