You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/02/26 13:15:36 UTC

[GitHub] [skywalking] tristaZero opened a new pull request #4421: Create Sharding Algorithm

tristaZero opened a new pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421
 
 
   Please answer these questions before submitting pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [x] Improve performance
   
   - Related issues
   #4131
   ___
   ### Bug fix
   - Bug description.
   
   - How to fix?
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591798660
 
 
   I mean comments of codes. You missed that. Are you planning to wait for @dmsolr to provide e2e? Even yes, should you or he provide the sharding configuration?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] dmsolr commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
dmsolr commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-592304790
 
 
   Oh, if you have written e2e-mysql, I think you are so familiar with e2e. @tristaZero 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385096658
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
 
 Review comment:
   My guess, the actual meaning is, `Database Location Algorithm, locate the specific database instance in the given cluster`
   
   Same questions for all `*Algorithm`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385098267
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/RangeDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,72 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.LinkedHashSet;
+
+/**
+ * Range sharding algorithm to shard database.
+ *
+ * Sharding Sphere will use it to handle SQL with between query condition.
+ */
+public final class RangeDatabaseShardingAlgorithm implements RangeShardingAlgorithm<String> {
 
 Review comment:
   What is this for? And what is the difference between this and `PreciseDatabaseShardingAlgorithm`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-592301866
 
 
   @tristaZero e2e is not that complex, as you have wrote one for MySQL. For shardingsphere, it is same as the prev one. What helps do you need? Your words make me feeling you have blocks?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] dmsolr commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
dmsolr commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591884786
 
 
   Hi, we need to setup e2e for shardingsphere before the main features to merge, right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385093793
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
+ * 
+ * Sharding Sphere will use it to handle SQL with equal or in query condition.
+ */
+public final class PreciseDatabaseShardingAlgorithm implements PreciseShardingAlgorithm<String> {
+    
+    private final static int DB_NUMBER = 4;
 
 Review comment:
   Is this static? How should user inject the value?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591950218
 
 
   @dmsolr You are doing storage UT framework and potential separated validator, right? I assume, without specific reasons, @tristaZero should finish the e2e by herself. This is an important step to understand how the SkyWalking community works, and help her to be one of qualified committer in the future. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] dmsolr commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
