提交 01b666b6 编写于 作者: L liquidsnake@sapo.pt

- Fixed a bug scattered across demos related to state management

- Added println to indicate if SMaRt created view from configuration file or fetched it from disk
上级 b9e2baec
......@@ -43,13 +43,15 @@ import bftsmart.tom.server.defaultservices.DefaultSingleRecoverable;
*/
public class BFTMapServer extends DefaultSingleRecoverable {
MapOfMaps tableMap = new MapOfMaps();
ServiceReplica replica = null;
private ReplicaContext replicaContext;
MapOfMaps tableMap = null;
//ServiceReplica replica = null;
//private ReplicaContext replicaContext;
//The constructor passes the id of the server to the super class
public BFTMapServer(int id) {
replica = new ServiceReplica(id, this, this);
tableMap = new MapOfMaps();
new ServiceReplica(id, this, this);
}
public static void main(String[] args){
......@@ -276,9 +278,4 @@ public class BFTMapServer extends DefaultSingleRecoverable {
}
@Override
public void setReplicaContext(ReplicaContext replicaContext) {
this.replicaContext = replicaContext;
}
}
\ No newline at end of file
......@@ -45,18 +45,13 @@ import bftsmart.tom.server.defaultservices.DefaultRecoverable;
public class BFTListImpl extends DefaultRecoverable {
BFTMapList tableList = new BFTMapList();
ServiceReplica replica = null;
ReplicaContext replicaCtx;
ServiceReplica replica = null;
//The constructor passes the id of the server to the super class
public BFTListImpl(int id) {
super();
replica = new ServiceReplica(id, this, this);
}
public void setReplicaContext(ReplicaContext replicaCtx) {
this.replicaCtx = replicaCtx;
}
public static void main(String[] args){
if(args.length < 1) {
......
......@@ -41,7 +41,6 @@ public final class RandomServer extends DefaultRecoverable {
private long currentTime = -1;
/***********************************************************************/
private ServiceReplica replica;
private ReplicaContext replicaContext;
public ServiceReplica getReplica() {
return replica;
......@@ -51,9 +50,6 @@ public final class RandomServer extends DefaultRecoverable {
this.replica = replica;
}
public void setReplicaContext(ReplicaContext replicaContext) {
this.replicaContext = replicaContext;
}
public RandomServer(int id) {
replica = new ServiceReplica(id, this, this);
......
......@@ -60,9 +60,12 @@ public class ServerViewController extends ViewController {
super(procId, configHome);
View cv = getViewStore().readView();
if(cv == null){
System.out.println("#Creating current view from configuration file");
reconfigureTo(new View(0, getStaticConf().getInitialView(),
getStaticConf().getF(), getInitAdddresses()));
}else{
System.out.println("#Using view stored on disk");
reconfigureTo(cv);
}
......
......@@ -98,6 +98,10 @@ public abstract class DefaultSingleRecoverable implements Recoverable, SingleExe
}
private StateLog getLog() {
if(log == null)
initLog();
return log;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册