Skip to content

Commit

Permalink
ref[cache]: use LazyCache instead of Caffeine
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Mar 26, 2024
1 parent a3c7dd0 commit 4b0018e
Show file tree
Hide file tree
Showing 16 changed files with 3 additions and 68 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ NetContext.getCosumer()
HotSwapUtils.hotswapClass(bytes);
```

#### 4. [orm](orm/README.md) automatic mapping framework based on mongodb, The secondary cache is designed using [caffeine](https://github.com/ben-manes/caffeine) to fully release the database pressure
#### 4. [orm](orm/README.md) automatic mapping framework based on mongodb

```
// You don't need to write sql and any configuration yourself, define a table in the database directly through annotation definitions
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ NetContext.getCosumer()
HotSwapUtils.hotswapClass(bytes);
```

#### 4. [orm](orm/README.md) 基于mongodb的自动映射框架,使用 [caffeine](https://github.com/ben-manes/caffeine) 设计了二级缓存,充分释放数据库压力
#### 4. [orm](orm/README.md) 基于mongodb的自动映射框架

```
// 无需自己写sql和任何配置,直接通过注解定义在数据库中定义一张表
Expand Down
2 changes: 0 additions & 2 deletions boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
5 changes: 0 additions & 5 deletions doc/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@

- 考虑用javassist的方式支持protobuf,用约定大于配置的方式,还可以原生的和pojo对象结合起来
- 通过protobuf的proto文件生成java的pojo源代码,通过动态编译java源代码的方式生成其它语言的源代码


### orm

- 使用更高性能的Cache2k替换Caffeine
1 change: 0 additions & 1 deletion doc/video-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ java的线程池,SingleThreadScheduledExecutor,SingleThreadExecutor
```
Mysql中的数据库,表,一条数据,在Mongodb分别叫做,数据库,集合,文档
Elastic Search的全文搜索引擎
Java的缓存框架guava cache,还有它的升级版本caffeine
mongodb的map reduce操作
分布式唯一Id,Java自带的UUID,雪花算法(SnowFlake),Redis分布式唯一Id实现,Mongodb分布式唯一Id实现,Zookeeper分布式唯一Id实现
```
Expand Down
2 changes: 0 additions & 2 deletions event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
2 changes: 0 additions & 2 deletions hotswap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
2 changes: 0 additions & 2 deletions monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
8 changes: 0 additions & 8 deletions net/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down Expand Up @@ -121,12 +119,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>${caffeine.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand Down
1 change: 0 additions & 1 deletion orm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ English | [简体中文](./README_CN.md)
- [orm](https://github.com/zfoo-project/zfoo/blob/main/orm/README.md) Based on MongoDB's orm framework, it provides a
mapping between POJO objects and Mongo DB databases
- MongoDB is a distributed database that can be used on a single machine or distributed in a single machine
- High-performance database entity object caching based on [caffeine](https://github.com/ben-manes/caffeine)

### Ⅱ. Use

Expand Down
1 change: 0 additions & 1 deletion orm/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- [orm](https://github.com/zfoo-project/zfoo/blob/main/orm/README.md) 基于MongoDB的orm框架,提供POJO对象和MongoDB数据库之间的映射
- mongodb是分布式数据库,可以单机使用,也可以分布式使用
- 基于 [caffeine](https://github.com/ben-manes/caffeine) 的高性能数据库实体对象Entity缓存

### Ⅱ. 使用

Expand Down
8 changes: 0 additions & 8 deletions orm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down Expand Up @@ -82,12 +80,6 @@
<version>${zfoo.version}</version>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>${caffeine.version}</version>
</dependency>

<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
2 changes: 0 additions & 2 deletions protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
2 changes: 0 additions & 2 deletions scheduler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
Expand Down
29 changes: 1 addition & 28 deletions storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
<curator.version>5.5.0</curator.version>
<!-- hardware detection -->
<oshi.version>6.4.5</oshi.version>
<!-- cache -->
<caffeine.version>3.1.8</caffeine.version>
<!-- Office document parsing -->
<poi.version>5.2.3</poi.version>
<csv.version>1.10.0</csv.version>
<commons-io.version>2.7</commons-io.version>

<!-- maven core plugin -->
<native-maven-plugin.version>0.10.1</native-maven-plugin.version>
<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
Expand All @@ -54,11 +51,6 @@
</properties>

<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>com.zfoo</groupId>
<artifactId>scheduler</artifactId>
Expand All @@ -72,30 +64,11 @@
</dependency>

<!-- excel,world,ppt,xml operation library -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
<exclusion>
<artifactId>log4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
<exclusion>
<artifactId>log4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
Expand Down

0 comments on commit 4b0018e

Please sign in to comment.