SteNicholas commented on a change in pull request #18222:
URL: https://github.com/apache/flink/pull/18222#discussion_r776115340
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBHandle.java
##########
@@ -202,12 +202,21 @@ private void restoreInstanceDirectoryFromPath(Path
source) throws IOException {
final String fileName = file.getFileName().toString();
final Path targetFile = instanceRocksDBDirectory.resolve(fileName);
if (fileName.endsWith(SST_FILE_SUFFIX)) {
- // hardlink'ing the immutable sst-files.
- Files.createLink(targetFile, file);
- } else {
- // true copy for all other files.
- Files.copy(file, targetFile,
StandardCopyOption.REPLACE_EXISTING);
+ try {
+ // hardlink'ing the immutable sst-files.
+ Files.createLink(targetFile, file);
+ continue;
+ } catch (IOException ioe) {
+ logger.debug(
+ String.format(
+ "Could not hard link sst file %s. Trying
to copy it over.",
+ fileName),
+ ioe);
+ }
}
+
+ // true copy for all other files and files that could not be hard
linked.
+ Files.copy(file, targetFile, StandardCopyOption.REPLACE_EXISTING);
Review comment:
Does this move to catch block? And meanwhile remove the continue.
##########
File path:
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBHandle.java
##########
@@ -202,12 +202,21 @@ private void restoreInstanceDirectoryFromPath(Path
source) throws IOException {
final String fileName = file.getFileName().toString();
final Path targetFile = instanceRocksDBDirectory.resolve(fileName);
if (fileName.endsWith(SST_FILE_SUFFIX)) {
- // hardlink'ing the immutable sst-files.
- Files.createLink(targetFile, file);
- } else {
- // true copy for all other files.
- Files.copy(file, targetFile,
StandardCopyOption.REPLACE_EXISTING);
+ try {
+ // hardlink'ing the immutable sst-files.
+ Files.createLink(targetFile, file);
+ continue;
+ } catch (IOException ioe) {
+ logger.debug(
+ String.format(
+ "Could not hard link sst file %s. Trying
to copy it over.",
+ fileName),
+ ioe);
+ }
}
+
+ // true copy for all other files and files that could not be hard
linked.
+ Files.copy(file, targetFile, StandardCopyOption.REPLACE_EXISTING);
Review comment:
Does this move to catch block? And meanwhile remove the continue.
--
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]