-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQueryRequest.java
More file actions
39 lines (35 loc) · 1.35 KB
/
Copy pathQueryRequest.java
File metadata and controls
39 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.dbaagent.model;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class QueryRequest {
private String query;
private Integer limit; // Optional limit for safety
private Integer timeoutSeconds; // Optional per-query timeout override (null = use server default)
private QueryExecutionOrigin executionOrigin = QueryExecutionOrigin.INTERNAL;
private Boolean mutationConfirmed = Boolean.FALSE;
// Client-generated id for this run, used to cancel the query if the caller
// gives up before it finishes.
private String executionId;
public QueryRequest(String query, Integer limit, Integer timeoutSeconds) {
this.query = query;
this.limit = limit;
this.timeoutSeconds = timeoutSeconds;
this.executionOrigin = QueryExecutionOrigin.INTERNAL;
this.mutationConfirmed = Boolean.FALSE;
}
public QueryRequest(
String query,
Integer limit,
Integer timeoutSeconds,
QueryExecutionOrigin executionOrigin,
Boolean mutationConfirmed
) {
this.query = query;
this.limit = limit;
this.timeoutSeconds = timeoutSeconds;
this.executionOrigin = executionOrigin == null ? QueryExecutionOrigin.INTERNAL : executionOrigin;
this.mutationConfirmed = Boolean.TRUE.equals(mutationConfirmed);
}
}