Skip to content

Commit

Permalink
[hotfix] Add logging for RocksDB backup durations
Browse files Browse the repository at this point in the history
  • Loading branch information
aljoscha committed Feb 24, 2016
1 parent cec7fbb commit be68b17
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,12 @@ public final KvStateSnapshot<K, N, S, SD, RocksDBStateBackend> snapshot(final lo
}
}

long startTime = System.currentTimeMillis();
try (BackupEngine backupEngine = BackupEngine.open(Env.getDefault(), new BackupableDBOptions(localBackupPath.getAbsolutePath()))) {
backupEngine.createNewBackup(db);
}
long endTime = System.currentTimeMillis();
LOG.info("RocksDB (" + rocksDbPath + ") backup (synchronous part) took " + (endTime - startTime) + " ms.");

return new AsyncRocksDBSnapshot<>(
localBackupPath,
Expand Down Expand Up @@ -419,7 +422,10 @@ public AsyncRocksDBSnapshot(File localBackupPath,
@Override
public KvStateSnapshot<K, N, S, SD, RocksDBStateBackend> materialize() throws Exception {
try {
long startTime = System.currentTimeMillis();
HDFSCopyFromLocal.copyFromLocal(localBackupPath, backupUri);
long endTime = System.currentTimeMillis();
LOG.info("RocksDB materialization from " + localBackupPath + " to " + backupUri + " (asynchronous part) took " + (endTime - startTime) + " ms.");
return state.createRocksDBSnapshot(backupUri, checkpointId);
} catch (Exception e) {
FileSystem fs = FileSystem.get(backupUri, HadoopFileSystem.getHadoopConfiguration());
Expand Down

0 comments on commit be68b17

Please sign in to comment.