m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMartin <marcin.j.chrzanowski@gmail.com>2020-01-11 18:56:04 +0100
committerGitHub <noreply@github.com>2020-01-11 18:56:04 +0100
commiteb93e15925f7062cf3ffdb0e3712bbbf8bd46ee9 (patch)
treee28f524dbbd716e2ea890d21cdd1edba559049f0 /src/main
parent0c94ea210579436f5a1723117f83ced974517b55 (diff)
parent472550511e084d814c8a8d91e2aafa6756506271 (diff)
Merge pull request #99 from m-chrzan/register-messages
Register messages
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java3
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AttributesMessage.java2
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HejkaMessage.java2
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/NoCoTamMessage.java2
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QueryMessage.java2
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPSerializer.java6
6 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
index b478f1f..58b55da 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
@@ -155,6 +155,7 @@ public class Agent {
PathName gossipLevel = gossipGirlStrategies.selectStrategy(zoneSelectionStrategy);
ValueContact contact = selectContactFromLevel(gossipLevel);
if (contact != null) {
+ System.out.println("INFO: found a contact " + contact.toString());
InitiateGossipMessage message = new InitiateGossipMessage("", 0, new PathName("/uw/violet07"), contact);
sendMessage(message);
} else {
@@ -188,7 +189,7 @@ public class Agent {
}
private static ValueContact selectFallbackContact() throws Exception {
- return selectContactFromSet(new HashSet());
+ return null;
}
private static ZMI selectZMI(List<ZMI> zmis) throws Exception {
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AttributesMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AttributesMessage.java
index 49bda14..e4e3cb7 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AttributesMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/AttributesMessage.java
@@ -17,6 +17,8 @@ public class AttributesMessage extends RemoteGossipGirlMessage {
this.receiverGossipId = receiverGossipId;
}
+ private AttributesMessage() {}
+
public PathName getPath() {
return path;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HejkaMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HejkaMessage.java
index 62554a5..479f63c 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HejkaMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/HejkaMessage.java
@@ -22,6 +22,8 @@ public class HejkaMessage extends RemoteGossipGirlMessage {
this.queryTimestamps = queryTimestamps;
}
+ private HejkaMessage() {}
+
public long getSenderGossipId() {
return senderGossipId;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/NoCoTamMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/NoCoTamMessage.java
index c23722c..4edfa67 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/NoCoTamMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/NoCoTamMessage.java
@@ -24,6 +24,8 @@ public class NoCoTamMessage extends RemoteGossipGirlMessage {
this.hejkaReceiveTimestamp = hejkaReceiveTimestamp;
}
+ private NoCoTamMessage() {}
+
public long getReceiverGossipId() {
return receiverGossipId;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QueryMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QueryMessage.java
index 2b3b064..e457c21 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QueryMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/QueryMessage.java
@@ -15,6 +15,8 @@ public class QueryMessage extends RemoteGossipGirlMessage {
this.receiverGossipId = receiverGossipId;
}
+ public QueryMessage() {}
+
public Attribute getName() {
return name;
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPSerializer.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPSerializer.java
index 0f7b99d..f858468 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPSerializer.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPSerializer.java
@@ -15,6 +15,7 @@ import java.net.UnknownHostException;
import java.rmi.Remote;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.HashMap;
import java.util.LinkedHashMap;
/**
@@ -125,7 +126,11 @@ public class UDUPSerializer {
// messages in chronological order so it's easier to keep track
kryo.register(AgentMessage.class);
+ kryo.register(AttributesMessage.class);
kryo.register(GetStateMessage.class);
+ kryo.register(HejkaMessage.class);
+ kryo.register(NoCoTamMessage.class);
+ kryo.register(QueryMessage.class);
kryo.register(QurnikMessage.class);
kryo.register(RemikMessage.class);
kryo.register(RemoveZMIMessage.class);
@@ -150,6 +155,7 @@ public class UDUPSerializer {
// other
kryo.register(byte[].class);
kryo.register(LinkedHashMap.class);
+ kryo.register(HashMap.class);
kryo.register(ModuleType.class);
}