Search in sources :

Example 1 with StorableKey

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

the class CatalogTagService method removeTag.

@Override
public Tag removeTag(Long tagId) {
    Tag tag = getTag(tagId);
    if (tag != null) {
        if (!getEntities(tagId, false).isEmpty()) {
            throw new TagNotEmptyException("Tag not empty, has child entities.");
        }
        removeTagsFromStorable(getTaggedEntity(tag), tag.getTags());
        dao.<Tag>remove(new StorableKey(TAG_NAMESPACE, tag.getPrimaryKey()));
    }
    return tag;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Tag(com.hortonworks.streamline.registries.tag.Tag)

Example 2 with StorableKey

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

the class CatalogTagService method getTag.

@Override
public Tag getTag(Long tagId) {
    Tag tag = new Tag();
    tag.setId(tagId);
    Tag result = this.dao.get(new StorableKey(TAG_NAMESPACE, tag.getPrimaryKey()));
    if (result != null) {
        result.setTags(getTags(getTaggedEntity(result)));
    }
    return result;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Tag(com.hortonworks.streamline.registries.tag.Tag)

Example 3 with StorableKey

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

the class DashboardCatalogService method removeWidget.

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

Example 4 with StorableKey

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

the class TestApplication method getCacheBackedDao.

private StorageManager getCacheBackedDao(TestConfiguration testConfiguration) {
    StorageProviderConfiguration storageProviderConfiguration = testConfiguration.getStorageProviderConfiguration();
    final StorageManager dao = getStorageManager(storageProviderConfiguration);
    final CacheBuilder cacheBuilder = getGuavaCacheBuilder();
    final Cache<StorableKey, Storable> cache = getCache(dao, cacheBuilder);
    final StorageWriter storageWriter = getStorageWriter(dao);
    return doGetCacheBackedDao(cache, storageWriter);
}
Also used : CacheBuilder(com.google.common.cache.CacheBuilder) StorableKey(com.hortonworks.registries.storage.StorableKey) CacheBackedStorageManager(com.hortonworks.registries.storage.CacheBackedStorageManager) StorageManager(com.hortonworks.registries.storage.StorageManager) Storable(com.hortonworks.registries.storage.Storable) StorageWriter(com.hortonworks.registries.storage.cache.writer.StorageWriter)

Example 5 with StorableKey

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

the class StreamCatalogService method getNotifierInfo.

public Notifier getNotifierInfo(Long id) {
    Notifier notifier = new Notifier();
    notifier.setId(id);
    return this.dao.get(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