Skip to content

Commit

Permalink
Algorithm name check before dataset check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanKarab committed Nov 16, 2020
1 parent 070c0fa commit 70e8161
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ private void handleHBPAlgorithmExecution(HttpRequest request, HttpResponse respo
preExecutionChecks(request);

String algorithmName = getAlgorithmName(request);
AlgorithmProperties algorithmProperties = Algorithms.getInstance().getAlgorithmProperties(algorithmName);
if (algorithmProperties == null)
throw new RequestException(algorithmName, "The algorithm '" + algorithmName + "' does not exist.");

String algorithmKey = algorithmName + "_" + System.currentTimeMillis();
log.info("Executing algorithm: " + algorithmName + " with key: " + algorithmKey);

// Logging the algorithm execution parameters
log.info("Executing algorithm: " + algorithmName + " with key: " + algorithmKey);
HashMap<String, String> algorithmParameters = HBPQueryHelper.getAlgorithmParameters(request);
log.info("Request for algorithm: " + algorithmName);
if (algorithmParameters != null) {
Expand All @@ -113,10 +118,6 @@ private void handleHBPAlgorithmExecution(HttpRequest request, HttpResponse respo

AdpDBClientQueryStatus queryStatus;

AlgorithmProperties algorithmProperties = Algorithms.getInstance().getAlgorithmProperties(algorithmName);
if (algorithmProperties == null)
throw new RequestException(algorithmName, "The algorithm '" + algorithmName + "' does not exist.");

algorithmProperties.mergeWithAlgorithmParameters(algorithmParameters);

DataSerialization ds = DataSerialization.summary;
Expand Down

0 comments on commit 70e8161

Please sign in to comment.