Yuta HIGUCHI

moved VersionedValue

Change-Id: Iec72c936e06ef9b1813ed3661d8f7d81d2654969
......@@ -15,19 +15,23 @@ public class WriteRequest {
private final long previousVersion;
private final byte[] oldValue;
// put regardless of previous value
public WriteRequest(String tableName, String key, byte[] newValue) {
this(tableName, key, newValue, -1, null);
}
// put if version matches
public WriteRequest(String tableName, String key, byte[] newValue, long previousVersion) {
this(tableName, key, newValue, previousVersion, null);
checkArgument(previousVersion >= 0);
}
// put if value matches
public WriteRequest(String tableName, String key, byte[] newValue, byte[] oldValue) {
this(tableName, key, newValue, -1, oldValue);
}
// hidden constructor
private WriteRequest(String tableName, String key, byte[] newValue, long previousVersion, byte[] oldValue) {
checkArgument(tableName != null);
......
......@@ -56,14 +56,15 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService {
@Activate
public void activate() {
// FIXME hack tcpPort +1 for copycat communication
TcpMember localMember =
new TcpMember(
clusterService.getLocalNode().ip().toString(),
clusterService.getLocalNode().tcpPort());
clusterService.getLocalNode().tcpPort() + 1);
List<TcpMember> remoteMembers = Lists.newArrayList();
for (ControllerNode node : clusterService.getNodes()) {
TcpMember member = new TcpMember(node.ip().toString(), node.tcpPort());
TcpMember member = new TcpMember(node.ip().toString(), node.tcpPort() + 1);
if (!member.equals(localMember)) {
remoteMembers.add(member);
}
......