wchevreuil commented on a change in pull request #3460:
URL: https://github.com/apache/hbase/pull/3460#discussion_r674328976
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
##########
@@ -1088,9 +1086,19 @@ public HStoreFile tryCommitRecoveredHFile(Path path)
throws IOException {
* @return store file created.
*/
private HStoreFile commitFile(Path path, long logCacheFlushId, MonitoredTask
status)
- throws IOException {
- // Write-out finished successfully, move into the right spot
- Path dstPath =
getRegionFileSystem().commitStoreFile(getColumnFamilyName(), path);
+ throws IOException {
+ HRegionFileSystem hfs = getRegionFileSystem();
+ Path storeDir = hfs.getStoreDir(getColumnFamilyName());
+ Path dstPath;
+ // As we want to support writing to data directory directly, here we need
to check whether the
+ // store file is already in the right place
+ if (path.getParent() != null && path.getParent().equals(storeDir)) {
+ // already in the right place, skip renmaing
+ dstPath = path;
+ } else {
+ // Write-out finished successfully, move into the right spot
+ dstPath = hfs.commitStoreFile(getColumnFamilyName(), path);
+ }
Review comment:
nit: As mentioned in the design doc, this could be delegated to SFT
implementations (similarly to how createWriter was moved from
Compactor/StoreFlusher to SFT).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]