Skip to content

Commit

Permalink
CASS-1937 cease filtering out OpsCenter keyspace. (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattl-netflix authored Sep 23, 2020
1 parent b1d1551 commit 0fd4822
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions priam/src/main/java/com/netflix/priam/backup/AbstractBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,16 @@ protected final void initiateBackup(

for (File columnFamilyDir : columnFamilyDirectories) {
File backupDir = new File(columnFamilyDir, monitoringFolder);

if (!isValidBackupDir(keyspaceDir, backupDir)) {
continue;
}

String columnFamilyName = columnFamilyDir.getName().split("-")[0];
if (backupRestoreUtil.isFiltered(
keyspaceDir.getName(), columnFamilyDir.getName())) {
// Clean the backup/snapshot directory else files will keep getting accumulated.
SystemUtils.cleanupDir(backupDir.getAbsolutePath(), null);
continue;
if (backupDir.exists() && backupDir.isDirectory() && backupDir.canRead()) {
String columnFamilyName = columnFamilyDir.getName().split("-")[0];
if (backupRestoreUtil.isFiltered(keyspaceDir.getName(), columnFamilyName)) {
// Clean the backup/snapshot directory else files will keep getting
// accumulated.
SystemUtils.cleanupDir(backupDir.getAbsolutePath(), null);
} else {
processColumnFamily(keyspaceDir.getName(), columnFamilyName, backupDir);
}
}

processColumnFamily(keyspaceDir.getName(), columnFamilyName, backupDir);
} // end processing all CFs for keyspace
} // end processing keyspaces under the C* data dir
}
Expand Down Expand Up @@ -206,18 +202,4 @@ public static Set<Path> getBackupDirectories(IConfiguration config, String monit
}
return backupPaths;
}

/** Filters unwanted keyspaces */
private boolean isValidBackupDir(File keyspaceDir, File backupDir) {
if (backupDir == null || !backupDir.isDirectory() || !backupDir.exists()) return false;
String keyspaceName = keyspaceDir.getName();
if (BackupRestoreUtil.FILTER_KEYSPACE.contains(keyspaceName)) {
logger.debug(
"{} is not consider a valid keyspace backup directory, will be bypass.",
keyspaceName);
return false;
}

return true;
}
}

0 comments on commit 0fd4822

Please sign in to comment.