# HG changeset patch # User sugi # Date 1364608217 -32400 # Node ID 4dc2f09a8f7a26a3caf739de2e9a5a3c1a518c6b # Parent 2cc9f1e0cb4344adb0db4efe467b663504571761 use extract method diff -r 2cc9f1e0cb43 -r 4dc2f09a8f7a src/alice/datasegment/DataSegmentKey.java --- a/src/alice/datasegment/DataSegmentKey.java Fri Mar 29 18:53:55 2013 +0900 +++ b/src/alice/datasegment/DataSegmentKey.java Sat Mar 30 10:50:17 2013 +0900 @@ -31,11 +31,7 @@ for (Iterator iter = waitList.iterator(); iter.hasNext(); ) { Command waitCmd = iter.next(); if (waitCmd.index < index) { - try { - waitCmd.replyQueue.put(new Command(CommandType.REPLY, null, null, cmd.val, cmd.obj, index, waitCmd.seq, null, null, cmd.reverseKey)); - } catch (InterruptedException e) { - e.printStackTrace(); - } + replyValue(waitCmd ,dsv); iter.remove(); if (waitCmd.type == CommandType.TAKE) { // someone is waiting for this put or update command dataList.remove(dsv); @@ -87,8 +83,8 @@ } public void replyValue(Command cmd, DataSegmentValue data){ - if (cmd.cs!=null){ // if cmd has cs-instance it means Command from local. - cmd.cs.ids.reply(cmd.receiver, new Command(CommandType.REPLY, null, null, data.val, data.obj, data.index, 0, null, null, data.from)); + if (cmd.cs!=null){ // if cmd has cs-instance, it means Command from local. + cmd.cs.ids.reply(cmd.receiver, new Command(CommandType.REPLY, null, null, data.val, data.obj, data.index, cmd.seq, null, null, data.from)); DataSegment.getLocal().getAndRemoveCmd(cmd.seq); cmd = null; // someone has been holding instance. } else {