dmsolr commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-592303298
 
 
   Hi @tristaZero 
   I am sorry. In fact, I think I can take little time to finish the e2e part if you provided the configuration of ShardSphere. In other words, we need to spend time to make ShardSphere work in a Docker container. 
   If you don't want to waste volume time learning the e2e framework temporarily, I am willing to do it. :)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385095420
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseTableShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard table.
+ *
+ * Sharding Sphere will use it to handle SQL with equal or in query condition.
+ */
+public final class PreciseTableShardingAlgorithm implements PreciseShardingAlgorithm<String> {
+    
+    private final static int TB_NUMBER = 10;
 
 Review comment:
   Same question here. Can't inject the value?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591894302
 
 
   > Hi, we need to setup e2e for shardingsphere before the main features to merge, right?
   
   Yes, after this PR is merged, you can move farword. And [here](https://shardingsphere.apache.org/document/current/cn/quick-start/sharding-proxy-quick-start/) is introduction of ShardingProxy.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591914948
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`master@4ebd617`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `66.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4421/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #4421   +/-   ##
   =========================================
     Coverage          ?   25.06%           
   =========================================
     Files             ?     1215           
     Lines             ?    28124           
     Branches          ?     3877           
   =========================================
     Hits              ?     7049           
     Misses            ?    20426           
     Partials          ?      649
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...re/register/service/EndpointInventoryRegister.java](https://codecov.io/gh/apache/skywalking/pull/4421/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2NvcmUvcmVnaXN0ZXIvc2VydmljZS9FbmRwb2ludEludmVudG9yeVJlZ2lzdGVyLmphdmE=) | `0% <0%> (ø)` | |
   | [...r/parser/standardization/ReferenceIdExchanger.java](https://codecov.io/gh/apache/skywalking/pull/4421/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItcmVjZWl2ZXItcGx1Z2luL3NreXdhbGtpbmctdHJhY2UtcmVjZWl2ZXItcGx1Z2luL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9za3l3YWxraW5nL29hcC9zZXJ2ZXIvcmVjZWl2ZXIvdHJhY2UvcHJvdmlkZXIvcGFyc2VyL3N0YW5kYXJkaXphdGlvbi9SZWZlcmVuY2VJZEV4Y2hhbmdlci5qYXZh) | `0% <0%> (ø)` | |
   | [...p/server/core/profile/analyze/ProfileAnalyzer.java](https://codecov.io/gh/apache/skywalking/pull/4421/diff?src=pr&el=tree#diff-b2FwLXNlcnZlci9zZXJ2ZXItY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2t5d2Fsa2luZy9vYXAvc2VydmVyL2NvcmUvcHJvZmlsZS9hbmFseXplL1Byb2ZpbGVBbmFseXplci5qYXZh) | `68.51% <100%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=footer). Last update [4ebd617...a454845](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385094345
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
 
 Review comment:
   What does this sentence mean? `Precise` is an adj.. Could you re-organize?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] wu-sheng commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591948842
 
 
   > Hi, we need to setup e2e for shardingsphere before the main features to merge, right?
   
   That is my concern. Traditionally, we don't merge PR without tests(including e2e), unless they are from experienced committer/PMC. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385488058
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
 
 Review comment:
   Precise sharding algorithm is a special item of Sharding Sphere. You can learn it more [Here](https://shardingsphere.apache.org/document/current/en/features/sharding/concept/sharding/). If necessary, i can add this description link to comment.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591766386
 
 
   Hi @wu-sheng  
   > Comments are required.
   
   I am not sure which comment you mentioned, but i modifed my first comment. Do you think it makes sense?
   
   > What are the steps of the further PRs? 
   
   As [Schedule](https://github.com/apache/skywalking/issues/4131#issuecomment-587302393) said, the next jobs are `Provide configuration of Sharding Proxy for Skywalking.` and `Provide e2e tests of Skywalking.`
   
   So maybe it is the time we'd better ask @dmsolr 's for help.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385487127
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
+ * 
+ * Sharding Sphere will use it to handle SQL with equal or in query condition.
+ */
+public final class PreciseDatabaseShardingAlgorithm implements PreciseShardingAlgorithm<String> {
+    
+    private final static int DB_NUMBER = 4;
 
 Review comment:
   Sorry that user can not inject the value into any implementation of this interface.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385488058
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
 
 Review comment:
   Precise sharding algorithm is a special item of Sharding Sphere. You can learn it more [Here](https://shardingsphere.apache.org/document/current/en/features/sharding/concept/sharding/). I will add this description link to comment, if you think it is necessary.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385488058
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/PreciseDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+
+import java.util.Collection;
+
+/**
+ * Precise sharding algorithm to shard database.
 
 Review comment:
   `Precise sharding algorithm` is a special item of Sharding Sphere. You can learn it more [Here](https://shardingsphere.apache.org/document/current/en/features/sharding/concept/sharding/). I will add this description link to comment, if you think it is necessary.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on a change in pull request #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#discussion_r385490319
 
 

 ##########
 File path: oap-server/server-storage-plugin/storage-shardingsphere-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/shardingsphere/RangeDatabaseShardingAlgorithm.java
 ##########
 @@ -0,0 +1,72 @@
+/*
+ * 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.skywalking.oap.server.storage.plugin.shardingsphere;
+
+import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
+import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.LinkedHashSet;
+
+/**
+ * Range sharding algorithm to shard database.
+ *
+ * Sharding Sphere will use it to handle SQL with between query condition.
+ */
+public final class RangeDatabaseShardingAlgorithm implements RangeShardingAlgorithm<String> {
 
 Review comment:
   Please note the small difference between `handle SQL with between(>= / <=) query condition` and `handle SQL with equal or in (= / IN) query condition`.
   Sorry my comments confused you, do you have a idea to describe them better?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-592298661
 
 
   @wu-sheng @dmsolr 
   > we don't merge PR without tests(including e2e)
   
   Hi, thanks for your comment. I can provide unit tests for all the Algorithms, if what you said is a rule of SW community.
   
   In addition, if others are interested and fimiliar with e2e than me, i am glad he or she can join me to finish this task togather.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] codecov-io edited a comment on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591914948
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=h1) Report
   > Merging [#4421](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/4ebd61717ba511b66da9f2512217f05602a28f17?src=pr&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/skywalking/pull/4421/graphs/tree.svg?width=650&token=qrILxY5yA8&height=150&src=pr)](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #4421   +/-   ##
   =======================================
     Coverage   25.06%   25.06%           
   =======================================
     Files        1215     1215           
     Lines       28124    28124           
     Branches     3877     3877           
   =======================================
     Hits         7048     7048           
     Misses      20426    20426           
     Partials      650      650
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=footer). Last update [4ebd617...a454845](https://codecov.io/gh/apache/skywalking/pull/4421?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-592897186
 
 
   @wu-sheng @dmsolr Make sense to me.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [skywalking] tristaZero commented on issue #4421: Create Sharding Algorithm

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4421: Create Sharding Algorithm
URL: https://github.com/apache/skywalking/pull/4421#issuecomment-591897391
 
 
   > I mean comments of codes. You missed that. Are you planning to wait for @dmsolr to provide e2e? Even yes, should you or he provide the sharding configuration?
   
   Comments have been added.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services