当前位置:首页 > 开发 > 系统架构 > 架构 > 正文

hbase mvcc

发表于: 2015-04-03   作者:blackproof   来源:转载   浏览次数:
摘要:   MVCC相关源码:   在HBase put源码中 http://blackproof.iteye.com/blog/2197710   有mvcc用hregion的mvcc的write point,在生成mvcc的readpoint   KeyValueHeap类的next获取cell的时候使用keyvalue的mvcc的readpoint,判断

  MVCC相关源码:

  在HBase put源码中 http://blackproof.iteye.com/blog/2197710

  有mvcc用hregion的mvcc的write point,在生成mvcc的readpoint

  KeyValueHeap类的next获取cell的时候使用keyvalue的mvcc的readpoint,判断是否取当前kv

  

/**
   * Gets the next row of keys from the top-most scanner.
   * <p>
   * This method takes care of updating the heap.
   * <p>
   * This can ONLY be called when you are using Scanners that implement
   * InternalScanner as well as KeyValueScanner (a {@link StoreScanner}).
   * @param result
   * @param limit
   * @return true if there are more keys, false if all scanners are done
   */
  public boolean next(List<Cell> result, int limit) throws IOException {
    if (this.current == null) {
      return false;
    }
    InternalScanner currentAsInternal = (InternalScanner)this.current;
    boolean mayContainMoreRows = currentAsInternal.next(result, limit);
    KeyValue pee = this.current.peek();
    /*
     * By definition, any InternalScanner must return false only when it has no
     * further rows to be fetched. So, we can close a scanner if it returns
     * false. All existing implementations seem to be fine with this. It is much
     * more efficient to close scanners which are not needed than keep them in
     * the heap. This is also required for certain optimizations.
     */
    if (pee == null || !mayContainMoreRows) {
      this.current.close();
    } else {
      this.heap.add(this.current);
    }
    this.current = pollRealKV();
    return (this.current != null);
  }

 

hbase mvcc

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
参考:http://www.rigongyizu.com/hbase-row-lock-and-multiversion-concurrency-control/ MVCC (Mu
Part I---mvcc concepts in most of databases,the acid symentics are ganranteed ,also,like hbas
英文原文 https://devcenter.heroku.com/articles/p了ostgresql-concurrency#how-mvcc-works 翻译 p
问题 最近项目中遇到了一个分布式系统的并发控制问题。该问题可以抽象为:某分布式系统由一个数据中
最近在看数据库的东西,了解到mysql的mvcc后,开始寻找各种资料,但说的都不是很清楚,看了几天,发
最近在看数据库的东西,了解到mysql的mvcc后,开始寻找各种资料,但说的都不是很清楚,看了几天,发
最近在看数据库的东西,了解到mysql的mvcc后,开始寻找各种资料,但说的都不是很清楚,看了几天,发
磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL内部结构与源代码研究索引页
InnoDB存储引擎MVCC的工作原理 InnoDB存储引擎的行结构 MySQL官方手册https://dev.mysql.com/doc/re
原文:http://coolshell.cn/articles/6790.htm 问题 最近项目中遇到了一个分布式系统的并发控制问题
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号