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();
}
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;
}
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;
}
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();
}
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;
}
Aggregations