Mercurial > hg > Members > tatsuki > Alice
changeset 386:aae8e515b0d9 multicast
add CommandType arguments flip method
author | sugi |
---|---|
date | Mon, 16 Jun 2014 16:57:31 +0900 |
parents | 030c4f35393c |
children | 1cbac5818dca |
files | src/main/java/alice/codesegment/OutputDataSegment.java |
diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/codesegment/OutputDataSegment.java Wed Jun 11 16:04:10 2014 +0900 +++ b/src/main/java/alice/codesegment/OutputDataSegment.java Mon Jun 16 16:57:31 2014 +0900 @@ -1,5 +1,6 @@ package alice.codesegment; +import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; @@ -10,9 +11,21 @@ */ public void flip(Receiver receiver) { - receiver.managerKey=null; DataSegment.getLocal().put(receiver.key, receiver.getObj()); } + + public void flip(Receiver receiver, CommandType type) { + switch (type) { + case PUT: + DataSegment.getLocal().put(receiver.key, receiver.getObj()); + break; + case UPDATE: + DataSegment.getLocal().update(receiver.key, receiver.getObj()); + break; + default: + break; + } + } public void put(String key, Object val) { DataSegment.getLocal().put(key, val);