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/04/09 02:47:16 UTC

[GitHub] [shardingsphere] sandynz opened a new pull request, #16687: Revise 16677, generic type inference problem workaround

sandynz opened a new pull request, #16687:
URL: https://github.com/apache/shardingsphere/pull/16687

   
   Changes proposed in this pull request:
   - Revise 16677, generic type inference problem workaround
   
   TypedSPIRegistry.getRegisteredServiceMetaDataMap is not used, it's kept for now.
   


-- 
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


[GitHub] [shardingsphere] sandynz commented on pull request #16687: Revise 16677, generic type inference problem workaround

Posted by GitBox <gi...@apache.org>.
sandynz commented on PR #16687:
URL: https://github.com/apache/shardingsphere/pull/16687#issuecomment-1093615490

   The fixed problem in unit test of `ShowScalingCheckAlgorithmsQueryResultSetTest`, stack trace:
   ```
   java.util.ServiceConfigurationError: org.apache.shardingsphere.data.pipeline.api.RuleAlteredJobAPI: Provider org.apache.shardingsphere.data.pipeline.core.api.impl.RuleAlteredJobAPIImpl could not be instantiated
   
   	at java.util.ServiceLoader.fail(ServiceLoader.java:232)
   	at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
   	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
   	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
   	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
   	at org.apache.shardingsphere.spi.ShardingSphereServiceLoader.load(ShardingSphereServiceLoader.java:53)
   	at org.apache.shardingsphere.spi.ShardingSphereServiceLoader.register(ShardingSphereServiceLoader.java:47)
   	at org.apache.shardingsphere.data.pipeline.api.PipelineJobAPIFactory.<clinit>(PipelineJobAPIFactory.java:29)
   	at org.apache.shardingsphere.scaling.distsql.handler.query.ShowScalingCheckAlgorithmsQueryResultSet.<clinit>(ShowScalingCheckAlgorithmsQueryResultSet.java:39)
   	at org.apache.shardingsphere.scaling.distsql.handler.query.ShowScalingCheckAlgorithmsQueryResultSetTest.assertGetRowData(ShowScalingCheckAlgorithmsQueryResultSetTest.java:54)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
   	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
   	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
   	at org.mockito.internal.runners.DefaultInternalRunner$1$1.evaluate(DefaultInternalRunner.java:54)
   	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
   	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
   	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
   	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
   	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
   	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
   	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
   	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
   	at org.mockito.internal.runners.DefaultInternalRunner$1.run(DefaultInternalRunner.java:99)
   	at org.mockito.internal.runners.DefaultInternalRunner.run(DefaultInternalRunner.java:105)
   	at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:40)
   	at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163)
   	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
   	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
   	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
   	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
   Caused by: java.lang.BootstrapMethodError: call site initialization exception
   	at java.lang.invoke.CallSite.makeSite(CallSite.java:341)
   	at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
   	at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
   	at org.apache.shardingsphere.spi.type.typed.TypedSPIRegistry.getRegisteredServiceMetaDataMap(TypedSPIRegistry.java:127)
   	at org.apache.shardingsphere.data.pipeline.core.api.impl.RuleAlteredJobAPIImpl.<clinit>(RuleAlteredJobAPIImpl.java:85)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at java.lang.Class.newInstance(Class.java:442)
   	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
   	... 35 more
   Caused by: java.lang.invoke.LambdaConversionException: Invalid receiver type interface org.apache.shardingsphere.spi.type.typed.TypedSPIMetadataAware; not a subtype of implementation type interface org.apache.shardingsphere.spi.type.typed.TypedSPI
   	at java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:233)
   	at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:303)
   	at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
   	... 45 more
   ```
   
   `DataConsistencyCheckAlgorithm` signature:
   ```
   public interface DataConsistencyCheckAlgorithm extends ShardingSphereAlgorithm, TypedSPIMetadataAware, ShardingSphereAlgorithmPostProcessor {
   ```
   
   `ShardingSphereAlgorithm` is sub interface of `StatefulTypedSPI`.
   
   `TypedSPIRegistry.getRegisteredServiceMetaDataMap` source code:
   ```
       public static <T extends TypedSPIMetadataAware & TypedSPI> Map<String, T> getRegisteredServiceMetaDataMap(final Class<T> spiClass) {
           return ShardingSphereServiceLoader.getSingletonServiceInstances(spiClass).stream().collect(Collectors.toMap(TypedSPI::getType, Function.identity()));
       }
   ```
   
   


-- 
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


[GitHub] [shardingsphere] zjcnb merged pull request #16687: Revise 16677, generic type inference problem workaround

Posted by GitBox <gi...@apache.org>.
zjcnb merged PR #16687:
URL: https://github.com/apache/shardingsphere/pull/16687


-- 
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