Search in sources :

Example 1 with OverviewExecutionStatus

use of com.bakdata.conquery.apiv1.OverviewExecutionStatus in project conquery by bakdata.

the class ManagedExecution method buildStatusOverview.

/**
 * Renders a lightweight status with meta information about this query. Computation an size should be small for this.
 */
public OverviewExecutionStatus buildStatusOverview(UriBuilder url, Subject subject) {
    OverviewExecutionStatus status = new OverviewExecutionStatus();
    setStatusBase(subject, status);
    return status;
}
Also used : OverviewExecutionStatus(com.bakdata.conquery.apiv1.OverviewExecutionStatus)

Example 2 with OverviewExecutionStatus

use of com.bakdata.conquery.apiv1.OverviewExecutionStatus in project conquery by bakdata.

the class StoredQueriesProcessorTest method makeState.

@SneakyThrows
private static ExecutionStatus makeState(ManagedExecutionId id, User owner, User callingUser, ExecutionState state, String typeLabel, SecondaryIdDescriptionId secondaryId) {
    OverviewExecutionStatus status = new OverviewExecutionStatus();
    final ManagedQuery execMock = new ManagedQuery() {

        {
            setDataset(DATASET_0);
            setQueryId(id.getExecution());
        }
    };
    status.setTags(new String[0]);
    status.setLabel(id.getExecution().toString());
    status.setPristineLabel(true);
    status.setCreatedAt(LocalDateTime.MIN.atZone(ZoneId.systemDefault()));
    status.setOwner(owner.getId());
    status.setShared(false);
    status.setOwn(owner.equals(callingUser));
    status.setId(id);
    status.setStatus(state);
    status.setQueryType(typeLabel);
    // This is probably not interesting on the overview (only if there is an filter for the search)
    status.setSecondaryId(secondaryId);
    if (state.equals(DONE)) {
        status.setResultUrls(List.of(ResultExcelResource.getDownloadURL(URI_BUILDER.clone(), execMock), ResultCsvResource.getDownloadURL(URI_BUILDER.clone(), execMock), ResultArrowFileResource.getDownloadURL(URI_BUILDER.clone(), execMock), ResultArrowStreamResource.getDownloadURL(URI_BUILDER.clone(), execMock)));
    }
    return status;
}
Also used : ManagedQuery(com.bakdata.conquery.models.query.ManagedQuery) OverviewExecutionStatus(com.bakdata.conquery.apiv1.OverviewExecutionStatus) SneakyThrows(lombok.SneakyThrows)

Aggregations

OverviewExecutionStatus (com.bakdata.conquery.apiv1.OverviewExecutionStatus)2 ManagedQuery (com.bakdata.conquery.models.query.ManagedQuery)1 SneakyThrows (lombok.SneakyThrows)1