Search in sources :

Example 1 with QueryParam

use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.

the class MLModelRegistryService method getModelInfo.

public MLModel getModelInfo(String name) {
    List<QueryParam> queryParams = Collections.singletonList(new QueryParam(MLModel.NAME, name));
    Collection<MLModel> modelInfos = this.storageManager.find(ML_MODEL_NAME_SPACE, queryParams);
    if (modelInfos.size() == 0) {
        throw EntityNotFoundException.byName(name);
    }
    return modelInfos.iterator().next();
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) MLModel(com.hortonworks.streamline.registries.model.data.MLModel)

Example 2 with QueryParam

use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.

the class CatalogTagService method getTags.

@Override
public List<Tag> getTags(TaggedEntity taggedEntity) {
    List<Tag> tags = new ArrayList<>();
    QueryParam qp1 = new QueryParam(TagStorableMap.FIELD_STORABLE_ID, String.valueOf(taggedEntity.getId()));
    QueryParam qp2 = new QueryParam(TagStorableMap.FIELD_STORABLE_NAMESPACE, String.valueOf(taggedEntity.getNamespace()));
    for (TagStorableMap mapping : listTagStorableMapping(ImmutableList.of(qp1, qp2))) {
        tags.add(getTag(mapping.getTagId()));
    }
    return tags;
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) ArrayList(java.util.ArrayList) TagStorableMap(com.hortonworks.streamline.registries.tag.TagStorableMap) Tag(com.hortonworks.streamline.registries.tag.Tag)

Example 3 with QueryParam

use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.

the class CatalogTagService method getTaggedEntities.

private List<TaggedEntity> getTaggedEntities(Long tagId) {
    List<TaggedEntity> taggedEntities = new ArrayList<>();
    QueryParam qp1 = new QueryParam(TagStorableMap.FIELD_TAG_ID, String.valueOf(tagId));
    for (TagStorableMap mapping : listTagStorableMapping(ImmutableList.of(qp1))) {
        taggedEntities.add(new TaggedEntity(mapping.getStorableNamespace(), mapping.getStorableId()));
    }
    return taggedEntities;
}
Also used : TaggedEntity(com.hortonworks.streamline.registries.tag.TaggedEntity) QueryParam(com.hortonworks.registries.common.QueryParam) ArrayList(java.util.ArrayList) TagStorableMap(com.hortonworks.streamline.registries.tag.TagStorableMap)

Example 4 with QueryParam

use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.

the class DashboardCatalogService method getWidgetDatasourceMapping.

public Set<Long> getWidgetDatasourceMapping(Widget widget) {
    List<QueryParam> queryParams = Collections.singletonList(new QueryParam(WidgetDatasourceMap.WIDGET_ID, widget.getId().toString()));
    Collection<WidgetDatasourceMap> mappings = dao.find(WIDGET_DATASOURCE_MAPPING_NAMESPACE, queryParams);
    if (mappings != null) {
        return mappings.stream().map(WidgetDatasourceMap::getWidgetId).collect(Collectors.toSet());
    }
    return Collections.emptySet();
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) WidgetDatasourceMap(com.hortonworks.streamline.registries.dashboard.entites.WidgetDatasourceMap)

Example 5 with QueryParam

use of com.hortonworks.registries.common.QueryParam in project streamline by hortonworks.

the class WSUtils method buildTopologyIdAwareQueryParams.

public static List<QueryParam> buildTopologyIdAwareQueryParams(Long topologyId, UriInfo uriInfo) {
    List<QueryParam> queryParams = new ArrayList<>();
    queryParams.add(new QueryParam(TOPOLOGY_ID, topologyId.toString()));
    addQueryParams(uriInfo, queryParams);
    return queryParams;
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) ArrayList(java.util.ArrayList)

Aggregations

QueryParam (com.hortonworks.registries.common.QueryParam)72 ArrayList (java.util.ArrayList)42 WSUtils.buildEdgesFromQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam)22 WSUtils.buildEdgesToQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam)22 WSUtils.currentVersionQueryParam (com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam)22 WSUtils.versionIdQueryParam (com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam)22 IOException (java.io.IOException)8 SchemaNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaNotFoundException)7 StorableKey (com.hortonworks.registries.storage.StorableKey)7 OrderByField (com.hortonworks.registries.storage.OrderByField)6 HashSet (java.util.HashSet)6 SchemaVersionLifecycleContext (com.hortonworks.registries.schemaregistry.state.SchemaVersionLifecycleContext)5 TopologyComponentBundle (com.hortonworks.streamline.streams.catalog.topology.TopologyComponentBundle)5 Timed (com.codahale.metrics.annotation.Timed)4 Preconditions (com.google.common.base.Preconditions)4 SchemaBranchNotFoundException (com.hortonworks.registries.schemaregistry.errors.SchemaBranchNotFoundException)4 StorageException (com.hortonworks.registries.storage.exception.StorageException)4 TopologyTestRunCaseSource (com.hortonworks.streamline.streams.catalog.TopologyTestRunCaseSource)4 InputStream (java.io.InputStream)4 HashMap (java.util.HashMap)4