@@ -2796,22 +2796,21 @@ protected FlushResultImpl internalFlushCacheAndCommit(WAL wal, MonitoredTask sta
2796
2796
2797
2797
// Switch snapshot (in memstore) -> new hfile (thus causing
2798
2798
// all the store scanners to reset/reseek).
2799
- Iterator <HStore > it = storesToFlush .iterator ();
2800
- // stores.values() and storeFlushCtxs have same order
2801
- for (StoreFlushContext flush : storeFlushCtxs .values ()) {
2802
- boolean needsCompaction = flush .commit (status );
2799
+ for (Map .Entry <byte [], StoreFlushContext > flushEntry : storeFlushCtxs .entrySet ()) {
2800
+ StoreFlushContext sfc = flushEntry .getValue ();
2801
+ boolean needsCompaction = sfc .commit (status );
2803
2802
if (needsCompaction ) {
2804
2803
compactionRequested = true ;
2805
2804
}
2806
- byte [] storeName = it . next (). getColumnFamilyDescriptor (). getName ();
2807
- List <Path > storeCommittedFiles = flush .getCommittedFiles ();
2805
+ byte [] storeName = flushEntry . getKey ();
2806
+ List <Path > storeCommittedFiles = sfc .getCommittedFiles ();
2808
2807
committedFiles .put (storeName , storeCommittedFiles );
2809
2808
// Flush committed no files, indicating flush is empty or flush was canceled
2810
2809
if (storeCommittedFiles == null || storeCommittedFiles .isEmpty ()) {
2811
2810
MemStoreSize storeFlushableSize = prepareResult .storeFlushableSize .get (storeName );
2812
2811
prepareResult .totalFlushableSize .decMemStoreSize (storeFlushableSize );
2813
2812
}
2814
- flushedOutputFileSize += flush .getOutputFileSize ();
2813
+ flushedOutputFileSize += sfc .getOutputFileSize ();
2815
2814
}
2816
2815
storeFlushCtxs .clear ();
2817
2816
0 commit comments