Skip to content

Commit

Permalink
Remove redundant logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattl-netflix committed May 4, 2024
1 parent 646973d commit 8c23800
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions priam/src/main/java/com/netflix/priam/restore/AbstractRestore.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,8 @@ private List<Future<Path>> download(Iterator<AbstractBackupPath> fsIterator) thr
while (fsIterator.hasNext()) {
AbstractBackupPath temp = fsIterator.next();
if (backupRestoreUtil.isFiltered(temp.getKeyspace(), temp.getColumnFamily())) {
logger.info(
"Bypassing restoring file \"{}\" as it is part of the keyspace.columnfamily filter list. Its keyspace:cf is: {}:{}",
temp.newRestoreFile(),
temp.getKeyspace(),
temp.getColumnFamily());
continue;
}

File localFileHandler = temp.newRestoreFile();
if (logger.isDebugEnabled())
logger.debug(
"Created local file name: "
+ localFileHandler.getAbsolutePath()
+ File.pathSeparator
+ localFileHandler.getName());
futureList.add(downloadFile(temp));
}
return futureList;
Expand All @@ -142,15 +129,14 @@ public void execute() throws Exception {
final DateUtil.DateRange dateRange = new DateUtil.DateRange(config.getRestoreSnapshot());
new RetryableCallable<Void>() {
public Void retriableCall() throws Exception {
logger.info("Attempting restore");
restore(dateRange);
logger.info("Restore completed");

// Wait for other server init to complete
sleeper.sleep(30000);
return null;
}
}.call();
logger.info("Restore complete.");
}

public void restore(DateUtil.DateRange dateRange) throws Exception {
Expand Down Expand Up @@ -189,14 +175,12 @@ public void restore(DateUtil.DateRange dateRange) throws Exception {
BackupRestoreUtil.getLatestValidMetaPath(metaProxy, dateRange);

if (!latestValidMetaFile.isPresent()) {
logger.info("No valid snapshot meta file found, Restore Failed.");
instanceState.getRestoreStatus().setExecutionEndTime(LocalDateTime.now());
instanceState.setRestoreStatus(Status.FAILED);
return;
}

logger.info(
"Snapshot Meta file for restore {}", latestValidMetaFile.get().getRemotePath());
logger.info("Meta file for restore {}", latestValidMetaFile.get().getRemotePath());
instanceState
.getRestoreStatus()
.setSnapshotMetaFile(latestValidMetaFile.get().getRemotePath());
Expand All @@ -216,21 +200,15 @@ public void restore(DateUtil.DateRange dateRange) throws Exception {

waitForCompletion(futureList);

logger.info("Starting post restore hook");
postRestoreHook.execute();
logger.info("Completed executing post restore hook");

instanceState.getRestoreStatus().setExecutionEndTime(LocalDateTime.now());
instanceState.setRestoreStatus(Status.FINISHED);

if (!config.doesCassandraStartManually()) cassProcess.start(true);
else
logger.info(
"config.doesCassandraStartManually() is set to True, hence Cassandra needs to be started manually ...");
} catch (Exception e) {
instanceState.setRestoreStatus(Status.FAILED);
instanceState.getRestoreStatus().setExecutionEndTime(LocalDateTime.now());
logger.error("Error while trying to restore: {}", e.getMessage(), e);
throw e;
} finally {
instanceIdentity.getInstance().setToken(origToken);
Expand Down

0 comments on commit 8c23800

Please sign in to comment.