Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoofin authored Oct 24, 2024
2 parents 650408e + 2ecb1fa commit fe35590
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 64 deletions.
16 changes: 8 additions & 8 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ notifications:
jobs: notifications@shardingsphere.apache.org

github:
description: Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
description: Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
labels:
- database-plus
- database
- database-cluster
- distributed-database
- distributed-sql-database
- distributed-transactions
- database-cluster
- rdbms
- distributed-transaction
- database-gateway
- database-middleware
- sql
- mysql
- postgresql
- shard
- read-write-splitting
- encrypt
- dba
- oltp
- data-encryption
- data-pipeline
- bigdata
- hacktoberfest
features:
issues: true
projects: true
Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
1. SQL Parser: Support parsing Doris INSTR - [#33289](https://github.com/apache/shardingsphere/pull/33289)
1. Agent: Simplify the use of Agent's Docker Image - [#33356](https://github.com/apache/shardingsphere/pull/33356)
1. Add arguments not null check when creating RouteUnit - [#33382](https://github.com/apache/shardingsphere/pull/33382)
1. Add index columns not empty judgement for IndexColumnTokenGenerator - [#33384](https://github.com/apache/shardingsphere/pull/33384)

### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

package org.apache.shardingsphere.preconditions;
package org.apache.shardingsphere.agent.core.preconditions;

import org.apache.shardingsphere.agent.core.preconditions.AgentPreconditions;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.yaml;
package org.apache.shardingsphere.agent.core.yaml;

import org.apache.shardingsphere.agent.api.PluginConfiguration;
import org.apache.shardingsphere.agent.core.advisor.config.yaml.entity.YamlAdvisorConfiguration;
Expand All @@ -26,7 +26,6 @@
import org.apache.shardingsphere.agent.core.advisor.config.yaml.fixture.YamlTargetObjectFixture;
import org.apache.shardingsphere.agent.core.plugin.config.yaml.entity.YamlAgentConfiguration;
import org.apache.shardingsphere.agent.core.plugin.config.yaml.swapper.YamlPluginsConfigurationSwapper;
import org.apache.shardingsphere.agent.core.yaml.AgentYamlEngine;
import org.junit.jupiter.api.Test;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public final class EncryptIndexColumnTokenGenerator implements CollectionSQLToke

@Override
public boolean isGenerateSQLToken(final SQLStatementContext sqlStatementContext) {
return sqlStatementContext instanceof IndexAvailable && sqlStatementContext instanceof TableAvailable && !((TableAvailable) sqlStatementContext).getTablesContext().getTableNames().isEmpty();
return sqlStatementContext instanceof IndexAvailable && sqlStatementContext instanceof TableAvailable && !((TableAvailable) sqlStatementContext).getTablesContext().getTableNames().isEmpty()
&& !((IndexAvailable) sqlStatementContext).getIndexColumns().isEmpty();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
* limitations under the License.
*/

package org.apache.shardingsphere.encrypt.rewrite.condition;
package org.apache.shardingsphere.encrypt.rewrite.condition.impl;

import org.apache.shardingsphere.encrypt.rewrite.condition.impl.EncryptBinaryCondition;
import org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.simple.LiteralExpressionSegment;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.sharding.distsql.checker;
package org.apache.shardingsphere.sharding.distsql.handler.checker;

import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
Expand All @@ -35,7 +35,6 @@
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.distsql.handler.checker.ShardingTableRuleStatementChecker;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.KeyGenerateStrategySegment;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.ShardingAuditorSegment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
* limitations under the License.
*/

package org.apache.shardingsphere.sharding.distsql.converter;
package org.apache.shardingsphere.sharding.distsql.handler.converter;

import org.apache.shardingsphere.distsql.segment.AlgorithmSegment;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.distsql.handler.converter.ShardingTableRuleStatementConverter;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.KeyGenerateStrategySegment;
import org.apache.shardingsphere.sharding.distsql.segment.strategy.ShardingAuditorSegment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,4 @@ public void stop() {
each.stop();
}
}

@Override
public void close() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,4 @@ public void stop() {
public InventoryTaskProgress getTaskProgress() {
return new InventoryTaskProgress(position.get());
}

@Override
public void close() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

import org.apache.shardingsphere.data.pipeline.core.task.progress.TaskProgress;

import java.io.Closeable;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;

/**
* Pipeline task interface.
*/
public interface PipelineTask extends Closeable {
public interface PipelineTask {

/**
* Start task.
Expand All @@ -53,9 +52,4 @@ public interface PipelineTask extends Closeable {
* @return task progress
*/
TaskProgress getTaskProgress();

/**
* Close.
*/
void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.shardingsphere.data.pipeline.core.execute.ExecuteCallback;

/**
Expand All @@ -39,6 +38,5 @@ public void onSuccess() {
public void onFailure(final Throwable throwable) {
log.error("onFailure, task ID={}", task.getTaskId(), throwable);
task.stop();
IOUtils.closeQuietly(task);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.shardingsphere.data.pipeline.core.task.PipelineTask;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.infra.util.close.QuietlyCloser;

import java.util.Collection;
import java.util.LinkedList;
Expand Down Expand Up @@ -120,14 +119,8 @@ private void updateJobItemStatus(final JobStatus jobStatus) {
@Override
public void stop() {
jobItemContext.setStopping(true);
for (PipelineTask each : inventoryTasks) {
each.stop();
QuietlyCloser.close(each);
}
for (PipelineTask each : incrementalTasks) {
each.stop();
QuietlyCloser.close(each);
}
inventoryTasks.forEach(PipelineTask::stop);
incrementalTasks.forEach(PipelineTask::stop);
}

private final class InventoryTaskExecuteCallback implements ExecuteCallback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* limitations under the License.
*/

package org.apache.shardingsphere.data.pipeline.core.ratelimit;
package org.apache.shardingsphere.data.pipeline.core.ratelimit.type;

import org.apache.shardingsphere.data.pipeline.core.constant.PipelineSQLOperationType;
import org.apache.shardingsphere.data.pipeline.core.ratelimit.JobRateLimitAlgorithm;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* limitations under the License.
*/

package org.apache.shardingsphere.data.pipeline.core.ratelimit;
package org.apache.shardingsphere.data.pipeline.core.ratelimit.type;

import org.apache.shardingsphere.data.pipeline.core.constant.PipelineSQLOperationType;
import org.apache.shardingsphere.data.pipeline.core.ratelimit.JobRateLimitAlgorithm;
import org.apache.shardingsphere.infra.algorithm.core.exception.AlgorithmInitializationException;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,4 @@ public void stop() {
importer.stop();
}
}

@Override
public void close() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,4 @@ public void stop() {
public InventoryTaskProgress getTaskProgress() {
return new InventoryTaskProgress(position.get());
}

@Override
public void close() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

package org.apache.shardingsphere.data.pipeline.cdc.core.task;

import org.apache.shardingsphere.data.pipeline.core.context.TransmissionJobItemContext;
import org.apache.shardingsphere.data.pipeline.core.context.PipelineJobItemContext;
import org.apache.shardingsphere.infra.util.close.QuietlyCloser;
import org.apache.shardingsphere.data.pipeline.core.context.TransmissionJobItemContext;
import org.apache.shardingsphere.data.pipeline.core.task.PipelineTask;
import org.apache.shardingsphere.data.pipeline.core.task.runner.PipelineTasksRunner;

Expand Down Expand Up @@ -56,11 +55,9 @@ public void stop() {
jobItemContext.setStopping(true);
for (PipelineTask each : inventoryTasks) {
each.stop();
QuietlyCloser.close(each);
}
for (PipelineTask each : incrementalTasks) {
each.stop();
QuietlyCloser.close(each);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.proxy.backend.handler.distsql.ral;
package org.apache.shardingsphere.proxy.backend.handler.distsql;

import org.apache.shardingsphere.distsql.statement.ral.queryable.QueryableRALStatement;
import org.apache.shardingsphere.distsql.statement.ral.queryable.export.ExportDatabaseConfigurationStatement;
Expand All @@ -40,7 +40,6 @@
import org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory;
import org.apache.shardingsphere.mode.spi.PersistRepository;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLQueryBackendHandler;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.DatabaseSegment;
import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable;
package org.apache.shardingsphere.proxy.backend.handler.distsql;

import org.apache.shardingsphere.infra.exception.kernel.metadata.resource.storageunit.EmptyStorageUnitException;
import org.apache.shardingsphere.infra.exception.kernel.metadata.resource.storageunit.MissingRequiredStorageUnitsException;
Expand All @@ -25,7 +25,6 @@
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLUpdateBackendHandler;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ void assertGetProgress() throws SQLException, ExecutionException, InterruptedExc
PipelineContextUtils.getExecuteEngine(), PipelineContextUtils.getExecuteEngine(), mock(Dumper.class), mock(Importer.class), position);
CompletableFuture.allOf(inventoryTask.start().toArray(new CompletableFuture[0])).get(10L, TimeUnit.SECONDS);
assertThat(inventoryTask.getTaskProgress().getPosition(), instanceOf(IntegerPrimaryKeyIngestPosition.class));
inventoryTask.close();
}

private void initTableData(final IncrementalDumperContext dumperContext) throws SQLException {
Expand Down

0 comments on commit fe35590

Please sign in to comment.