m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
diff options
context:
space:
mode:
authorMartin <marcin.j.chrzanowski@gmail.com>2020-01-12 16:54:19 +0100
committerGitHub <noreply@github.com>2020-01-12 16:54:19 +0100
commitf0076abd246bdf40ba4a03c0c894f6f75173eac8 (patch)
treedb9cac13dae0da577c63dfd9a368452be6c14f2a /src/main/java/pl/edu/mimuw/cloudatlas/agent/messages
parentd88caa2d3fdb3cc5d17a4367583e8ab385ead3b6 (diff)
parentedec7f92b20f1f873083bdf3198283fa822e0f64 (diff)
Merge pull request #112 from m-chrzan/gossip-gc
Garbage collect inactive gossips
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/CleanOldGossipsMessage.java16
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java3
2 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/CleanOldGossipsMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/CleanOldGossipsMessage.java
new file mode 100644
index 0000000..6c3cb7e
--- /dev/null
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/CleanOldGossipsMessage.java
@@ -0,0 +1,16 @@
+package pl.edu.mimuw.cloudatlas.agent.messages;
+
+import pl.edu.mimuw.cloudatlas.model.ValueTime;
+
+public class CleanOldGossipsMessage extends GossipGirlMessage {
+ private ValueTime ageThreshold;
+
+ public CleanOldGossipsMessage(String messageId, long timestamp, ValueTime ageThreshold) {
+ super(messageId, timestamp, Type.CLEAN);
+ this.ageThreshold = ageThreshold;
+ }
+
+ public ValueTime getAgeThreshold() {
+ return ageThreshold;
+ }
+}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java
index 03525bb..6255e3b 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/GossipGirlMessage.java
@@ -9,7 +9,8 @@ public abstract class GossipGirlMessage extends AgentMessage {
HEJKA,
INITIATE,
NO_CO_TAM,
- QUERY
+ QUERY,
+ CLEAN
}
private Type type;