RaigorJiang commented on code in PR #25036:
URL: https://github.com/apache/shardingsphere/pull/25036#discussion_r1161396492
##########
kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/algorithm/traffic/segment/SQLMatchTrafficAlgorithm.java:
##########
@@ -41,8 +44,11 @@ public final class SQLMatchTrafficAlgorithm implements
SegmentTrafficAlgorithm {
@Override
public void init(final Properties props) {
- Preconditions.checkArgument(props.containsKey(SQL_PROPS_KEY), "%s
cannot be null.", SQL_PROPS_KEY);
+
ShardingSpherePreconditions.checkState(props.containsKey(SQL_PROPS_KEY),
+ () -> new
SegmentTrafficAlgorithmInitializationException(SQLMatchTrafficAlgorithm.class.getName(),
String.format("%s cannot be null", SQL_PROPS_KEY)));
sql = getExactlySQL(props.getProperty(SQL_PROPS_KEY));
+
ShardingSpherePreconditions.checkState(Strings.isNullOrEmpty(String.valueOf(sql)),
Review Comment:
Is the expectation here is sql null or empty?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]