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 2021/08/13 05:42:45 UTC
[GitHub] [shardingsphere] terrymanu commented on a change in pull request #11796: solve the OrderedServicesCache concurrency exception
terrymanu commented on a change in pull request #11796:
URL: https://github.com/apache/shardingsphere/pull/11796#discussion_r688257227
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/spi/ordered/OrderedSPIRegistry.java
##########
@@ -77,18 +77,18 @@
* @param comparator comparator
* @return registered services
*/
- @SuppressWarnings("unchecked")
public static <K, V extends OrderedSPI<?>> Map<K, V> getRegisteredServices(final Collection<K> types, final Class<V> orderedSPIClass, final Comparator<Integer> comparator) {
Review comment:
Is it better to adjust the param sequence too?
`orderedSPIClass` maybe the first param, `types` is second one.
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/spi/ordered/cache/OrderedServicesCacheKey.java
##########
@@ -17,20 +17,19 @@
package org.apache.shardingsphere.infra.spi.ordered.cache;
-import lombok.Getter;
+import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import java.util.Collection;
-import java.util.Map;
/**
- * Cached ordered services.
+ * Ordered services cache key.
*/
+@EqualsAndHashCode
Review comment:
Please adjust order, constructor should the first of annotation
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/spi/ordered/cache/OrderedServicesCacheKey.java
##########
@@ -17,20 +17,19 @@
package org.apache.shardingsphere.infra.spi.ordered.cache;
-import lombok.Getter;
+import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import java.util.Collection;
-import java.util.Map;
/**
- * Cached ordered services.
+ * Ordered services cache key.
*/
+@EqualsAndHashCode
@RequiredArgsConstructor
-@Getter
-public final class CachedOrderedServices {
+public class OrderedServicesCacheKey {
Review comment:
may add final with class
--
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