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