From f76c2bf7d0530078d35ec387626c59bf7b15d639 Mon Sep 17 00:00:00 2001 From: likui Date: Fri, 27 Mar 2020 13:15:30 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20READ?= =?UTF-8?q?ME=5FEN.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_EN.md | 71 ---------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 README_EN.md diff --git a/README_EN.md b/README_EN.md deleted file mode 100644 index 7c82df0..0000000 --- a/README_EN.md +++ /dev/null @@ -1,71 +0,0 @@ -## J2Cache —— Double Level Cache Framework base on Memory and Redis - -J2Cache is a two-level cache framework for Java. The first level cache uses the memory cache framework and the second level cache uses Redis. Since a large number of cache reads cause the L2 network to become a bottleneck to the entire system, the goal of L1 is to reduce the number of reads to L2. This cache framework is mainly used in a clustered environment. Stand-alone can also be used to avoid memory data loss due to application restart. - -We also provided Python version, Please refer to [https://gitee.com/ld/Py3Cache](https://gitee.com/ld/Py3Cache) - -From 1.3.0, `J2Cache` supports two ways to notify the cache event, include `JGroups` and `Redis PubSub`. In cloud platforms may not be able to use JGroups's multicast mode, so you can choose `Redis PubSub`. For more details, please see configuration file description in `j2cache.properties`. - -**J2Cache two-level cache system architecture** - -L1: In-Process Memory Cache Framework(ehcache,caffeine) -L2: Redis Server - -Since a large amount of cache reads causes network bandwidth to become a bottleneck in the overall system, the goal of L1 is to reduce the number of L2 reads - - -### Data Flow - -1. Data reading -> L1 -> L2 -> DB -2. Data writing - - 1 Read latest data from the business system, updates L1 -> L2, and - then broadcast clear event to all nodes in cluster - 2 When received the clear event, clear corresponding data in memory - -### J2Cache settings - -settings file located in `core/resources` directory, include: - -* `ehcache.xml` for ehcache 2.x - `ehcache3.xml` for ehcache 3.x -* `j2cache.properties` J2Cache settings, include redis configurations, connection pool, broadcast, serialization etc. -* `network.xml` JGroups network settings, needed when setting `j2cache.broadcast = jgroups` - -Those setting files must be placed in classpath , such as `WEB-INF/classes` - -### How to Test - -1. Install Redis -2. Modify `core/resource/j2cache.properties` to use installed redis servers -3. Open shell windows and execute command: `mvn package -DskipTests=true` -4. Open multiple command line windows and running `runtest.sh` -5. In > prompt type `help` to show command list - -### Maven - -``` - - net.oschina.j2cache - j2cache-core - xxxxx - -``` -### Usage - -Refer to [J2CacheCmd.java](https://gitee.com/ld/J2Cache/blob/master/core/src/net/oschina/j2cache/J2CacheCmd.java) - -### Questions - -1. J2Cache scenarios? -First, your application is running in cluster environment, J2Cache can effectively reduce the amount of data transfer between nodes -2. Why j2cache api does not provide the validity of the cache settings -Defining the validity period of the cached data in the program will cause the cache to be uncontrollable. Because it's difficult to find the source of the problem, it is impossible to check the validity of all the caches in J2Cache. Therefore, the validity period of all caches of J2Cache must be preset in the ehcache configuration - -## Projects using J2Cache - -* www.oschina.net -* https://gitee.com/jfinal/jfinal -* https://gitee.com/fuhai/jboot -* https://gitee.com/tywo45/t-io -* ... \ No newline at end of file -- Gitee From 81729134a1723e348c8c4086b2a4803a4bf17558 Mon Sep 17 00:00:00 2001 From: likui Date: Thu, 22 Apr 2021 15:01:08 +0800 Subject: [PATCH 2/6] update core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java. --- core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java b/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java index c4020df..226baa3 100644 --- a/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java +++ b/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java @@ -49,6 +49,8 @@ public class EhCacheProvider implements CacheProvider { @Override public String name() { + + String a = "a"; return "ehcache"; } -- Gitee From 18f8c183f1fe67cac7a3d5456439dbefc6b3b7fa Mon Sep 17 00:00:00 2001 From: likui Date: Thu, 22 Apr 2021 22:49:42 +0800 Subject: [PATCH 3/6] update core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java. --- core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java b/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java index 226baa3..f9970f1 100644 --- a/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java +++ b/core/src/net/oschina/j2cache/ehcache/EhCacheProvider.java @@ -93,6 +93,7 @@ public class EhCacheProvider implements CacheProvider { } } } + String c = "c"; return ehcache; } -- Gitee From 77c99b692f02e7fdf57be4e507aef078e86f8fff Mon Sep 17 00:00:00 2001 From: likui Date: Tue, 25 May 2021 10:18:21 +0800 Subject: [PATCH 4/6] update README.md. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cf95ec..c6cc7d7 100644 --- a/README.md +++ b/README.md @@ -190,4 +190,5 @@ channel.close(); ## TODO ## 1. 当 ehcache 配置模板为永久时的处理 -2. 欢迎大家给 J2Cache 提建议 \ No newline at end of file +2. 欢迎大家给 J2Cache 提建议 +3. 测认识 \ No newline at end of file -- Gitee From feaf6ffc4cdce73371808dd9e76edfa1ae845400 Mon Sep 17 00:00:00 2001 From: likui Date: Fri, 19 Aug 2022 03:23:15 +0000 Subject: [PATCH 5/6] update README.md. Signed-off-by: likui --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6cc7d7..4c7708d 100644 --- a/README.md +++ b/README.md @@ -191,4 +191,4 @@ channel.close(); 1. 当 ehcache 配置模板为永久时的处理 2. 欢迎大家给 J2Cache 提建议 -3. 测认识 \ No newline at end of file +3. 测认识a \ No newline at end of file -- Gitee From 3ebc4ed86f22f4865c4c01b18f8fb7cb25c904cf Mon Sep 17 00:00:00 2001 From: likui Date: Sat, 20 Aug 2022 01:51:17 +0000 Subject: [PATCH 6/6] update README.md. Signed-off-by: likui --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c7708d..22e6f28 100644 --- a/README.md +++ b/README.md @@ -191,4 +191,4 @@ channel.close(); 1. 当 ehcache 配置模板为永久时的处理 2. 欢迎大家给 J2Cache 提建议 -3. 测认识a \ No newline at end of file +3. 测认识ab \ No newline at end of file -- Gitee