Search in sources :

Example 6 with StorableKey

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

the class StreamCatalogService method getTopologyTestRunCaseSink.

public TopologyTestRunCaseSink getTopologyTestRunCaseSink(Long testcaseId, Long id) {
    TopologyTestRunCaseSink testCaseSink = new TopologyTestRunCaseSink();
    testCaseSink.setId(id);
    TopologyTestRunCaseSink retrieved = dao.get(new StorableKey(TopologyTestRunCaseSink.NAMESPACE, testCaseSink.getPrimaryKey()));
    if (retrieved == null || !retrieved.getTestCaseId().equals(testcaseId)) {
        return null;
    }
    return retrieved;
}
Also used : TopologyTestRunCaseSink(com.hortonworks.streamline.streams.catalog.TopologyTestRunCaseSink) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 7 with StorableKey

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

the class StreamCatalogService method removeUDF.

public UDF removeUDF(Long id) {
    UDF udf = new UDF();
    udf.setId(id);
    return dao.remove(new StorableKey(UDF_NAMESPACE, udf.getPrimaryKey()));
}
Also used : UDF(com.hortonworks.streamline.streams.catalog.UDF) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 8 with StorableKey

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

the class StreamCatalogService method getTopologySink.

public TopologySink getTopologySink(Long topologyId, Long sinkId, Long versionId) {
    TopologySink topologySink = new TopologySink();
    topologySink.setId(sinkId);
    topologySink.setVersionId(versionId);
    TopologySink sink = dao.get(new StorableKey(TOPOLOGY_SINK_NAMESPACE, topologySink.getPrimaryKey()));
    if (sink == null || !sink.getTopologyId().equals(topologyId)) {
        return null;
    }
    sink.setVersionTimestamp(getVersionTimestamp(versionId));
    return sink;
}
Also used : TopologySink(com.hortonworks.streamline.streams.catalog.TopologySink) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 9 with StorableKey

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

the class StreamCatalogService method getUDF.

public UDF getUDF(Long id) {
    UDF udf = new UDF();
    udf.setId(id);
    return this.dao.get(new StorableKey(UDF_NAMESPACE, udf.getPrimaryKey()));
}
Also used : UDF(com.hortonworks.streamline.streams.catalog.UDF) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 10 with StorableKey

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

the class StreamCatalogService method getTopologyEdge.

public TopologyEdge getTopologyEdge(Long topologyId, Long edgeId, Long versionId) {
    TopologyEdge topologyEdge = new TopologyEdge();
    topologyEdge.setId(edgeId);
    topologyEdge.setVersionId(versionId);
    TopologyEdge edge = dao.get(new StorableKey(TOPOLOGY_EDGE_NAMESPACE, topologyEdge.getPrimaryKey()));
    if (edge == null || !edge.getTopologyId().equals(topologyId)) {
        return null;
    }
    edge.setVersionTimestamp(getVersionTimestamp(versionId));
    return edge;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyEdge(com.hortonworks.streamline.streams.catalog.TopologyEdge)

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