JingsongLi commented on a change in pull request #12651:
URL: https://github.com/apache/flink/pull/12651#discussion_r440590714
##
File path:
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/FileSystemLookupFunction.java
##
@@ -143,26 +148,41 @@ private void checkCacheReload() {
} else {
LOG.info("Populating lookup join cache");
}
- cache.clear();
- try {
- T[] inputSplits = inputFormat.createInputSplits(1);
- GenericRowData reuse = new
GenericRowData(producedNames.length);
- long count = 0;
- for (T split : inputSplits) {
- inputFormat.open(split);
- while (!inputFormat.reachedEnd()) {
- RowData row =
inputFormat.nextRecord(reuse);
- count++;
- Row key = extractKey(row);
- List rows =
cache.computeIfAbsent(key, k -> new ArrayList<>());
- rows.add(serializer.copy(row));
+ int numRetry = 0;
+ while (true) {
+ cache.clear();
+ try {
+ T[] inputSplits =
inputFormat.createInputSplits(1);
+ GenericRowData reuse = new
GenericRowData(producedNames.length);
+ long count = 0;
+ for (T split : inputSplits) {
+ inputFormat.open(split);
+ while (!inputFormat.reachedEnd()) {
+ RowData row =
inputFormat.nextRecord(reuse);
+ count++;
+ Row key = extractKey(row);
+ List rows =
cache.computeIfAbsent(key, k -> new ArrayList<>());
+ rows.add(serializer.copy(row));
+ }
+ inputFormat.close();
+ }
+ nextLoadTime = System.currentTimeMillis() +
getCacheTTL().toMillis();
+ LOG.info("Loaded {} row(s) into lookup join
cache", count);
+ return;
+ } catch (IOException e) {
+ if (numRetry >= MAX_RETRIES) {
+ throw new FlinkRuntimeException(
+ String.format("Failed
to load table into cache after %d retries", numRetry), e);
+ }
+ long toSleep = ++numRetry *
RETRY_INTERVAL.toMillis();
Review comment:
One single line to `numRetry ++`
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org