|
@@ -25,9 +25,9 @@ import java.util.Map;
|
|
|
|
|
|
public class SparkVideoFeaToRedisLoader {
|
|
|
|
|
|
- private static final String userKeyFormat = "user:ad:%s";
|
|
|
+ private static final String userKeyFormat = "user:video:%s";
|
|
|
|
|
|
- private static final String adKeyFormat = "ad:%s";
|
|
|
+ private static final String adKeyFormat = "video:%s";
|
|
|
|
|
|
|
|
|
public static RedisTemplate<String, String> buildRedisTemplate() {
|
|
@@ -102,7 +102,7 @@ public class SparkVideoFeaToRedisLoader {
|
|
|
|
|
|
// load Ad features
|
|
|
JavaRDD<List<String>> readAdData = odpsOps.readTableWithJava(project, tableAdInfo, partition, new SparkAdFeaToRedisLoader.RecordsToAdRedisKV(), Integer.valueOf(10));
|
|
|
- readAdData.sample(false, 0.001).foreachPartition(
|
|
|
+ readAdData.sample(false, 0.0001).foreachPartition(
|
|
|
rowIterator -> {
|
|
|
RedisTemplate<String, String> redisTemplate = buildRedisTemplate();
|
|
|
rowIterator.forEachRemaining(line -> loadFeatureToRedis(redisTemplate, line));
|