Skip to content

Commit

Permalink
chore(*): merge dev_3.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yizzuide committed Nov 22, 2023
2 parents f68a92a + a0326a4 commit 66b8c44
Show file tree
Hide file tree
Showing 310 changed files with 9,663 additions and 1,618 deletions.
61 changes: 52 additions & 9 deletions Milkomeda/pom.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@

<properties>
<java.version>1.8</java.version>
<kotlin.version>1.5.32</kotlin.version>
<project.release.version>3.14.1-SNAPSHOT</project.release.version>
<spring-boot.version>2.6.12</spring-boot.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
<mybatis.starter.version>2.2.2</mybatis.starter.version>
<kotlin.version>1.6.21</kotlin.version>
<project.release.version>3.15.0-SNAPSHOT</project.release.version>
<spring-boot.version>2.7.6</spring-boot.version>
<spring-cloud.version>2021.0.5</spring-cloud.version>
<mybatis.starter.version>3.0.0</mybatis.starter.version>
<mybatis-plus.version>3.5.2</mybatis-plus.version>
<redission.version>3.17.7</redission.version>
<redission.version>3.18.0</redission.version>
<jetcd.version>0.7.5</jetcd.version>
<disruptor.version>3.4.4</disruptor.version>
<jsqlparser.version>4.5</jsqlparser.version>
<jwt.version>0.9.1</jwt.version>
<commons-fileupload.version>1.5</commons-fileupload.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<jsoup.version>1.15.3</jsoup.version>
<ognl.version>3.3.4</ognl.version>
</properties>

Expand Down Expand Up @@ -69,7 +73,7 @@
<profile>
<id>sonatype-oss-release</id>
<properties>
<project.release.version>3.14.1</project.release.version>
<project.release.version>3.15.0</project.release.version>
</properties>
<build>
<plugins>
Expand Down Expand Up @@ -112,18 +116,24 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<optional>true</optional>
</dependency>
<!-- springboot 2.3.x: No longer included in web starters -->
<!-- Spring Boot 2.3.x: No longer included in web starters -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- springboot 2.3.x: A number of properties have been renamed or deprecated. You can use the spring-boot-properties-migrator module to identify those properties. -->
<!-- Spring Boot 2.3.x: A number of properties have been renamed or deprecated. You can use the spring-boot-properties-migrator module to identify those properties. -->
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
Expand Down Expand Up @@ -179,12 +189,24 @@
<artifactId>redisson</artifactId>
<version>${redission.version}</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<version>${jetcd.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand All @@ -194,6 +216,16 @@
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>${disruptor.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -202,12 +234,23 @@
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Springboot 2.6: Redis (both Jedis and Lettuce) will now automatically enable pooling when commons-pool2 is on the classpath. -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.github.yizzuide.milkomeda.atom;

import org.springframework.context.annotation.Bean;
import com.github.yizzuide.milkomeda.orbit.OrbitConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

Expand All @@ -30,16 +30,11 @@
*
* @author yizzuide
* @since 3.3.0
* @version 3.15.0
* <br>
* Create at 2020/04/30 15:13
*/
@Configuration
@Import({RedisAtomConfig.class, ZkAtomConfig.class})
@Import({EtcdAtomConfig.class, RedisAtomConfig.class, ZkAtomConfig.class, OrbitConfig.class})
public class AtomConfig {

@Bean
public AtomLockAspect atomLockAspect() {
return new AtomLockAspect();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
long waitTime() default -1;

/**
* 自动释放锁时间ms(ZK不需要这个特性)
* 自动释放锁时间ms(ZK不需要这个特性,断开就删除节点
* @return -1不自动释放锁
*/
long leaseTime() default 60000;

/**
* 加锁类型(ZK仅支持公平锁、读写锁)
* 加锁类型(ZK仅支持公平锁、读写锁,ETCD不支持设置
* @return AtomLockType
*/
AtomLockType type() default AtomLockType.FAIR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
package com.github.yizzuide.milkomeda.atom;

/**
* AtomLockWaitTimeoutException
* 获取锁超时异常
* Lock wait timeout exception.
*
* @since 3.13.0
* @author yizzuide
* <br>
* Create at 2020/05/01 02:19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.List;

/**
* AtomProperties
Expand All @@ -37,8 +38,11 @@
* Create at 2020/04/30 15:26
*/
@Data
@ConfigurationProperties("milkomeda.atom")
@ConfigurationProperties(AtomProperties.PREFIX)
public class AtomProperties {

public static final String PREFIX = "milkomeda.atom";

/**
* 策略方式
*/
Expand All @@ -54,6 +58,63 @@ public class AtomProperties {
*/
private Zk zk = new Zk();

/**
* Etcd config.
* @since 3.15.0
*/
private Etcd etcd = new Etcd();

@Data
static class Etcd {
/**
* The URL is used to Connect from ETCD server.
*/
private String endpointUrl;

/**
* The URL is used to Connect from ETCD servers.
*/
private List<String> endpointUrls;

/**
* config etcd auth user.
*/
private String user;

/**
* Etcd auth password.
*/
private String password;

/**
* Sets the authority used to authenticate connections to servers.
*/
private String authority;

/**
* Etcd root lock key.
*/
private String rootLockNode;

/**
* Etcd connect timeout.
*/
@DurationUnit(ChronoUnit.MILLIS)
private Duration connectTimeout = Duration.ofMillis(30000);

/**
* Set the interval for gRPC keepalive time.
*/
@DurationUnit(ChronoUnit.MILLIS)
private Duration keepaliveTime = Duration.ofMillis(30000);

/**
* Set timeout for gRPC keepalive time.
*/
@DurationUnit(ChronoUnit.MILLIS)
private Duration keepaliveTimeout = Duration.ofMillis(10000);
}

@Data
static class Redis {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,32 @@
package com.github.yizzuide.milkomeda.atom;

/**
* AtomStrategy
* Distributed lock strategy type which can support.
*
* @author yizzuide
* @since 3.3.0
* @version 3.15.0
* <br>
* Create at 2020/04/30 15:26
*/
public enum AtomStrategyType {
/**
* Redis strategy which is default.
*/
REDIS,
ZK

/**
* Zookeeper strategy.
*/
ZK,

/**
* Etcd strategy.
*/
ETCD,

/**
* Custom strategy which need impl of {@link Atom} and register as bean.
*/
Custom
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2023 yizzuide All rights Reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.github.yizzuide.milkomeda.atom;

/**
* Unlock exception.
*
* @since 3.15.0
* @author yizzuide
* <br>
* Create at 2023/04/29 16:36
*/
public class AtomUnLockException extends RuntimeException {
private static final long serialVersionUID = 1818244101533374602L;

public AtomUnLockException(String message) {
super(message);
}
}
Loading

0 comments on commit 66b8c44

Please sign in to comment.