@@ -2825,22 +2825,21 @@ protected FlushResultImpl internalFlushCacheAndCommit(WAL wal, MonitoredTask sta
2825
2825
2826
2826
// Switch snapshot (in memstore) -> new hfile (thus causing
2827
2827
// all the store scanners to reset/reseek).
2828
- Iterator <HStore > it = storesToFlush .iterator ();
2829
- // stores.values() and storeFlushCtxs have same order
2830
- for (StoreFlushContext flush : storeFlushCtxs .values ()) {
2831
- boolean needsCompaction = flush .commit (status );
2828
+ for (Map .Entry <byte [], StoreFlushContext > flushEntry : storeFlushCtxs .entrySet ()) {
2829
+ StoreFlushContext sfc = flushEntry .getValue ();
2830
+ boolean needsCompaction = sfc .commit (status );
2832
2831
if (needsCompaction ) {
2833
2832
compactionRequested = true ;
2834
2833
}
2835
- byte [] storeName = it . next (). getColumnFamilyDescriptor (). getName ();
2836
- List <Path > storeCommittedFiles = flush .getCommittedFiles ();
2834
+ byte [] storeName = flushEntry . getKey ();
2835
+ List <Path > storeCommittedFiles = sfc .getCommittedFiles ();
2837
2836
committedFiles .put (storeName , storeCommittedFiles );
2838
2837
// Flush committed no files, indicating flush is empty or flush was canceled
2839
2838
if (storeCommittedFiles == null || storeCommittedFiles .isEmpty ()) {
2840
2839
MemStoreSize storeFlushableSize = prepareResult .storeFlushableSize .get (storeName );
2841
2840
prepareResult .totalFlushableSize .decMemStoreSize (storeFlushableSize );
2842
2841
}
2843
- flushedOutputFileSize += flush .getOutputFileSize ();
2842
+ flushedOutputFileSize += sfc .getOutputFileSize ();
2844
2843
}
2845
2844
storeFlushCtxs .clear ();
2846
2845
0 commit comments