|
|
@@ -3,7 +3,6 @@ package com.tzld.piaoquan.recommend.feature.produce.service;
|
|
|
import com.tzld.piaoquan.recommend.feature.produce.model.DTSConfig;
|
|
|
import com.tzld.piaoquan.recommend.feature.produce.util.CompressionUtil;
|
|
|
import com.tzld.piaoquan.recommend.feature.produce.util.JSONUtils;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang3.RandomUtils;
|
|
|
@@ -46,6 +45,15 @@ public class RedisService implements Serializable {
|
|
|
while (dataIte.hasNext()) {
|
|
|
Map<String, String> record = dataIte.next();
|
|
|
String redisKey = redisKey(record, config);
|
|
|
+
|
|
|
+ Map<String, String> valueMap = new HashMap<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(config.getRedis().getValue())) {
|
|
|
+ for (String valueKey : config.getRedis().getValue()) {
|
|
|
+ valueMap.put(valueKey, record.get(valueKey));
|
|
|
+ }
|
|
|
+ record = valueMap;
|
|
|
+ }
|
|
|
+
|
|
|
String value = JSONUtils.toJson(record);
|
|
|
if (RandomUtils.nextDouble() <= 0.001d) {
|
|
|
System.out.printf("redisKey: %s, value: %s%n", redisKey, value);
|