DEC-16532 feat: 支持hdfs高可用模式 #3

Merged
richie merged 2 commits from :master into master 4 years ago
  1. 17
      src/main/java/com/fanruan/api/cluster/resource/BaseCommonRepoConfig.java
  2. 17
      src/main/java/com/fanruan/api/cluster/resource/ResourceModuleContextKit.java
  3. 15
      src/main/java/com/fanruan/api/cluster/resource/WorkContextKit.java
  4. 15
      src/main/java/com/fanruan/api/cluster/state/StoreTemplateKit.java
  5. 6
      src/main/java/com/fanruan/api/conf/HolderKit.java

17
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);
}
}

17
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 extends RepositoryConfig> T getRepoConfig(String hdfs, String srcRepo) {
return ResourceModuleContext.getRepoConfig(hdfs, srcRepo);
}
}

15
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();
}
}

15
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();
}
}

6
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.ObjectMapConf;
import com.fanruan.api.conf.impl.SimConf; import com.fanruan.api.conf.impl.SimConf;
import com.fr.config.holder.Conf; import com.fr.config.holder.Conf;
import com.fr.config.holder.impl.MapConf;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -109,4 +111,8 @@ public class HolderKit {
public static <K> ColConf<Collection<K>> collection(Collection<K> collection, Class<K> valueType) { public static <K> ColConf<Collection<K>> collection(Collection<K> collection, Class<K> valueType) {
return new ColConf(collection, valueType); return new ColConf(collection, valueType);
} }
public static MapConf<Map<String, String>> map(HashMap<Object, Object> map, Class<String> keyType, Class<String> valueType) {
return new MapConf<>(map, keyType, valueType);
}
} }

Loading…
Cancel
Save