-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
shichen
committed
Apr 22, 2021
1 parent
9b020b8
commit 20913a5
Showing
175 changed files
with
5,694 additions
and
1,761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ | |
<artifactId>logback-classic</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
|
||
</dependencies> | ||
|
||
<build> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
create or replace table app_import( | ||
id bigint auto_increment | ||
primary key, | ||
app_id bigint null comment '目标应用id', | ||
instance_info text null comment '源redis实例信息', | ||
redis_password varchar (200) null comment '源redis密码', | ||
status int null comment '迁移状态:PREPARE(0, "准备", "应用导入-未开始"), | ||
START(1, "进行中...", "应用导入-开始"), | ||
ERROR(2, "error", "应用导入-出错"), | ||
VERSION_BUILD_START(11, "进行中...", "新建redis版本-进行中"), | ||
VERSION_BUILD_ERROR(12, "error", "新建redis版本-出错"), | ||
VERSION_BUILD_END(20, "成功", "新建redis版本-完成"), | ||
APP_BUILD_INIT(21, "准备就绪", "新建redis应用-准备就绪"), | ||
APP_BUILD_START(22, "进行中...", "新建redis应用-进行中"), | ||
APP_BUILD_ERROR(23, "error", "新建redis应用-出错"), | ||
APP_BUILD_END(30, "成功", "新建redis应用-完成"), | ||
MIGRATE_INIT(31, "准备就绪", "数据迁移-准备就绪"), | ||
MIGRATE_START(32, "进行中...", "数据迁移-进行中"), | ||
MIGRATE_ERROR(33, "error", "数据迁移-出错"), | ||
MIGRATE_END(3, "成功", "应用导入-成功")', | ||
step int null comment '导入阶段', | ||
create_time timestamp default CURRENT_TIMESTAMP not null, | ||
update_time timestamp default CURRENT_TIMESTAMP null, | ||
migrate_id bigint null comment '数据迁移id', | ||
mem_size int null comment '目标应用内存大小,单位G', | ||
redis_version_name varchar (20) null comment '目标应用redis版本,格式:redis-x.x.x', | ||
app_build_task_id bigint null comment '目标应用部署任务id', | ||
source_type int null comment '源redis类型:7:cluster, 6:sentinel, 5:standalone' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
cachecloud-web/src/main/java/com/sohu/cache/configuration/AsyncConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.sohu.cache.configuration; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.concurrent.ForkJoinPool; | ||
|
||
@Configuration | ||
@Slf4j | ||
public class AsyncConfiguration { | ||
|
||
private int parallelism=256; | ||
|
||
@Bean | ||
public ForkJoinPool forkJoinPool() { | ||
log.info("availableProcessors:{}, parallelism:{}", Runtime.getRuntime().availableProcessors(), parallelism); | ||
ForkJoinPool forkJoinPool = new ForkJoinPool(parallelism); | ||
return forkJoinPool; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
cachecloud-web/src/main/java/com/sohu/cache/dao/AppImportDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.sohu.cache.dao; | ||
|
||
|
||
import com.sohu.cache.entity.AppImport; | ||
import org.apache.ibatis.annotations.Param; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @Author: rucao | ||
* @Date: 2021/1/7 下午6:03 | ||
*/ | ||
public interface AppImportDao { | ||
AppImport get(@Param("id") Long id); | ||
|
||
int save(AppImport appImport); | ||
|
||
int update(AppImport appImport); | ||
|
||
List<AppImport> getAppImports(@Param("status") int status); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ | |
*/ | ||
@Data | ||
public class AppDataMigrateSearch { | ||
/** | ||
* 迁移id | ||
*/ | ||
private Long migrateId; | ||
/** | ||
* 源应用id | ||
*/ | ||
|
26 changes: 26 additions & 0 deletions
26
cachecloud-web/src/main/java/com/sohu/cache/entity/AppImport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.sohu.cache.entity; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* @Author: rucao | ||
* @Date: 2021/1/7 下午6:00 | ||
*/ | ||
@Data | ||
public class AppImport { | ||
private long id; | ||
private long appId; | ||
private int memSize; | ||
private int sourceType; | ||
private String redisVersionName; | ||
private String instanceInfo; | ||
private String redisPassword; | ||
private int status; | ||
private int step; | ||
private long appBuildTaskId; | ||
private long migrateId; | ||
private Date createTime; | ||
private Date updateTime; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.