vvysotskyi commented on a change in pull request #1608: DRILL-6960: AutoLimit
the size of ResultSet for a WebUI (or REST) client
URL: https://github.com/apache/drill/pull/1608#discussion_r258620482
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
##########
@@ -46,15 +46,21 @@
private static final double HEAP_MEMORY_FAILURE_THRESHOLD = 0.85;
private final String query;
-
private final String queryType;
+ private final Integer autoLimitRowCount;
private static MemoryMXBean memMXBean = ManagementFactory.getMemoryMXBean();
@JsonCreator
- public QueryWrapper(@JsonProperty("query") String query,
@JsonProperty("queryType") String queryType) {
+ public QueryWrapper(@JsonProperty("query") String query,
@JsonProperty("queryType") String queryType, @JsonProperty("autoLimit") String
autoLimit) {
this.query = query;
this.queryType = queryType.toUpperCase();
+ this.autoLimitRowCount = autoLimit != null && autoLimit.matches("[0-9]+")
? new Integer(autoLimit) : null;
+ }
+
+ @JsonCreator
+ public QueryWrapper(@JsonProperty("query") String query,
@JsonProperty("queryType") String queryType) {
+ this(query, queryType, null);
Review comment:
```suggestion
this(query, queryType, 0);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services