From 40754f05def04e237307dabf6b000a9e6bad3967 Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Mon, 4 Jan 2021 13:59:52 +0800 Subject: [PATCH] =?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); + } +}