weijietong commented on a change in pull request #2000: DRILL-7607: support dynamic credit based flow control URL: https://github.com/apache/drill/pull/2000#discussion_r386001376
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/rpc/DynamicSemaphore.java ########## @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.drill.exec.rpc; + +import java.util.concurrent.Semaphore; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.locks.ReentrantLock; + Review comment: Yes, I would do that. Besides the tradeoff you mentioned above, the main problem is to send data with a speed according to their real data size. To some queries, such as: select user_id from table and select * from table, the former's batch size is normally smaller than the latter one. So receiver could receive more batch to the former query. Of course the sender would send their data more rapidly, and then accelerate the execution speed without more time spending to wait for the semaphore. This would also make the scanner storage plugin to release their resource more sooner to support more queries. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
