未验证 提交 caa56fd7 编写于 作者: 孙不服 提交者: GitHub

Feature 3185 step1 registry (#3486)

* Add `CenterType` enum.

* 1. add InstanceConfiguration class.
2. update related code.
3. add UTs.

* Rename CenterType to OrchestrationType.
上级 b2a19302
......@@ -39,6 +39,11 @@
<artifactId>sharding-orchestration-reg-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-orchestration-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.orchestration.center.api;
import org.apache.shardingsphere.orchestration.center.configuration.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
import org.apache.shardingsphere.spi.TypeBasedSPI;
......@@ -38,7 +38,7 @@ public interface ConfigCenter extends TypeBasedSPI {
*
* @param config config center configuration
*/
void init(OrchestrationConfiguration config);
void init(InstanceConfiguration config);
/**
* Get data from config center.
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.orchestration.center.api;
import org.apache.shardingsphere.orchestration.center.configuration.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.spi.TypeBasedSPI;
/**
......@@ -35,7 +35,7 @@ public interface DistributedLockManagement extends TypeBasedSPI {
*
* @param config distributed lock center configuration
*/
void init(OrchestrationConfiguration config);
void init(InstanceConfiguration config);
/**
* Get data from distributed lock center.
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.orchestration.center.api;
import org.apache.shardingsphere.orchestration.center.configuration.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
import org.apache.shardingsphere.spi.TypeBasedSPI;
......@@ -39,7 +39,7 @@ public interface RegistryCenter extends TypeBasedSPI {
*
* @param config registry center configuration
*/
void init(OrchestrationConfiguration config);
void init(InstanceConfiguration config);
/**
* Get data from registry center.
......
/*
* 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.orchestration.center.configuration;
import java.util.Properties;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.api.config.TypeBasedSPIConfiguration;
/**
* Orchestration Instance Configuration.
*
* @author zhangliang
* @author dongzonglei
* @author wangguangyuan
* @author sunbufu
*/
@Getter
@Setter
public class InstanceConfiguration extends TypeBasedSPIConfiguration {
/**
* Type of orchestration.
*/
private String orchestrationType;
/**
* Server list of center.
*/
private String serverLists;
/**
* Namespace of center.
*/
private String namespace;
/**
* Constructor for InstanceConfiguration.
* @param type instance type
*/
public InstanceConfiguration(final String type) {
super(type);
}
/**
* Constructor for InstanceConfiguration.
* @param type instance type
* @param properties extra properties
*/
public InstanceConfiguration(final String type, final Properties properties) {
super(type, properties);
}
}
......@@ -17,11 +17,9 @@
package org.apache.shardingsphere.orchestration.center.configuration;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.api.config.TypeBasedSPIConfiguration;
import java.util.Properties;
/**
* Config center configuration.
......@@ -33,48 +31,10 @@ import java.util.Properties;
*/
@Getter
@Setter
public final class OrchestrationConfiguration extends TypeBasedSPIConfiguration {
/**
* Server list of config center.
*/
private String serverLists;
public final class OrchestrationConfiguration {
/**
* Namespace of config center.
* Instance configuration map.
*/
private String namespace;
/**
* Digest of config center.
*/
private String digest;
/**
* Operation timeout time in milliseconds.
*/
private int operationTimeoutMilliseconds = 500;
/**
* Max number of times to retry.
*/
private int maxRetries = 3;
/**
* Time interval in milliseconds on each retry.
*/
private int retryIntervalMilliseconds = 500;
/**
* Time to live in seconds of ephemeral keys.
*/
private int timeToLiveSeconds = 60;
public OrchestrationConfiguration(final String type) {
super(type);
}
public OrchestrationConfiguration(final String type, final Properties properties) {
super(type, properties);
}
private Map<String, InstanceConfiguration> instanceConfigurationMap;
}
......@@ -35,7 +35,7 @@ import org.apache.curator.utils.CloseableUtils;
import org.apache.shardingsphere.orchestration.center.api.ConfigCenter;
import org.apache.shardingsphere.orchestration.center.api.DistributedLockManagement;
import org.apache.shardingsphere.orchestration.center.api.RegistryCenter;
import org.apache.shardingsphere.orchestration.center.configuration.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.instance.handler.CuratorZookeeperExceptionHandler;
import org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
import org.apache.shardingsphere.orchestration.center.listener.DataChangedEventListener;
......@@ -75,24 +75,29 @@ public final class CuratorZookeeperInstance implements ConfigCenter, Distributed
private Properties properties = new Properties();
@Override
public void init(final OrchestrationConfiguration config) {
public void init(final InstanceConfiguration config) {
client = buildCuratorClient(config);
initCuratorClient(config);
}
private CuratorFramework buildCuratorClient(final OrchestrationConfiguration config) {
private CuratorFramework buildCuratorClient(final InstanceConfiguration config) {
int retryIntervalMilliseconds = Integer.parseInt(config.getProperties().getProperty("retryIntervalMilliseconds", "500"));
int maxRetries = Integer.parseInt(config.getProperties().getProperty("maxRetries", "3"));
int timeToLiveSeconds = Integer.parseInt(config.getProperties().getProperty("timeToLiveSeconds", "60"));
int operationTimeoutMilliseconds = Integer.parseInt(config.getProperties().getProperty("operationTimeoutMilliseconds", "500"));
String digest = config.getProperties().getProperty("digest");
CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
.connectString(config.getServerLists())
.retryPolicy(new ExponentialBackoffRetry(config.getRetryIntervalMilliseconds(), config.getMaxRetries(), config.getRetryIntervalMilliseconds() * config.getMaxRetries()))
.retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries))
.namespace(config.getNamespace());
if (0 != config.getTimeToLiveSeconds()) {
builder.sessionTimeoutMs(config.getTimeToLiveSeconds() * 1000);
if (0 != timeToLiveSeconds) {
builder.sessionTimeoutMs(timeToLiveSeconds * 1000);
}
if (0 != config.getOperationTimeoutMilliseconds()) {
builder.connectionTimeoutMs(config.getOperationTimeoutMilliseconds());
if (0 != operationTimeoutMilliseconds) {
builder.connectionTimeoutMs(operationTimeoutMilliseconds);
}
if (!Strings.isNullOrEmpty(config.getDigest())) {
builder.authorization("digest", config.getDigest().getBytes(Charsets.UTF_8))
if (!Strings.isNullOrEmpty(digest)) {
builder.authorization("digest", digest.getBytes(Charsets.UTF_8))
.aclProvider(new ACLProvider() {
@Override
......@@ -109,10 +114,12 @@ public final class CuratorZookeeperInstance implements ConfigCenter, Distributed
return builder.build();
}
private void initCuratorClient(final OrchestrationConfiguration config) {
private void initCuratorClient(final InstanceConfiguration config) {
client.start();
try {
if (!client.blockUntilConnected(config.getRetryIntervalMilliseconds() * config.getMaxRetries(), TimeUnit.MILLISECONDS)) {
int retryIntervalMilliseconds = Integer.parseInt(config.getProperties().getProperty("retryIntervalMilliseconds", "500"));
int maxRetries = Integer.parseInt(config.getProperties().getProperty("maxRetries", "3"));
if (!client.blockUntilConnected(retryIntervalMilliseconds * maxRetries, TimeUnit.MILLISECONDS)) {
client.close();
throw new OperationTimeoutException();
}
......
/*
* 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.orchestration.center.yaml.config;
import java.util.Properties;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.core.yaml.config.YamlConfiguration;
/**
* Orchestration instance configuration for YAML.
*
* @author zhangliang
* @author dongzonglei
* @author wangguangyuan
* @author sunbufu
*/
@Getter
@Setter
public class YamlInstanceConfiguration implements YamlConfiguration {
private String orchestrationType;
private String instanceType;
private String serverLists;
private String namespace;
private Properties props = new Properties();
}
/*
* 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.orchestration.center.yaml.swapper;
import org.apache.shardingsphere.core.yaml.swapper.YamlSwapper;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.yaml.config.YamlInstanceConfiguration;
/**
* Orchestration instance configuration YAML swapper.
*
* @author zhangliang
* @author dongzonglei
* @author wangguangyuan
* @author sunbufu
*/
public final class InstanceConfigurationYamlSwapper implements YamlSwapper<YamlInstanceConfiguration, InstanceConfiguration> {
/**
* Swap from InstanceConfiguration to YamlInstanceConfiguration.
*
* @param data data to be swapped
* @return YAML instance configuration
*/
@Override
public YamlInstanceConfiguration swap(final InstanceConfiguration data) {
YamlInstanceConfiguration result = new YamlInstanceConfiguration();
result.setOrchestrationType(data.getOrchestrationType());
result.setInstanceType(data.getType());
result.setServerLists(data.getServerLists());
result.setNamespace(data.getNamespace());
result.setProps(data.getProperties());
return result;
}
/**
* Swap from YamlInstanceConfiguration to InstanceConfiguration.
*
* @param yamlConfiguration YAML instance configuration
* @return swapped object
*/
@Override
public InstanceConfiguration swap(final YamlInstanceConfiguration yamlConfiguration) {
InstanceConfiguration result = new InstanceConfiguration(yamlConfiguration.getInstanceType(), yamlConfiguration.getProps());
result.setOrchestrationType(yamlConfiguration.getOrchestrationType());
result.setServerLists(yamlConfiguration.getServerLists());
result.setNamespace(yamlConfiguration.getNamespace());
return result;
}
}
/*
* 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.orchestration.center.configuration;
import java.util.Properties;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class InstanceConfigurationTest {
@Test
public void assertConstructorWithType() {
String type = "zookeeper";
assertThat(new InstanceConfiguration(type).getType(), is(type));
}
@Test
public void assertConstructorWithTypeAndProperties() {
String type = "zookeeper";
Properties properties = new Properties();
InstanceConfiguration instanceConfiguration = new InstanceConfiguration(type, properties);
assertThat(instanceConfiguration.getType(), is(type));
assertThat(instanceConfiguration.getProperties(), is(properties));
}
@Test
public void assertCenterType() {
String type = "zookeeper";
String orchestrationType = "config_center";
InstanceConfiguration instanceConfiguration = new InstanceConfiguration(type);
instanceConfiguration.setOrchestrationType(orchestrationType);
assertThat(instanceConfiguration.getOrchestrationType(), is(orchestrationType));
}
@Test
public void assertServerLists() {
String type = "zookeeper";
String serverLists = "127.0.0.1:2181,127.0.0.1:2182";
InstanceConfiguration instanceConfiguration = new InstanceConfiguration(type);
instanceConfiguration.setServerLists(serverLists);
assertThat(instanceConfiguration.getServerLists(), is(serverLists));
}
@Test
public void assertNamespace() {
String type = "zookeeper";
String namespace = "orchestration";
InstanceConfiguration instanceConfiguration = new InstanceConfiguration(type);
instanceConfiguration.setNamespace(namespace);
assertThat(instanceConfiguration.getNamespace(), is(namespace));
}
}
/*
* 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.orchestration.center.configuration;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class OrchestrationConfigurationTest {
@Test
public void assertInstanceConfigurationMap() {
OrchestrationConfiguration orchestrationConfiguration = new OrchestrationConfiguration();
Map<String, InstanceConfiguration> instanceConfigurationMap = new HashMap<>();
orchestrationConfiguration.setInstanceConfigurationMap(instanceConfigurationMap);
assertThat(orchestrationConfiguration.getInstanceConfigurationMap(), is(instanceConfigurationMap));
}
}
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.orchestration.center.instance;
import org.apache.shardingsphere.orchestration.center.configuration.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.util.EmbedTestingServer;
import org.junit.BeforeClass;
......@@ -36,7 +36,7 @@ public class CuratorZookeeperInstanceTest {
@BeforeClass
public static void init() {
EmbedTestingServer.start();
OrchestrationConfiguration configuration = new OrchestrationConfiguration(curatorZookeeperInstance.getType(), new Properties());
InstanceConfiguration configuration = new InstanceConfiguration(curatorZookeeperInstance.getType(), new Properties());
configuration.setServerLists("127.0.0.1:3181");
curatorZookeeperInstance.init(configuration);
}
......
/*
* 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.orchestration.center.yaml.config;
import java.util.Properties;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class YamlInstanceConfigurationTest {
@Test
public void assertCenterType() {
String orchestrationType = "config_center";
YamlInstanceConfiguration yamlInstanceConfiguration = new YamlInstanceConfiguration();
yamlInstanceConfiguration.setOrchestrationType(orchestrationType);
assertThat(yamlInstanceConfiguration.getOrchestrationType(), is(orchestrationType));
}
@Test
public void assertInstanceType() {
String instanceType = "zookeeper";
YamlInstanceConfiguration yamlInstanceConfiguration = new YamlInstanceConfiguration();
yamlInstanceConfiguration.setInstanceType(instanceType);
assertThat(yamlInstanceConfiguration.getInstanceType(), is(instanceType));
}
@Test
public void assertServerLists() {
String serverLists = "127.0.0.1:2181,127.0.0.1:2182";
YamlInstanceConfiguration yamlInstanceConfiguration = new YamlInstanceConfiguration();
yamlInstanceConfiguration.setServerLists(serverLists);
assertThat(yamlInstanceConfiguration.getServerLists(), is(serverLists));
}
@Test
public void assertNamespace() {
String namespace = "orchestration";
YamlInstanceConfiguration yamlInstanceConfiguration = new YamlInstanceConfiguration();
yamlInstanceConfiguration.setNamespace(namespace);
assertThat(yamlInstanceConfiguration.getNamespace(), is(namespace));
}
@Test
public void assertProperties() {
Properties properties = new Properties();
YamlInstanceConfiguration yamlInstanceConfiguration = new YamlInstanceConfiguration();
yamlInstanceConfiguration.setProps(properties);
assertThat(yamlInstanceConfiguration.getProps(), is(properties));
}
}
/*
* 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.orchestration.center.yaml.swapper;
import java.util.Properties;
import org.apache.shardingsphere.orchestration.center.configuration.InstanceConfiguration;
import org.apache.shardingsphere.orchestration.center.yaml.config.YamlInstanceConfiguration;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class InstanceConfigurationYamlSwapperTest {
@Test
public void assertToYaml() {
InstanceConfiguration instanceConfiguration = getInstanceConfiguration();
YamlInstanceConfiguration yamlConfiguration = new InstanceConfigurationYamlSwapper().swap(instanceConfiguration);
assertThat(yamlConfiguration.getOrchestrationType(), is(instanceConfiguration.getOrchestrationType()));
assertThat(yamlConfiguration.getInstanceType(), is(instanceConfiguration.getType()));
assertThat(yamlConfiguration.getServerLists(), is(instanceConfiguration.getServerLists()));
assertThat(yamlConfiguration.getNamespace(), is(instanceConfiguration.getNamespace()));
assertThat(yamlConfiguration.getProps(), is(instanceConfiguration.getProperties()));
}
private InstanceConfiguration getInstanceConfiguration() {
InstanceConfiguration result = new InstanceConfiguration("zookeeper", new Properties());
result.setOrchestrationType("config_center");
result.setServerLists("127.0.0.1:2181,127.0.0.1:2182");
result.setNamespace("orchestration");
return result;
}
@Test
public void assertSwapToConfiguration() {
YamlInstanceConfiguration yamlConfiguration = getYamlInstanceConfiguration();
InstanceConfiguration instanceConfiguration = new InstanceConfigurationYamlSwapper().swap(yamlConfiguration);
assertThat(instanceConfiguration.getOrchestrationType(), is(yamlConfiguration.getOrchestrationType()));
assertThat(instanceConfiguration.getType(), is(yamlConfiguration.getInstanceType()));
assertThat(instanceConfiguration.getServerLists(), is(yamlConfiguration.getServerLists()));
assertThat(instanceConfiguration.getNamespace(), is(yamlConfiguration.getNamespace()));
assertThat(instanceConfiguration.getProperties(), is(yamlConfiguration.getProps()));
}
private YamlInstanceConfiguration getYamlInstanceConfiguration() {
YamlInstanceConfiguration result = new YamlInstanceConfiguration();
result.setInstanceType("zookeeper");
result.setProps(new Properties());
result.setOrchestrationType("config_center");
result.setServerLists("127.0.0.1:2181,127.0.0.1:2182");
result.setNamespace("orchestration");
return result;
}
}
/*
* 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.orchestration.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* Orchestration type.
*
* @author zhangliang
* @author dongzonglei
* @author wangguangyuan
* @author sunbufu
*/
@Getter
@RequiredArgsConstructor
public enum OrchestrationType {
REGISTRY_CENTER("registry_center"),
CONFIG_CENTER("config_center"),
DISTRIBUTED_LOCK_MANAGER("distributed_lock_manager");
private final String value;
/**
* Find OrchestrationType via property value.
*
* @param value property value
* @return OrchestrationType enum, return {@code null} if not found
*/
public static OrchestrationType findByValue(final String value) {
for (OrchestrationType each : OrchestrationType.values()) {
if (each.getValue().equals(value)) {
return each;
}
}
return null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册