Github user jinossy commented on a diff in the pull request:
https://github.com/apache/tajo/pull/560#discussion_r29731769
--- Diff:
tajo-core/src/main/java/org/apache/tajo/ha/HdfsServiceTracker.java ---
@@ -184,15 +181,31 @@ private void createMasterFile(boolean isActive)
throws IOException {
createMasterFile(false);
}
+ // Set active status and delete existing file.
if (isActive) {
isActiveStatus = true;
+ Path backupFile = new Path(backupPath, fileName);
+ if (fs.exists(backupFile)) {
+ fs.delete(backupFile, true);
+ }
} else {
isActiveStatus = false;
+ Path activeFile = new Path(activePath, fileName);
--- End diff --
Can you refactor the duplicate codes?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---