策略需求-推荐召回接入用户短时兴趣

vim /home/disk2/xx/du-rus/du_rus_offline/dict/sample/sample_variable.conf

注意配置文件不要用空的行

[work@gzns-bac-orp-dumi-sandbox-113483 conf]$ vim /home/disk2/xx/du-rus/du_rus_offline/conf/log.conf

重启服务
如果修改其他配置 最后一定重启rus服务

/home/disk2/xx/du-rus/du_rus_offline/bin 如果没有bin目录再执行 ./server_control stop 暂停服务
./server_control start 启动服务

先播放30s以上的音乐 有声(小王子小说)

测试rpc.log有short_memory_global_id

测试结果

自动化代码如下

package baiduapi.serverTest.rus;
import baiduapi.baseDeal.fileOperate.FileWrite;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class rusRespAssert {
    private static Logger logger = LoggerFactory.getLogger(rusRespAssert.class);
 /**
 * @param count
 * @param request_RECOMMEND
 * @param response
 * @return 0
 */
 public static int responseToParse(int count, String dumisid, JSONObject request_RECOMMEND, JSONObject
response) {

try {

// String baseParamPrint = "request_RECOMMEND==" + request_RECOMMEND + "";
 String baseParamPrint = "";
 String bug = "BUG BUG BUG " + (count + 1) + "id=" + dumisid + baseParamPrint;
 String pass = "PASS PASS PASS ~ ~ ~ " + (count + 1) + "id=" + dumisid + baseParamPrint;
 String notExist = "NotExist NotExist NotExist ~ ~ ~ " + (count + 1) + "" + baseParamPrint;

//

if (response != null) {
               /**
* request.recommends.subCategories.category"RECOMMEND"
* 2020914case
*/

// session

if (response.containsKey("session")) {
                   String session = response.getString("session");
System.out.println("session==" + session);
if (!session.equals("{}")) {

} else { }

}

        System.err.println(bug + "session0" + session);
        System.out.println(pass + "session{}");
} else {
    System.err.println(notExist + "session");

// version

 if (response.containsKey("version")) {
                    String version = response.getString("version");
// System.out.println("version==" + version);
 if (!version.equals("2.0.0")) {
                        System.err.println(bug + "version2.0.0" + version);

} else { }

}

        System.out.println(pass + "version2.0.0");
} else {
    System.err.println(notExist + "version");
// responserecommendItems
 if (response.containsKey("response")) {
                    JSONObject response_value = response.getJSONObject("response");
// System.out.println("response==" + response_value);
 JSONArray resources = response_value.getJSONArray("resources");
 if (!resources.isEmpty()) {
                        JSONArray recommendItems = resources.getJSONObject(0).getJSONObject("payload").
getJSONArray("recommendItems");
 int size = recommendItems.size();
 System.out.println("recommendItems JSONArray==" + size);
 if (size < 100) {
                            System.err.println(bug + "recommendItems100" + size);
 int count_RECOMMEND = 0;
 for (int i = 0; i < size; i++) {
                                String id = recommendItems.getJSONObject(i).getString("id");
 String array = "" + count_RECOMMEND + ":";
if (!id.isEmpty()) {
} else {

}

System.out.println(pass + array + "id==" + id);
System.err.println(bug + array + "id");
                               JSONObject data = recommendItems.getJSONObject(i).getJSONObject("data");
String category = data.getString("category");
if (!category.isEmpty()) {
} else {
System.out.println(pass + array + "category==" + category);
System.err.println(bug + array + "category");

}

                                String title = data.getString("title");
 System.out.println(pass + array + "debug-title==" + title);
 // originLoglog
// FileWrite.originLog(pass + array + "debug-title==" + title);
 String clickUrl = recommendItems.getJSONObject(i).getJSONObject("data").getString("clickUrl");
 if (clickUrl.contains("feed_global_short_memory_recaller") && dumisid.equals("507508")) {
                                    // clickUrlclickUrl78 feed_global_short_memory_recaller2
 // url short_memory
 System.err.println(pass + array + "clickUrlfeed_global_short_memory_recaller");
 FileWrite.originLog(pass + array + "clickUrlfeed_global_short_memory_recaller");
 } else {
                                    System.out.println(bug + array + "clickUrl
feed_global_short_memory_recaller" + clickUrl);

}

// System.err.println("subCategory=RECOMMENDcount_RECOMMEND==" + count_RECOMMEND);
count_RECOMMEND++;
}

//

} else { }

}

        System.err.println(bug + "resources");
} else {
    System.err.println(notExist + "response");

}

// originLoglog
FileWrite.originLog(pass + "=================================");
//
FileWrite.originLog(" ");
FileWrite.originLog(" ");
FileWrite.originLog(" ");
System.err.println(pass + "=================================");
               System.err.println("Finished~ RUSjsonvalue~");
System.err.println("----------------------------------------");

} else {

}

}

} }

        System.err.println("FATAL FATAL FATAL" + (count + 1) + "" +
                "rec_type" + request_RECOMMEND + "");
} catch (
        Exception e) {
    e.printStackTrace();
return 0;

PASS PASS PASS ~ ~ ~ 1id=507507=================================
PASS PASS PASS ~ ~ ~ 2id=5075083:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=5075084:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=5075086:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=5075087:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=5075089:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750810:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750812:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750813:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750817:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750819:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750828:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750829:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750830:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750831:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750832:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750835:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750836:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=50750838:clickUrlfeed_global_short_memory_recaller
PASS PASS PASS ~ ~ ~ 2id=507508=================================
PASS PASS PASS ~ ~ ~ 3id=507508_507013=================================
PASS PASS PASS ~ ~ ~ 4id= =================================

507507没有
507508有 507508_507013有 这三个ok就没问题了

  • 10
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东方狱兔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值