837414750 opened a new issue, #20870:
URL: https://github.com/apache/shardingsphere/issues/20870

   ## Question
   `public class KeyGenerator implements ShardingKeyGenerator {
   
       private SnowflakeShardingKeyGenerator snow = new 
SnowflakeShardingKeyGenerator();
   
       @Override
       public Comparable<?> generateKey() {
           //return getCurrentDateKey() + snow.generateKey();
           return snow.generateKey();
       }
   
       @Override
       public String getType() {
           return "TRAINKEY";
       }
   
       @Override
       public Properties getProperties() {
           return null;
       }
   
       @Override
       public void setProperties(Properties properties) {
   
       }
   }`
   
![image](https://user-images.githubusercontent.com/29977320/189030019-81e080e7-670b-4c8c-91d8-c39839397365.png)
   
![image](https://user-images.githubusercontent.com/29977320/189030118-1bb31f1a-ed94-400c-8e1d-1e2c20cba7bf.png)
   --
   Startup error:
   Caused by: java.lang.RuntimeException: Invalid 
`org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator` SPI type `TRAINKEY`.
        at 
org.apache.shardingsphere.spi.TypeBasedSPIServiceLoader.newService(TypeBasedSPIServiceLoader.java:46)
        at 
org.apache.shardingsphere.core.rule.TableRule.<init>(TableRule.java:113)
        at 
org.apache.shardingsphere.core.rule.ShardingRule.lambda$createTableRules$0(ShardingRule.java:91)
        at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at 
java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at 
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
   
   Please 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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to