summaryrefslogtreecommitdiff
path: root/same/src/main/java/com/orbekk/paxos
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-27 16:08:54 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-27 16:08:54 +0100
commitc58c649531e4884a92f07d9b12f0ad77fbcf5d6a (patch)
tree38d2997ec6cdaed9120dba012b61afbb8b2e53ea /same/src/main/java/com/orbekk/paxos
parentee51a98e9b61336610d667de57a8cff70d0ac1d9 (diff)
Clean up source code.
Clean up source code with Eclipse. In particular remove tabs.
Diffstat (limited to 'same/src/main/java/com/orbekk/paxos')
-rw-r--r--same/src/main/java/com/orbekk/paxos/MasterProposer.java12
-rw-r--r--same/src/main/java/com/orbekk/paxos/PaxosService.java2
-rw-r--r--same/src/main/java/com/orbekk/paxos/PaxosServiceImpl.java4
3 files changed, 9 insertions, 9 deletions
diff --git a/same/src/main/java/com/orbekk/paxos/MasterProposer.java b/same/src/main/java/com/orbekk/paxos/MasterProposer.java
index effe6df..5eb7ebb 100644
--- a/same/src/main/java/com/orbekk/paxos/MasterProposer.java
+++ b/same/src/main/java/com/orbekk/paxos/MasterProposer.java
@@ -12,14 +12,14 @@ public class MasterProposer {
private String myUrl;
private List<String> paxosUrls = new ArrayList<String>();
private ConnectionManager connections;
-
+
public MasterProposer(String clientUrl, List<String> paxosUrls,
ConnectionManager connections) {
this.myUrl = clientUrl;
this.paxosUrls = paxosUrls;
this.connections = connections;
}
-
+
private int internalPropose(int proposalNumber) {
int bestPromise = -proposalNumber;
int promises = 0;
@@ -43,7 +43,7 @@ public class MasterProposer {
return bestPromise;
}
}
-
+
private int internalAcceptRequest(int proposalNumber) {
int bestAccepted = -proposalNumber;
int accepts = 0;
@@ -79,11 +79,11 @@ public class MasterProposer {
return false;
}
}
-
+
public boolean proposeRetry(int proposalNumber) {
int nextProposal = proposalNumber;
int result = 0;
-
+
while (result != nextProposal) {
result = internalPropose(nextProposal);
if (result == nextProposal) {
@@ -94,7 +94,7 @@ public class MasterProposer {
nextProposal = -result + 1;
}
}
-
+
return true;
}
}
diff --git a/same/src/main/java/com/orbekk/paxos/PaxosService.java b/same/src/main/java/com/orbekk/paxos/PaxosService.java
index 8de02da..a6f6b08 100644
--- a/same/src/main/java/com/orbekk/paxos/PaxosService.java
+++ b/same/src/main/java/com/orbekk/paxos/PaxosService.java
@@ -1,7 +1,7 @@
package com.orbekk.paxos;
public interface PaxosService {
-
+
/**
* @return N == proposalNumber if a promise is made.
* -M if another promise already was made, where M is the promise
diff --git a/same/src/main/java/com/orbekk/paxos/PaxosServiceImpl.java b/same/src/main/java/com/orbekk/paxos/PaxosServiceImpl.java
index 3ecf523..58426bf 100644
--- a/same/src/main/java/com/orbekk/paxos/PaxosServiceImpl.java
+++ b/same/src/main/java/com/orbekk/paxos/PaxosServiceImpl.java
@@ -28,7 +28,7 @@ public class PaxosServiceImpl implements PaxosService {
logger.info(tag + "propose({}, {}) = rejected " +
"(promised: {})",
new Object[]{clientUrl, proposalNumber,
- highestPromise});
+ highestPromise});
return -highestPromise;
}
}
@@ -45,7 +45,7 @@ public class PaxosServiceImpl implements PaxosService {
logger.info(tag + "acceptRequest({}, {}) = rejected " +
"(promise={})",
new Object[]{clientUrl, proposalNumber,
- highestPromise});
+ highestPromise});
return -highestPromise;
}
}