use of io.hops.hopsworks.common.featurestore.xattr.dto.TrainingDatasetXAttrDTO 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