Skip to content

Commit

Permalink
make copier final
Browse files Browse the repository at this point in the history
  • Loading branch information
keuin committed Nov 17, 2024
1 parent da48f17 commit 6cd8aa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ public class IncrementalBackupStorageManager {
private final Logger logger = Logger.getLogger(IncrementalBackupStorageManager.class.getName());
private final Path backupStorageBase;
private final Logger LOGGER = Logger.getLogger(IncrementalBackupStorageManager.class.getName());
private FileCopier copier;
private final FileCopier copier;

public IncrementalBackupStorageManager(Path backupStorageBase) {
this.backupStorageBase = backupStorageBase;
FileCopier copier;
if (KBackupConfig.getInstance().getIncbakCow()) {
// try to use cow copier, if failed, fallback to normal copier
try {
this.copier = FileCowCopier.getInstance();
copier = FileCowCopier.getInstance();
} catch (Exception | UnsatisfiedLinkError ex) {
PrintUtil.error("Failed to initialize kbackup-cow: " + ex + ex.getMessage());
this.copier = new FileEagerCopier();
copier = new FileEagerCopier();
}
} else {
this.copier = new FileEagerCopier();
copier = new FileEagerCopier();
}
this.copier = copier;
if (this.copier.isCow()) {
PrintUtil.info("Copy-on-write is enabled");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ConfiguredIncrementalBackupMethod(String backupIndexFileName, String leve
@Override
public IncrementalBackupFeedback backup() {
final int hashFactoryThreads = ThreadingUtil.getRecommendedThreadCount(); // how many threads do we use to generate the hash tree
LOGGER.info("Threads: " + hashFactoryThreads);
PrintUtil.info("Threads: " + hashFactoryThreads);

// needed in abort progress
File levelPathFile = new File(levelPath);
Expand Down

0 comments on commit 6cd8aa2

Please sign in to comment.