Search in sources :

Example 61 with StorableKey

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

the class DashboardCatalogService method getWidget.

public Widget getWidget(Long dashboardId, Long widgetId) {
    Widget widget = new Widget();
    widget.setDashboardId(dashboardId);
    widget.setId(widgetId);
    ensureDashboardExists(dashboardId);
    return dao.get(new StorableKey(WIDGET_NAMESPACE, widget.getPrimaryKey()));
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Widget(com.hortonworks.streamline.registries.dashboard.entites.Widget)

Example 62 with StorableKey

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

the class StreamCatalogService method removeWindow.

public TopologyWindow removeWindow(Long topologyId, Long windowId, Long versionId) throws Exception {
    TopologyWindow topologyWindow = getWindow(topologyId, windowId, versionId);
    if (topologyWindow != null) {
        topologyWindow = dao.remove(new StorableKey(TOPOLOGY_WINDOWINFO_NAMESPACE, topologyWindow.getPrimaryKey()));
        topologyWindow.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
    }
    return topologyWindow;
}
Also used : TopologyWindow(com.hortonworks.streamline.streams.catalog.TopologyWindow) StorableKey(com.hortonworks.registries.storage.StorableKey)

Example 63 with StorableKey

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

the class StreamCatalogService method getTopologyProcessor.

public TopologyProcessor getTopologyProcessor(Long topologyId, Long processorId, Long versionId) {
    TopologyProcessor topologyProcessor = new TopologyProcessor();
    topologyProcessor.setId(processorId);
    topologyProcessor.setVersionId(versionId);
    TopologyProcessor processor = dao.get(new StorableKey(TOPOLOGY_PROCESSOR_NAMESPACE, topologyProcessor.getPrimaryKey()));
    if (processor == null || !processor.getTopologyId().equals(topologyId)) {
        return null;
    }
    fillProcessorStreams(processor);
    processor.setVersionTimestamp(getVersionTimestamp(versionId));
    return processor;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyProcessor(com.hortonworks.streamline.streams.catalog.TopologyProcessor)

Example 64 with StorableKey

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

the class StreamCatalogService method getRule.

public TopologyRule getRule(Long topologyId, Long ruleId, Long versionId) {
    TopologyRule topologyTopologyRule = new TopologyRule();
    topologyTopologyRule.setId(ruleId);
    topologyTopologyRule.setVersionId(versionId);
    TopologyRule ruleInfo = dao.get(new StorableKey(TOPOLOGY_RULEINFO_NAMESPACE, topologyTopologyRule.getPrimaryKey()));
    if (ruleInfo == null || !ruleInfo.getTopologyId().equals(topologyId)) {
        return null;
    }
    ruleInfo.setVersionTimestamp(getVersionTimestamp(versionId));
    return ruleInfo;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyRule(com.hortonworks.streamline.streams.catalog.TopologyRule) BaseTopologyRule(com.hortonworks.streamline.streams.catalog.BaseTopologyRule)

Example 65 with StorableKey

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

the class StreamCatalogService method removeRule.

public TopologyRule removeRule(Long topologyId, Long ruleId, Long versionId) throws Exception {
    TopologyRule topologyRule = getRule(topologyId, ruleId, versionId);
    if (topologyRule != null) {
        topologyRule = dao.remove(new StorableKey(TOPOLOGY_RULEINFO_NAMESPACE, topologyRule.getPrimaryKey()));
        topologyRule.setVersionTimestamp(updateVersionTimestamp(versionId).getTimestamp());
    }
    return topologyRule;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) TopologyRule(com.hortonworks.streamline.streams.catalog.TopologyRule) BaseTopologyRule(com.hortonworks.streamline.streams.catalog.BaseTopologyRule)

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