refact(rocksdb): clean & reformat some code#2200
Conversation
also mark TODO in some gists
| } | ||
|
|
||
| @Override | ||
| // TODO: why this method is same as super.eliminate() in RocksDBTable, del it? |
There was a problem hiding this comment.
added the assert?
seems totally same in parent class?
There was a problem hiding this comment.
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.
|
|
||
| @Override | ||
| public byte[] position(String position) { | ||
| // TODO: START & END is same & be empty now? remove one? |
There was a problem hiding this comment.
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.
it's more clear to keep 3 lines
There was a problem hiding this comment.
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.
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)
|
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; |
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 { |
|
|
||
| for (Map.Entry<String, RocksDBSessions> entry : | ||
| snapshotPaths.entrySet()) { | ||
| snapshotPaths.entrySet()) { |
|
|
||
| @Override | ||
| public byte[] position(String position) { | ||
| // TODO: START & END is same & be empty now? remove one? |
There was a problem hiding this comment.
the values are equaled, but the meanings are different, we can add NOTE for the const define
| } | ||
|
|
||
| @Override | ||
| // TODO: why this method is same as super.eliminate() in RocksDBTable, del it? |
There was a problem hiding this comment.
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.
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: