zoukankan      html  css  js  c++  java
  • HBase数据读写流程(1.3.1)

    ===数据写入流程===

    源码:https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

    函数:doMiniBatchMutation

    总结:图片来自博客:http://hbasefly.com/2016/03/23/hbase_writer/

    源码注释摘录:

    // ------------------------------------
          // STEP 1. Try to acquire as many locks as we can, and ensure
          // we acquire at least one.
          // ----------------------------------
    
          // ------------------------------------
          // STEP 2. Update any LATEST_TIMESTAMP timestamps
          // ----------------------------------
    
          // ------------------------------------
          // STEP 3. Build WAL edit
          // ----------------------------------
    
          // -------------------------
          // STEP 4. Append the final edit to WAL. Do not sync wal.
          // -------------------------
    
          // ------------------------------------
          // STEP 5. Write back to memstore
          // Write to memstore. It is ok to write to memstore
          // first without syncing the WAL because we do not roll
          // forward the memstore MVCC. The MVCC will be moved up when
          // the complete operation is done. These changes are not yet
          // visible to scanners till we update the MVCC. The MVCC is
          // moved only when the sync is complete.
          // ----------------------------------
    
          // -------------------------------
          // STEP 6. Release row locks, etc.
          // -------------------------------
    
          // -------------------------
          // STEP 7. Sync wal.
          // -------------------------
    
          // ------------------------------------------------------------------
          // STEP 8. Advance mvcc. This will make this put visible to scanners and getters.
          // ------------------------------------------------------------------
    
          // ------------------------------------
          // STEP 9. Run coprocessor post hooks. This should be done after the wal is
          // synced so that the coprocessor contract is adhered to.
          // ------------------------------------
    
          // if the wal sync was unsuccessful, remove keys from memstore

    ===数据读取流程===

    参考博客:http://hbasefly.com/2016/12/21/hbase-getorscan/

  • 相关阅读:
    ARM指令集----寻址方式
    [js] 实现接口
    sublime自定义配置
    [javascript] postmessage
    [javascript] visible - 待写
    [读书笔记]24个比利
    解决div里面img的缝隙问题(转)
    【JAVASCRIPT】React + Redux
    【JAVASCRIPT】React 学习
    代理
  • 原文地址:https://www.cnblogs.com/quchunhui/p/7569542.html
Copyright © 2011-2022 走看看