You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/09 03:02:21 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #21994: ConvertYamlConfigurationHandler supports mixed rules.

RaigorJiang commented on code in PR #21994:
URL: https://github.com/apache/shardingsphere/pull/21994#discussion_r1017358426


##########
proxy/backend/src/test/resources/expected/convert-mix.yaml:
##########
@@ -0,0 +1,92 @@
+#
+# 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.
+#
+CREATE DATABASE mix_db;
+USE mix_db;
+
+REGISTER STORAGE UNIT ds_0 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+), ds_1 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+), ds_2 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_2?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+), ds_3 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_3?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+), ds_4 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_4?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+), ds_5 (
+URL='jdbc:mysql://127.0.0.1:3306/demo_ds_5?serverTimezone=UTC&useSSL=false',
+USER='root',
+PASSWORD='12345678',
+PROPERTIES('minPoolSize'='1', 'connectionTimeoutMilliseconds'='30000', 'maxLifetimeMilliseconds'='1800000', 'idleTimeoutMilliseconds'='60000', 'maxPoolSize'='50')
+);
+
+CREATE DB_DISCOVERY RULE readwrite_ds_0 (
+STORAGE_UNITS(ds_0,ds_1,ds_2),
+TYPE(NAME='mysql.mgr', PROPERTIES('group-name'='558edd3c-02ec-11ea-9bb3-080027e39bd2')),
+HEARTBEAT(PROPERTIES('keep-alive-cron'='0/5 * * * * ?'))
+), readwrite_ds_1 (
+STORAGE_UNITS(ds_3,ds_4,ds_5),
+TYPE(NAME='mysql.mgr', PROPERTIES('group-name'='558edd3c-02ec-11ea-9bb3-080027e39bd2')),
+HEARTBEAT(PROPERTIES('keep-alive-cron'='0/5 * * * * ?'))
+);
+
+CREATE READWRITE_SPLITTING RULE replica_ds_0 (
+AUTO_AWARE_RESOURCE=readwrite_ds_0,
+WRITE_DATA_SOURCE_QUERY_ENABLED=true
+), replica_ds_1 (
+AUTO_AWARE_RESOURCE=readwrite_ds_1,
+WRITE_DATA_SOURCE_QUERY_ENABLED=true
+);
+
+CREATE ENCRYPT RULE t_encrypt (
+COLUMNS(
+(NAME=user_id, PLAIN=user_plain, CIPHER=user_cipher, TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))),
+(NAME=order_id, CIPHER=order_cipher, TYPE(NAME='md5'))
+),QUERY_WITH_CIPHER_COLUMN=true);
+
+CREATE SHARDING ALGORITHM database_inline (

Review Comment:
   `CREATE SHARDING ALGORITHM` has been removed from DistSQL, shall we change it now or later?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org