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