|
|
@@ -30,6 +30,7 @@ public class RedisService implements Serializable {
|
|
|
private int port = 6379;
|
|
|
private String password = "";
|
|
|
private String hostName = "";
|
|
|
+ private Jedis jedis;
|
|
|
|
|
|
public RedisService(String env) {
|
|
|
if (StringUtils.equals(env, PROD.getEnv())) {
|
|
|
@@ -42,13 +43,14 @@ public class RedisService implements Serializable {
|
|
|
password = "Wqsd@2019";
|
|
|
hostName = "r-bp1wwqqkjqwwkxgbup.redis.rds.aliyuncs.com";
|
|
|
}
|
|
|
+
|
|
|
+ this.jedis = new Jedis(hostName, port);
|
|
|
+ jedis.auth(password);
|
|
|
}
|
|
|
|
|
|
public void mSetV2(Iterator<Map<String, String>> dataIte, DTSConfig config) {
|
|
|
log.info("mSetV2 param: {}", config);
|
|
|
Map<String, String> batch = new HashMap<>();
|
|
|
- Jedis jedis = new Jedis(hostName, port);
|
|
|
- jedis.auth(password);
|
|
|
long expire = config.getRedis().getExpire();
|
|
|
while (dataIte.hasNext()) {
|
|
|
Map<String, String> record = dataIte.next();
|