Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.shardingsphere.sharding.route.engine.type.standard;

import com.cedarsoftware.util.CaseInsensitiveSet;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.datanode.DataNode;
Expand Down Expand Up @@ -56,6 +57,7 @@
/**
* Sharding standard route engine.
*/
@RequiredArgsConstructor
public final class ShardingStandardRouteEngine implements ShardingRouteEngine {

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

private final SQLStatementContext sqlStatementContext;

private final ConfigurationProperties props;

private final Collection<Collection<DataNode>> originalDataNodes = new LinkedList<>();

private final HintValueContext hintValueContext;

public ShardingStandardRouteEngine(final String logicTableName, final ShardingConditions shardingConditions, final SQLStatementContext sqlStatementContext,
final HintValueContext hintValueContext, final ConfigurationProperties props) {
this.logicTableName = logicTableName;
this.shardingConditions = shardingConditions;
this.sqlStatementContext = sqlStatementContext;
this.props = props;
this.hintValueContext = hintValueContext;
}
private final ConfigurationProperties props;

@Override
public RouteContext route(final ShardingRule shardingRule) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.shardingsphere.data.pipeline.cdc.client.handler;

import io.netty.channel.ChannelHandlerContext;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.data.pipeline.cdc.client.CDCClient;
Expand All @@ -30,6 +31,7 @@
/**
* Retry streaming exception handler.
*/
@RequiredArgsConstructor
@Slf4j
public final class RetryStreamingExceptionHandler implements ExceptionHandler {

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

private final AtomicInteger retryTimes = new AtomicInteger(0);

public RetryStreamingExceptionHandler(final CDCClient cdcClient, final int maxRetryTimes, final int retryIntervalMillis) {
this.cdcClient = cdcClient;
this.maxRetryTimes = maxRetryTimes;
this.retryIntervalMillis = retryIntervalMillis;
}

@Override
public void handleException(final ChannelHandlerContext ctx, final Throwable throwable) {
log.error("Catch exception: ", throwable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper;
import com.google.common.base.Preconditions;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import javax.sql.XAConnection;
Expand All @@ -31,6 +32,7 @@
/**
* XAResourceRecoveryHelper implementation which gets XIDs, which needs to be recovered, from the database.
*/
@RequiredArgsConstructor
@Slf4j
public final class DataSourceXAResourceRecoveryHelper implements XAResourceRecoveryHelper, XAResource {

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

private XAResource delegate;

/**
* Create a new {@link DataSourceXAResourceRecoveryHelper} instance.
*
* @param xaDataSource the XA data source
*/
public DataSourceXAResourceRecoveryHelper(final XADataSource xaDataSource) {
this(xaDataSource, null, null);
}

/**
* Create a new {@link DataSourceXAResourceRecoveryHelper} instance.
*
* @param xaDataSource the XA data source
* @param user the database user or {@code null}
* @param password the database password or {@code null}
*/
public DataSourceXAResourceRecoveryHelper(final XADataSource xaDataSource, final String user, final String password) {
this.xaDataSource = xaDataSource;
this.user = user;
this.password = password;
}

@Override
public boolean initialise(final String props) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
package org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sql.parser.statement.core.segment.SQLSegment;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;

/**
* Properties segment.
*/
@RequiredArgsConstructor
@Getter
public final class PropertiesSegment implements SQLSegment {

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

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

public PropertiesSegment(final int startIndex, final int stopIndex) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
}

/**
* Convert to properties map.
*
* @return properties map
*/
public Properties toProperties() {
Properties result = new Properties();
for (PropertySegment each : properties) {
result.setProperty(each.getKey(), each.getValue());
}
return result;
}

/**
* Convert to map.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.datetime;

import lombok.Getter;
import lombok.Setter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;

/**
* Datetime expression.
*/
@RequiredArgsConstructor
@Getter
@Setter
public final class DatetimeExpression implements ExpressionSegment {

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

private final String text;

public DatetimeExpression(final int startIndex, final int stopIndex, final ExpressionSegment left, final ExpressionSegment right, final String text) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.left = left;
this.right = right;
this.text = text;
}

public DatetimeExpression(final int startIndex, final int stopIndex, final ExpressionSegment left, final String text) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.left = left;
right = null;
this.text = text;
this(startIndex, stopIndex, left, null, text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.item;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
Expand All @@ -32,6 +33,7 @@
/**
* Aggregation projection segment.
*/
@RequiredArgsConstructor
@Getter
public class AggregationProjectionSegment implements ProjectionSegment, AliasAvailable, ExpressionSegment {

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

public AggregationProjectionSegment(final int startIndex, final int stopIndex, final AggregationType type, final String expression) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.type = type;
this.expression = expression;
separator = null;
}

public AggregationProjectionSegment(final int startIndex, final int stopIndex, final AggregationType type, final String expression, final String separator) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.type = type;
this.expression = expression;
this.separator = separator;
this(startIndex, stopIndex, type, expression, null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
package org.apache.shardingsphere.sql.parser.statement.core.segment.dml.item;

import lombok.Getter;
import lombok.Setter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;

/**
* Datetime projection segment.
*/
@RequiredArgsConstructor
@Getter
@Setter
public final class DatetimeProjectionSegment implements ProjectionSegment {

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

private final String text;

public DatetimeProjectionSegment(final int startIndex, final int stopIndex, final ExpressionSegment left, final ExpressionSegment right, final String text) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.left = left;
this.right = right;
this.text = text;
}

public DatetimeProjectionSegment(final int startIndex, final int stopIndex, final ExpressionSegment left, final String text) {
this.startIndex = startIndex;
this.stopIndex = stopIndex;
this.left = left;
right = null;
this.text = text;
this(startIndex, stopIndex, null, left, text);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
package org.apache.shardingsphere.proxy.backend.response.data;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Optional;

/**
* Query response cell.
*/
@RequiredArgsConstructor
@Getter
public final class QueryResponseCell {

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

public QueryResponseCell(final int jdbcType, final Object data, final String columnTypeName) {
this.jdbcType = jdbcType;
this.data = data;
this.columnTypeName = columnTypeName;
}

/**
* Get column type name.
*
* @return column type name
*/
public Optional<String> getColumnTypeName() {
return Optional.ofNullable(columnTypeName);
}
Expand Down
Loading