Home > database >  Memstore flush
Memstore flush

Time:10-31

Prepare stage 1: the current Region through all the Memstore, will the current data set in Memstore kvset do a snapshot of the snapshot, and then create a new kvset, later all write operations will be written to the new kvset, while the flush stage read operation will first traversal kvset respectively and the snapshot, if not find farewell to the HFile lookup, prepare stage need to add a updateLock to write request block, after will release the lock, because this stage without any time-consuming operation, so the lock time is short,

Stage 2, flush: iterate over all Memstore, will prepare phase generated snapshot lasting into temporary files, temporary files will be unified in a directory. TMP, because the process involves the disk IO operations, so relatively time consuming,

Commit stage 3: iterate over all Memstore, flush stage to generate temporary files will be moved to the specified ColumnFamily directory, in view of the HFile generate corresponding storefile and Reader, add storefile to HStore storefiles list, and then empty the prepare phase generated snapshot,
  • Related