ihuzenko 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_r257169564
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
##########
@@ -143,8 +144,9 @@ public Foreman(final WorkerBee bee, final DrillbitContext
drillbitContext,
this.initiatingClient = connection;
this.closeFuture = initiatingClient.getChannelClosureFuture();
closeFuture.addListener(closeListener);
-
- this.queryContext = new QueryContext(connection.getSession(),
drillbitContext, queryId);
+ //Extract any auto-limit for the resultSet in case of a WebUser invoked
query
+ Integer autoLimitRowCount = (connection instanceof WebUserConnection) ?
((WebUserConnection) connection).getAutoLimitRowCount() : null;
Review comment:
This code creates unnecessary coupling between ```Foreman``` and
```WebUserConnection``` , previously ```Forman``` only knew about
```UserClientConnection``` interface, now it imports the concrete
implementation and makes this downcast. If it's possible, pass
```autoLimitRowCount``` into this constructor as new optional parameter within
```RunQuery queryRequest``` (needs proto update), otherwise add default
```getAutoLimitRowCount()``` method into ```UserClientConnection``` interface
which returns null and ensure that it's overridden in ```WebUserConnection``` .
We need to get rid of the ```WebUserConnection``` dependency in ```Foreman```.
----------------------------------------------------------------
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