This is an automated email from the ASF dual-hosted git repository. zhangliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push: new 8fc7c0e08cd Refactor YamlRuleRepositoryTupleSwapperEngine (#34844) 8fc7c0e08cd is described below commit 8fc7c0e08cdf39c4da2575d6951e20e08c865a2f Author: Liang Zhang <zhangli...@apache.org> AuthorDate: Mon Mar 3 15:52:07 2025 +0800 Refactor YamlRuleRepositoryTupleSwapperEngine (#34844) * Refactor YamlRuleRepositoryTupleSwapperEngine * Refactor YamlRuleRepositoryTupleSwapperEngine * Refactor YamlRuleRepositoryTupleSwapperEngine --- .../database/DatabaseRulePersistService.java | 3 -- .../database/DatabaseRulePersistServiceTest.java | 6 +-- .../fixture/NoTupleRuleConfigurationFixture.java | 30 ----------- .../NoTupleYamlRuleConfigurationFixture.java | 34 ------------ ...NoTupleYamlRuleConfigurationSwapperFixture.java | 50 ------------------ ...onfig.swapper.rule.YamlRuleConfigurationSwapper | 18 ------- .../YamlRuleRepositoryTupleSwapperEngine.java | 60 ++++++++++++---------- .../YamlRuleRepositoryTupleSwapperEngineTest.java | 6 --- .../leaf/GlobalLeafYamlRuleConfiguration.java | 41 --------------- .../fixture/none/NoneYamlRuleConfiguration.java | 31 ----------- 10 files changed, 35 insertions(+), 244 deletions(-) diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistService.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistService.java index c998fa69b33..ee43e7994c1 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistService.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistService.java @@ -138,9 +138,6 @@ public final class DatabaseRulePersistService { Collection<MetaDataVersion> result = new LinkedList<>(); for (YamlRuleConfiguration each : yamlSwapperEngine.swapToYamlRuleConfigurations(configs)) { List<RuleRepositoryTuple> tuples = new LinkedList<>(tupleSwapperEngine.swapToTuples(databaseName, each)); - if (tuples.isEmpty()) { - continue; - } Collections.reverse(tuples); result.addAll(deleteTuples(tuples)); } diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistServiceTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistServiceTest.java index 90630dec835..ec28b841d89 100644 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistServiceTest.java +++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/config/database/DatabaseRulePersistServiceTest.java @@ -19,7 +19,6 @@ package org.apache.shardingsphere.mode.metadata.persist.config.database; import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; import org.apache.shardingsphere.infra.metadata.version.MetaDataVersion; -import org.apache.shardingsphere.mode.metadata.persist.fixture.NoTupleRuleConfigurationFixture; import org.apache.shardingsphere.mode.spi.repository.PersistRepository; import org.apache.shardingsphere.test.fixture.infra.rule.MockedRuleConfiguration; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +27,6 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -75,7 +73,7 @@ class DatabaseRulePersistServiceTest { @Test void assertPersistWithoutActiveVersion() { - Collection<MetaDataVersion> actual = persistService.persist("foo_db", Arrays.asList(new MockedRuleConfiguration("test"), new NoTupleRuleConfigurationFixture("test"))); + Collection<MetaDataVersion> actual = persistService.persist("foo_db", Collections.singleton(new MockedRuleConfiguration("test"))); assertThat(actual.size(), is(1)); assertThat(actual.iterator().next().getActiveVersion(), is(0)); } @@ -96,7 +94,7 @@ class DatabaseRulePersistServiceTest { @Test void assertDeleteWithRuleConfigurations() { - Collection<MetaDataVersion> actual = persistService.delete("foo_db", Arrays.asList(new MockedRuleConfiguration("test"), new NoTupleRuleConfigurationFixture("test"))); + Collection<MetaDataVersion> actual = persistService.delete("foo_db", Collections.singleton(new MockedRuleConfiguration("test"))); assertThat(actual.size(), is(1)); assertNull(actual.iterator().next().getActiveVersion()); } diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleRuleConfigurationFixture.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleRuleConfigurationFixture.java deleted file mode 100644 index cd19d4a7826..00000000000 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleRuleConfigurationFixture.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.mode.metadata.persist.fixture; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.config.rule.function.EnhancedRuleConfiguration; - -@RequiredArgsConstructor -@Getter -public final class NoTupleRuleConfigurationFixture implements RuleConfiguration, EnhancedRuleConfiguration { - - private final String name; -} diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationFixture.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationFixture.java deleted file mode 100644 index 35239d3395e..00000000000 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationFixture.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.mode.metadata.persist.fixture; - -import lombok.Getter; -import lombok.Setter; -import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration; - -@Getter -@Setter -public final class NoTupleYamlRuleConfigurationFixture implements YamlRuleConfiguration { - - private String name; - - @Override - public Class<NoTupleRuleConfigurationFixture> getRuleConfigurationType() { - return NoTupleRuleConfigurationFixture.class; - } -} diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationSwapperFixture.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationSwapperFixture.java deleted file mode 100644 index 264109a5362..00000000000 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/fixture/NoTupleYamlRuleConfigurationSwapperFixture.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.mode.metadata.persist.fixture; - -import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper; - -public final class NoTupleYamlRuleConfigurationSwapperFixture implements YamlRuleConfigurationSwapper<NoTupleYamlRuleConfigurationFixture, NoTupleRuleConfigurationFixture> { - - @Override - public NoTupleYamlRuleConfigurationFixture swapToYamlConfiguration(final NoTupleRuleConfigurationFixture data) { - NoTupleYamlRuleConfigurationFixture result = new NoTupleYamlRuleConfigurationFixture(); - result.setName(data.getName()); - return result; - } - - @Override - public NoTupleRuleConfigurationFixture swapToObject(final NoTupleYamlRuleConfigurationFixture yamlConfig) { - return new NoTupleRuleConfigurationFixture(yamlConfig.getName()); - } - - @Override - public String getRuleTagName() { - return "NO_TUPLE.FIXTURE"; - } - - @Override - public int getOrder() { - return -401; - } - - @Override - public Class<NoTupleRuleConfigurationFixture> getTypeClass() { - return NoTupleRuleConfigurationFixture.class; - } -} diff --git a/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper b/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper deleted file mode 100644 index 2465bf1fced..00000000000 --- a/mode/core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.mode.metadata.persist.fixture.NoTupleYamlRuleConfigurationSwapperFixture diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngine.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngine.java index 5909ba3ebdf..4758234fe8d 100644 --- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngine.java +++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngine.java @@ -75,9 +75,7 @@ public final class YamlRuleRepositoryTupleSwapperEngine { */ public Collection<RuleRepositoryTuple> swapToTuples(final String databaseName, final YamlRuleConfiguration yamlRuleConfig) { RuleRepositoryTupleEntity entity = yamlRuleConfig.getClass().getAnnotation(RuleRepositoryTupleEntity.class); - if (null == entity) { - return Collections.emptyList(); - } + Preconditions.checkNotNull(entity); Preconditions.checkArgument(!entity.leaf()); String ruleType = entity.value(); Collection<RuleRepositoryTuple> result = new LinkedList<>(); @@ -91,45 +89,53 @@ public final class YamlRuleRepositoryTupleSwapperEngine { } @SneakyThrows(ReflectiveOperationException.class) - @SuppressWarnings("rawtypes") private Collection<RuleRepositoryTuple> swapToTuples(final String databaseName, final String ruleType, final YamlRuleConfiguration yamlRuleConfig, final Field field) { Object fieldValue = field.get(yamlRuleConfig); if (null == fieldValue) { return Collections.emptyList(); } String tupleName = YamlRuleConfigurationFieldUtil.getTupleItemName(field); - RuleRepositoryTupleKeyListNameGenerator tupleKeyListNameGenerator = field.getAnnotation(RuleRepositoryTupleKeyListNameGenerator.class); - if (null != tupleKeyListNameGenerator && fieldValue instanceof Collection) { - Collection<RuleRepositoryTuple> result = new LinkedList<>(); - for (Object value : (Collection) fieldValue) { - String tupleKeyName = tupleKeyListNameGenerator.value().getConstructor().newInstance().generate(value); - String tupleKey = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(tupleName, tupleKeyName)), false); - result.add(new RuleRepositoryTuple(tupleKey, value.toString())); - } - return result; - } + return isNamedItem(field) + ? swapToNamedTuples(databaseName, ruleType, tupleName, field, fieldValue) + : swapToUniqueTuple(databaseName, ruleType, tupleName, fieldValue).map(Collections::singletonList).orElse(Collections.emptyList()); + } + + @SneakyThrows(ReflectiveOperationException.class) + @SuppressWarnings("rawtypes") + private Collection<RuleRepositoryTuple> swapToNamedTuples(final String databaseName, final String ruleType, final String ruleItemType, final Field field, final Object fieldValue) { + Collection<RuleRepositoryTuple> result = new LinkedList<>(); if (fieldValue instanceof Map) { - Collection<RuleRepositoryTuple> result = new LinkedList<>(); for (Object entry : ((Map) fieldValue).entrySet()) { - String tupleKey = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(tupleName, ((Entry) entry).getKey().toString())), false); - result.add(new RuleRepositoryTuple(tupleKey, YamlEngine.marshal(((Entry) entry).getValue()))); + String ruleItemName = ((Entry) entry).getKey().toString(); + String path = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(ruleItemType, ruleItemName)), false); + result.add(new RuleRepositoryTuple(path, YamlEngine.marshal(((Entry) entry).getValue()))); + } + } else { + for (Object each : (Collection) fieldValue) { + String ruleItemName = field.getAnnotation(RuleRepositoryTupleKeyListNameGenerator.class).value().getConstructor().newInstance().generate(each); + String path = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(ruleItemType, ruleItemName)), false); + result.add(new RuleRepositoryTuple(path, each.toString())); } - return result; } - String tupleKey = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(tupleName)), false); + return result; + } + + @SuppressWarnings("rawtypes") + private Optional<RuleRepositoryTuple> swapToUniqueTuple(final String databaseName, final String ruleType, final String ruleItemType, final Object fieldValue) { + String path = NodePathGenerator.toPath(new DatabaseRuleNodePath(databaseName, ruleType, new DatabaseRuleItem(ruleItemType)), false); if (fieldValue instanceof Collection) { - return ((Collection) fieldValue).isEmpty() ? Collections.emptyList() : Collections.singleton(new RuleRepositoryTuple(tupleKey, YamlEngine.marshal(fieldValue))); + return ((Collection) fieldValue).isEmpty() ? Optional.empty() : Optional.of(new RuleRepositoryTuple(path, YamlEngine.marshal(fieldValue))); } if (fieldValue instanceof String) { - return ((String) fieldValue).isEmpty() ? Collections.emptyList() : Collections.singleton(new RuleRepositoryTuple(tupleKey, fieldValue.toString())); + return ((String) fieldValue).isEmpty() ? Optional.empty() : Optional.of(new RuleRepositoryTuple(path, fieldValue.toString())); } if (fieldValue instanceof Boolean || fieldValue instanceof Integer || fieldValue instanceof Long) { - return Collections.singleton(new RuleRepositoryTuple(tupleKey, fieldValue.toString())); + return Optional.of(new RuleRepositoryTuple(path, fieldValue.toString())); } if (fieldValue instanceof Enum) { - return Collections.singleton(new RuleRepositoryTuple(tupleKey, ((Enum) fieldValue).name())); + return Optional.of(new RuleRepositoryTuple(path, ((Enum) fieldValue).name())); } - return Collections.singleton(new RuleRepositoryTuple(tupleKey, YamlEngine.marshal(fieldValue))); + return Optional.of(new RuleRepositoryTuple(path, YamlEngine.marshal(fieldValue))); } /** @@ -200,15 +206,15 @@ public final class YamlRuleRepositoryTupleSwapperEngine { private void setFieldValue(final String databaseName, final YamlRuleConfiguration yamlRuleConfig, final Field field, final String ruleType, final RuleRepositoryTuple tuple) { String itemType = YamlRuleConfigurationFieldUtil.getTupleItemName(field); - if (isNamedItem(field, field.getAnnotation(RuleRepositoryTupleKeyListNameGenerator.class))) { + if (isNamedItem(field)) { setNamedItemFieldValue(databaseName, yamlRuleConfig, ruleType, tuple, itemType, field); } else { setUniqueItemFieldValue(databaseName, yamlRuleConfig, ruleType, tuple, itemType, field); } } - private boolean isNamedItem(final Field field, final RuleRepositoryTupleKeyListNameGenerator tupleKeyListNameGenerator) { - return field.getType().equals(Map.class) || null != tupleKeyListNameGenerator && field.getType().equals(Collection.class); + private boolean isNamedItem(final Field field) { + return field.getType().equals(Map.class) || null != field.getAnnotation(RuleRepositoryTupleKeyListNameGenerator.class) && field.getType().equals(Collection.class); } @SneakyThrows(ReflectiveOperationException.class) diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngineTest.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngineTest.java index 9ea88d2e7fb..4aab1ceefd7 100644 --- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngineTest.java +++ b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/YamlRuleRepositoryTupleSwapperEngineTest.java @@ -21,7 +21,6 @@ import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfigurati import org.apache.shardingsphere.mode.node.rule.tuple.fixture.leaf.LeafYamlRuleConfiguration; import org.apache.shardingsphere.mode.node.rule.tuple.fixture.node.NodeYamlRuleConfiguration; import org.apache.shardingsphere.mode.node.rule.tuple.fixture.node.NodeYamlRuleConfigurationEnum; -import org.apache.shardingsphere.mode.node.rule.tuple.fixture.none.NoneYamlRuleConfiguration; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -43,11 +42,6 @@ class YamlRuleRepositoryTupleSwapperEngineTest { assertThat(actual.getContent(), is("value: foo" + System.lineSeparator())); } - @Test - void assertSwapToTuplesWithoutTupleEntityAnnotation() { - assertTrue(new YamlRuleRepositoryTupleSwapperEngine().swapToTuples("foo_db", new NoneYamlRuleConfiguration()).isEmpty()); - } - @Test void assertSwapToTuplesWithEmptyNodeYamlRuleConfiguration() { assertTrue(new YamlRuleRepositoryTupleSwapperEngine().swapToTuples("foo_db", new NodeYamlRuleConfiguration()).isEmpty()); diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/leaf/GlobalLeafYamlRuleConfiguration.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/leaf/GlobalLeafYamlRuleConfiguration.java deleted file mode 100644 index a675d0ff6bb..00000000000 --- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/leaf/GlobalLeafYamlRuleConfiguration.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.mode.node.rule.tuple.fixture.leaf; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlGlobalRuleConfiguration; -import org.apache.shardingsphere.mode.node.rule.tuple.annotation.RuleRepositoryTupleEntity; - -@RuleRepositoryTupleEntity(value = "leaf", leaf = true) -@AllArgsConstructor -@NoArgsConstructor -@Getter -@Setter -public final class GlobalLeafYamlRuleConfiguration implements YamlGlobalRuleConfiguration { - - private String value; - - @Override - public Class<? extends RuleConfiguration> getRuleConfigurationType() { - return RuleConfiguration.class; - } -} diff --git a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/none/NoneYamlRuleConfiguration.java b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/none/NoneYamlRuleConfiguration.java deleted file mode 100644 index 322607224da..00000000000 --- a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/fixture/none/NoneYamlRuleConfiguration.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.mode.node.rule.tuple.fixture.none; - -import org.apache.shardingsphere.infra.config.rule.RuleConfiguration; -import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration; -import org.apache.shardingsphere.mode.node.rule.tuple.annotation.RuleRepositoryTupleEntity; - -@RuleRepositoryTupleEntity("none") -public final class NoneYamlRuleConfiguration implements YamlRuleConfiguration { - - @Override - public Class<? extends RuleConfiguration> getRuleConfigurationType() { - return RuleConfiguration.class; - } -}