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 2020/10/24 05:54:19 UTC
[GitHub] [shardingsphere] piggytough opened a new issue #7905: shardingsphere-jdbc standard alg. initialization problem
piggytough opened a new issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905
### Which version of ShardingSphere did you use?
5.0.0-RC1-SNAPSHOT
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### problem
standard sharding algorithm configuration not loaded
configuration below:
```
spring:
shardingsphere:
dataSources:
...
rules:
sharding:
tables:
quantityaggregationdata:
logicTable: quantityaggregationdata
actualDataNodes: shardingdata.quantityaggregationdata_0_$->{0..7}
tableStrategy:
standard:
shardingColumn: logtime
shardingAlgorithmName: range-sharding
tx: com.example.demosharding.strategy.ShardingAlgorithm
keyGenerateStrategy:
column: id
keyGeneratorName: snowflake
shardingAlgorithms:
range-sharding:
type: BOUNDARY_RANGE
props:
sharding-ranges: 0, 10, 20, 30, 40, 50, 60, 70
```
cause I cannot find some useful configuration example except for INLINE sharding, i'm not sure my config is properly set.
In my opinion, maybe the initation function's not called before doSharding. like this.
![sharding config](https://user-images.githubusercontent.com/43106779/97069092-27e40c80-1600-11eb-86ea-3aa7ebc05baa.png)
## Maybe complex sharding's got the same problem as well.
thank you!
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough closed issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough closed issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-717750957
Yeah I tried. like this:
1) the initiazation never triggered.
![image](https://user-images.githubusercontent.com/43106779/97401901-9bea2180-192c-11eb-9336-0ef4f94aaa6e.png)
2) after manually init and got partitionRange, another error occured. Integer cast to Long problem.
![image](https://user-images.githubusercontent.com/43106779/97404564-46fcda00-1931-11eb-90d5-814e65f2aded.png)
----------------------------------------------------------------
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
[GitHub] [shardingsphere] avalon5666 commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-717170658
> > You can refer to the following configuration documents:
> > [Spring Boot Sharding Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/sharding/)
> > [Spring Boot Sharding Algorithm Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/sharding/)
> > Here is complete [Spring Boot Example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-jpa-example)
>
> thanks for your reply.
>
> I've read the document, a detailed configuration example. Yet my main question still remains.
> I mean, **the initialization of algorithm is not properly triggered while applicaition''s started**, few clue's found. Couldyou check out this for me? thank you.
>
> BTW, I suggest buildin complex algorithm like range + hash etc.
Have you ever tried inserting data? The result is your expect?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-720993460
sorry for replying late.
I made a pull yesterday, it's almost latest. I made the breakpoint by it's not loaded. howhowever the bean BoundaryBasedRangeShardingAlgorithm is loaded, I can't find any clue.
![image](https://user-images.githubusercontent.com/43106779/97966751-36e46f00-1df7-11eb-8c0d-7b8701ebe21e.png)
btw. my configuration's like below, I can't find anything wrong with that but the init is never loaded.
![image](https://user-images.githubusercontent.com/43106779/97966883-62675980-1df7-11eb-8206-203a0ac2824d.png)
----------------------------------------------------------------
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
[GitHub] [shardingsphere] avalon5666 commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-718301007
For Q1, can you make a breakpoint here, ensure the algorithm is loaded.
![image](https://user-images.githubusercontent.com/64016692/97513972-95a98300-19c8-11eb-9cae-1333b576e7ce.png)
By the way your code is lastest?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] avalon5666 commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-716301406
You can refer to the following configuration documents:
[Spring Boot Sharding Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/sharding/)
[Spring Boot Sharding Algorithm Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/sharding/)
Here is complete [Spring Boot Example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-jpa-example)
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-717088903
> You can refer to the following configuration documents:
> [Spring Boot Sharding Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/spring-boot-starter/sharding/)
> [Spring Boot Sharding Algorithm Configuration](https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/sharding/)
> Here is complete [Spring Boot Example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-jdbc-example/sharding-example/sharding-spring-boot-jpa-example)
thanks for your reply.
I've read the document, a detailed configuration example. Yet my main question still remains.
I mean, **the initialization of algorithm is not properly triggered while applicaition''s started**, few clue's found. Couldyou check out this for me? thank you.
BTW, I suggest buildin complex algorithm like range + hash etc.
----------------------------------------------------------------
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
[GitHub] [shardingsphere] avalon5666 commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-721557471
Did you have a custom BeanPostProcessor? It seem some class skipped auto proxying.
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-722182435
Oh sorry, My FAULT. After reCreating a demo project, it's ok to init. maybe some class's made the skip, I'll find that.
thank you for your patience. problem closed.
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-721579755
nope, it's only a simple demo. few classes were created except for ordinary controller/repository and druid connection. I can't see anything special
----------------------------------------------------------------
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
[GitHub] [shardingsphere] piggytough commented on issue #7905: shardingsphere-jdbc standard alg. initialization problem
Posted by GitBox <gi...@apache.org>.
piggytough commented on issue #7905:
URL: https://github.com/apache/shardingsphere/issues/7905#issuecomment-717089255
Meanwhile, what''s the difference between autotable and table?
----------------------------------------------------------------
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