|
|
|
@ -28,9 +28,9 @@ public class RedisTableDataModel extends BaseDataModel {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Redis redis = mc.createRedisClient(); |
|
|
|
|
try { |
|
|
|
|
redis.getClient().select(dbIndex); |
|
|
|
|
LogKit.info("Connect to redis and select database:" + dbIndex); |
|
|
|
|
try { |
|
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
|
DataWrapper<Object> wrapper = VisitorFactory.getKeyValueResult(calculator, ps, redis.getClient(), query, rowCount); |
|
|
|
|
LogKit.info("Fetch data from redis spend time {} ms.", System.currentTimeMillis() - start); |
|
|
|
@ -40,6 +40,8 @@ public class RedisTableDataModel extends BaseDataModel {
|
|
|
|
|
redis.close(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
throw new RuntimeException(e.getCause()); |
|
|
|
|
} finally { |
|
|
|
|
redis.close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|