|
@@ -5,12 +5,12 @@ import com.tzld.piaoquan.recommend.feature.produce.util.CompressionUtil;
|
|
|
import com.tzld.piaoquan.recommend.feature.produce.util.JSONUtils;
|
|
import com.tzld.piaoquan.recommend.feature.produce.util.JSONUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
-import org.apache.commons.lang3.RandomUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import redis.clients.jedis.Jedis;
|
|
import redis.clients.jedis.Jedis;
|
|
|
import redis.clients.jedis.Pipeline;
|
|
import redis.clients.jedis.Pipeline;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -91,6 +91,12 @@ public class RedisService implements Serializable {
|
|
|
pipeline.setex(e.getKey(), expireSeconds, CompressionUtil.snappyCompress(e.getValue()));
|
|
pipeline.setex(e.getKey(), expireSeconds, CompressionUtil.snappyCompress(e.getValue()));
|
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ String newKey = String.format("%s:v2", e.getKey());
|
|
|
|
|
+ pipeline.setex(newKey.getBytes(StandardCharsets.UTF_8), expireSeconds, CompressionUtil.snappyCompressV2(e.getValue()));
|
|
|
|
|
+ } catch (Exception ignore) {
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
pipeline.sync();
|
|
pipeline.sync();
|
|
|
|
|
|