这个load操作发生在启动broker的时候。

所以我们直接进入DefaultMessageStore的load()方法:

   /**
* 加载数据
*
* @throws IOException
*/
public boolean load() {
boolean result = true; try {
boolean lastExitOK = !this.isTempFileExist();
log.info("last shutdown {}", (lastExitOK ? "normally" : "abnormally")); // load 定时进度
// 这个步骤要放置到最前面,从CommitLog里Recover定时消息需要依赖加载的定时级别参数
// slave依赖scheduleMessageService做定时消息的恢复
if (null != scheduleMessageService) {
result = result && this.scheduleMessageService.load();
} // load Commit Log
result = result && this.commitLog.load(); // load Consume Queue
result = result && this.loadConsumeQueue(); if (result) {
this.storeCheckpoint =
new StoreCheckpoint(StorePathConfigHelper.getStoreCheckpoint(this.messageStoreConfig.getStorePathRootDir())); this.indexService.load(lastExitOK); // 尝试恢复数据
this.recover(lastExitOK); log.info("load over, and the max phy offset = {}", this.getMaxPhyOffset());
}
} catch (Exception e) {
log.error("load exception", e);
result = false;
} if (!result) {
this.allocateMapedFileService.shutdown();
} return result;
}

新开了一篇来写:http://www.cnblogs.com/guazi/p/6836112.html

最新文章

  1. 编辑距离——Edit Distance
  2. spring源码分析(一)IoC、DI
  3. Android Studio 使用小技巧
  4. UIButton 点击后变灰
  5. Scoket
  6. try-catch-finally中return的执行情况分析
  7. CXF之一 基础理论介绍
  8. 『电脑技巧』破解Win7/Win8登录密码
  9. (搬运工)国内顺利使用Google的另类技巧
  10. POJ 3678 Katu Puzzle(2 - SAT) - from lanshui_Yang
  11. [string]Valid Parentheses
  12. 支付宝支付-tp5
  13. 百行go代码构建p2p聊天室
  14. Mac下git配置
  15. SQL 中事务的分类
  16. Java入门(五):控制流程
  17. Piwis Tester II V18.100 with CF30 Laptop for Porsche
  18. 深度学习Bible学习笔记:第一章 前言
  19. python爬虫积累(一)--------selenium+python+PhantomJS的使用
  20. POJ1860-Currency Exchange (正权回路)【Bellman-Ford】

热门文章

  1. 哪些情况会导致OOM
  2. 编译cuda Examples 时出现错误:/bin/ld cannot find -lglut
  3. Delphi - 字符串 详解
  4. ubuntu下使用mysql的一点笔记
  5. php关于private、protected、public的区别
  6. magento 搬家
  7. 设置每个datanode里面的map数目,提高运行效率
  8. poj2253 最短路变形
  9. 几何+暴力【p1959】 遗址[NOI导刊2009普及(6)]
  10. 洛谷—— P1775 古代人的难题_NOI导刊2010提高(02)