Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor code style and naming changes
  • Loading branch information
riyaverm-db committed Jun 25, 2024
commit ddb97d66a4fd04f873dc5386b075be0ceb927cfd
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class RocksDB(
checkpointDir: File,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2 more spaces (4 spaces for params in multi-lines)

version: Long,
numKeys: Long,
fileMappings: RocksDBFileMappings) {
capturedFileMappings: RocksDBFileMappings) {
def close(): Unit = {
silentDeleteRecursively(checkpointDir, s"Free up local checkpoint of snapshot $version")
}
Expand Down Expand Up @@ -596,7 +596,7 @@ class RocksDB(
// inside the uploadSnapshot() called below.
// If changelog checkpointing is enabled, snapshot will be uploaded asynchronously
// during state store maintenance.
oldSnapshots.addOne(latestSnapshot)
oldSnapshots += latestSnapshot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check if latestSnapshot is None before we append it to the list?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a List[Option[Snapshot]], so checking is not needed. But I feel changing it to a List[Snapshot] and doing the null check make the code much cleaner.

latestSnapshot = Some(
RocksDBSnapshot(checkpointDir,
newVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ class RocksDBFileManager(

/**
* Track file mappings in RocksDB across local and remote directories
* @param versionToRocksDBFiles Mapping of version to DFS files
* @param versionToRocksDBFiles Mapping of RocksDB files used across versions for maintenance
* @param localFilesToDfsFiles Mapping of the exact Dfs file used to create a local SST file
* The reason localFilesToDfsFiles is a separate map because versionToRocksDBFiles can contain
* multiple similar SST files to a particular local file (for example 1.sst can map to 1-UUID1.sst
Expand Down