Commit e5e57987 by guos

会员标签4.0

parent 274571b4
......@@ -3,6 +3,7 @@ package com.gic.spark.tag;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.gic.spark.application.SparkEnvManager;
import com.gic.spark.config.SparkConfigManager;
import com.gic.spark.datasource.DataSourceManager;
import com.gic.spark.datasource.entity.DataSourceEntity;
import com.gic.spark.datasource.entity.DataSourceSharding;
......@@ -68,24 +69,24 @@ public class TagProcessManager {
public void init(boolean isProd){
this.isProduction=isProd;
MysqlDatasource member4Datasource = new MysqlDatasource();
MysqlDatasource enterprise4Datasource = new MysqlDatasource();
MysqlDatasource member4Datasource = null;
MysqlDatasource enterprise4Datasource = null;
if(isProduction){
member4Datasource.setJdbcUrl("jdbc:mysql://10.0.0.6:3306/gic-member4.0_2" + JDBC_OPTIONS);
member4Datasource.setUser("cdb_outerroot");
member4Datasource.setPassword("@09ui%sbc09");
enterprise4Datasource=SparkConfigManager.getInstance().getDatasource("4.0-enterprise");
member4Datasource=SparkConfigManager.getInstance().getDatasourceByIdAndSchema("4.0-prodDs", "gic_member_4_0");
enterprise4Datasource.setJdbcUrl("jdbc:mysql://10.0.0.6:3306/gic-enterprise4.0" + JDBC_OPTIONS);
enterprise4Datasource.setUser("cdb_outerroot");
enterprise4Datasource.setPassword("@09ui%sbc09");
}else{
member4Datasource.setJdbcUrl("jdbc:mysql://10.0.0.6:3306/gic-member4.0_2" + JDBC_OPTIONS);
member4Datasource=new MysqlDatasource();
member4Datasource.setJdbcUrl(MysqlDatasource.devDatasource.getJdbcUrl().replaceAll("gic3_test", "gic-member4.0"));
member4Datasource.setUser("cdb_outerroot");
member4Datasource.setPassword("@09ui%sbc09");
enterprise4Datasource.setJdbcUrl("jdbc:mysql://10.0.0.6:3306/gic-enterprise4.0" + JDBC_OPTIONS);
enterprise4Datasource=new MysqlDatasource();
enterprise4Datasource.setJdbcUrl(MysqlDatasource.devDatasource.getJdbcUrl().replaceAll("gic3_test", "gic-enterprise4.0"));
enterprise4Datasource.setUser("cdb_outerroot");
enterprise4Datasource.setPassword("@09ui%sbc09");
}
member4RddManager=member4Datasource.buildRddManager();
enterprise4RddManager=enterprise4Datasource.buildRddManager();
......@@ -274,7 +275,7 @@ public class TagProcessManager {
private void updateIndex(JavaPairRDD<Long, String> updateMemberGroup, Integer enterpriseId) {
Map<String, String> conf = new HashMap();
String indexName = EsRequestUtil.getESIindexName(enterpriseId);
String indexName = EsRequestUtil.getESIindexName(enterpriseId,this.isProduction());
System.out.println("indexName===>" + indexName);
conf.put("es.resource", indexName + "/mapper_type");
conf.put("es.nodes", AppEnvUtil.ES_NODES);
......
......@@ -12,8 +12,9 @@ import java.util.Map;
*/
public class EsRequestUtil {
public static String getESIindexName(Integer enterpriseId) {
String url = "https://four.gicdev.com/member-config/member/index-version/" + enterpriseId;
public static String getESIindexName(Integer enterpriseId,boolean isProduction) {
String url = isProduction?"https://ideal.demogic.com/member-config/member/index-version/" + enterpriseId
:"https://four.gicdev.com/member-config/member/index-version/" + enterpriseId;
HttpResponse response = HttpClient.getHttpResponseByGet(url);
int responseCode = response.getStatusLine().getStatusCode();
if (responseCode == 200) {
......
......@@ -18,8 +18,8 @@ import java.util.List;
public class IndexRequestUtil {
public static List<String> getStoreId(Integer enterpriseId, String widgetId, boolean isProd) {
String url = isProd?"https://four.gicdev.com/gic-store-web/list-widget-store-info?enterpriseId="+enterpriseId+"&storeWidgetId="+widgetId
:"https://ideal.demogic.com/gic-store-web/list-widget-store-info?enterpriseId="+enterpriseId+"&storeWidgetId="+widgetId;
String url = isProd?"https://ideal.demogic.com/gic-store-web/list-widget-store-info?enterpriseId="+enterpriseId+"&storeWidgetId="+widgetId
:"https://four.gicdev.com/gic-store-web/list-widget-store-info?enterpriseId="+enterpriseId+"&storeWidgetId="+widgetId;
HttpResponse response = HttpClient.getHttpResponseByGet(url);
JSONObject jsonObject = JSONObject.parseObject(HttpClient.getResponseString(response));
......
##sharding.config
member.sharding.4="member_sharding_4.0_test
member.sharding.4=member_sharding_4.0_prod
marketing.sharding=marketing_sharding
##MQ-zk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment