-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refact(rocksdb): clean & reformat some code #2200
Conversation
also mark TODO in some gists
@@ -218,6 +218,7 @@ public IndexTable(String database, String table) { | |||
} | |||
|
|||
@Override | |||
// TODO: why this method is same as super.eliminate() in RocksDBTable, del it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the assert?
seems totally same in parent class?
Line 114 in e7c7558
public void eliminate(RocksDBSessions.Session session, BackendEntry entry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and find out that delete() method is override by IndexTable, we want to call super.delete() instead of this.delete() here. we can add a NOTE here.
@@ -359,6 +358,7 @@ public long estimateNumKeys(RocksDBSessions.Session session) { | |||
|
|||
@Override | |||
public byte[] position(String position) { | |||
// TODO: START & END is same & be empty now? remove one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but the meanings are different
E.checkArgument(snapshotPath.toFile().exists(), | ||
"The snapshot path '%s' doesn't exist", | ||
snapshotPath); | ||
"The snapshot path '%s' doesn't exist", snapshotPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more clear to keep 3 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more clear to keep 3 lines
seems one phrase for one line to read is better? like
// ① not split
throw new BackendException("Table '%s' is not opened", cfName);
// ② split, not necessary to break one line unless it's too long?
throw new BackendException("Table '%s' is not opened",
cfName);
private static Set<String> mergeOldCFs(String path, List<String> cfNames) | ||
throws RocksDBException { | ||
private static Set<String> mergeOldCFs(String path, | ||
List<String> cfNames) throws RocksDBException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer the old style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, the Exception
keyword can't be auto formatted well, so prefer not to align it in a single line
otherwise, it will break the style while formatting the code (with plugin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Update: |
This comment was marked as off-topic.
This comment was marked as off-topic.
@zyxxoo more context about the DriverVersion & StoreVersion? CI alert error log And why alert this (without any code logic change) |
fix
// TODO: is the typo "EREUSING_ENABLED" right? or should be "REUSING_ENABLED"? | ||
private static final boolean EREUSING_ENABLED = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need ensure
This comment was marked as outdated.
This comment was marked as outdated.
private static Set<String> mergeOldCFs(String path, List<String> cfNames) | ||
throws RocksDBException { | ||
private static Set<String> mergeOldCFs(String path, | ||
List<String> cfNames) throws RocksDBException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
@@ -774,7 +754,7 @@ public void resumeSnapshot(String snapshotPrefix, boolean deleteSnapshot) { | |||
} | |||
|
|||
for (Map.Entry<String, RocksDBSessions> entry : | |||
snapshotPaths.entrySet()) { | |||
snapshotPaths.entrySet()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep in one line?
@@ -359,6 +353,7 @@ public long estimateNumKeys(RocksDBSessions.Session session) { | |||
|
|||
@Override | |||
public byte[] position(String position) { | |||
// TODO: START & END is same & be empty now? remove one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the values are equaled, but the meanings are different, we can add NOTE for the const define
@@ -218,6 +218,7 @@ public IndexTable(String database, String table) { | |||
} | |||
|
|||
@Override | |||
// TODO: why this method is same as super.eliminate() in RocksDBTable, del it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and find out that delete() method is override by IndexTable, we want to call super.delete() instead of this.delete() here. we can add a NOTE here.
for (Pair<byte[], byte[]> change : table.getValue()) { | ||
sst.put(change.getKey(), change.getValue()); | ||
} | ||
SstFileWriter sst = table(table.getKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIX ME: 'SstFileWriter' used without 'try'-with-resources statement
* chore: merge master to clean-rocksdb for synchronization (apache#2383) --------- Co-authored-by: V_Galaxy <[email protected]>
also mark TODO in some gists
split it for future dev
TODO: