Skip to content

Commit f7f966e

Browse files
authored
1 parent 3938c9e commit f7f966e

File tree

8 files changed

+25
-102
lines changed

8 files changed

+25
-102
lines changed

features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/standard/ShardingStandardRouteEngine.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.shardingsphere.sharding.route.engine.type.standard;
1919

2020
import com.cedarsoftware.util.CaseInsensitiveSet;
21+
import lombok.RequiredArgsConstructor;
2122
import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
2223
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
2324
import org.apache.shardingsphere.infra.datanode.DataNode;
@@ -56,6 +57,7 @@
5657
/**
5758
* Sharding standard route engine.
5859
*/
60+
@RequiredArgsConstructor
5961
public final class ShardingStandardRouteEngine implements ShardingRouteEngine {
6062

6163
private final String logicTableName;
@@ -64,20 +66,11 @@ public final class ShardingStandardRouteEngine implements ShardingRouteEngine {
6466

6567
private final SQLStatementContext sqlStatementContext;
6668

67-
private final ConfigurationProperties props;
68-
6969
private final Collection<Collection<DataNode>> originalDataNodes = new LinkedList<>();
7070

7171
private final HintValueContext hintValueContext;
7272

73-
public ShardingStandardRouteEngine(final String logicTableName, final ShardingConditions shardingConditions, final SQLStatementContext sqlStatementContext,
74-
final HintValueContext hintValueContext, final ConfigurationProperties props) {
75-
this.logicTableName = logicTableName;
76-
this.shardingConditions = shardingConditions;
77-
this.sqlStatementContext = sqlStatementContext;
78-
this.props = props;
79-
this.hintValueContext = hintValueContext;
80-
}
73+
private final ConfigurationProperties props;
8174

8275
@Override
8376
public RouteContext route(final ShardingRule shardingRule) {

kernel/data-pipeline/scenario/cdc/client/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/client/handler/RetryStreamingExceptionHandler.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.shardingsphere.data.pipeline.cdc.client.handler;
1919

2020
import io.netty.channel.ChannelHandlerContext;
21+
import lombok.RequiredArgsConstructor;
2122
import lombok.SneakyThrows;
2223
import lombok.extern.slf4j.Slf4j;
2324
import org.apache.shardingsphere.data.pipeline.cdc.client.CDCClient;
@@ -30,6 +31,7 @@
3031
/**
3132
* Retry streaming exception handler.
3233
*/
34+
@RequiredArgsConstructor
3335
@Slf4j
3436
public final class RetryStreamingExceptionHandler implements ExceptionHandler {
3537

@@ -41,12 +43,6 @@ public final class RetryStreamingExceptionHandler implements ExceptionHandler {
4143

4244
private final AtomicInteger retryTimes = new AtomicInteger(0);
4345

44-
public RetryStreamingExceptionHandler(final CDCClient cdcClient, final int maxRetryTimes, final int retryIntervalMillis) {
45-
this.cdcClient = cdcClient;
46-
this.maxRetryTimes = maxRetryTimes;
47-
this.retryIntervalMillis = retryIntervalMillis;
48-
}
49-
5046
@Override
5147
public void handleException(final ChannelHandlerContext ctx, final Throwable throwable) {
5248
log.error("Catch exception: ", throwable);

kernel/transaction/type/xa/provider/narayana/src/main/java/org/apache/shardingsphere/transaction/xa/narayana/manager/DataSourceXAResourceRecoveryHelper.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper;
2121
import com.google.common.base.Preconditions;
22+
import lombok.RequiredArgsConstructor;
2223
import lombok.extern.slf4j.Slf4j;
2324

2425
import javax.sql.XAConnection;
@@ -31,6 +32,7 @@
3132
/**
3233
* XAResourceRecoveryHelper implementation which gets XIDs, which needs to be recovered, from the database.
3334
*/
35+
@RequiredArgsConstructor
3436
@Slf4j
3537
public final class DataSourceXAResourceRecoveryHelper implements XAResourceRecoveryHelper, XAResource {
3638

@@ -46,28 +48,10 @@ public final class DataSourceXAResourceRecoveryHelper implements XAResourceRecov
4648

4749
private XAResource delegate;
4850

49-
/**
50-
* Create a new {@link DataSourceXAResourceRecoveryHelper} instance.
51-
*
52-
* @param xaDataSource the XA data source
53-
*/
5451
public DataSourceXAResourceRecoveryHelper(final XADataSource xaDataSource) {
5552
this(xaDataSource, null, null);
5653
}
5754

58-
/**
59-
* Create a new {@link DataSourceXAResourceRecoveryHelper} instance.
60-
*
61-
* @param xaDataSource the XA data source
62-
* @param user the database user or {@code null}
63-
* @param password the database password or {@code null}
64-
*/
65-
public DataSourceXAResourceRecoveryHelper(final XADataSource xaDataSource, final String user, final String password) {
66-
this.xaDataSource = xaDataSource;
67-
this.user = user;
68-
this.password = password;
69-
}
70-
7155
@Override
7256
public boolean initialise(final String props) {
7357
return true;

parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/property/PropertiesSegment.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
package org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property;
1919

2020
import lombok.Getter;
21+
import lombok.RequiredArgsConstructor;
2122
import org.apache.shardingsphere.sql.parser.statement.core.segment.SQLSegment;
2223

2324
import java.util.LinkedHashMap;
2425
import java.util.LinkedList;
2526
import java.util.List;
2627
import java.util.Map;
27-
import java.util.Properties;
2828
import java.util.stream.Collectors;
2929

3030
/**
3131
* Properties segment.
3232
*/
33+
@RequiredArgsConstructor
3334
@Getter
3435
public final class PropertiesSegment implements SQLSegment {
3536

@@ -39,24 +40,6 @@ public final class PropertiesSegment implements SQLSegment {
3940

4041
private final List<PropertySegment> properties = new LinkedList<>();
4142

42-
public PropertiesSegment(final int startIndex, final int stopIndex) {
43-
this.startIndex = startIndex;
44-
this.stopIndex = stopIndex;
45-
}
46-
47-
/**
48-
* Convert to properties map.
49-
*
50-
* @return properties map
51-
*/
52-
public Properties toProperties() {
53-
Properties result = new Properties();
54-
for (PropertySegment each : properties) {
55-
result.setProperty(each.getKey(), each.getValue());
56-
}
57-
return result;
58-
}
59-
6043
/**
6144
* Convert to map.
6245
*

parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dml/datetime/DatetimeExpression.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.datetime;
1919

2020
import lombok.Getter;
21-
import lombok.Setter;
21+
import lombok.RequiredArgsConstructor;
2222
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
2323

2424
/**
2525
* Datetime expression.
2626
*/
27+
@RequiredArgsConstructor
2728
@Getter
28-
@Setter
2929
public final class DatetimeExpression implements ExpressionSegment {
3030

3131
private final int startIndex;
@@ -38,19 +38,7 @@ public final class DatetimeExpression implements ExpressionSegment {
3838

3939
private final String text;
4040

41-
public DatetimeExpression(final int startIndex, final int stopIndex, final ExpressionSegment left, final ExpressionSegment right, final String text) {
42-
this.startIndex = startIndex;
43-
this.stopIndex = stopIndex;
44-
this.left = left;
45-
this.right = right;
46-
this.text = text;
47-
}
48-
4941
public DatetimeExpression(final int startIndex, final int stopIndex, final ExpressionSegment left, final String text) {
50-
this.startIndex = startIndex;
51-
this.stopIndex = stopIndex;
52-
this.left = left;
53-
right = null;
54-
this.text = text;
42+
this(startIndex, stopIndex, left, null, text);
5543
}
5644
}

parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dml/item/AggregationProjectionSegment.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.item;
1919

2020
import lombok.Getter;
21+
import lombok.RequiredArgsConstructor;
2122
import lombok.Setter;
2223
import org.apache.shardingsphere.sql.parser.statement.core.enums.AggregationType;
2324
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
@@ -32,6 +33,7 @@
3233
/**
3334
* Aggregation projection segment.
3435
*/
36+
@RequiredArgsConstructor
3537
@Getter
3638
public class AggregationProjectionSegment implements ProjectionSegment, AliasAvailable, ExpressionSegment {
3739

@@ -51,19 +53,7 @@ public class AggregationProjectionSegment implements ProjectionSegment, AliasAva
5153
private AliasSegment alias;
5254

5355
public AggregationProjectionSegment(final int startIndex, final int stopIndex, final AggregationType type, final String expression) {
54-
this.startIndex = startIndex;
55-
this.stopIndex = stopIndex;
56-
this.type = type;
57-
this.expression = expression;
58-
separator = null;
59-
}
60-
61-
public AggregationProjectionSegment(final int startIndex, final int stopIndex, final AggregationType type, final String expression, final String separator) {
62-
this.startIndex = startIndex;
63-
this.stopIndex = stopIndex;
64-
this.type = type;
65-
this.expression = expression;
66-
this.separator = separator;
56+
this(startIndex, stopIndex, type, expression, null);
6757
}
6858

6959
@Override

parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/dml/item/DatetimeProjectionSegment.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.item;
1919

2020
import lombok.Getter;
21-
import lombok.Setter;
21+
import lombok.RequiredArgsConstructor;
2222
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
2323

2424
/**
2525
* Datetime projection segment.
2626
*/
27+
@RequiredArgsConstructor
2728
@Getter
28-
@Setter
2929
public final class DatetimeProjectionSegment implements ProjectionSegment {
3030

3131
private final int startIndex;
@@ -38,20 +38,8 @@ public final class DatetimeProjectionSegment implements ProjectionSegment {
3838

3939
private final String text;
4040

41-
public DatetimeProjectionSegment(final int startIndex, final int stopIndex, final ExpressionSegment left, final ExpressionSegment right, final String text) {
42-
this.startIndex = startIndex;
43-
this.stopIndex = stopIndex;
44-
this.left = left;
45-
this.right = right;
46-
this.text = text;
47-
}
48-
4941
public DatetimeProjectionSegment(final int startIndex, final int stopIndex, final ExpressionSegment left, final String text) {
50-
this.startIndex = startIndex;
51-
this.stopIndex = stopIndex;
52-
this.left = left;
53-
right = null;
54-
this.text = text;
42+
this(startIndex, stopIndex, null, left, text);
5543
}
5644

5745
@Override

proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/response/data/QueryResponseCell.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
package org.apache.shardingsphere.proxy.backend.response.data;
1919

2020
import lombok.Getter;
21+
import lombok.RequiredArgsConstructor;
2122

2223
import java.util.Optional;
2324

2425
/**
2526
* Query response cell.
2627
*/
28+
@RequiredArgsConstructor
2729
@Getter
2830
public final class QueryResponseCell {
2931

@@ -37,12 +39,11 @@ public QueryResponseCell(final int jdbcType, final Object data) {
3739
this(jdbcType, data, null);
3840
}
3941

40-
public QueryResponseCell(final int jdbcType, final Object data, final String columnTypeName) {
41-
this.jdbcType = jdbcType;
42-
this.data = data;
43-
this.columnTypeName = columnTypeName;
44-
}
45-
42+
/**
43+
* Get column type name.
44+
*
45+
* @return column type name
46+
*/
4647
public Optional<String> getColumnTypeName() {
4748
return Optional.ofNullable(columnTypeName);
4849
}

0 commit comments

Comments
 (0)