-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3519 from ingef/feature/extract-execution-synchro…
…nization Feature/extract execution synchronization
- Loading branch information
Showing
48 changed files
with
653 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
backend/src/main/java/com/bakdata/conquery/io/result/external/ExternalResultProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
package com.bakdata.conquery.io.result.external; | ||
|
||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.WebApplicationException; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import com.bakdata.conquery.io.result.ExternalResult; | ||
import com.bakdata.conquery.io.result.ExternalState; | ||
import com.bakdata.conquery.io.result.ResultUtil; | ||
import com.bakdata.conquery.models.auth.entities.Subject; | ||
import com.bakdata.conquery.models.execution.ManagedExecution; | ||
import com.bakdata.conquery.models.forms.managed.ExternalExecution; | ||
import com.bakdata.conquery.models.query.ExecutionManager; | ||
import com.bakdata.conquery.models.worker.DatasetRegistry; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor(onConstructor_ = @Inject) | ||
public class ExternalResultProcessor { | ||
|
||
public <T extends ManagedExecution & ExternalResult> Response getResult(Subject subject, ManagedExecution execution, String fileName) { | ||
private final DatasetRegistry<?> datasetRegistry; | ||
|
||
ResultUtil.authorizeExecutable(subject, execution); | ||
|
||
if (!(execution instanceof ExternalResult)) { | ||
throw new WebApplicationException("The execution exists, but produces not a zipped result", Response.Status.CONFLICT); | ||
public Response getResult(Subject subject, ExternalExecution execution, String fileName) { | ||
|
||
} | ||
ResultUtil.authorizeExecutable(subject, execution); | ||
|
||
T externalExecution = (T) execution; | ||
ExecutionManager executionManager = datasetRegistry.get(execution.getDataset().getId()).getExecutionManager(); | ||
ExternalState externalResult = executionManager.getResult(execution.getId()); | ||
|
||
return externalExecution.fetchExternalResult(fileName); | ||
return externalResult.fetchExternalResult(fileName); | ||
} | ||
} |
Oops, something went wrong.