From 40754f05def04e237307dabf6b000a9e6bad3967 Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Mon, 4 Jan 2021 13:59:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?DEC-16532=20feat:=20=E6=94=AF=E6=8C=81hdfs?= =?UTF-8?q?=E9=AB=98=E5=8F=AF=E7=94=A8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cluster/resource/BaseCommonRepoConfig.java | 17 +++++++++++++++++ .../resource/ResourceModuleContextKit.java | 17 +++++++++++++++++ .../api/cluster/resource/WorkContextKit.java | 15 +++++++++++++++ .../api/cluster/state/StoreTemplateKit.java | 15 +++++++++++++++ .../java/com/fanruan/api/conf/HolderKit.java | 6 ++++++ .../java/com/fanruan/api/util/StableKit.java | 14 ++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 src/main/java/com/fanruan/api/cluster/resource/BaseCommonRepoConfig.java create mode 100644 src/main/java/com/fanruan/api/cluster/resource/ResourceModuleContextKit.java create mode 100644 src/main/java/com/fanruan/api/cluster/resource/WorkContextKit.java create mode 100644 src/main/java/com/fanruan/api/cluster/state/StoreTemplateKit.java create mode 100644 src/main/java/com/fanruan/api/util/StableKit.java diff --git a/src/main/java/com/fanruan/api/cluster/resource/BaseCommonRepoConfig.java b/src/main/java/com/fanruan/api/cluster/resource/BaseCommonRepoConfig.java new file mode 100644 index 0000000..54ad914 --- /dev/null +++ b/src/main/java/com/fanruan/api/cluster/resource/BaseCommonRepoConfig.java @@ -0,0 +1,17 @@ +package com.fanruan.api.cluster.resource; + +import com.fr.io.config.CommonRepoConfig; + +/** + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/1/3 + */ +public class BaseCommonRepoConfig extends CommonRepoConfig { + + private static final long serialVersionUID = 6713243696930557143L; + + public BaseCommonRepoConfig(String identity) { + super(identity); + } +} diff --git a/src/main/java/com/fanruan/api/cluster/resource/ResourceModuleContextKit.java b/src/main/java/com/fanruan/api/cluster/resource/ResourceModuleContextKit.java new file mode 100644 index 0000000..8435c4f --- /dev/null +++ b/src/main/java/com/fanruan/api/cluster/resource/ResourceModuleContextKit.java @@ -0,0 +1,17 @@ +package com.fanruan.api.cluster.resource; + +import com.fr.io.config.RepositoryConfig; +import com.fr.io.context.ResourceModuleContext; + +/** + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/1/3 + */ +public class ResourceModuleContextKit { + + public static T getRepoConfig(String hdfs, String srcRepo) { + return ResourceModuleContext.getRepoConfig(hdfs, srcRepo); + } + +} diff --git a/src/main/java/com/fanruan/api/cluster/resource/WorkContextKit.java b/src/main/java/com/fanruan/api/cluster/resource/WorkContextKit.java new file mode 100644 index 0000000..fda12f7 --- /dev/null +++ b/src/main/java/com/fanruan/api/cluster/resource/WorkContextKit.java @@ -0,0 +1,15 @@ +package com.fanruan.api.cluster.resource; + +import com.fr.workspace.WorkContext; +import com.fr.workspace.resource.WorkResource; + +/** + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/1/3 + */ +public class WorkContextKit { + public static WorkResource getWorkResource() { + return WorkContext.getWorkResource(); + } +} diff --git a/src/main/java/com/fanruan/api/cluster/state/StoreTemplateKit.java b/src/main/java/com/fanruan/api/cluster/state/StoreTemplateKit.java new file mode 100644 index 0000000..b7020fd --- /dev/null +++ b/src/main/java/com/fanruan/api/cluster/state/StoreTemplateKit.java @@ -0,0 +1,15 @@ +package com.fanruan.api.cluster.state; + +import com.fr.store.impl.StoreTemplate; + +/** + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/1/3 + */ +public class StoreTemplateKit { + + public static void close() { + StoreTemplate.getInstance().close(); + } +} diff --git a/src/main/java/com/fanruan/api/conf/HolderKit.java b/src/main/java/com/fanruan/api/conf/HolderKit.java index 3e1f5b3..63255ab 100644 --- a/src/main/java/com/fanruan/api/conf/HolderKit.java +++ b/src/main/java/com/fanruan/api/conf/HolderKit.java @@ -6,9 +6,11 @@ import com.fanruan.api.conf.impl.ObjectColConf; import com.fanruan.api.conf.impl.ObjectMapConf; import com.fanruan.api.conf.impl.SimConf; import com.fr.config.holder.Conf; +import com.fr.config.holder.impl.MapConf; import java.util.Collection; +import java.util.HashMap; import java.util.Map; /** @@ -109,4 +111,8 @@ public class HolderKit { public static ColConf> collection(Collection collection, Class valueType) { return new ColConf(collection, valueType); } + + public static MapConf> map(HashMap map, Class keyType, Class valueType) { + return new MapConf<>(map, keyType, valueType); + } } diff --git a/src/main/java/com/fanruan/api/util/StableKit.java b/src/main/java/com/fanruan/api/util/StableKit.java new file mode 100644 index 0000000..9cb344f --- /dev/null +++ b/src/main/java/com/fanruan/api/util/StableKit.java @@ -0,0 +1,14 @@ +package com.fanruan.api.util; + +import com.fr.stable.StableUtils; + +/** + * @author Dylan.Liu + * @version 10.0 + * Created by Dylan.Liu on 2021/1/3 + */ +public class StableKit { + public static String pathJoin(String pluginsName, String homeName) { + return StableUtils.pathJoin(pluginsName, homeName); + } +} From a5f9492492bedf797b3c7327da54c4730d54f35b Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Mon, 4 Jan 2021 14:06:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?DEC-16532=20fix:=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fanruan/api/util/StableKit.java | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/util/StableKit.java diff --git a/src/main/java/com/fanruan/api/util/StableKit.java b/src/main/java/com/fanruan/api/util/StableKit.java deleted file mode 100644 index 9cb344f..0000000 --- a/src/main/java/com/fanruan/api/util/StableKit.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.fanruan.api.util; - -import com.fr.stable.StableUtils; - -/** - * @author Dylan.Liu - * @version 10.0 - * Created by Dylan.Liu on 2021/1/3 - */ -public class StableKit { - public static String pathJoin(String pluginsName, String homeName) { - return StableUtils.pathJoin(pluginsName, homeName); - } -}