Reidddddd commented on a change in pull request #528: HBASE-22890 Verify the 
files when RegionServer is starting and BucketCache is in file mode
URL: https://github.com/apache/hbase/pull/528#discussion_r319439221
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
 ##########
 @@ -370,9 +388,15 @@ private IOEngine getIOEngineFromName(String ioEngineName, 
long capacity)
       // In order to make the usage simple, we only need the prefix 'files:' in
       // document whether one or multiple file(s), but also support 'file:' for
       // the compatibility
-      String[] filePaths =
+      filePaths =
           ioEngineName.substring(ioEngineName.indexOf(":") + 
1).split(FileIOEngine.FILE_DELIMITER);
-      return new FileIOEngine(capacity, filePaths);
+      hasKey = FileIOEngineUtils.readLongFormPersistencePath(persistencePath) 
== -1;
+      if (hasKey) {
+        return new FileIOEngine(algorithm, persistencePath, capacity, 
filePaths);
+      } else {
+        return new FileIOEngine(capacity,filePaths);
 
 Review comment:
   I don't like the idea of keeping the older constructor, the `hasKey` check 
can put into the new constructor as well.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to