Skip to content
Snippets Groups Projects
Commit bdcf6fb6 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

fix caching for histograms

parent 9b484d10
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ public class MiningApi {
@ApiOperation(value = "Run an algorithm", response = String.class)
@Cacheable("mining")
@Cacheable(value = "mining", condition = "#query.getAlgorithm().getCode() == 'histograms'", key = "#query.toString()")
@RequestMapping(method = RequestMethod.POST)
public ResponseEntity runAlgorithm(@RequestBody eu.hbp.mip.model.MiningQuery query) throws IOException {
LOGGER.info("Run an algorithm");
......@@ -63,4 +63,5 @@ public class MiningApi {
return ResponseEntity.ok(result.data().get());
}
}
package eu.hbp.mip.model;
import com.google.gson.Gson;
import eu.hbp.mip.messages.external.Filter;
import eu.hbp.mip.messages.external.VariableId;
import eu.hbp.mip.utils.TypesConvert;
......@@ -76,4 +77,9 @@ public class MiningQuery {
return new eu.hbp.mip.messages.external.MiningQuery(variablesSeq, covariablesSeq,groupingSeq,filtersSeq, scalaAlgorithm);
}
@Override
public String toString() {
return new Gson().toJson(this);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment