Authored by hugufei

调大数据服务

... ... @@ -12,6 +12,15 @@
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.11.Final</version>
</dependency>
<dependency>
<groupId>com.yoho.core</groupId>
<artifactId>yoho-core-rest-client-simple</artifactId>
</dependency>
<dependency>
<groupId>com.yoho.search</groupId>
<artifactId>search-es</artifactId>
</dependency>
... ...
package com.yoho.search.recall.scene.beans.persional;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.core.personalized.models.UserPersonalFactorReq;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
... ... @@ -14,12 +19,12 @@ class UserPersionalFactorComponent {
private static final Logger logger = LoggerFactory.getLogger(UserPersionalFactorComponent.class);
//@Autowired
// private ServiceCaller serviceCaller;
@Autowired
private ServiceCaller serviceCaller;
//serviceCaller.asyncCall("message.publishIosUser", iosTokenBO, Integer.class);
private static final String SERVICE_NAME = "bigdata.UserPersionalFactor";
private static final String SERVICE_NAME = "bigdata.userPersionalFactorRsp";
private static final int timeOut = 100;
/**
... ... @@ -49,13 +54,14 @@ class UserPersionalFactorComponent {
}
private UserPersonalFactorRsp queryUserPersionalFactorRsp(int uid, String udid){
// try {
// UserPersionalFactorReq userPersionalFactorReq = new UserPersionalFactorReq(uid,udid);
// return serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,UserPersionalFactorRsp.class,timeOut);
// }catch (Exception e){
// logger.error(e.getMessage(),e);
// return null;
// }
return null;
try {
UserPersonalFactorReq userPersionalFactorReq = new UserPersonalFactorReq(uid,udid);
JSONObject result = serviceCaller.call(SERVICE_NAME,userPersionalFactorReq,JSONObject.class,timeOut);
JSONObject userPersonalFactorRspJSon = result.getJSONObject("data");
return JSON.toJavaObject(userPersonalFactorRspJSon,UserPersonalFactorRsp.class);
}catch (Exception e){
logger.error(e.getMessage(),e);
return null;
}
}
}
... ...
... ... @@ -11,7 +11,7 @@ search.multiMatchQuery.type=CROSS_FIELDS
search.use.cache=true
#zkAddress
zkAddress=192.168.102.216:2181
zkAddress=192.168.102.45:2181
#web.content
web.context=yohosearch
... ...