1 / 20

JIAN系列开源项目介绍

JIAN系列开源项目介绍. 项目位置:code.google.com/p/eejian. 沉淀、分享、学习和进步. 易剑 2010年七月. 纲要. 项目成员 jian_util jian_sys jian_net jian_server jian_table jian_sender http_paser JDSP JDFS JMBR. 项目成员. jian_loader. http_parser. time_keeper. jian_util. jian_sys. jian_net. jian_server. jian_httpd.

ita
Download Presentation

JIAN系列开源项目介绍

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JIAN系列开源项目介绍 项目位置:code.google.com/p/eejian 沉淀、分享、学习和进步 易剑 2010年七月

  2. 纲要 • 项目成员 • jian_util • jian_sys • jian_net • jian_server • jian_table • jian_sender • http_paser • JDSP • JDFS • JMBR

  3. 项目成员 jian_loader http_parser time_keeper jian_util jian_sys jian_net jian_server jian_httpd jian_sender JDSP jian_observer JDFS jian_table JMBR

  4. jian_util • 日志接口(提供对log4cxx的包装) • 配置接口(提供对tinyxml的包装,支持单值、数组和子树方式读取) • main函数模板 • 数组队列 • 字符串工具类 • 整数工具类 • token类 • 列表队列/可列表的

  5. jian_sys • 原子锁 • 互斥锁 • 事件 • 动态连接库加载 • 系统调用异常 • mmap • 读写锁 • 引用计数 • 系统信息(内存、CPU和进程的内存及CPU等) • 系统工具(CPU个数、当前进程全路径等) • 线程 • 线程池

  6. jian_net • epoll • 监听/监听池 • 服务端socket • 客户端socket • 网络工具(根据网卡名取IP地址等) • 超时相关

  7. jian_loader • 不需设置LD_LIBRARY_PATH直接运行指定程序

  8. jian_table • 节点表 • IP到ID的映射 • ID取值从0开始,每个ID对应一个唯一的IP,但是同一个IP可以对应多个不同ID • jian_sender根据ID分发消息

  9. jian_sender • 多线程客户端工具 • 主要用于节点间转发消息 • 不适合大数据传输 • 支持动态更新“节点表”,以实现节点容灾

  10. jian_server • TCP服务端框架 • 提供简单的编程接口 • IProtocolParser:协议解析接口 • IProtocolTranslator:协议转换接口 • IResponsor:请求响应接口 • 多线程,高效,可管理

  11. jian_observer • 提供可观察机制 • 提供可观察对象抽象接口 • 定时触发数据采集和上报事件 • IObservable:可观察对象抽象接口 • IDataReporter:数据上报接口

  12. http_parser • HTTP包解析器 • 采用command模式,简洁高效,可复用 • 只需要实现IHttpEvent接口

  13. jian_httpd • HTTP Server • 主要定位于高效的静态页面处理 • 将支持基于so类型的CGI • 兼容exe类型的CGI

  14. JDSP • 分布式业务平台(Jian Distributed Service Platform) • 提供三种对象编程模式: • object:无状态对象模式,object总是线程安全 • service:状态对象模式,总是非线程安全 • session:总是由service创建,且线程安全

  15. JDFS • HDFS的C++简化版本 • 基于JDSP实现

  16. JMBR • MapReduce的改进和简化版本 • C++实现 • 无数据倾斜问题 • 精细化调度: • 类似于时间片的Job切换 • 类似于操作系统的Job优先级

  17. 代码结构 • 代码主目录下分: • include:对外开放的头文件 • src:存放源代码和内部头文件 • lib:编译后生成的库文件 • vcproj:VC6.0工程文件

  18. 编译介绍 • automake编译方式 • Make.rules文件定义通用编译规则 • 增加和删除文件,都不需要修改Makefile.am文件

  19. 第一次编译 • 使用SVN从https://eejian.googlecode.com/svn/trunk下载源代码 • 进入src目录,并依次执行: • gen_makefile_am.sh • gen_configure_ac.sh • 按automake方式执行configure • 按automake方式执行make等 • 注:第一次和每当有CPP文件的增加或删除时,都需要重新执行上述步骤,否则可以跳过gen_makefile_am.sh和gen_configure_ac.sh两步。

  20. QQ:784027584 email:eyjian@qq.com eyjian@gmail eyjian@live.com

More Related