Search in sources :

Example 6 with ProvStateParamBuilder

use of io.hops.hopsworks.common.provenance.state.ProvStateParamBuilder in project hopsworks by logicalclocks.

the class ExperimentsController method getExperiment.

public ProvStateDTO getExperiment(Project project, String mlId) throws ProvenanceException {
    ProvStateParamBuilder provFilesParamBuilder = new ProvStateParamBuilder().filterByField(ProvStateParser.FieldsP.PROJECT_I_ID, project.getInode().getId()).filterByField(ProvStateParser.FieldsP.ML_TYPE, Provenance.MLType.EXPERIMENT.name()).filterByField(ProvStateParser.FieldsP.ML_ID, mlId).hasXAttr(ExperimentsBuilder.EXPERIMENT_SUMMARY_XATTR_NAME).withAppExpansion().paginate(0, 1);
    ProvStateDTO fileState = provenanceController.provFileStateList(project, provFilesParamBuilder);
    if (fileState != null && fileState.getItems() != null) {
        List<ProvStateDTO> experiments = fileState.getItems();
        if (experiments != null && !experiments.isEmpty()) {
            return experiments.iterator().next();
        }
    }
    return null;
}
Also used : ProvStateParamBuilder(io.hops.hopsworks.common.provenance.state.ProvStateParamBuilder) ProvStateDTO(io.hops.hopsworks.common.provenance.state.dto.ProvStateDTO)

Aggregations

ProvStateParamBuilder (io.hops.hopsworks.common.provenance.state.ProvStateParamBuilder)6 ProvStateDTO (io.hops.hopsworks.common.provenance.state.dto.ProvStateDTO)4 GenericException (io.hops.hopsworks.exceptions.GenericException)3 ModelRegistryDTO (io.hops.hopsworks.api.modelregistry.dto.ModelRegistryDTO)2 AbstractFacade (io.hops.hopsworks.common.dao.AbstractFacade)2 DatasetException (io.hops.hopsworks.exceptions.DatasetException)2 ProvenanceException (io.hops.hopsworks.exceptions.ProvenanceException)2 HdfsUsers (io.hops.hopsworks.persistence.entity.hdfs.user.HdfsUsers)2 Project (io.hops.hopsworks.persistence.entity.project.Project)2 ProjectTeam (io.hops.hopsworks.persistence.entity.project.team.ProjectTeam)2 Users (io.hops.hopsworks.persistence.entity.user.Users)2 HashMap (java.util.HashMap)2 ExperimentDTO (io.hops.hopsworks.api.experiments.dto.ExperimentDTO)1 ExperimentsEndpointDTO (io.hops.hopsworks.api.experiments.dto.ExperimentsEndpointDTO)1 ModelDTO (io.hops.hopsworks.api.modelregistry.models.dto.ModelDTO)1 ExperimentsException (io.hops.hopsworks.exceptions.ExperimentsException)1 MetadataException (io.hops.hopsworks.exceptions.MetadataException)1 ModelRegistryException (io.hops.hopsworks.exceptions.ModelRegistryException)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1