m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-14 22:54:16 +0100
committerMagdalena Grodzińska <mag.grodzinska@gmail.com>2020-01-14 22:54:16 +0100
commit42b9d84b2668476510d015b40510fa18a0cffbdd (patch)
treec1ac0ebff3d5e980d85e841de75aacbe891b8f37
parent42abac9eda30ba47ef6e710d0af22969f657a0cd (diff)
Remove TODOs
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/ByteSerializer.java1
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java27
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/AgentConfig.java1
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java1
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlState.java2
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java2
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/AgentIntegrationTest.java2
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/EventBusTest.java3
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java2
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/SchedulerTest.java3
-rw-r--r--src/test/java/pl/edu/mimuw/cloudatlas/agent/UDUPTest.java2
11 files changed, 0 insertions, 46 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/ByteSerializer.java b/src/main/java/pl/edu/mimuw/cloudatlas/ByteSerializer.java
index ee7a6f0..94c8d65 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/ByteSerializer.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/ByteSerializer.java
@@ -25,7 +25,6 @@ import java.util.LinkedHashMap;
/**
* Serializes classes to and from byte arrays
*/
-// TODO remove udupserializer
public class ByteSerializer {
private Kryo kryo;
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 06e067b..d864bd6 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/Agent.java
@@ -7,28 +7,6 @@ import pl.edu.mimuw.cloudatlas.model.ZMI;
public class Agent {
- private static void addZoneAndChildren(ZMI zmi, PathName pathName, EventBus eventBus) {
- try {
- UpdateAttributesMessage message = new UpdateAttributesMessage("", 0, pathName.toString(), zmi.getAttributes());
- eventBus.addMessage(message);
- for (ZMI son : zmi.getSons()) {
- addZoneAndChildren(son, pathName.levelDown(son.getAttributes().getOrNull("name").toString()), eventBus);
- }
- } catch (Exception e) {
- System.out.println("ERROR: failed to add zone");
- }
- }
-
- public static void initZones(EventBus eventBus) {
- try {
- ZMI root = Main.createTestHierarchy2();
- addZoneAndChildren(root, new PathName(""), eventBus);
- System.out.println("Initialized with test hierarchy");
- } catch (Exception e) {
- System.out.println("ERROR: failed to create test hierarchy");
- }
- }
-
public static void main(String[] args) {
AgentConfig agentConfig = new AgentConfig();
@@ -38,10 +16,6 @@ public class Agent {
agentConfig.runRegistry(eventBus);
agentConfig.startNonModuleThreads(eventBus);
- // initZones(eventBus);
-
- // TODO: make query period confiurable with config file and from tests
-
String zonePath = System.getProperty("zone_path");
String selectionStrategy = System.getProperty("Gossip.zone_strategy");
Long queryPeriod = Long.getLong("query_period");
@@ -51,7 +25,6 @@ public class Agent {
HierarchyConfig hierarchyConfig = new HierarchyConfig(eventBus, zonePath, selectionStrategy);
hierarchyConfig.startQueries(queryPeriod);
hierarchyConfig.startGossip(gossipPeriod, zonePath);
- // TODO: should this be different than ZMI freshness period?
hierarchyConfig.startCleaningGossips(freshnessPeriod);
}
}
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/AgentConfig.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/AgentConfig.java
index e9bbf4e..2363f4b 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/AgentConfig.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/AgentConfig.java
@@ -38,7 +38,6 @@ public class AgentConfig {
}
private HashMap<ModuleType, Module> initializeModules() throws UnknownHostException, SocketException, NullPointerException {
- // TODO config setup
Long freshnessPeriod = Long.getLong("freshness_period");
Integer port = Integer.getInteger("UDUPServer.port");
Integer timeout = Integer.getInteger("UDUPServer.timeout");
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 92b7f66..2f04a25 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/HierarchyConfig.java
@@ -79,7 +79,6 @@ public class HierarchyConfig {
return selectContactFromSet(valueSet);
}
- // TODO
private ValueContact selectFallbackContact(Set<ValueContact> contacts) throws Exception {
if (contacts.isEmpty()) {
return null;
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlState.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlState.java
index 4709eb1..d5c404d 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlState.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/GossipGirlState.java
@@ -312,7 +312,6 @@ public class GossipGirlState {
}
break;
case WAIT_FOR_FIRST_INFO:
- // TODO: use offset to setup GTP
offset = message.getOffset();
setZonesToSend();
setQueriesToSend();
@@ -336,7 +335,6 @@ public class GossipGirlState {
public void gotQuery(QueryMessage message) {
switch (state) {
case WAIT_FOR_FIRST_INFO:
- // TODO: use offset to setup GTP
offset = message.getOffset();
setZonesToSend();
setQueriesToSend();
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java
index 68a9326..b9a68bd 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/TimerScheduler.java
@@ -13,7 +13,6 @@ import java.util.Timer;
* Handle used to attach tasks to schedule
* Tasks declared as inherited from TimerTask
*
- * TODO: add request id and custom time
*/
public class TimerScheduler extends Module {
private Timer timer;
@@ -37,7 +36,6 @@ public class TimerScheduler extends Module {
System.out.println("Task with delay " + msg.getDelay() + " scheduled");
}
- // TODO
public void removeTask(String requestId) {}
public void passMessageFromTask(AgentMessage msg) throws InterruptedException {
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/AgentIntegrationTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/AgentIntegrationTest.java
index 26473cd..6d220e8 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/AgentIntegrationTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/AgentIntegrationTest.java
@@ -115,7 +115,6 @@ public class AgentIntegrationTest {
// String name = "&query";
// String queryCode = "SELECT 1 AS one";
// api.installQuery(name, queryCode);
-// // TODO: test something here
// }
// @Test
@@ -137,7 +136,6 @@ public class AgentIntegrationTest {
// api.uninstallQuery(name);
// AttributesMap attributes = api.getZoneAttributeValues("/pjwstk");
// assertNull(attributes.getOrNull(name));
-// // TODO: test this correctly
// }
@Test
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/EventBusTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/EventBusTest.java
index 34b80bb..dfd69cc 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/EventBusTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/EventBusTest.java
@@ -31,7 +31,6 @@ public class EventBusTest {
@Override
public void handle(AgentMessage event) throws InterruptedException {
System.out.println("Module 1 handle called");
- // TODO correct message subclass
sendMessage(new AgentMessage("1", ModuleType.UDP) {});
counter ++;
}
@@ -64,7 +63,6 @@ public class EventBusTest {
@Test
@Ignore
- // TODO correct message subclass
public void messageModule() throws InterruptedException {
HashMap<ModuleType, Module> modules = initializeModule();
HashMap<ModuleType, Executor> executors = Agent.initializeExecutors(modules);
@@ -82,7 +80,6 @@ public class EventBusTest {
@Test
@Ignore
- // TODO correct message subclass
public void messagingBetweenModules() throws InterruptedException {
HashMap<ModuleType, Module> modules = initializeTwoModules();
HashMap<ModuleType, Executor> executors = Agent.initializeExecutors(modules);
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java
index 2898d3c..501bca5 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/ExecutorTest.java
@@ -8,8 +8,6 @@ import pl.edu.mimuw.cloudatlas.agent.messages.ResponseMessage;
import pl.edu.mimuw.cloudatlas.agent.modules.Module;
import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
-// TODO make agent messages specific subclass
-
public class ExecutorTest {
public class MessageCounterModule extends Module {
public int counter = 0;
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/SchedulerTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/SchedulerTest.java
index 99051ff..a0948f7 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/SchedulerTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/SchedulerTest.java
@@ -11,9 +11,6 @@ import pl.edu.mimuw.cloudatlas.agent.modules.TimerScheduler;
import java.util.ArrayList;
import java.util.HashMap;
-// TODO better task tests with counters after enabling messaging from tasks
-// TODO add wrong message test with switched types
-
public class SchedulerTest {
private HashMap<ModuleType, Module> modules;
private HashMap<ModuleType, Executor> executors;
diff --git a/src/test/java/pl/edu/mimuw/cloudatlas/agent/UDUPTest.java b/src/test/java/pl/edu/mimuw/cloudatlas/agent/UDUPTest.java
index 922ebe2..4f32d89 100644
--- a/src/test/java/pl/edu/mimuw/cloudatlas/agent/UDUPTest.java
+++ b/src/test/java/pl/edu/mimuw/cloudatlas/agent/UDUPTest.java
@@ -18,8 +18,6 @@ import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
-// TODO add serialization tests that target custom serializers (type collections!)
-
@Ignore
public class UDUPTest {