From 06df4d98619de4cc1fd8c452de401823b3c1168d Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Fri, 29 Jan 2021 16:40:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?DEC-17057=20fix:=20=E3=80=90=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E3=80=91=E3=80=90=E7=BB=84=E4=BB=B6=E5=87=BA=E9=94=99?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91HA=20HDFS=EF=BC=8C=E5=85=B3=E6=8E=89?= =?UTF-8?q?=E6=89=80=E6=9C=89datanode=EF=BC=8C=E5=90=AF=E5=8A=A8=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=BF=9B=E5=85=A5=E9=83=A8=E7=BD=B2=E5=90=91=E5=AF=BC?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/cluster/resource/FineFileServerKit.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/fanruan/api/cluster/resource/FineFileServerKit.java b/src/main/java/com/fanruan/api/cluster/resource/FineFileServerKit.java index eadcef1..e29247d 100644 --- a/src/main/java/com/fanruan/api/cluster/resource/FineFileServerKit.java +++ b/src/main/java/com/fanruan/api/cluster/resource/FineFileServerKit.java @@ -2,6 +2,7 @@ package com.fanruan.api.cluster.resource; import com.fr.decision.fileserver.FineFileServer; import com.fr.io.config.RepositoryConfig; +import com.fr.io.repository.ResourceRepository; /** * 文件服务器Kit. @@ -22,4 +23,15 @@ public class FineFileServerKit { return FineFileServer.getInstance().getRepoConfig(); } + /** + * 文件服务器读写权限测试. + * + * @param repo 仓库 + * @param workRoot 工作路径 + * @return 是否有读写权限 + */ + public static boolean hasReadWritePermission(ResourceRepository repo, String workRoot) { + return FineFileServer.getInstance().hasReadWritePermission(repo, workRoot); + } + } -- 2.28.0 From 5d9a0d5b58dccab3baa3fa2ef1215cb234fa4d0b Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Tue, 2 Feb 2021 14:23:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?DEC-17124=20fix:=20=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8A=A0=E9=9B=86=E7=BE=A4=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/cluster/FineLockKit.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/java/com/fanruan/api/cluster/FineLockKit.java diff --git a/src/main/java/com/fanruan/api/cluster/FineLockKit.java b/src/main/java/com/fanruan/api/cluster/FineLockKit.java new file mode 100644 index 0000000..a047c75 --- /dev/null +++ b/src/main/java/com/fanruan/api/cluster/FineLockKit.java @@ -0,0 +1,33 @@ +package com.fanruan.api.cluster; + +import com.fr.collections.utils.FineLockUtils; + +/** + * Redis实现的集群锁工具类. + * + * 需要在{@link com.fr.store.StateServiceActivator}启动后使用. + * + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/2/2 + */ +public class FineLockKit { + + /** + * 加锁. + * + * @param lockName 锁名 + */ + public static void lockViaFineLock(String lockName) { + FineLockUtils.lockViaFineLock(lockName); + } + + /** + * 解锁. + * + * @param lockName 锁名 + */ + public static void unlockViaFineLock(String lockName) { + FineLockUtils.unlockViaFineLock(lockName); + } +} -- 2.28.0