2525import java .util .concurrent .ConcurrentHashMap ;
2626import java .util .concurrent .ConcurrentMap ;
2727import java .util .concurrent .Semaphore ;
28- import java .util .concurrent .atomic .AtomicLong ;
2928import java .util .concurrent .locks .Lock ;
3029import java .util .concurrent .locks .ReentrantLock ;
3130import org .apache .commons .lang3 .StringUtils ;
@@ -59,7 +58,6 @@ public class FlatMessageFile implements FlatFileInterface {
5958 protected final MetadataStore metadataStore ;
6059 protected final FlatCommitLogFile commitLog ;
6160 protected final FlatConsumeQueueFile consumeQueue ;
62- protected final AtomicLong lastDestroyTime ;
6361
6462 protected final ConcurrentMap <String , CompletableFuture <?>> inFlightRequestMap ;
6563
@@ -77,7 +75,6 @@ public FlatMessageFile(FlatFileFactory fileFactory, String filePath) {
7775 this .metadataStore = fileFactory .getMetadataStore ();
7876 this .commitLog = fileFactory .createFlatFileForCommitLog (filePath );
7977 this .consumeQueue = fileFactory .createFlatFileForConsumeQueue (filePath );
80- this .lastDestroyTime = new AtomicLong ();
8178 this .inFlightRequestMap = new ConcurrentHashMap <>();
8279 }
8380
@@ -388,8 +385,8 @@ public void shutdown() {
388385 closed = true ;
389386 fileLock .lock ();
390387 try {
391- commitLog .shutdown ();
392388 consumeQueue .shutdown ();
389+ commitLog .shutdown ();
393390 } finally {
394391 fileLock .unlock ();
395392 }
@@ -399,8 +396,8 @@ public void shutdown() {
399396 public void destroyExpiredFile (long timestamp ) {
400397 fileLock .lock ();
401398 try {
402- commitLog .destroyExpiredFile (timestamp );
403399 consumeQueue .destroyExpiredFile (timestamp );
400+ commitLog .destroyExpiredFile (timestamp );
404401 } finally {
405402 fileLock .unlock ();
406403 }
@@ -410,8 +407,8 @@ public void destroy() {
410407 this .shutdown ();
411408 fileLock .lock ();
412409 try {
413- commitLog .destroyExpiredFile (Long .MAX_VALUE );
414410 consumeQueue .destroyExpiredFile (Long .MAX_VALUE );
411+ commitLog .destroyExpiredFile (Long .MAX_VALUE );
415412 if (queueMetadata != null ) {
416413 metadataStore .deleteQueue (queueMetadata .getQueue ());
417414 }
0 commit comments