Voltdb 源码阅读
2015-12-08 18:51
246 查看
入口文件:https://github.com/VoltDB/voltdb/blob/master/src/frontend/org/voltdb/VoltDB.java
主要就是Configuration类保存运行参数,主要的如 pathToDeployment(指向deployment.xml),m_startAction(create ,rejoin,,),端口等
一个单体voltdb实例 https://github.com/VoltDB/voltdb/blob/master/src/frontend/org/voltdb/RealVoltDB.java
主要voltdb 实例类:https://github.com/VoltDB/voltdb/blob/master/src/frontend/org/voltdb/RealVoltDB.java
m_config.m_computationCoreBindings 是个 ArrayQueue<String>,ThreadFactory从这个里面取得元素创建一个线程到线程池{computation threadpool 个数为核心数/4,用的是ThreadPoolExecutor},由MoreExecutors封装{任务执行完有回调通知}
http://guojuanjun.blog.51cto.com/277646/948298/
public final Queue<String> m_networkCoreBindings = new ArrayDeque<String>();
对应buildMeshCluster里的HostMessenger的VoltNetworkPool,cpu/4个线程,所以VoltNetworkPool含有VoltNetwork[cpu/4]。
public final Queue<String> m_computationCoreBindings = new ArrayDeque<String>();
对应private ListeningExecutorService m_computationService; 是个ExecuteService的线程池,cpu/4个线程。
public final Queue<String> m_executionCoreBindings = new ArrayDeque<String>();
VoltNetwork是一个实现了Runnable的类;
HostMessager还包含一个SocketJoiner类实例,顾名思义,看下面:
/**
* SocketJoiner runs all the time listening for new nodes in the cluster. Since it is a dedicated thread
* it is able to block while a new node joins without disrupting other activities.
*
* At startup socket joiner will connect to the rest of the cluster in the start method if it fails
* to bind to the leader address.
*
* If it binds to the leader address and becomes the leader the start method returns immediately and runPrimary
* is run from a separate thread. runPrimary will wait for the countdown latch for bootstrapping zk to count down
* before accepting new connections
*/
--host 指定的机器,运行runPrimary,其它机器执行connectToPrimary。第一个连上primary,第二个连上primary,被告知第一个的监听地址,于是再连接第一个;第三个连上 primary后,会被告知第一个和第二个host的监听地址,再连上第一个和第二个。如此进行。 知道最后所有节点都会两两之间存在连接。
AgreementSite代表一个zk node,zk 的一个非持久的内置实现。
主要就是Configuration类保存运行参数,主要的如 pathToDeployment(指向deployment.xml),m_startAction(create ,rejoin,,),端口等
一个单体voltdb实例 https://github.com/VoltDB/voltdb/blob/master/src/frontend/org/voltdb/RealVoltDB.java
主要voltdb 实例类:https://github.com/VoltDB/voltdb/blob/master/src/frontend/org/voltdb/RealVoltDB.java
m_config.m_computationCoreBindings 是个 ArrayQueue<String>,ThreadFactory从这个里面取得元素创建一个线程到线程池{computation threadpool 个数为核心数/4,用的是ThreadPoolExecutor},由MoreExecutors封装{任务执行完有回调通知}
http://guojuanjun.blog.51cto.com/277646/948298/
public final Queue<String> m_networkCoreBindings = new ArrayDeque<String>();
对应buildMeshCluster里的HostMessenger的VoltNetworkPool,cpu/4个线程,所以VoltNetworkPool含有VoltNetwork[cpu/4]。
public final Queue<String> m_computationCoreBindings = new ArrayDeque<String>();
对应private ListeningExecutorService m_computationService; 是个ExecuteService的线程池,cpu/4个线程。
public final Queue<String> m_executionCoreBindings = new ArrayDeque<String>();
VoltNetwork是一个实现了Runnable的类;
HostMessager还包含一个SocketJoiner类实例,顾名思义,看下面:
/**
* SocketJoiner runs all the time listening for new nodes in the cluster. Since it is a dedicated thread
* it is able to block while a new node joins without disrupting other activities.
*
* At startup socket joiner will connect to the rest of the cluster in the start method if it fails
* to bind to the leader address.
*
* If it binds to the leader address and becomes the leader the start method returns immediately and runPrimary
* is run from a separate thread. runPrimary will wait for the countdown latch for bootstrapping zk to count down
* before accepting new connections
*/
--host 指定的机器,运行runPrimary,其它机器执行connectToPrimary。第一个连上primary,第二个连上primary,被告知第一个的监听地址,于是再连接第一个;第三个连上 primary后,会被告知第一个和第二个host的监听地址,再连上第一个和第二个。如此进行。 知道最后所有节点都会两两之间存在连接。
AgreementSite代表一个zk node,zk 的一个非持久的内置实现。
相关文章推荐
- 第十五周“知原理”题目2
- C 文件操作
- 远程连接另一个主机上的MongoDB数据库服务器
- Linux系统的启动流程
- 数组
- linux在shell中获取时间
- java继承覆盖与向上转型,权限
- web自动化(6)----操作浏览器以及添加COOKIE
- 设置VMWARE通过桥接方式使用主机无线网卡上网
- Ubuntu11.10vim+Ctags+Taglist+WinManager工具的安装
- 字符分割的基础
- MongoDb系列
- hdu 1034 Candy Sharing Game
- csu1569: Wet Tiles
- ZOJ 3623 Battle Ships 造战舰炸塔 动态规划 伪装较好的完全背包 ★★★
- linux的引导过程和服务控制
- web自动化(5)----selenium运行JavaScript代码
- linux的引导过程和服务控制
- DataTable.select() 返回 DataTable
- Lucene入门实例