diff --git a/sharding-core/src/main/java/io/shardingsphere/core/optimizer/insert/InsertOptimizeEngine.java b/sharding-core/src/main/java/io/shardingsphere/core/optimizer/insert/InsertOptimizeEngine.java
index d086719843c76..180c5f4191640 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/optimizer/insert/InsertOptimizeEngine.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/optimizer/insert/InsertOptimizeEngine.java
@@ -81,7 +81,7 @@ public ShardingConditions optimize() {
}
String expression;
Number currentGeneratedKey = generatedKeys.next();
- if (0 == parameters.size()) {
+ if (parameters.isEmpty()) {
if (DefaultKeyword.VALUES.equals(insertValue.getType())) {
expression = insertValue.getExpression().substring(0, insertValue.getExpression().lastIndexOf(")")) + ", " + currentGeneratedKey.toString() + ")";
} else {
diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutorTest.java b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutorTest.java
index d4661f6979318..82a9492fce0af 100644
--- a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutorTest.java
+++ b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/BatchPreparedStatementExecutorTest.java
@@ -155,7 +155,6 @@ private void setSQLType(final SQLType sqlType) {
field.set(actual, sqlType);
}
-
private void setExecuteGroups(final List preparedStatements) {
Collection> executeGroups = new LinkedList<>();
List preparedStatementExecuteUnits = new LinkedList<>();
diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/PreparedStatementExecutorTest.java b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/PreparedStatementExecutorTest.java
index 76661f4ff9918..e753d3184e55c 100644
--- a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/PreparedStatementExecutorTest.java
+++ b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/shardingjdbc/executor/PreparedStatementExecutorTest.java
@@ -71,7 +71,7 @@ public void assertNoStatement() throws SQLException {
}
@Test
- public void assertExecuteQueryForSinglePreparedStatementSuccess() throws SQLException{
+ public void assertExecuteQueryForSinglePreparedStatementSuccess() throws SQLException {
PreparedStatement preparedStatement = getPreparedStatement();
ResultSet resultSet = mock(ResultSet.class);
when(resultSet.getInt(1)).thenReturn(1);
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/Bootstrap.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/Bootstrap.java
index 831597ff5b337..462d9bb61ec5a 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/Bootstrap.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/Bootstrap.java
@@ -22,13 +22,13 @@
import io.shardingsphere.core.yaml.other.YamlServerConfiguration;
import io.shardingsphere.opentracing.ShardingTracer;
import io.shardingsphere.orchestration.internal.OrchestrationFacade;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
-import io.shardingsphere.shardingproxy.config.yaml.ProxyConfiguration;
-import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlConfigurationLoader;
+import io.shardingsphere.shardingproxy.config.ShardingConfiguration;
+import io.shardingsphere.shardingproxy.config.ShardingConfigurationLoader;
import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlRuleConfiguration;
import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlServerConfiguration;
import io.shardingsphere.shardingproxy.frontend.ShardingProxy;
import io.shardingsphere.shardingproxy.listener.ProxyListenerRegister;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@@ -57,13 +57,13 @@ public final class Bootstrap {
* @throws IOException IO exception
*/
public static void main(final String[] args) throws InterruptedException, IOException {
- ProxyConfiguration proxyConfig = new ProxyYamlConfigurationLoader().load();
+ ShardingConfiguration shardingConfig = new ShardingConfigurationLoader().load();
int port = getPort(args);
new ProxyListenerRegister().register();
- if (null == proxyConfig.getServerConfiguration().getOrchestration()) {
- startWithoutRegistryCenter(proxyConfig.getServerConfiguration(), proxyConfig.getRuleConfigurationMap(), port);
+ if (null == shardingConfig.getServerConfiguration().getOrchestration()) {
+ startWithoutRegistryCenter(shardingConfig.getServerConfiguration(), shardingConfig.getRuleConfigurationMap(), port);
} else {
- startWithRegistryCenter(proxyConfig.getServerConfiguration(), proxyConfig.getRuleConfigurationMap(), port);
+ startWithRegistryCenter(shardingConfig.getServerConfiguration(), shardingConfig.getRuleConfigurationMap(), port);
}
}
@@ -80,7 +80,7 @@ private static int getPort(final String[] args) {
private static void startWithoutRegistryCenter(
final ProxyYamlServerConfiguration serverConfig, final Map ruleConfigs, final int port) throws InterruptedException {
- ProxyContext.getInstance().init(getYamlServerConfiguration(serverConfig), getSchemaDataSourceMap(ruleConfigs), getRuleConfiguration(ruleConfigs));
+ GlobalRegistry.getInstance().init(getYamlServerConfiguration(serverConfig), getSchemaDataSourceMap(ruleConfigs), getRuleConfiguration(ruleConfigs));
initOpenTracing();
new ShardingProxy().start(port);
}
@@ -91,7 +91,7 @@ private static void startWithRegistryCenter(
if (!ruleConfigs.isEmpty()) {
orchestrationFacade.init(getYamlServerConfiguration(serverConfig), getSchemaDataSourceMap(ruleConfigs), getRuleConfiguration(ruleConfigs));
}
- ProxyContext.getInstance().init(orchestrationFacade.getConfigService().loadYamlServerConfiguration(),
+ GlobalRegistry.getInstance().init(orchestrationFacade.getConfigService().loadYamlServerConfiguration(),
orchestrationFacade.getConfigService().loadProxyDataSources(), orchestrationFacade.getConfigService().loadProxyConfiguration());
initOpenTracing();
new ShardingProxy().start(port);
@@ -99,7 +99,7 @@ private static void startWithRegistryCenter(
}
private static void initOpenTracing() {
- if (ProxyContext.getInstance().isOpenTracingEnable()) {
+ if (GlobalRegistry.getInstance().isOpenTracingEnable()) {
ShardingTracer.init();
}
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendExecutorContext.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendExecutorContext.java
index 07ea68cb32d98..e4c41ef16bb41 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendExecutorContext.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendExecutorContext.java
@@ -18,7 +18,7 @@
package io.shardingsphere.shardingproxy.backend;
import io.shardingsphere.core.executor.ShardingExecuteEngine;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import lombok.Getter;
/**
@@ -31,7 +31,7 @@ public final class BackendExecutorContext {
private static final BackendExecutorContext INSTANCE = new BackendExecutorContext();
@Getter
- private final ShardingExecuteEngine executeEngine = new ShardingExecuteEngine(ProxyContext.getInstance().getExecutorSize());
+ private final ShardingExecuteEngine executeEngine = new ShardingExecuteEngine(GlobalRegistry.getInstance().getExecutorSize());
/**
* Get backend executor context instance.
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendHandlerFactory.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendHandlerFactory.java
index 89323ab25adc8..c61179671ee6f 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendHandlerFactory.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/BackendHandlerFactory.java
@@ -38,9 +38,9 @@
import io.shardingsphere.shardingproxy.backend.jdbc.wrapper.PreparedStatementExecutorWrapper;
import io.shardingsphere.shardingproxy.backend.jdbc.wrapper.StatementExecutorWrapper;
import io.shardingsphere.shardingproxy.backend.netty.NettyBackendHandler;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
-import io.shardingsphere.shardingproxy.config.RuleRegistry;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
+import io.shardingsphere.shardingproxy.runtime.ShardingSchema;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@@ -56,7 +56,7 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class BackendHandlerFactory {
- private static final ProxyContext PROXY_CONTEXT = ProxyContext.getInstance();
+ private static final GlobalRegistry GLOBAL_REGISTRY = GlobalRegistry.getInstance();
/**
* Create new instance of text protocol backend handler.
@@ -71,11 +71,11 @@ public final class BackendHandlerFactory {
*/
public static BackendHandler newTextProtocolInstance(
final int connectionId, final int sequenceId, final String sql, final BackendConnection backendConnection, final DatabaseType databaseType, final String schema) {
- RuleRegistry ruleRegistry = PROXY_CONTEXT.getRuleRegistry(schema);
- backendConnection.setRuleRegistry(ruleRegistry);
- return PROXY_CONTEXT.isUseNIO()
- ? new NettyBackendHandler(ruleRegistry, connectionId, sequenceId, sql, databaseType)
- : new JDBCBackendHandler(ruleRegistry, sql, new JDBCExecuteEngine(backendConnection, new StatementExecutorWrapper(ruleRegistry)));
+ ShardingSchema shardingSchema = GLOBAL_REGISTRY.getShardingSchema(schema);
+ backendConnection.setShardingSchema(shardingSchema);
+ return GLOBAL_REGISTRY.isUseNIO()
+ ? new NettyBackendHandler(shardingSchema, connectionId, sequenceId, sql, databaseType)
+ : new JDBCBackendHandler(shardingSchema, sql, new JDBCExecuteEngine(backendConnection, new StatementExecutorWrapper(shardingSchema)));
}
/**
@@ -92,10 +92,10 @@ public static BackendHandler newTextProtocolInstance(
*/
public static BackendHandler newBinaryProtocolInstance(final int connectionId, final int sequenceId, final String sql, final List
*/
-package io.shardingsphere.shardingproxy.config.yaml;
+package io.shardingsphere.shardingproxy.config;
+import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlRuleConfiguration;
+import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlServerConfiguration;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Map;
/**
- * Proxy configuration.
+ * Sharding configuration.
*
* @author zhangliang
*/
@RequiredArgsConstructor
@Getter
-public final class ProxyConfiguration {
+public final class ShardingConfiguration {
private final ProxyYamlServerConfiguration serverConfiguration;
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/yaml/ProxyYamlConfigurationLoader.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoader.java
similarity index 88%
rename from sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/yaml/ProxyYamlConfigurationLoader.java
rename to sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoader.java
index 6eb6855f44522..c7169d1e5c519 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/yaml/ProxyYamlConfigurationLoader.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoader.java
@@ -15,11 +15,13 @@
*
*/
-package io.shardingsphere.shardingproxy.config.yaml;
+package io.shardingsphere.shardingproxy.config;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
+import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlRuleConfiguration;
+import io.shardingsphere.shardingproxy.config.yaml.ProxyYamlServerConfiguration;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@@ -36,11 +38,11 @@
import java.util.regex.Pattern;
/**
- * Yaml configuration loader.
+ * Sharding configuration loader.
*
* @author chenqingyang
*/
-public final class ProxyYamlConfigurationLoader {
+public final class ShardingConfigurationLoader {
private static final String CONFIG_PATH = "/conf/";
@@ -54,10 +56,10 @@ public final class ProxyYamlConfigurationLoader {
* @return proxy configuration
* @throws IOException IO exception
*/
- public ProxyConfiguration load() throws IOException {
+ public ShardingConfiguration load() throws IOException {
Collection schemaNames = new HashSet<>();
- ProxyYamlServerConfiguration serverConfig = loadServerConfiguration(new File(ProxyYamlConfigurationLoader.class.getResource(CONFIG_PATH + SERVER_CONFIG_FILE).getFile()));
- File configPath = new File(ProxyYamlConfigurationLoader.class.getResource(CONFIG_PATH).getFile());
+ ProxyYamlServerConfiguration serverConfig = loadServerConfiguration(new File(ShardingConfigurationLoader.class.getResource(CONFIG_PATH + SERVER_CONFIG_FILE).getFile()));
+ File configPath = new File(ShardingConfigurationLoader.class.getResource(CONFIG_PATH).getFile());
Collection ruleConfigurations = new LinkedList<>();
for (File each : findRuleConfigurationFiles(configPath)) {
Optional ruleConfig = loadRuleConfiguration(each, serverConfig);
@@ -71,7 +73,7 @@ public ProxyConfiguration load() throws IOException {
for (ProxyYamlRuleConfiguration each : ruleConfigurations) {
ruleConfigurationMap.put(each.getSchemaName(), each);
}
- return new ProxyConfiguration(serverConfig, ruleConfigurationMap);
+ return new ShardingConfiguration(serverConfig, ruleConfigurationMap);
}
private ProxyYamlServerConfiguration loadServerConfiguration(final File yamlFile) throws IOException {
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/ShardingProxy.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/ShardingProxy.java
index 263635a41a133..7edc83a17f262 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/ShardingProxy.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/ShardingProxy.java
@@ -32,8 +32,8 @@
import io.netty.handler.logging.LoggingHandler;
import io.shardingsphere.shardingproxy.backend.BackendExecutorContext;
import io.shardingsphere.shardingproxy.backend.netty.client.BackendNettyClientManager;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
import io.shardingsphere.shardingproxy.frontend.common.netty.ServerHandlerInitializer;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
/**
* Sharding-Proxy.
@@ -44,7 +44,7 @@
*/
public final class ShardingProxy {
- private static final ProxyContext PROXY_CONTEXT = ProxyContext.getInstance();
+ private static final GlobalRegistry GLOBAL_REGISTRY = GlobalRegistry.getInstance();
private final BackendExecutorContext backendExecutorContext = BackendExecutorContext.getInstance();
@@ -55,7 +55,7 @@ public final class ShardingProxy {
private EventLoopGroup userGroup;
public ShardingProxy() {
- PROXY_CONTEXT.initShardingMetaData(backendExecutorContext.getExecuteEngine());
+ GLOBAL_REGISTRY.initShardingMetaData(backendExecutorContext.getExecuteEngine());
}
/**
@@ -66,7 +66,7 @@ public ShardingProxy() {
*/
public void start(final int port) throws InterruptedException {
try {
- if (PROXY_CONTEXT.isUseNIO()) {
+ if (GLOBAL_REGISTRY.isUseNIO()) {
BackendNettyClientManager.getInstance().start();
}
ServerBootstrap bootstrap = new ServerBootstrap();
@@ -83,7 +83,7 @@ public void start(final int port) throws InterruptedException {
workerGroup.shutdownGracefully();
bossGroup.shutdownGracefully();
backendExecutorContext.getExecuteEngine().close();
- if (PROXY_CONTEXT.isUseNIO()) {
+ if (GLOBAL_REGISTRY.isUseNIO()) {
BackendNettyClientManager.getInstance().stop();
}
}
@@ -99,7 +99,7 @@ private EventLoopGroup createEventLoopGroup() {
private void groupsEpoll(final ServerBootstrap bootstrap) {
workerGroup = new EpollEventLoopGroup();
- userGroup = new EpollEventLoopGroup(PROXY_CONTEXT.getAcceptorSize());
+ userGroup = new EpollEventLoopGroup(GLOBAL_REGISTRY.getAcceptorSize());
bootstrap.group(bossGroup, workerGroup)
.channel(EpollServerSocketChannel.class)
.option(EpollChannelOption.SO_BACKLOG, 128)
@@ -112,7 +112,7 @@ private void groupsEpoll(final ServerBootstrap bootstrap) {
private void groupsNio(final ServerBootstrap bootstrap) {
workerGroup = new NioEventLoopGroup();
- userGroup = new NioEventLoopGroup(PROXY_CONTEXT.getAcceptorSize());
+ userGroup = new NioEventLoopGroup(GLOBAL_REGISTRY.getAcceptorSize());
bootstrap.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 128)
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/common/executor/ExecutorGroup.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/common/executor/ExecutorGroup.java
index 733c4c3042e3b..eb8d7f9aef8bb 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/common/executor/ExecutorGroup.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/common/executor/ExecutorGroup.java
@@ -20,7 +20,7 @@
import io.netty.channel.ChannelId;
import io.netty.channel.EventLoopGroup;
import io.shardingsphere.core.constant.transaction.TransactionType;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import lombok.RequiredArgsConstructor;
import java.util.concurrent.ExecutorService;
@@ -33,7 +33,7 @@
@RequiredArgsConstructor
public final class ExecutorGroup {
- private static final ProxyContext PROXY_CONTEXT = ProxyContext.getInstance();
+ private static final GlobalRegistry GLOBAL_REGISTRY = GlobalRegistry.getInstance();
private final EventLoopGroup eventLoopGroup;
@@ -45,6 +45,6 @@ public final class ExecutorGroup {
* @return executor service
*/
public ExecutorService getExecutorService() {
- return TransactionType.XA == PROXY_CONTEXT.getTransactionType() ? ChannelThreadExecutorGroup.getInstance().get(channelId) : eventLoopGroup;
+ return TransactionType.XA == GLOBAL_REGISTRY.getTransactionType() ? ChannelThreadExecutorGroup.getInstance().get(channelId) : eventLoopGroup;
}
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/MySQLFrontendHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/MySQLFrontendHandler.java
index eda281ce1a897..5030a77bb21b1 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/MySQLFrontendHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/frontend/mysql/MySQLFrontendHandler.java
@@ -22,13 +22,11 @@
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.EventLoopGroup;
-import io.shardingsphere.spi.root.RootInvokeHook;
-import io.shardingsphere.spi.root.SPIRootInvokeHook;
import io.shardingsphere.shardingproxy.backend.jdbc.connection.BackendConnection;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
import io.shardingsphere.shardingproxy.frontend.common.executor.ExecutorGroup;
import io.shardingsphere.shardingproxy.runtime.ChannelRegistry;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import io.shardingsphere.shardingproxy.transport.common.packet.DatabasePacket;
import io.shardingsphere.shardingproxy.transport.mysql.constant.ServerErrorCode;
import io.shardingsphere.shardingproxy.transport.mysql.packet.MySQLPacketPayload;
@@ -43,6 +41,8 @@
import io.shardingsphere.shardingproxy.transport.mysql.packet.handshake.ConnectionIdGenerator;
import io.shardingsphere.shardingproxy.transport.mysql.packet.handshake.HandshakePacket;
import io.shardingsphere.shardingproxy.transport.mysql.packet.handshake.HandshakeResponse41Packet;
+import io.shardingsphere.spi.root.RootInvokeHook;
+import io.shardingsphere.spi.root.SPIRootInvokeHook;
import lombok.RequiredArgsConstructor;
import java.sql.SQLException;
@@ -75,7 +75,7 @@ protected void auth(final ChannelHandlerContext context, final ByteBuf message)
try (MySQLPacketPayload payload = new MySQLPacketPayload(message)) {
HandshakeResponse41Packet response41 = new HandshakeResponse41Packet(payload);
if (authenticationHandler.login(response41.getUsername(), response41.getAuthResponse())) {
- if (!Strings.isNullOrEmpty(response41.getDatabase()) && !ProxyContext.getInstance().schemaExists(response41.getDatabase())) {
+ if (!Strings.isNullOrEmpty(response41.getDatabase()) && !GlobalRegistry.getInstance().schemaExists(response41.getDatabase())) {
context.writeAndFlush(new ErrPacket(response41.getSequenceId() + 1, ServerErrorCode.ER_BAD_DB_ERROR, response41.getDatabase()));
return;
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/listener/ProxyListenerRegister.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/listener/ProxyListenerRegister.java
index 73417c87bc7e1..2c9469b0bcd3d 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/listener/ProxyListenerRegister.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/listener/ProxyListenerRegister.java
@@ -18,7 +18,7 @@
package io.shardingsphere.shardingproxy.listener;
import io.shardingsphere.core.bootstrap.ShardingBootstrap;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
/**
* Listener register for Proxy.
@@ -28,13 +28,13 @@
*/
public final class ProxyListenerRegister {
- private final ProxyContext proxyContext = ProxyContext.getInstance();
+ private final GlobalRegistry globalRegistry = GlobalRegistry.getInstance();
/**
* Register all listeners.
*/
public void register() {
ShardingBootstrap.init();
- proxyContext.register();
+ globalRegistry.register();
}
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyContext.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
similarity index 85%
rename from sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyContext.java
rename to sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
index 30eb5559f653a..df49504b29dc4 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyContext.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/GlobalRegistry.java
@@ -15,7 +15,7 @@
*
*/
-package io.shardingsphere.shardingproxy.config;
+package io.shardingsphere.shardingproxy.runtime;
import com.google.common.base.Strings;
import com.google.common.eventbus.Subscribe;
@@ -24,13 +24,14 @@
import io.shardingsphere.core.constant.transaction.TransactionType;
import io.shardingsphere.core.event.ShardingEventBusInstance;
import io.shardingsphere.core.executor.ShardingExecuteEngine;
-import io.shardingsphere.core.rule.DataSourceParameter;
import io.shardingsphere.core.rule.Authentication;
+import io.shardingsphere.core.rule.DataSourceParameter;
import io.shardingsphere.core.yaml.YamlRuleConfiguration;
import io.shardingsphere.core.yaml.other.YamlServerConfiguration;
import io.shardingsphere.orchestration.internal.event.config.ProxyConfigurationEventBusEvent;
import io.shardingsphere.orchestration.internal.event.state.CircuitStateEventBusEvent;
import io.shardingsphere.orchestration.internal.event.state.ProxyDisabledStateEventBusEvent;
+import io.shardingsphere.shardingproxy.runtime.nio.BackendNIOConfiguration;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -43,26 +44,24 @@
import java.util.concurrent.ConcurrentHashMap;
/**
- * Proxy context.
+ * Global registry.
*
* @author chenqingyang
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
-public final class ProxyContext {
+public final class GlobalRegistry {
- private static final ProxyContext INSTANCE = new ProxyContext();
+ private static final GlobalRegistry INSTANCE = new GlobalRegistry();
private List schemaNames = new LinkedList<>();
- private Map ruleRegistryMap = new ConcurrentHashMap<>();
+ private Map shardingSchemas = new ConcurrentHashMap<>();
private Authentication authentication;
private boolean showSQL;
- private boolean useNIO;
-
private int maxConnectionsSizePerQuery;
private int acceptorSize;
@@ -73,6 +72,8 @@ public final class ProxyContext {
private boolean openTracingEnable;
+ private boolean useNIO;
+
private BackendNIOConfiguration backendNIOConfig;
private boolean isCircuitBreak;
@@ -82,7 +83,7 @@ public final class ProxyContext {
*
* @return instance of proxy context.
*/
- public static ProxyContext getInstance() {
+ public static GlobalRegistry getInstance() {
return INSTANCE;
}
@@ -105,7 +106,7 @@ public void init(final YamlServerConfiguration serverConfig, final Map entry : schemaRules.entrySet()) {
String schemaName = entry.getKey();
schemaNames.add(schemaName);
- ruleRegistryMap.put(schemaName, new RuleRegistry(schemaName, schemaDataSources.get(schemaName), entry.getValue()));
+ shardingSchemas.put(schemaName, new ShardingSchema(schemaName, schemaDataSources.get(schemaName), entry.getValue()));
}
}
@@ -134,7 +135,7 @@ private void initServerConfiguration(final YamlServerConfiguration serverConfig)
* @param executeEngine sharding execute engine
*/
public void initShardingMetaData(final ShardingExecuteEngine executeEngine) {
- for (RuleRegistry each : ruleRegistryMap.values()) {
+ for (ShardingSchema each : shardingSchemas.values()) {
each.initShardingMetaData(executeEngine);
}
}
@@ -150,13 +151,13 @@ public boolean schemaExists(final String schema) {
}
/**
- * Get rule registry of schema.
+ * Get sharding schema.
*
- * @param schema schema
- * @return rule registry of schema
+ * @param schemaName schema name
+ * @return sharding schema
*/
- public RuleRegistry getRuleRegistry(final String schema) {
- return Strings.isNullOrEmpty(schema) ? null : ruleRegistryMap.get(schema);
+ public ShardingSchema getShardingSchema(final String schemaName) {
+ return Strings.isNullOrEmpty(schemaName) ? null : shardingSchemas.get(schemaName);
}
/**
@@ -167,13 +168,13 @@ public RuleRegistry getRuleRegistry(final String schema) {
@Subscribe
public void renew(final ProxyConfigurationEventBusEvent proxyConfigurationEventBusEvent) {
initServerConfiguration(proxyConfigurationEventBusEvent.getServerConfiguration());
- for (Entry entry : ruleRegistryMap.entrySet()) {
+ for (Entry entry : shardingSchemas.entrySet()) {
entry.getValue().getBackendDataSource().close();
}
- ruleRegistryMap.clear();
+ shardingSchemas.clear();
for (Entry> entry : proxyConfigurationEventBusEvent.getSchemaDataSourceMap().entrySet()) {
String schemaName = entry.getKey();
- ruleRegistryMap.put(schemaName, new RuleRegistry(schemaName, entry.getValue(), proxyConfigurationEventBusEvent.getSchemaRuleMap().get(schemaName)));
+ shardingSchemas.put(schemaName, new ShardingSchema(schemaName, entry.getValue(), proxyConfigurationEventBusEvent.getSchemaRuleMap().get(schemaName)));
}
}
@@ -194,7 +195,7 @@ public void renewCircuitBreakerDataSourceNames(final CircuitStateEventBusEvent c
*/
@Subscribe
public void renewDisabledDataSourceNames(final ProxyDisabledStateEventBusEvent disabledStateEventBusEvent) {
- for (Entry entry : ruleRegistryMap.entrySet()) {
+ for (Entry entry : shardingSchemas.entrySet()) {
entry.getValue().setDisabledDataSourceNames(disabledStateEventBusEvent.getDisabledSchemaDataSourceMap().get(entry.getKey()));
}
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/RuleRegistry.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/ShardingSchema.java
similarity index 89%
rename from sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/RuleRegistry.java
rename to sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/ShardingSchema.java
index 37516e37a8645..bbfe3f1fa2ffb 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/RuleRegistry.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/ShardingSchema.java
@@ -15,7 +15,7 @@
*
*/
-package io.shardingsphere.shardingproxy.config;
+package io.shardingsphere.shardingproxy.runtime;
import io.shardingsphere.api.config.ShardingRuleConfiguration;
import io.shardingsphere.core.constant.DatabaseType;
@@ -26,6 +26,7 @@
import io.shardingsphere.core.rule.ShardingRule;
import io.shardingsphere.core.yaml.YamlRuleConfiguration;
import io.shardingsphere.shardingproxy.backend.jdbc.datasource.JDBCBackendDataSource;
+import io.shardingsphere.shardingproxy.runtime.metadata.ProxyTableMetaDataConnectionManager;
import lombok.Getter;
import lombok.Setter;
@@ -36,7 +37,7 @@
import java.util.Map.Entry;
/**
- * Sharding rule registry.
+ * Sharding schema.
*
* @author zhangliang
* @author zhangyonglun
@@ -45,9 +46,9 @@
* @author wangkai
*/
@Getter
-public final class RuleRegistry {
+public final class ShardingSchema {
- private final String schemaName;
+ private final String name;
private final Map dataSources;
@@ -62,8 +63,8 @@ public final class RuleRegistry {
@Setter
private Collection disabledDataSourceNames = new LinkedList<>();
- public RuleRegistry(final String schemaName, final Map dataSources, final YamlRuleConfiguration rule) {
- this.schemaName = schemaName;
+ public ShardingSchema(final String name, final Map dataSources, final YamlRuleConfiguration rule) {
+ this.name = name;
// TODO :jiaqi only use JDBC need connect db via JDBC, netty style should use SQL packet to get metadata
this.dataSources = dataSources;
shardingRule = new ShardingRule(null == rule.getShardingRule() ? new ShardingRuleConfiguration() : rule.getShardingRule().getShardingRuleConfiguration(), dataSources.keySet());
@@ -78,7 +79,7 @@ public RuleRegistry(final String schemaName, final Map getDataSourceURLs(final Map dataSourceParameters) {
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyTableMetaDataConnectionManager.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/metadata/ProxyTableMetaDataConnectionManager.java
similarity index 95%
rename from sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyTableMetaDataConnectionManager.java
rename to sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/metadata/ProxyTableMetaDataConnectionManager.java
index 6e05adf36704a..cf1a1c613975f 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/ProxyTableMetaDataConnectionManager.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/metadata/ProxyTableMetaDataConnectionManager.java
@@ -15,7 +15,7 @@
*
*/
-package io.shardingsphere.shardingproxy.config;
+package io.shardingsphere.shardingproxy.runtime.metadata;
import io.shardingsphere.core.metadata.table.executor.TableMetaDataConnectionManager;
import io.shardingsphere.shardingproxy.backend.jdbc.datasource.JDBCBackendDataSource;
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/BackendNIOConfiguration.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/nio/BackendNIOConfiguration.java
similarity index 94%
rename from sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/BackendNIOConfiguration.java
rename to sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/nio/BackendNIOConfiguration.java
index 2c5d3d3a8cc85..7172dafe87cd2 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/config/BackendNIOConfiguration.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/runtime/nio/BackendNIOConfiguration.java
@@ -15,7 +15,7 @@
*
*/
-package io.shardingsphere.shardingproxy.config;
+package io.shardingsphere.shardingproxy.runtime.nio;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/admin/initdb/ComInitDbPacket.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/admin/initdb/ComInitDbPacket.java
index bb1f2b9f5305f..776d972f1a736 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/admin/initdb/ComInitDbPacket.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/admin/initdb/ComInitDbPacket.java
@@ -18,8 +18,8 @@
package io.shardingsphere.shardingproxy.transport.mysql.packet.command.admin.initdb;
import com.google.common.base.Optional;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import io.shardingsphere.shardingproxy.transport.mysql.constant.ServerErrorCode;
import io.shardingsphere.shardingproxy.transport.mysql.packet.MySQLPacketPayload;
import io.shardingsphere.shardingproxy.transport.mysql.packet.command.CommandPacket;
@@ -61,7 +61,7 @@ public void write(final MySQLPacketPayload payload) {
@Override
public Optional execute() {
log.debug("Schema name received for Sharding-Proxy: {}", schema);
- if (ProxyContext.getInstance().schemaExists(schema)) {
+ if (GlobalRegistry.getInstance().schemaExists(schema)) {
frontendHandler.setCurrentSchema(schema);
return Optional.of(new CommandResponsePackets(new OKPacket(getSequenceId() + 1)));
}
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/execute/ComStmtExecutePacket.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/execute/ComStmtExecutePacket.java
index e3acbcdb5c3c9..2787f37a9d63a 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/execute/ComStmtExecutePacket.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/execute/ComStmtExecutePacket.java
@@ -24,8 +24,8 @@
import io.shardingsphere.shardingproxy.backend.BackendHandlerFactory;
import io.shardingsphere.shardingproxy.backend.ResultPacket;
import io.shardingsphere.shardingproxy.backend.jdbc.connection.BackendConnection;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import io.shardingsphere.shardingproxy.transport.common.packet.DatabasePacket;
import io.shardingsphere.shardingproxy.transport.mysql.constant.ColumnType;
import io.shardingsphere.shardingproxy.transport.mysql.constant.NewParametersBoundFlag;
@@ -139,7 +139,7 @@ public void write(final MySQLPacketPayload payload) {
@Override
public Optional execute() {
log.debug("COM_STMT_EXECUTE received for Sharding-Proxy: {}", statementId);
- if (ProxyContext.getInstance().isCircuitBreak()) {
+ if (GlobalRegistry.getInstance().isCircuitBreak()) {
return Optional.of(new CommandResponsePackets(new ErrPacket(1, ServerErrorCode.ER_CIRCUIT_BREAK_MODE)));
}
return Optional.of(backendHandler.execute());
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/prepare/ComStmtPreparePacket.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/prepare/ComStmtPreparePacket.java
index 33a59c72b3a8b..498e0ff641aa6 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/prepare/ComStmtPreparePacket.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/prepare/ComStmtPreparePacket.java
@@ -23,9 +23,9 @@
import io.shardingsphere.core.parsing.parser.sql.SQLStatement;
import io.shardingsphere.core.parsing.parser.sql.dml.insert.InsertStatement;
import io.shardingsphere.core.parsing.parser.sql.dql.select.SelectStatement;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
-import io.shardingsphere.shardingproxy.config.RuleRegistry;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
+import io.shardingsphere.shardingproxy.runtime.ShardingSchema;
import io.shardingsphere.shardingproxy.transport.mysql.constant.ColumnType;
import io.shardingsphere.shardingproxy.transport.mysql.packet.MySQLPacketPayload;
import io.shardingsphere.shardingproxy.transport.mysql.packet.command.CommandPacket;
@@ -61,8 +61,8 @@ public ComStmtPreparePacket(final int sequenceId, final MySQLPacketPayload paylo
this.sequenceId = sequenceId;
this.frontendHandler = frontendHandler;
sql = payload.readStringEOF();
- RuleRegistry ruleRegistry = ProxyContext.getInstance().getRuleRegistry(frontendHandler.getCurrentSchema());
- sqlParsingEngine = new SQLParsingEngine(DatabaseType.MySQL, sql, ruleRegistry.getShardingRule(), ruleRegistry.getMetaData().getTable());
+ ShardingSchema shardingSchema = GlobalRegistry.getInstance().getShardingSchema(frontendHandler.getCurrentSchema());
+ sqlParsingEngine = new SQLParsingEngine(DatabaseType.MySQL, sql, shardingSchema.getShardingRule(), shardingSchema.getMetaData().getTable());
}
@Override
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacket.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacket.java
index 1a064a627df61..ea5833fba5899 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacket.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacket.java
@@ -27,8 +27,8 @@
import io.shardingsphere.shardingproxy.backend.BackendHandlerFactory;
import io.shardingsphere.shardingproxy.backend.ResultPacket;
import io.shardingsphere.shardingproxy.backend.jdbc.connection.BackendConnection;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
import io.shardingsphere.shardingproxy.frontend.common.FrontendHandler;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import io.shardingsphere.shardingproxy.transport.common.packet.DatabasePacket;
import io.shardingsphere.shardingproxy.transport.mysql.constant.ServerErrorCode;
import io.shardingsphere.shardingproxy.transport.mysql.packet.MySQLPacketPayload;
@@ -84,14 +84,14 @@ public void write(final MySQLPacketPayload payload) {
@Override
public Optional execute() throws SQLException {
log.debug("COM_QUERY received for Sharding-Proxy: {}", sql);
- if (ProxyContext.getInstance().isCircuitBreak()) {
+ if (GlobalRegistry.getInstance().isCircuitBreak()) {
return Optional.of(new CommandResponsePackets(new ErrPacket(1, ServerErrorCode.ER_CIRCUIT_BREAK_MODE)));
}
Optional operationType = TransactionOperationType.getOperationType(sql);
if (!operationType.isPresent()) {
return Optional.of(backendHandler.execute());
}
- if (TransactionType.XA == ProxyContext.getInstance().getTransactionType() && isInTransaction(operationType.get())) {
+ if (TransactionType.XA == GlobalRegistry.getInstance().getTransactionType() && isInTransaction(operationType.get())) {
ShardingEventBusInstance.getInstance().post(new XATransactionEvent(operationType.get()));
}
// TODO :zhaojun do not send TCL to backend, send when local transaction ready
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/handshake/AuthenticationHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/handshake/AuthenticationHandler.java
index 6f2feca85adf8..fb43ec8c7ca46 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/handshake/AuthenticationHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/transport/mysql/packet/handshake/AuthenticationHandler.java
@@ -19,7 +19,7 @@
import com.google.common.base.Strings;
import io.shardingsphere.core.rule.Authentication;
-import io.shardingsphere.shardingproxy.config.ProxyContext;
+import io.shardingsphere.shardingproxy.runtime.GlobalRegistry;
import lombok.Getter;
import org.apache.commons.codec.digest.DigestUtils;
@@ -33,7 +33,7 @@
@Getter
public final class AuthenticationHandler {
- private static final ProxyContext PROXY_CONTEXT = ProxyContext.getInstance();
+ private static final GlobalRegistry GLOBAL_REGISTRY = GlobalRegistry.getInstance();
private final AuthPluginData authPluginData = new AuthPluginData();
@@ -45,7 +45,7 @@ public final class AuthenticationHandler {
* @return login success or failure
*/
public boolean login(final String username, final byte[] authResponse) {
- Authentication authentication = PROXY_CONTEXT.getAuthentication();
+ Authentication authentication = GLOBAL_REGISTRY.getAuthentication();
if (Strings.isNullOrEmpty(authentication.getPassword())) {
return authentication.getUsername().equals(username);
}
diff --git a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/AllConfigTests.java b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/AllConfigTests.java
index 91a619ff64f11..067af63a7cdc6 100644
--- a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/AllConfigTests.java
+++ b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/AllConfigTests.java
@@ -22,6 +22,6 @@
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses(ProxyTableMetaDataConnectionManagerTest.class)
+@SuiteClasses(ShardingConfigurationLoaderTest.class)
public final class AllConfigTests {
}
diff --git a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java
new file mode 100644
index 0000000000000..80df8e35e1bce
--- /dev/null
+++ b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2016-2018 shardingsphere.io.
+ *
+ * Licensed 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.
+ *