@@ -66,7 +66,7 @@ public class RedisAsyncReqRow extends BaseAsyncReqRow {
6666
6767 private RedisSideTableInfo redisSideTableInfo ;
6868
69- private RedisSideReqRow redisSideReqRow ;
69+ private final RedisSideReqRow redisSideReqRow ;
7070
7171 public RedisAsyncReqRow (RowTypeInfo rowTypeInfo , JoinInfo joinInfo , List <FieldInfo > outFieldInfoList , AbstractSideTableInfo sideTableInfo ) {
7272 super (new RedisAsyncSideInfo (rowTypeInfo , joinInfo , outFieldInfoList , sideTableInfo ));
@@ -92,15 +92,15 @@ private void buildRedisClient(RedisSideTableInfo tableInfo){
9292 case STANDALONE :
9393 RedisURI redisURI = RedisURI .create ("redis://" + url );
9494 redisURI .setPassword (password );
95- redisURI .setDatabase (Integer .valueOf (database ));
95+ redisURI .setDatabase (Integer .parseInt (database ));
9696 redisClient = RedisClient .create (redisURI );
9797 connection = redisClient .connect ();
9898 async = connection .async ();
9999 break ;
100100 case SENTINEL :
101101 RedisURI redisSentinelURI = RedisURI .create ("redis-sentinel://" + url );
102102 redisSentinelURI .setPassword (password );
103- redisSentinelURI .setDatabase (Integer .valueOf (database ));
103+ redisSentinelURI .setDatabase (Integer .parseInt (database ));
104104 redisSentinelURI .setSentinelMasterId (redisSideTableInfo .getMasterName ());
105105 redisClient = RedisClient .create (redisSentinelURI );
106106 connection = redisClient .connect ();
@@ -129,21 +129,18 @@ public void handleAsyncInvoke(Map<String, Object> inputParams, BaseRow input, Re
129129 return ;
130130 }
131131 RedisFuture <Map <String , String >> future = ((RedisHashAsyncCommands ) async ).hgetall (key );
132- future .thenAccept (new Consumer <Map <String , String >>() {
133- @ Override
134- public void accept (Map <String , String > values ) {
135- if (MapUtils .isNotEmpty (values )) {
136- try {
137- BaseRow row = fillData (input , values );
138- dealCacheData (key ,CacheObj .buildCacheObj (ECacheContentType .SingleLine , row ));
139- RowDataComplete .completeBaseRow (resultFuture , row );
140- } catch (Exception e ) {
141- dealFillDataError (input , resultFuture , e );
142- }
143- } else {
144- dealMissKey (input , resultFuture );
145- dealCacheData (key , CacheMissVal .getMissKeyObj ());
132+ future .thenAccept (values -> {
133+ if (MapUtils .isNotEmpty (values )) {
134+ try {
135+ BaseRow row = fillData (input , values );
136+ dealCacheData (key ,CacheObj .buildCacheObj (ECacheContentType .SingleLine , row ));
137+ RowDataComplete .completeBaseRow (resultFuture , row );
138+ } catch (Exception e ) {
139+ dealFillDataError (input , resultFuture , e );
146140 }
141+ } else {
142+ dealMissKey (input , resultFuture );
143+ dealCacheData (key , CacheMissVal .getMissKeyObj ());
147144 }
148145 });
149146 }
0 commit comments