HBase在split和major compact的一些非通常情況下的觸發條件

來源:互聯網
上載者:User

HBase中的major compact功能中,參數hbase.hregion.majorcompaction已經設為0了,
日誌中發現還是會major compact。
有3種方式,可以激發major compact
1) 通過hbase shell命令 major_compact進行觸發
2) compact when file <= sum(smaller_files) *
'hbase.hstore.compaction.ratio'
    這種情況是選中的檔案數量等於store中的檔案數量時,會有minor compact升級為major compact
3) major compact時間間隔到期: after (now - min(StoreFile.timestamp)) >
"hbase.hregion.majorcompaction" + rand() *
hbase.hregion.majorcompaction.jitter"

至於split,並不是設定了hbase.hregion.max.filesize(預設10G)為很大就保證不split了,需要有以下的演算法,參見
IncreasingToUpperBoundRegionSplitPolicy是0.94.0預設region split策略
  這裡的split有一個判斷條件,先計算這tableRegionsCount(regionserver上的這個table的online的region個數),
然後迴圈計算此region的所有store是否太大,這是通過getSizeToCheck方法計算出一個size,若當前的store總大小大於這個值,則表示此region需要split.

getSizeToCheck的計算方法首先判斷tableRegionsCount是否等於0,若是則返回hbase.hregion.max.filesize ,若不是,則計算Math.min(getDesiredMaxFileSize(),

this.flushSize * (tableRegionsCount * tableRegionsCount)。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.