Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
4194a15f
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4194a15f
编写于
3月 11, 2019
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
for #1864, move rule to sharding-core-common
上级
568438dd
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
245 addition
and
2 deletion
+245
-2
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/Authentication.java
...a/org/apache/shardingsphere/core/rule/Authentication.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/BindingTableRule.java
...org/apache/shardingsphere/core/rule/BindingTableRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/DataNode.java
...in/java/org/apache/shardingsphere/core/rule/DataNode.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java
...java/org/apache/shardingsphere/core/rule/EncryptRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptTableRule.java
...org/apache/shardingsphere/core/rule/EncryptTableRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/MasterSlaveRule.java
.../org/apache/shardingsphere/core/rule/MasterSlaveRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/SQLStatementFillerRule.java
...ache/shardingsphere/core/rule/SQLStatementFillerRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNames.java
...che/shardingsphere/core/rule/ShardingDataSourceNames.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java
...ava/org/apache/shardingsphere/core/rule/ShardingRule.java
+0
-0
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/TableRule.java
...n/java/org/apache/shardingsphere/core/rule/TableRule.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/AllCoreTests.java
...est/java/org/apache/shardingsphere/core/AllCoreTests.java
+2
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/ComplexKeysShardingAlgorithmFixture.java
...ere/core/fixture/ComplexKeysShardingAlgorithmFixture.java
+31
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/HintShardingAlgorithmFixture.java
...dingsphere/core/fixture/HintShardingAlgorithmFixture.java
+37
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/PreciseShardingAlgorithmFixture.java
...gsphere/core/fixture/PreciseShardingAlgorithmFixture.java
+36
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/RangeShardingAlgorithmFixture.java
...ingsphere/core/fixture/RangeShardingAlgorithmFixture.java
+40
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/TestQueryAssistedShardingEncryptor.java
...here/core/fixture/TestQueryAssistedShardingEncryptor.java
+51
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/TestShardingEncryptor.java
...he/shardingsphere/core/fixture/TestShardingEncryptor.java
+46
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/AllRuleTests.java
...ava/org/apache/shardingsphere/core/rule/AllRuleTests.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/BindingTableRuleTest.java
...apache/shardingsphere/core/rule/BindingTableRuleTest.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/DataNodeTest.java
...ava/org/apache/shardingsphere/core/rule/DataNodeTest.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/MasterSlaveRuleTest.java
.../apache/shardingsphere/core/rule/MasterSlaveRuleTest.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNamesTest.java
...shardingsphere/core/rule/ShardingDataSourceNamesTest.java
+0
-0
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/ShardingRuleTest.java
...org/apache/shardingsphere/core/rule/ShardingRuleTest.java
+1
-1
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/TableRuleTest.java
...va/org/apache/shardingsphere/core/rule/TableRuleTest.java
+1
-1
未找到文件。
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/Authentication.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/Authentication.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/BindingTableRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/BindingTableRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/DataNode.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/DataNode.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/EncryptTableRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/EncryptTableRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/MasterSlaveRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/MasterSlaveRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/SQLStatementFillerRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/SQLStatementFillerRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNames.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNames.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/main/java/org/apache/shardingsphere/core/rule/TableRule.java
→
sharding-core/sharding-core-
common
/src/main/java/org/apache/shardingsphere/core/rule/TableRule.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/AllCoreTests.java
浏览文件 @
4194a15f
...
...
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.core;
import
org.apache.shardingsphere.core.config.AllConfigTests
;
import
org.apache.shardingsphere.core.constant.AllConstantsTests
;
import
org.apache.shardingsphere.core.rule.AllRuleTests
;
import
org.apache.shardingsphere.core.spi.AllSPITests
;
import
org.apache.shardingsphere.core.strategy.AllStrategyTests
;
import
org.apache.shardingsphere.core.util.AllUtilTests
;
...
...
@@ -32,6 +33,7 @@ import org.junit.runners.Suite.SuiteClasses;
AllConstantsTests
.
class
,
AllStrategyTests
.
class
,
AllSPITests
.
class
,
AllRuleTests
.
class
,
AllUtilTests
.
class
})
public
final
class
AllCoreTests
{
...
...
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/ComplexKeysShardingAlgorithmFixture.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingAlgorithm
;
import
org.apache.shardingsphere.api.sharding.complex.ComplexKeysShardingValue
;
import
java.util.Collection
;
public
final
class
ComplexKeysShardingAlgorithmFixture
implements
ComplexKeysShardingAlgorithm
<
Integer
>
{
@Override
public
Collection
<
String
>
doSharding
(
final
Collection
<
String
>
availableTargetNames
,
final
ComplexKeysShardingValue
<
Integer
>
shardingValue
)
{
return
availableTargetNames
;
}
}
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/HintShardingAlgorithmFixture.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
org.apache.shardingsphere.api.sharding.hint.HintShardingAlgorithm
;
import
org.apache.shardingsphere.api.sharding.hint.HintShardingValue
;
import
java.util.Collection
;
import
java.util.Collections
;
public
final
class
HintShardingAlgorithmFixture
implements
HintShardingAlgorithm
<
Integer
>
{
@Override
public
Collection
<
String
>
doSharding
(
final
Collection
<
String
>
availableTargetNames
,
final
HintShardingValue
<
Integer
>
shardingValue
)
{
for
(
String
each
:
availableTargetNames
)
{
if
(
each
.
endsWith
(
String
.
valueOf
(
shardingValue
.
getValues
().
iterator
().
next
()
%
2
)))
{
return
Collections
.
singletonList
(
each
);
}
}
return
null
;
}
}
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/PreciseShardingAlgorithmFixture.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm
;
import
org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue
;
import
java.util.Collection
;
public
final
class
PreciseShardingAlgorithmFixture
implements
PreciseShardingAlgorithm
<
Integer
>
{
@Override
public
String
doSharding
(
final
Collection
<
String
>
availableTargetNames
,
final
PreciseShardingValue
<
Integer
>
shardingValue
)
{
for
(
String
each
:
availableTargetNames
)
{
if
(
each
.
endsWith
(
String
.
valueOf
(
shardingValue
.
getValue
()
%
2
)))
{
return
each
;
}
}
return
null
;
}
}
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/RangeShardingAlgorithmFixture.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm
;
import
org.apache.shardingsphere.api.sharding.standard.RangeShardingValue
;
import
java.util.Collection
;
import
java.util.HashSet
;
public
final
class
RangeShardingAlgorithmFixture
implements
RangeShardingAlgorithm
<
Integer
>
{
@Override
public
Collection
<
String
>
doSharding
(
final
Collection
<
String
>
availableTargetNames
,
final
RangeShardingValue
<
Integer
>
shardingValue
)
{
Collection
<
String
>
result
=
new
HashSet
<>(
2
);
for
(
int
i
=
shardingValue
.
getValueRange
().
lowerEndpoint
();
i
<=
shardingValue
.
getValueRange
().
upperEndpoint
();
i
++)
{
for
(
String
each
:
availableTargetNames
)
{
if
(
each
.
endsWith
(
String
.
valueOf
(
i
%
2
)))
{
result
.
add
(
each
);
}
}
}
return
result
;
}
}
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/TestQueryAssistedShardingEncryptor.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.shardingsphere.spi.encrypt.ShardingQueryAssistedEncryptor
;
import
java.util.Properties
;
@Getter
@Setter
public
final
class
TestQueryAssistedShardingEncryptor
implements
ShardingQueryAssistedEncryptor
{
private
Properties
properties
=
new
Properties
();
@Override
public
String
getType
()
{
return
"assistedTest"
;
}
@Override
public
String
encrypt
(
final
Object
plaintext
)
{
return
"encryptValue"
;
}
@Override
public
Object
decrypt
(
final
String
ciphertext
)
{
return
"decryptValue"
;
}
@Override
public
String
queryAssistedEncrypt
(
final
String
plaintext
)
{
return
"assistedEncryptValue"
;
}
}
sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/fixture/TestShardingEncryptor.java
0 → 100644
浏览文件 @
4194a15f
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
org.apache.shardingsphere.core.fixture
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.shardingsphere.spi.encrypt.ShardingEncryptor
;
import
java.util.Properties
;
@Getter
@Setter
public
final
class
TestShardingEncryptor
implements
ShardingEncryptor
{
private
Properties
properties
=
new
Properties
();
@Override
public
String
getType
()
{
return
"test"
;
}
@Override
public
String
encrypt
(
final
Object
plaintext
)
{
return
"encryptValue"
;
}
@Override
public
Object
decrypt
(
final
String
ciphertext
)
{
return
"decryptValue"
;
}
}
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/AllRuleTests.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/AllRuleTests.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/BindingTableRuleTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/BindingTableRuleTest.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/DataNodeTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/DataNodeTest.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/MasterSlaveRuleTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/MasterSlaveRuleTest.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNamesTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/ShardingDataSourceNamesTest.java
浏览文件 @
4194a15f
文件已移动
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/ShardingRuleTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/ShardingRuleTest.java
浏览文件 @
4194a15f
...
...
@@ -25,9 +25,9 @@ import org.apache.shardingsphere.api.config.sharding.strategy.InlineShardingStra
import
org.apache.shardingsphere.api.config.sharding.strategy.NoneShardingStrategyConfiguration
;
import
org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration
;
import
org.apache.shardingsphere.core.exception.ShardingConfigurationException
;
import
org.apache.shardingsphere.core.fixture.IncrementShardingKeyGenerator
;
import
org.apache.shardingsphere.core.fixture.PreciseShardingAlgorithmFixture
;
import
org.apache.shardingsphere.core.strategy.keygen.SnowflakeShardingKeyGenerator
;
import
org.apache.shardingsphere.core.strategy.keygen.fixture.IncrementShardingKeyGenerator
;
import
org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy
;
import
org.apache.shardingsphere.core.strategy.route.none.NoneShardingStrategy
;
import
org.hamcrest.CoreMatchers
;
...
...
sharding-core/sharding-core-
rest
/src/test/java/org/apache/shardingsphere/core/rule/TableRuleTest.java
→
sharding-core/sharding-core-
common
/src/test/java/org/apache/shardingsphere/core/rule/TableRuleTest.java
浏览文件 @
4194a15f
...
...
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.api.config.sharding.KeyGeneratorConfiguration;
import
org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration
;
import
org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration
;
import
org.apache.shardingsphere.api.config.sharding.strategy.NoneShardingStrategyConfiguration
;
import
org.apache.shardingsphere.core.fixture.IncrementShardingKeyGenerator
;
import
org.apache.shardingsphere.core.
strategy.keygen.
fixture.IncrementShardingKeyGenerator
;
import
org.junit.Test
;
import
java.util.Arrays
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录