@@ -93,12 +93,12 @@ protected void initCache() throws SQLException {
93
93
protected void reloadCache () {
94
94
//reload cacheRef and replace to old cacheRef
95
95
Map <String , List <Map <String , Object >>> newCache = Maps .newConcurrentMap ();
96
- cacheRef .set (newCache );
97
96
try {
98
97
loadData (newCache );
99
98
} catch (SQLException e ) {
100
99
throw new RuntimeException (e );
101
100
}
101
+ cacheRef .set (newCache );
102
102
LOG .info ("----- rdb all cacheRef reload end:{}" , Calendar .getInstance ());
103
103
}
104
104
@@ -122,9 +122,9 @@ public void flatMap(CRow value, Collector<CRow> out) throws Exception {
122
122
List <Map <String , Object >> cacheList = cacheRef .get ().get (cacheKey );
123
123
if (CollectionUtils .isEmpty (cacheList ) && sideInfo .getJoinType () == JoinType .LEFT ) {
124
124
out .collect (new CRow (fillData (value .row (), null ), value .change ()));
125
+ } else if (!CollectionUtils .isEmpty (cacheList )) {
126
+ cacheList .forEach (one -> out .collect (new CRow (fillData (value .row (), one ), value .change ())));
125
127
}
126
-
127
- cacheList .stream ().forEach (one -> out .collect (new CRow (fillData (value .row (), one ), value .change ())));
128
128
}
129
129
130
130
@ Override
@@ -151,8 +151,8 @@ public Row fillData(Row input, Object sideInput) {
151
151
}
152
152
153
153
/**
154
- * covert flink time attribute.Type information for indicating event or processing time.
155
- * However, it behaves like a regular SQL timestamp but is serialized as Long.
154
+ * covert flink time attribute.Type information for indicating event or processing time.
155
+ * However, it behaves like a regular SQL timestamp but is serialized as Long.
156
156
*
157
157
* @param entry
158
158
* @param obj
@@ -232,7 +232,8 @@ public int getFetchSize() {
232
232
}
233
233
234
234
/**
235
- * get jdbc connection
235
+ * get jdbc connection
236
+ *
236
237
* @param dbURL
237
238
* @param userName
238
239
* @param password
0 commit comments