You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/07/07 16:11:59 UTC
[GitHub] [incubator-doris] liutang123 commented on a change in pull request #6159: Add a property to limit user instance num.
liutang123 commented on a change in pull request #6159:
URL: https://github.com/apache/incubator-doris/pull/6159#discussion_r665517707
##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java
##########
@@ -79,10 +88,58 @@ public void registerQuery(TUniqueId queryId, QueryInfo info) throws UserExceptio
}
}
+ public void registerInstances(TUniqueId queryId, Integer instancesNum) throws UserException {
+ if (!coordinatorMap.containsKey(queryId)) {
+ throw new UserException("query not exists in coordinatorMap:" + DebugUtil.printId(queryId));
+ }
+ QueryInfo queryInfo = coordinatorMap.get(queryId);
+ if (queryInfo.getConnectContext() != null &&
+ !Strings.isNullOrEmpty(queryInfo.getConnectContext().getQualifiedUser())
+ ) {
+ String user = queryInfo.getConnectContext().getQualifiedUser();
+ long maxQueryInstances = queryInfo.getConnectContext().getCatalog().getAuth().getMaxQueryInstances(user);
Review comment:
If save `maxQueryInstances` in `ConnectionContext `, we can not change it after `ConnectionContext` created.
`getMaxQueryInstances` will try to obtain an read lock in PlaoAuth. I think the cost should be very small, because it is a situation of reading more and writing less.
However, we can update parameters and disconnect all links to make parameters take effect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org