Mercurial > hg > Database > Alice
changeset 507:28627bb3eeda dispose
refactor
author | sugi |
---|---|
date | Sat, 03 Jan 2015 19:43:36 +0900 |
parents | 9e69b5c6fe44 |
children | b7d02ea79850 |
files | src/main/java/alice/topology/manager/keeparive/CreateTask.java src/main/java/alice/topology/manager/keeparive/RemoveTask.java src/main/java/alice/topology/manager/keeparive/StartKeepAlive.java src/main/java/alice/topology/manager/keeparive/TaskExecuter.java src/main/java/alice/topology/node/CloseRemoteDataSegment.java src/main/java/alice/topology/node/DeleteConnection.java |
diffstat | 6 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/topology/manager/keeparive/CreateTask.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/CreateTask.java Sat Jan 03 19:43:36 2015 +0900 @@ -9,10 +9,11 @@ public class CreateTask extends CodeSegment{ private Receiver info = ids.create(CommandType.PEEK); private Receiver info1 = ids.create(CommandType.TAKE); + public static int INTERVAL = 5; public CreateTask(){ info.setKey("_CLIST"); - info1.setKey("_WAITINGLIST"); + info1.setKey("_SCHEDULER"); } @Override @@ -21,12 +22,12 @@ List<String> clist = info.asClass(List.class); ListManager list = info1.asClass(ListManager.class); - int i = 5; + int i = INTERVAL; for (String manager : clist){ TaskInfo task = new TaskInfo(TaskType.PING); task.setInfo(manager, "_FORM_"+manager, i * 1000); list.addTask(task); - i +=5; + i +=INTERVAL; } ods.update(info1.key, list);
--- a/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RemoveTask.java Sat Jan 03 19:43:36 2015 +0900 @@ -9,7 +9,7 @@ private Receiver info2 = ids.create(CommandType.TAKE); // remove task public RemoveTask(){ - info1.setKey("_WAITINGLIST"); + info1.setKey("_SCHEDULER"); info2.setKey("_REMOVETASK"); } @@ -25,6 +25,6 @@ ods.put("_REMOVETASK", task); } } - ods.update("_WAITINGLIST", list); + ods.update("_SCHEDULER", list); } }
--- a/src/main/java/alice/topology/manager/keeparive/StartKeepAlive.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/StartKeepAlive.java Sat Jan 03 19:43:36 2015 +0900 @@ -6,7 +6,7 @@ @Override public void run() { - ods.put("_WAITINGLIST", new ListManager()); + ods.put("_SCHEDULER", new ListManager()); TaskExecuter.getInstance().setKey(); }
--- a/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Sat Jan 03 19:43:36 2015 +0900 @@ -21,7 +21,7 @@ public void setKey() { ids.init(); - info.setKey("_WAITINGLIST"); + info.setKey("_SCHEDULER"); } @Override @@ -31,12 +31,12 @@ TaskInfo task = new TaskInfo(TaskType.CREATE); task.setSleepTime(3000); list.addTask(task); - ods.update("_WAITINGLIST", list); + ods.update("_SCHEDULER", list); remainingTime = 0; } else { nowTask = list.getTaskList().poll(); if (nowTask.getType() !=TaskType.PING) - ods.update("_WAITINGLIST", list); + ods.update("_SCHEDULER", list); if (skipFlag) { skipFlag = false; nowTask.setSleepTime(remainingTime + nowTask.getSleepTime()); @@ -60,7 +60,7 @@ TaskInfo task = new TaskInfo(TaskType.CLOSE); task.setInfo(nowTask.getManagerKey(), 10 * 1000); list.addTask(task); - ods.update("_WAITINGLIST", list); + ods.update("_SCHEDULER", list); new RespondPing(nowTask.getReturnKey()); } else if (nowTask.getType() == TaskType.CLOSE) { // no response from the Remote DataSegment. So close this connection.
--- a/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Sat Jan 03 19:43:36 2015 +0900 @@ -17,7 +17,7 @@ info.setKey("_CLOSEMESSEAGE"); info1.setKey("_CLOSEREADY"); info2.setKey("_CLOSEREADY"); - info3.setKey("_WAITINGLIST"); + info3.setKey("_SCHEDULER"); } @Override
--- a/src/main/java/alice/topology/node/DeleteConnection.java Fri Jan 02 15:43:52 2015 +0900 +++ b/src/main/java/alice/topology/node/DeleteConnection.java Sat Jan 03 19:43:36 2015 +0900 @@ -15,7 +15,7 @@ public DeleteConnection() { info.setKey("_CLIST"); - info1.setKey("_WAITINGLIST"); + info1.setKey("_SCHEDULER"); } @Override