Cloudy 节能环的修改
来源:互联网 发布:linux setid 用法 编辑:程序博客网 时间:2024/06/11 14:49
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter
是主要负责路由的,可以从这儿来改。
修改路线
client end:
add swich command in cli.java:
cloudy2>: switch mode=[0,1,2,3,4]
which will be sent by javaclient.java.
server端:
in
ch.ethz.systems.cloudy2.server.external.java.CloudyRequestWorker.consume(ServerDataEvent)
read from the request message, the emun EJavaOperations indicates which it is types request(ROUTING_TABLE, GET, PUT, DELETE; )
ch.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol
ch.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol.put(DPI, int, int)
GET inside:
ch.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol
just to do:
Map<DPI, List<Endpoint>> m = CloudyFactory.getRouter().getPreferenceList(dpi, replicationFactor);
really invokes:
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter.getPreferenceList(DPI, int)
for a DPI with a single key
String partitioning = partitioningStrategy.getPartitioning(dpi);
find the responsible node:
private Entry<Token,Endpoint> ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter.binarySearchResponsibleToken(Token);
Entry<Token,Endpoint> responsibleToken = tokenToEndpointMap.ceilingEntry(token);//ifin ps mode, it should check tokenToEndpointMapPS;
while (list.size() < numberOfReplicas) {
Entry<Token,Endpoint> nextEntry = tokenToEndpointMap.higherEntry(lastToken);
}
So, finally, it refers to tokenToEndpointMap.
We decide to modify tokenToEndpointMap.
tokenToEndpointMap was only used at following places:
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter // many times
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouterStatic.getBootstrapInformation(Endpoint)
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouterStatic.claimSeed()
endpointToTokensMap just store avialable nodes, see DHTRouter.java isReady();
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter.onChange(Endpoint, EndpointState)seems to be a key interface.
if (CloudyFactory.getGossiper().isAlive(endpoint))
{
}
else
{
}
Invoking of DHTRouter.java
1) DefaultBootstrapper.java
ch.ethz.systems.cloudy2.server.components.bootstrapper.def.DefaultBootstrapper.bootstrap()
{...
CloudyFactory.getRouter().setBootstrapInformation(bootInfoMsg.getBootstrapInfo());
if (isSeed == true) {
CloudyFactory.getRouter().claimSeed();
}
}
2) QuorumProtocol.javach.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol.onChange(Endpoint, EndpointState)
{
Set<DPI> dpis = CloudyFactory.getRouter().getDpisManagedBy(endpointState);
ReplicationLevelAssurer task = new ReplicationLevelAssurer(endpoint, dpis);
}
subclass:
ch.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol.ReplicationLevelAssurer.run(){
if (CloudyFactory.getGossiper().isAlive(deadEndpoint)) { // Endpoint is alive again
// Check if the Endpoint still has the same tokens
// anycom: after 1 minute.
Set<DPI> managedDPIs = CloudyFactory.getRouter().getDpisManagedBy(deadEndpoint);
...
}
}
When one node has been declared dead, and the replication-factor is more than 1, its replicated data will be copy to other nodes.
QuorumProtocol will wait 60 seconds to copy. Onchange(..)
ch.ethz.systems.cloudy2.server.components.protocol.quorum.QuorumProtocol.ReplicationLevelAssurer
streamrang()
ch.ethz.systems.cloudy2.server.components.router.dht.DHTRouter.getPreferenceList(DPI, int)
In addition, the Balancer also move the data.
- Cloudy 节能环的修改
- cloudy
- 4830修改BIOS更加节能
- 节能
- 中央空调节能的使用案例
- 变频调速节能的优点
- 编写更节能的程序
- 编写更节能的程序
- 编写更节能的程序
- 变频器是如何节能的?
- 关于节能的两种经济学
- ARM嵌入式汽车节能控制系统的设计
- pdk14关于节能的一些讲述
- 非常赞同《编写更节能的程序》
- 更节能的双涡轮发动机
- 摩拜单车的节能黑科技
- 轻松智能的数据中心冷却节能方法
- 基于802.11协议的节能技术
- IL Disassembler
- inline函数
- 跟我一起写 Makefile(四)
- 工作中如何平和自己愤怒的情绪
- 还是nyist 8(一种排序)
- Cloudy 节能环的修改
- c++异常处理机制示例及讲解
- Linux中的并发和竞态
- C#安装项目 连接数据库及枚举Windows服务列表
- Windows服务启动时,如何与UI进行交互
- Android中dip、dp、sp、pt和px的区别
- 重载输出操作符
- ofbiz encoding
- 王通Google排名秘笈-价值1200元的王通的书