Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GIE Compiler] Unify Gremlin Timeout Configurations (#2953)
<!-- Thanks for your contribution! please review https://github.com/alibaba/GraphScope/blob/main/CONTRIBUTING.md before opening an issue. --> ## What do these changes do? Unify gremlin timeout configurations. By this pr, the console will output like this if gremlin query execution timeout is set to 2000ms. <img width="1627" alt="image" src="https://github.com/alibaba/GraphScope/assets/22363306/922d0702-1a7f-4904-814c-0e9ebd6e7102"> Timeout can be set by two ways: 1. system configuration, set `query.execution.timeout.ms: 2000` in `conf/ir.compiler.properties` 2. set per query in gremlin query `g.with(ARGS_EVAL_TIMEOUT, 2000).V()` or `g.with(Tokens.ARGS_EVAL_TIMEOUT, 2000).V()`. if timeout value is of long type, suffix with 'L' <!-- Please give a short brief about these changes. --> ## Related issue number <!-- Are there any issues opened that will be resolved by merging this change? --> Fixes #2854 --------- Co-authored-by: Longbin Lai <longbin.lailb@alibaba-inc.com>
- Loading branch information
1 parent
4694963
commit 1e2c8f6
Showing
18 changed files
with
156 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...ngine/compiler/src/main/java/com/alibaba/graphscope/common/config/QueryTimeoutConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2020 Alibaba Group Holding Limited. | ||
* | ||
* Licensed 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 com.alibaba.graphscope.common.config; | ||
|
||
public class QueryTimeoutConfig { | ||
// timeout in milliseconds for engine execution | ||
private final long engineTimeoutMS; | ||
// timeout in milliseconds for channel communication | ||
private final long channelTimeoutMS; | ||
// timeout in milliseconds for total query execution | ||
private final long executionTimeoutMS; | ||
private static final double GRADUAL_FACTOR = 0.1d; | ||
|
||
public QueryTimeoutConfig(long engineTimeoutMS) { | ||
this.engineTimeoutMS = engineTimeoutMS; | ||
this.channelTimeoutMS = (long) (engineTimeoutMS * (1 + GRADUAL_FACTOR)); | ||
this.executionTimeoutMS = (long) (engineTimeoutMS * (1 + 2 * GRADUAL_FACTOR)); | ||
} | ||
|
||
public long getExecutionTimeoutMS() { | ||
return executionTimeoutMS; | ||
} | ||
|
||
public long getChannelTimeoutMS() { | ||
return channelTimeoutMS; | ||
} | ||
|
||
public long getEngineTimeoutMS() { | ||
return engineTimeoutMS; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "QueryTimeoutConfig{" | ||
+ "executionTimeoutMS=" | ||
+ executionTimeoutMS | ||
+ ", channelTimeoutMS=" | ||
+ channelTimeoutMS | ||
+ ", engineTimeoutMS=" | ||
+ engineTimeoutMS | ||
+ '}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.