Mercurial > hg > Database > Alice
view src/main/java/alice/topology/manager/keeparive/RespondPing.java @ 552:767d93626b88 dispose
add compressed to DSM name
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2015 18:33:23 +0900 |
parents | c5072a63b257 |
children |
line wrap: on
line source
package alice.topology.manager.keeparive; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class RespondPing extends CodeSegment{ private Receiver respond = ids.create(CommandType.TAKE); // private long pingedTime = System.currentTimeMillis(); public RespondPing(String key) { respond.setKey("compressedlocal", key); } @Override public void run() { TaskExecuter exec = TaskExecuter.getInstance(); synchronized (exec){ RespondData d = respond.asClass(RespondData.class); //System.out.print("ping from "+d.from); //System.out.println(" Recieved time "+(d.time - pingedTime)); TaskInfo task = new TaskInfo(TaskType.CLOSE); task.setInfo(d.from, null, 0); if (!exec.compareAndSkip(task)){ // case: remove task is still in the waiting queue. ods.put("compressedlocal", "_REMOVETASK",task); new RemoveTask(); } } } }