use of io.hops.hopsworks.api.user.UserDTO in project hopsworks by logicalclocks.
the class ElasticFeaturestoreItemBuilder method fromFeaturegroup.
public ElasticFeaturestoreItemDTO.Base fromFeaturegroup(ElasticFeaturestoreHit hit, HopsworksJAXBContext converter) throws GenericException {
ElasticFeaturestoreItemDTO.Base item = new ElasticFeaturestoreItemDTO.Base();
item.elasticId = hit.getId();
item.name = hit.getName();
item.version = hit.getVersion();
item.datasetIId = hit.getDatasetIId();
item.parentProjectId = hit.getProjectId();
item.parentProjectName = hit.getProjectName();
for (Map.Entry<String, Object> e : hit.getXattrs().entrySet()) {
switch(e.getKey()) {
case FeaturestoreXAttrsConstants.FEATURESTORE:
{
Gson gson = new Gson();
FeaturegroupXAttr.FullDTO fg = converter.unmarshal(gson.toJson(e.getValue()), FeaturegroupXAttr.FullDTO.class);
item.featurestoreId = fg.getFeaturestoreId();
item.description = fg.getDescription();
item.created = new Date(fg.getCreateDate());
item.creator = new UserDTO(userFacade.findByEmail(fg.getCreator()));
}
break;
}
}
return item;
}
use of io.hops.hopsworks.api.user.UserDTO in project hopsworks by logicalclocks.
the class ElasticFeaturestoreItemBuilder method fromTrainingDataset.
public ElasticFeaturestoreItemDTO.Base fromTrainingDataset(ElasticFeaturestoreHit hit, HopsworksJAXBContext converter) throws GenericException {
ElasticFeaturestoreItemDTO.Base item = new ElasticFeaturestoreItemDTO.Base();
item.elasticId = hit.getId();
item.name = hit.getName();
item.version = hit.getVersion();
item.datasetIId = hit.getDatasetIId();
item.parentProjectId = hit.getProjectId();
item.parentProjectName = hit.getProjectName();
for (Map.Entry<String, Object> e : hit.getXattrs().entrySet()) {
switch(e.getKey()) {
case FeaturestoreXAttrsConstants.FEATURESTORE:
{
Gson gson = new Gson();
TrainingDatasetXAttrDTO td = converter.unmarshal(gson.toJson(e.getValue()), TrainingDatasetXAttrDTO.class);
item.featurestoreId = td.getFeaturestoreId();
item.description = td.getDescription();
item.created = new Date(td.getCreateDate());
item.creator = new UserDTO(userFacade.findByEmail(td.getCreator()));
}
break;
}
}
return item;
}
Aggregations