Skip to content

Commit

Permalink
1.并发问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
weilong.hu committed Jan 26, 2021
1 parent 945afb9 commit 843fcd4
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ebatis-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ebatis-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.concurrent.ConcurrentHashMap;

/**
* 路由器载入器,对名字缓存
Expand All @@ -16,7 +16,7 @@
*/
@Slf4j
public class ClusterRouterLoader {
private static final Map<String, ClusterRouter> CLUSTER_ROUTERS = new HashMap<>();
private static final Map<String, ClusterRouter> CLUSTER_ROUTERS = new ConcurrentHashMap<>();

private ClusterRouterLoader() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.elasticsearch.index.query.RangeQueryBuilder;

public enum IntervalType {
enum IntervalType {
/**
* 闭区间
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand All @@ -13,7 +13,7 @@
* @since 2020/6/3 14:11
*/
class CachedAnnotationMeta implements AnnotationMeta {
private static final Map<Class<? extends Annotation>, AnnotationMeta> METAS = new HashMap<>();
private static final Map<Class<? extends Annotation>, AnnotationMeta> METAS = new ConcurrentHashMap<>();

private final Class<? extends Annotation> annotationType;
private final List<AnnotationAttribute> attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

/**
* @author duoliang.zhang
Expand Down Expand Up @@ -62,7 +62,7 @@ public <T> Object adaptResult(CompletableFuture<T> futureResult) {
}
};

private static final Map<Class<?>, ResultType> METHOD_RETURN_TYPES = new HashMap<>();
private static final Map<Class<?>, ResultType> METHOD_RETURN_TYPES = new ConcurrentHashMap<>();

static {
for (ResultType type : values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import java.lang.annotation.Annotation;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* Mapper接口注解表,所有的接口的动态代理都存在在此
Expand All @@ -17,7 +17,7 @@
* @since 2020/5/25 17:27
*/
class MapperRegistry {
private static final Map<Class<?>, Object> PROXIES = new HashMap<>();
private static final Map<Class<?>, Object> PROXIES = new ConcurrentHashMap<>();

private MapperRegistry() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.concurrent.ConcurrentHashMap;

/**
* @author 章多亮
* @since 2019/12/20 10:35
*/
public class ResponseExtractorLoader {
private static final Map<MethodMeta, ResponseExtractor<?>> RESPONSE_EXTRACTORS = new HashMap<>();
private static final Map<MethodMeta, ResponseExtractor<?>> RESPONSE_EXTRACTORS = new ConcurrentHashMap<>();
private static final List<ResponseExtractorProvider> RESPONSE_EXTRACTOR_PROVIDERS = new ArrayList<>();

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

/**
* 集群亲和会话
Expand All @@ -40,7 +40,7 @@
* @since 2020/5/23 17:14
*/
class CachedClusterSession implements ClusterSession {
private static final Map<Cluster, ClusterSession> CLUSTER_SESSIONS = new HashMap<>();
private static final Map<Cluster, ClusterSession> CLUSTER_SESSIONS = new ConcurrentHashMap<>();
private final Cluster cluster;
private final Interceptor interceptor;

Expand Down
4 changes: 2 additions & 2 deletions ebatis-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>io.manbang</groupId>
<artifactId>ebatis-spring</artifactId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis-spring-boot</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion ebatis-spring-boot/ebatis-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis-spring-boot</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
8 changes: 4 additions & 4 deletions ebatis-spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -30,17 +30,17 @@
<dependency>
<groupId>io.manbang</groupId>
<artifactId>ebatis-spring</artifactId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>io.manbang</groupId>
<artifactId>ebatis-core</artifactId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>io.manbang</groupId>
<artifactId>ebatis-spring-boot-autoconfigure</artifactId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions ebatis-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ebatis-spring</artifactId>
Expand All @@ -14,7 +14,7 @@
<dependency>
<artifactId>ebatis-core</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
2 changes: 1 addition & 1 deletion ebatis-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ebatis</artifactId>
<groupId>io.manbang</groupId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.manbang</groupId>
<artifactId>ebatis</artifactId>
<version>7.5.1.6.RELEASE</version>
<version>7.5.1.7.RELEASE</version>
<packaging>pom</packaging>
<name>ebatis</name>
<description>Elasticsearch ORM Framework</description>
Expand Down

0 comments on commit 843fcd4

Please sign in to comment.