Mercurial > hg > Database > Alice
changeset 491:7d67bc538549 dispose
bug fix
author | sugi |
---|---|
date | Wed, 10 Dec 2014 20:31:09 +0900 |
parents | f28087efa911 |
children | 24e535123df7 |
files | src/main/java/alice/datasegment/LocalDataSegmentManager.java src/main/java/alice/topology/manager/ParentManager.java src/main/java/alice/topology/manager/keeparive/CatchDisconnectEvent.java src/main/java/alice/topology/manager/keeparive/ListManager.java src/main/java/alice/topology/manager/keeparive/RespondPing.java |
diffstat | 5 files changed, 12 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/datasegment/LocalDataSegmentManager.java Wed Dec 10 18:47:21 2014 +0900 +++ b/src/main/java/alice/datasegment/LocalDataSegmentManager.java Wed Dec 10 20:31:09 2014 +0900 @@ -64,6 +64,11 @@ return dataSegmentKey; } + public void removeDataSegmentKey(String key) { + if (key!=null) + dataSegments.remove(key); + } + @Override public void put(String key, ReceiveData rData, SendOption option) { DataSegmentKey dataSegmentKey = getDataSegmentKey(key);
--- a/src/main/java/alice/topology/manager/ParentManager.java Wed Dec 10 18:47:21 2014 +0900 +++ b/src/main/java/alice/topology/manager/ParentManager.java Wed Dec 10 20:31:09 2014 +0900 @@ -77,6 +77,7 @@ if (counter==position) System.out.print("P "); System.out.print(p.getName()+" "+p.children()+" | "); + counter++; } } }
--- a/src/main/java/alice/topology/manager/keeparive/CatchDisconnectEvent.java Wed Dec 10 18:47:21 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -package alice.topology.manager.keeparive; - -import alice.codesegment.CloseEventCodeSegment; -import alice.daemon.ConnectionInfo; - -public class CatchDisconnectEvent extends CloseEventCodeSegment{ - - @Override - public void run() { - ConnectionInfo e = getConnectionInfo(); - System.out.println("IPAddr "+ e.addr); - System.out.println("port "+ e.port); - } -}
--- a/src/main/java/alice/topology/manager/keeparive/ListManager.java Wed Dec 10 18:47:21 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/ListManager.java Wed Dec 10 20:31:09 2014 +0900 @@ -2,6 +2,8 @@ import java.util.LinkedList; +import alice.datasegment.DataSegment; + public class ListManager { private LinkedList<TaskInfo> list = new LinkedList<TaskInfo>(); @@ -91,6 +93,7 @@ TaskExecuter.getInstance().skip(); } } + DataSegment.getLocal().removeDataSegmentKey("_FORM_"+name); task = new TaskInfo(TaskType.CLOSE); task.setInfo(name, 0); while(deleteTask(task));
--- a/src/main/java/alice/topology/manager/keeparive/RespondPing.java Wed Dec 10 18:47:21 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RespondPing.java Wed Dec 10 20:31:09 2014 +0900 @@ -6,7 +6,7 @@ public class RespondPing extends CodeSegment{ private Receiver respond = ids.create(CommandType.TAKE); -// private long pingedTime = System.currentTimeMillis(); + private long pingedTime = System.currentTimeMillis(); public RespondPing(String key) { respond.setKey(key); @@ -15,8 +15,8 @@ @Override public void run() { RespondData d = respond.asClass(RespondData.class); -// System.out.print("ping from "+d.from); -// System.out.println(" Recieved time "+(d.time - pingedTime)); + System.out.print("ping from "+d.from); + System.out.println(" Recieved time "+(d.time - pingedTime)); // if (d.time - pingedTime > 60 * 1000){ // // need check, this connection is alive. may be close // if (DataSegment.contains(d.from))