wchevreuil commented on code in PR #5341:
URL: https://github.com/apache/hbase/pull/5341#discussion_r1290640054


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -1252,16 +1259,19 @@ static List<RAMQueueEntry> 
getRAMQueueEntries(BlockingQueue<RAMQueueEntry> q,
   @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = 
"OBL_UNSATISFIED_OBLIGATION",
       justification = "false positive, try-with-resources ensures close is 
called.")
   void persistToFile() throws IOException {
-    if (!ioEngine.isPersistent()) {
+    if (!isCachePersistent()) {
       throw new IOException("Attempt to persist non-persistent cache 
mappings!");
     }
-    try (FileOutputStream fos = new FileOutputStream(persistencePath, false)) {
+    File tempPersistencePath = new File(persistencePath + 
EnvironmentEdgeManager.currentTime());
+    try (FileOutputStream fos = new FileOutputStream(tempPersistencePath, 
false)) {
       fos.write(ProtobufMagic.PB_MAGIC);
       BucketProtoUtils.toPB(this).writeDelimitedTo(fos);
     }
-    if (prefetchedFileListPath != null) {
-      PrefetchExecutor.persistToFile(prefetchedFileListPath);
-    }
+    tempPersistencePath.renameTo(new File(persistencePath));

Review Comment:
   Yeah, let me add that.



-- 
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]

Reply via email to