fredia commented on code in PR #19907:
URL: https://github.com/apache/flink/pull/19907#discussion_r926200002
##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java:
##########
@@ -409,39 +405,31 @@ private void discardLocalStateForCheckpoint(long
checkpointID, Optional<TaskStat
}
});
- Optional<LocalRecoveryDirectoryProvider> directoryProviderOptional =
- localRecoveryConfig.getLocalStateDirectoryProvider();
+ File checkpointDir = getCheckpointDirectory(checkpointID);
- if (directoryProviderOptional.isPresent()) {
- File checkpointDir =
- directoryProviderOptional
- .get()
- .subtaskSpecificCheckpointDirectory(checkpointID);
Review Comment:
> Is it intentional? If not, is it safe?
Yes, this slightly changes the semantics, it is to reuse the logic of
`getCheckpointDirectory`. It is safe, because the directory would be deleted by:
```
try {
deleteDirectory(checkpointDir);
} catch (IOException ex) {
...
}
```
I will refactor the ` getCheckpointDirectory()` in
https://issues.apache.org/jira/browse/FLINK-28614 , separate the logic of `get`
and `create`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]