From 7a4508bfa906eff853dfb2424e3b91761a886da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sun, 12 Jan 2020 14:54:47 +0100 Subject: Switch zones by flags in agent, client, fetcher --- src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java | 3 ++- src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent') 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..53255aa 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java @@ -44,12 +44,13 @@ public class Agent { // TODO config setup String zonePath = System.getProperty("zone_path"); + System.out.println("zonePAth " + zonePath); String selectionStrategy = System.getProperty("Gossip.zone_strategy"); Long queryPeriod = Long.getLong("query_period"); Long gossipPeriod = Long.getLong("gossip_period"); 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 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"); -- cgit v1.2.3 From 5995da144818842e69b9d0afa9f392a9e6419508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Sun, 12 Jan 2020 14:57:35 +0100 Subject: Remove redundant log --- src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent') 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 53255aa..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,9 +42,7 @@ public class Agent { // TODO: make query period confiurable with config file and from tests - // TODO config setup String zonePath = System.getProperty("zone_path"); - System.out.println("zonePAth " + zonePath); String selectionStrategy = System.getProperty("Gossip.zone_strategy"); Long queryPeriod = Long.getLong("query_period"); Long gossipPeriod = Long.getLong("gossip_period"); -- cgit v1.2.3