Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JDChain
Bftsmart
提交
d43b4b61
B
Bftsmart
项目概览
JDChain
/
Bftsmart
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Bftsmart
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d43b4b61
编写于
9月 16, 2011
作者:
L
liquidsnake@sapo.pt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleaned up a few comments. no changes in the code.
上级
8b25d2d1
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
29 addition
and
51 deletion
+29
-51
src/navigators/smart/communication/SystemMessage.java
src/navigators/smart/communication/SystemMessage.java
+1
-1
src/navigators/smart/paxosatwar/Consensus.java
src/navigators/smart/paxosatwar/Consensus.java
+0
-4
src/navigators/smart/paxosatwar/executionmanager/Execution.java
...vigators/smart/paxosatwar/executionmanager/Execution.java
+0
-1
src/navigators/smart/paxosatwar/executionmanager/ExecutionManager.java
...s/smart/paxosatwar/executionmanager/ExecutionManager.java
+1
-3
src/navigators/smart/paxosatwar/executionmanager/Round.java
src/navigators/smart/paxosatwar/executionmanager/Round.java
+1
-1
src/navigators/smart/paxosatwar/roles/Acceptor.java
src/navigators/smart/paxosatwar/roles/Acceptor.java
+2
-2
src/navigators/smart/paxosatwar/roles/Proposer.java
src/navigators/smart/paxosatwar/roles/Proposer.java
+1
-2
src/navigators/smart/statemanagment/StateLog.java
src/navigators/smart/statemanagment/StateLog.java
+2
-3
src/navigators/smart/statemanagment/TransferableState.java
src/navigators/smart/statemanagment/TransferableState.java
+0
-1
src/navigators/smart/tom/ReplicaContext.java
src/navigators/smart/tom/ReplicaContext.java
+1
-1
src/navigators/smart/tom/ServiceProxy.java
src/navigators/smart/tom/ServiceProxy.java
+1
-3
src/navigators/smart/tom/ServiceReplica.java
src/navigators/smart/tom/ServiceReplica.java
+3
-3
src/navigators/smart/tom/TOMReceiver.java
src/navigators/smart/tom/TOMReceiver.java
+1
-1
src/navigators/smart/tom/TOMSender.java
src/navigators/smart/tom/TOMSender.java
+3
-5
src/navigators/smart/tom/core/DeliveryThread.java
src/navigators/smart/tom/core/DeliveryThread.java
+1
-1
src/navigators/smart/tom/core/TOMLayer.java
src/navigators/smart/tom/core/TOMLayer.java
+3
-4
src/navigators/smart/tom/core/messages/TOMMessage.java
src/navigators/smart/tom/core/messages/TOMMessage.java
+0
-1
src/navigators/smart/tom/demo/random/RandomServer.java
src/navigators/smart/tom/demo/random/RandomServer.java
+3
-3
src/navigators/smart/tom/leaderchange/CollectData.java
src/navigators/smart/tom/leaderchange/CollectData.java
+0
-1
src/navigators/smart/tom/leaderchange/LCManager.java
src/navigators/smart/tom/leaderchange/LCManager.java
+5
-10
未找到文件。
src/navigators/smart/communication/SystemMessage.java
浏览文件 @
d43b4b61
...
...
@@ -47,7 +47,7 @@ public abstract class SystemMessage implements Externalizable {
/**
* Returns the ID of the process which sent the message
* @return
* @return
ID of the process that sent the message
*/
public
final
int
getSender
()
{
return
sender
;
...
...
src/navigators/smart/paxosatwar/Consensus.java
浏览文件 @
d43b4b61
...
...
@@ -25,9 +25,7 @@ import navigators.smart.tom.util.Logger;
*
* This class represents a Consensus Instance.
*
* @param <E> Type of the decided Object
*
* @author unkown
* @author Christian Spann <christian.spann at uni-ulm.de>
*/
public
class
Consensus
{
...
...
@@ -43,9 +41,7 @@ public class Consensus {
/**
* Creates a new instance of Consensus
* @param proposer The proposer role of PaW algorithm
* @param eid The execution ID for this consensus
* @param startTime The consensus start time
*/
public
Consensus
(
int
eid
)
{
this
.
eid
=
eid
;
...
...
src/navigators/smart/paxosatwar/executionmanager/Execution.java
浏览文件 @
d43b4b61
...
...
@@ -55,7 +55,6 @@ public class Execution {
*
* @param manager Execution manager for this execution
* @param consensus Consensus instance to which this execution works for
* @param initialTimeout Initial timeout for rounds
*/
protected
Execution
(
ExecutionManager
manager
,
Consensus
consensus
)
{
this
.
manager
=
manager
;
...
...
src/navigators/smart/paxosatwar/executionmanager/ExecutionManager.java
浏览文件 @
d43b4b61
...
...
@@ -71,12 +71,10 @@ public final class ExecutionManager {
/**
* Creates a new instance of ExecutionManager
*
* @param manager Reconfiguration Manager
* @param acceptor Acceptor role of the PaW algorithm
* @param proposer Proposer role of the PaW algorithm
* @param acceptors Process ID's of all replicas, including this one
* @param f Maximum number of replicas that can be faulty
* @param me This process ID
* @param initialTimeout initial timeout for rounds
*/
public
ExecutionManager
(
ReconfigurationManager
manager
,
Acceptor
acceptor
,
Proposer
proposer
,
int
me
)
{
...
...
src/navigators/smart/paxosatwar/executionmanager/Round.java
浏览文件 @
d43b4b61
...
...
@@ -56,9 +56,9 @@ public class Round implements Serializable {
/**
* Creates a new instance of Round for acceptors
* @param manager Reconfiguration Manager
* @param parent Execution to which this round belongs
* @param number Number of the round
* @param timeout Timeout duration for this round
*/
protected
Round
(
ReconfigurationManager
manager
,
Execution
parent
,
int
number
)
{
this
.
execution
=
parent
;
...
...
src/navigators/smart/paxosatwar/roles/Acceptor.java
浏览文件 @
d43b4b61
...
...
@@ -52,8 +52,8 @@ public final class Acceptor {
* Creates a new instance of Acceptor.
* @param communication Replicas communication system
* @param factory Message factory for PaW messages
* @param
verifier Proof verifier
* @param
conf TOM configuration
* @param
lm Leader Module
* @param
manager Reconfiguration Manager
*/
public
Acceptor
(
ServerCommunicationSystem
communication
,
MessageFactory
factory
,
LeaderModule
lm
,
ReconfigurationManager
manager
)
{
...
...
src/navigators/smart/paxosatwar/roles/Proposer.java
浏览文件 @
d43b4b61
...
...
@@ -37,8 +37,7 @@ public class Proposer {
*
* @param communication Replicas communication system
* @param factory Factory for PaW messages
* @param verifier Proof verifier
* @param conf TOM configuration
* @param manager Reconfiguration Manager
*/
public
Proposer
(
ServerCommunicationSystem
communication
,
MessageFactory
factory
,
ReconfigurationManager
manager
)
{
...
...
src/navigators/smart/statemanagment/StateLog.java
浏览文件 @
d43b4b61
...
...
@@ -88,7 +88,7 @@ public class StateLog {
/**
* Sets the decision round for the last checkpoint
* @param lastCheckpoint
Ei
d Decision round for the last checkpoint
* @param lastCheckpoint
Roun
d Decision round for the last checkpoint
*/
public
void
setLastCheckpointRound
(
int
lastCheckpointRound
)
{
...
...
@@ -106,7 +106,7 @@ public class StateLog {
/**
* Sets the leader for the last checkpoint
* @param lastCheckpoint
Eid
Leader for the last checkpoint
* @param lastCheckpoint
Leader
Leader for the last checkpoint
*/
public
void
setLastCheckpointLeader
(
int
lastCheckpointLeader
)
{
...
...
@@ -161,7 +161,6 @@ public class StateLog {
* in the same order in which they are delivered to the application. Only
* the 'k' batches received after the last checkpoint are supposed to be kept
* @param batch The batch of messages to be kept.
* @return True if the batch was added to the log, false otherwise
*/
public
void
addMessageBatch
(
byte
[]
batch
,
int
round
,
int
leader
)
{
...
...
src/navigators/smart/statemanagment/TransferableState.java
浏览文件 @
d43b4b61
...
...
@@ -43,7 +43,6 @@ public class TransferableState implements Serializable {
* Constructs a TansferableState
* This constructor should be used when there is a valid state to construct the object with
* @param messageBatches Batches received since the last checkpoint.
* @param nextEid Execution ID for the last checkpoint
* @param state State associated with the last checkpoint
* @param stateHash Hash of the state associated with the last checkpoint
*/
...
...
src/navigators/smart/tom/ReplicaContext.java
浏览文件 @
d43b4b61
...
...
@@ -32,7 +32,7 @@ public class ReplicaContext {
* send a message to one or more clients.
*
* @param targets the target receivers of the message
* @param
sm
the message to be sent
* @param
msg
the message to be sent
*/
public
void
sendMessage
(
int
[]
targets
,
TOMMessage
msg
)
{
cs
.
send
(
targets
,
msg
);
...
...
src/navigators/smart/tom/ServiceProxy.java
浏览文件 @
d43b4b61
...
...
@@ -55,7 +55,6 @@ public class ServiceProxy extends TOMSender {
/**
* Constructor
*
* @see bellow
*/
public
ServiceProxy
(
int
processId
)
{
this
(
processId
,
null
,
null
,
null
);
...
...
@@ -64,7 +63,6 @@ public class ServiceProxy extends TOMSender {
/**
* Constructor
*
* @see bellow
*/
public
ServiceProxy
(
int
processId
,
String
configHome
)
{
this
(
processId
,
configHome
,
null
,
null
);
...
...
@@ -73,7 +71,7 @@ public class ServiceProxy extends TOMSender {
/**
* Constructor
*
* @param
i
d Process id for this client (should be different from replicas)
* @param
processI
d Process id for this client (should be different from replicas)
* @param configHome Configuration directory for BFT-SMART
* @param replyComparator used for comparing replies from different servers
* to extract one returned by f+1
...
...
src/navigators/smart/tom/ServiceReplica.java
浏览文件 @
d43b4b61
...
...
@@ -98,7 +98,7 @@ public abstract class ServiceReplica extends TOMReceiver implements Runnable {
/**
* Constructor
* @param id Replica ID
* @param isToJoin
:
if true, the replica tries to join the system, otherwise it waits for TTP message
* @param isToJoin if true, the replica tries to join the system, otherwise it waits for TTP message
* informing its join
*/
public
ServiceReplica
(
int
id
,
boolean
isToJoin
)
{
...
...
@@ -343,7 +343,7 @@ public abstract class ServiceReplica extends TOMReceiver implements Runnable {
* therefore, ensure the determinism required in a replicated state machine.
*
* @param command the command issue by the client
* @param
MessageContext
msgCtx information related with the command
* @param msgCtx information related with the command
*
* @return the reply for the request issued by the client
*/
...
...
@@ -357,7 +357,7 @@ public abstract class ServiceReplica extends TOMReceiver implements Runnable {
* sender.
*
* @param command the command issue by the client
* @param
MessageContext
msgCtx information related with the command
* @param msgCtx information related with the command
*
* @return the reply for the request issued by the client
*/
...
...
src/navigators/smart/tom/TOMReceiver.java
浏览文件 @
d43b4b61
...
...
@@ -46,7 +46,7 @@ public abstract class TOMReceiver implements TOMRequestReceiver {
* This method initializes the object
*
* @param cs Server side communication System
* @param
conf Total order messaging configuration
* @param
reconfManager Reconfiguration Manager
*/
public
void
init
(
ServerCommunicationSystem
cs
,
ReconfigurationManager
reconfManager
,
int
lastExec
,
int
lastLeader
)
{
...
...
src/navigators/smart/tom/TOMSender.java
浏览文件 @
d43b4b61
...
...
@@ -80,8 +80,7 @@ public abstract class TOMSender implements ReplyReceiver {
* This method initializes the object
* TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)
*
* @param cs Client side comunication system
* @param conf Client side comunication system configuration
* @param processId ID of the process
* @param sequence Initial sequence number for data multicast
*
*
...
...
@@ -102,8 +101,7 @@ public abstract class TOMSender implements ReplyReceiver {
* This method initializes the object
* TODO: Perguntar se este metodo n pode antes ser protected (compila como protected, mas mesmo assim...)
*
* @param cs Client side comunication system
* @param conf Total order messaging configuration
* @param processId ID of the process
*/
public
void
init
(
int
processId
)
{
this
.
viewManager
=
new
ViewManager
(
processId
);
...
...
@@ -151,7 +149,7 @@ public abstract class TOMSender implements ReplyReceiver {
/**
* Multicast a TOMMessage to the group of replicas
*
* @param
m Data
to be multicast
* @param
sm Message
to be multicast
*/
public
void
TOMulticast
(
TOMMessage
sm
)
{
cs
.
send
(
useSignatures
,
this
.
viewManager
.
getCurrentViewProcesses
(),
sm
);
...
...
src/navigators/smart/tom/core/DeliveryThread.java
浏览文件 @
d43b4b61
...
...
@@ -48,7 +48,7 @@ public final class DeliveryThread extends Thread {
* Creates a new instance of DeliveryThread
* @param tomLayer TOM layer
* @param receiver Object that receives requests from clients
* @param
conf TOM configuration
* @param
manager Reconfiguration Manager
*/
public
DeliveryThread
(
TOMLayer
tomLayer
,
TOMRequestReceiver
receiver
,
ReconfigurationManager
manager
)
{
super
(
"Delivery Thread"
);
...
...
src/navigators/smart/tom/core/TOMLayer.java
浏览文件 @
d43b4b61
...
...
@@ -119,7 +119,7 @@ public final class TOMLayer extends Thread implements RequestReceiver {
* @param lm Leader module
* @param a Acceptor role of the PaW algorithm
* @param cs Communication system between replicas
* @param
conf TOM configuration
* @param
recManager Reconfiguration Manager
*/
public
TOMLayer
(
ExecutionManager
manager
,
TOMRequestReceiver
receiver
,
...
...
@@ -174,7 +174,7 @@ public final class TOMLayer extends Thread implements RequestReceiver {
/**
* Computes an hash for a TOM message
* @param
message
* @param
data Data from which to generate the hash
* @return Hash for the specified TOM message
*/
public
final
byte
[]
computeHash
(
byte
[]
data
)
{
...
...
@@ -401,9 +401,8 @@ public final class TOMLayer extends Thread implements RequestReceiver {
*
* TODO: verify timestamps and nonces
*
* @param round the Round for which this value is being proposed
* @param proposedValue the value being proposed
* @return
* @return
Valid messages contained in the proposed value
*/
public
TOMMessage
[]
checkProposedValue
(
byte
[]
proposedValue
)
{
Logger
.
println
(
"(TOMLayer.isProposedValueValid) starting"
);
...
...
src/navigators/smart/tom/core/messages/TOMMessage.java
浏览文件 @
d43b4b61
...
...
@@ -125,7 +125,6 @@ public class TOMMessage extends SystemMessage implements Externalizable, Compara
/**
* Retrieves the debug info from the TOM layer
* @return The debug info from the TOM layer
*/
public
void
setDebugInfo
(
DebugInfo
info
)
{
this
.
info
=
info
;
...
...
src/navigators/smart/tom/demo/random/RandomServer.java
浏览文件 @
d43b4b61
...
...
@@ -98,9 +98,9 @@ public final class RandomServer extends ServiceReplica {
/**
* Just return the current value of the counter.
*
* @param command
* @param msgCtx
* @return
* @param command
Command to b executed
* @param msgCtx
Context of the message received
* @return
Reply t obe sent to the client
*/
@Override
public
byte
[]
executeUnordered
(
byte
[]
command
,
MessageContext
msgCtx
)
{
...
...
src/navigators/smart/tom/leaderchange/CollectData.java
浏览文件 @
d43b4b61
...
...
@@ -54,7 +54,6 @@ public class CollectData implements Externalizable {
* @param eid id da execucao
* @param quorumWeaks ultimo valor recebido de um quorum bizantino de WEAKS
* @param writeSet valores escritos pela replica
* @param signature assinatura da replica
*/
public
CollectData
(
int
pid
,
int
eid
,
RoundValuePair
quorumWeaks
,
HashSet
<
RoundValuePair
>
writeSet
)
{
...
...
src/navigators/smart/tom/leaderchange/LCManager.java
浏览文件 @
d43b4b61
...
...
@@ -258,7 +258,7 @@ public class LCManager {
/**
* Defines the set of last eids related to a timestamp
* @param ts timestamp for the last eid info
* @param
coll
s a set of last eid data
* @param
last
s a set of last eid data
*/
public
void
setLastEids
(
int
ts
,
HashSet
<
LastEidData
>
lasts
)
{
...
...
@@ -268,7 +268,7 @@ public class LCManager {
/**
* Keep collect from an incoming SYNC message
* @param ts the current timestamp
* @param
collect the
collect data
* @param
signedCollect the signed
collect data
*/
public
void
addCollect
(
int
ts
,
SignedObject
signedCollect
)
{
...
...
@@ -391,19 +391,14 @@ public class LCManager {
*/
public
boolean
binds
(
int
round
,
byte
[]
value
,
HashSet
<
CollectData
>
collects
)
{
/*System.out.println(value != null);
System.out.println(collects != null);
System.out.println(collects.size() > reconfManager.getCurrentViewN() - reconfManager.getCurrentViewF());
System.out.println(quorumHighest(round, value, collects));
System.out.println(certifiedValue(round, value, collects));*/
return
(
value
!=
null
&&
collects
!=
null
&&
collects
.
size
()
>
(
reconfManager
.
getCurrentViewN
()
-
reconfManager
.
getCurrentViewF
()))
&&
quorumHighest
(
round
,
value
,
collects
)
&&
certifiedValue
(
round
,
value
,
collects
);
}
/**
* Devolve um valor que seja bind, que seja diferente de nulo e com round maior ou igual a zero
* @param collects
* @return
* @param collects
Conjunto de collects de onde determinar o valor
* @return
O valor bind
*/
public
byte
[]
getBindValue
(
HashSet
<
CollectData
>
collects
)
{
...
...
@@ -588,7 +583,7 @@ public class LCManager {
/**
* Fetchs a set of correctly signed and normalized collect data structures from the
* specified original set of collects
* @param
collects original set of
collects
* @param
signedObjects original set of signed
collects
* @param eid the eid to which to normalize the collects
* @return a set of correctly signed and normalized collect data structures
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录