Search in sources :

Example 41 with StorableKey

use of com.hortonworks.registries.storage.StorableKey in project registry 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.registries.tag.Tag)

Example 42 with StorableKey

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

the class EnvironmentService method removeServiceClusterMapping.

public NamespaceServiceClusterMap removeServiceClusterMapping(Long namespaceId, String serviceName, Long clusterId) {
    assertEnvironmentIsNotInternal(namespaceId);
    StorableKey key = getStorableKeyForNamespaceServiceClusterMapping(namespaceId, serviceName, clusterId);
    NamespaceServiceClusterMap ret = this.dao.remove(key);
    invalidateTopologyActionsMetricsInstances(namespaceId);
    return ret;
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) NamespaceServiceClusterMap(com.hortonworks.streamline.streams.cluster.catalog.NamespaceServiceClusterMap)

Example 43 with StorableKey

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

the class EnvironmentService method getStorableKeyForNamespaceServiceClusterMapping.

private StorableKey getStorableKeyForNamespaceServiceClusterMapping(Long namespaceId, String serviceName, Long clusterId) {
    NamespaceServiceClusterMap mapping = new NamespaceServiceClusterMap();
    mapping.setNamespaceId(namespaceId);
    mapping.setServiceName(serviceName);
    mapping.setClusterId(clusterId);
    return new StorableKey(NAMESPACE_SERVICE_CLUSTER_MAPPING_NAMESPACE, mapping.getPrimaryKey());
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) NamespaceServiceClusterMap(com.hortonworks.streamline.streams.cluster.catalog.NamespaceServiceClusterMap)

Example 44 with StorableKey

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

the class EnvironmentService method removeService.

public Service removeService(Long serviceId) {
    Service service = new Service();
    service.setId(serviceId);
    return dao.remove(new StorableKey(SERVICE_NAMESPACE, service.getPrimaryKey()));
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Service(com.hortonworks.streamline.streams.cluster.catalog.Service)

Example 45 with StorableKey

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

the class EnvironmentService method getComponent.

public Component getComponent(Long componentId) {
    Component component = new Component();
    component.setId(componentId);
    return this.dao.get(new StorableKey(COMPONENT_NAMESPACE, component.getPrimaryKey()));
}
Also used : StorableKey(com.hortonworks.registries.storage.StorableKey) Component(com.hortonworks.streamline.streams.cluster.catalog.Component)

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