From 4199182e20aeb4c55f07ff08292c01d1939628ed Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Thu, 23 Apr 2020 20:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=20jira=20=E4=BB=BB=E5=8A=A1=20finekit?= =?UTF-8?q?=20=E9=80=82=E9=85=8D=E7=8A=B6=E6=80=81=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../state/BaseRedisCollectionsClient.java | 4 ++-- .../api/cluster/state/BaseRedisStore.java | 5 +++-- .../api/cluster/state/FineJedisPoolKit.java | 9 +++++---- .../api/cluster/state/StandAloneJedisKit.java | 8 ++++---- .../cluster/state/FineJedisPoolKitTest.java | 20 +++++++++---------- .../cluster/state/StandAloneJedisKitTest.java | 4 ++-- 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/fanruan/api/cluster/state/BaseRedisCollectionsClient.java b/src/main/java/com/fanruan/api/cluster/state/BaseRedisCollectionsClient.java index ca75924..4c79368 100644 --- a/src/main/java/com/fanruan/api/cluster/state/BaseRedisCollectionsClient.java +++ b/src/main/java/com/fanruan/api/cluster/state/BaseRedisCollectionsClient.java @@ -1,6 +1,6 @@ package com.fanruan.api.cluster.state; -import com.fr.collections.cluster.client.RedisCollectionsClient; +import com.fr.collections.cluster.client.StoreCollectionsClient; import com.fr.collections.config.redis.RedisCollectionConfig; /** @@ -9,7 +9,7 @@ import com.fr.collections.config.redis.RedisCollectionConfig; * @version 10.0 * Created by Dylan.Liu on 2019/12/3 */ -public class BaseRedisCollectionsClient extends RedisCollectionsClient { +public class BaseRedisCollectionsClient extends StoreCollectionsClient { public BaseRedisCollectionsClient() { diff --git a/src/main/java/com/fanruan/api/cluster/state/BaseRedisStore.java b/src/main/java/com/fanruan/api/cluster/state/BaseRedisStore.java index b4c47a8..e9b5ab5 100644 --- a/src/main/java/com/fanruan/api/cluster/state/BaseRedisStore.java +++ b/src/main/java/com/fanruan/api/cluster/state/BaseRedisStore.java @@ -1,6 +1,7 @@ package com.fanruan.api.cluster.state; -import com.fr.store.RedisStore; + +import com.fr.store.StateStore; /** * Redis Store @@ -8,7 +9,7 @@ import com.fr.store.RedisStore; * @version 10.0 * Created by Dylan.Liu on 2019/12/3 */ -public class BaseRedisStore extends RedisStore { +public class BaseRedisStore extends StateStore { public BaseRedisStore(String tableNamePrefix, int expireStateRemoveInterval) { super(tableNamePrefix, expireStateRemoveInterval); diff --git a/src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java b/src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java index eb848d0..c4b5884 100644 --- a/src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java +++ b/src/main/java/com/fanruan/api/cluster/state/FineJedisPoolKit.java @@ -1,7 +1,8 @@ package com.fanruan.api.cluster.state; -import com.fr.store.impl.redis.accessor.FineJedisPool; -import com.fr.store.impl.redis.accessor.FineJedisWrapper; + +import com.fr.store.impl.accessor.FineStorePool; +import com.fr.store.impl.accessor.FineStoreWrapper; /** * @author Dylan.Liu @@ -14,8 +15,8 @@ public class FineJedisPoolKit { * 设置提供真实资源的 Jedis 包装对象 * @param jedisWrapper Jedis 包装对象 */ - public static void setRealClient(FineJedisWrapper jedisWrapper) { + public static void setRealClient(FineStoreWrapper jedisWrapper) { - FineJedisPool.getInstance().setRealClient(jedisWrapper); + FineStorePool.getInstance().setRealClient(jedisWrapper); } } diff --git a/src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java b/src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java index 02aea54..900d3eb 100644 --- a/src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java +++ b/src/main/java/com/fanruan/api/cluster/state/StandAloneJedisKit.java @@ -1,7 +1,7 @@ package com.fanruan.api.cluster.state; -import com.fr.store.impl.redis.accessor.FineJedis; -import com.fr.store.impl.redis.accessor.StandAloneJedis; +import com.fr.store.impl.accessor.FineStore; +import com.fr.store.impl.accessor.StandAloneStore; import com.fr.third.redis.clients.jedis.Jedis; /** @@ -16,11 +16,11 @@ public class StandAloneJedisKit { * @param jedis Jedis 资源 * @return 单机版 Jedis Api集合 */ - public static FineJedis createStandAloneJedis(Jedis jedis) { + public static FineStore createStandAloneJedis(Jedis jedis) { if (jedis == null) { throw new NullPointerException("jedis is null"); } - return new StandAloneJedis(jedis); + return new StandAloneStore(jedis); } } diff --git a/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java b/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java index c0cbd17..f64c325 100644 --- a/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java +++ b/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java @@ -1,8 +1,8 @@ package com.fanruan.api.cluster.state; -import com.fr.store.impl.redis.accessor.FineJedis; -import com.fr.store.impl.redis.accessor.FineJedisPool; -import com.fr.store.impl.redis.accessor.FineJedisWrapper; +import com.fr.store.impl.accessor.FineStore; +import com.fr.store.impl.accessor.FineStorePool; +import com.fr.store.impl.accessor.FineStoreWrapper; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; @@ -21,10 +21,10 @@ public class FineJedisPoolKitTest { @Test public void TestSetRealClient() { - FineJedisPoolKit.setRealClient(new FineJedisWrapper() { + FineJedisPoolKit.setRealClient(new FineStoreWrapper() { @Override - public FineJedis getResource() { + public FineStore getResource() { return null; } @@ -33,16 +33,16 @@ public class FineJedisPoolKitTest { } }); - Assert.assertNull(FineJedisPool.getInstance().getResource()); + Assert.assertNull(FineStorePool.getInstance().getResource()); - FineJedis mockFineJedis = mock(FineJedis.class); + FineStore mockFineJedis = mock(FineStore.class); expect(mockFineJedis.type(anyObject())).andReturn("TestFineJedis"); EasyMock.replay(mockFineJedis); - FineJedisPoolKit.setRealClient(new FineJedisWrapper() { + FineJedisPoolKit.setRealClient(new FineStoreWrapper() { @Override - public FineJedis getResource() { + public FineStore getResource() { return mockFineJedis; } @@ -51,7 +51,7 @@ public class FineJedisPoolKitTest { } }); - Assert.assertEquals("TestFineJedis", FineJedisPool.getInstance().getResource().type(new byte[]{})); + Assert.assertEquals("TestFineJedis", FineStorePool.getInstance().getResource().type(new byte[]{})); } } \ No newline at end of file diff --git a/src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java b/src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java index 61fcb52..dd74611 100644 --- a/src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java +++ b/src/test/java/com/fanruan/api/cluster/state/StandAloneJedisKitTest.java @@ -1,6 +1,6 @@ package com.fanruan.api.cluster.state; -import com.fr.store.impl.redis.accessor.FineJedis; +import com.fr.store.impl.accessor.FineStore; import com.fr.third.redis.clients.jedis.Jedis; import org.easymock.EasyMock; import org.junit.Assert; @@ -24,7 +24,7 @@ public class StandAloneJedisKitTest { expect(mockJedis.type(anyObject(byte[].class))).andReturn("test_echo"); EasyMock.replay(mockJedis); - FineJedis standAloneJedis = StandAloneJedisKit.createStandAloneJedis(mockJedis); + FineStore standAloneJedis = StandAloneJedisKit.createStandAloneJedis(mockJedis); Assert.assertEquals("test_echo", standAloneJedis.type(new byte[]{})); }