diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 16:12:53 +0100 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2020-01-12 16:12:53 +0100 |
commit | 94d88e27bc6ac28a2c92de76f193920b664040dd (patch) | |
tree | 217ca58c3bdbd6051dbd3601a39659b0f1ed554e /src/main/java/pl/edu/mimuw/cloudatlas/agent | |
parent | a91ffb770782450b0dd23f0510cd80ec531f7339 (diff) | |
parent | d88caa2d3fdb3cc5d17a4367583e8ab385ead3b6 (diff) |
Merge branch 'master' into gossip-gc
Diffstat (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent')
3 files changed, 4 insertions, 5 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 0cbda2d..24ed0c1 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java @@ -42,7 +42,6 @@ public class Agent { // TODO: make query period confiurable with config file and from tests - // TODO config setup String zonePath = System.getProperty("zone_path"); String selectionStrategy = System.getProperty("Gossip.zone_strategy"); Long queryPeriod = Long.getLong("query_period"); @@ -50,6 +49,6 @@ public class Agent { HierarchyConfig hierarchyConfig = new HierarchyConfig(eventBus, zonePath, selectionStrategy); hierarchyConfig.startQueries(queryPeriod); - hierarchyConfig.startGossip(gossipPeriod); + hierarchyConfig.startGossip(gossipPeriod, zonePath); } } diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java index dc5241d..f9e323a 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java @@ -37,7 +37,7 @@ public class HierarchyConfig { } } - public void startGossip(long gossipPeriod) { + public void startGossip(long gossipPeriod, String zonePath) { Supplier<TimerScheduledTask> taskSupplier = () -> new TimerScheduledTask() { public void run() { @@ -47,7 +47,7 @@ public class HierarchyConfig { 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); + InitiateGossipMessage message = new InitiateGossipMessage("", 0, new PathName(zonePath), contact); sendMessage(message); } else { System.out.println("DEBUG: couldn't find contact for gossip"); diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirl.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirl.java index 08d8580..e795b83 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirl.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirl.java @@ -166,7 +166,7 @@ public class GossipGirl extends Module { if (state != null) { state.setLastAction(); state.gotAttributes(message); - if (state.state == GossipGirlState.State.SEND_INFO) { + if (state.state == GossipGirlState.State.SEND_INFO || state.state == GossipGirlState.State.SEND_INFO_AND_FINISH) { sendInfo(state); } UpdateAttributesMessage updateMessage = new UpdateAttributesMessage("", 0, message.getPath().toString(), message.getAttributes()); |