Mercurial > hg > Database > Alice
view src/main/java/alice/codesegment/OutputDataSegment.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | 388e7d4b0624 |
line wrap: on
line source
package alice.codesegment; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; public class OutputDataSegment { /** * for local */ public void flip(Receiver receiver) { receiver.managerKey=null; DataSegment.getLocal().put(receiver.key, receiver.getObj()); } public void put(String key, Object val) { DataSegment.getLocal().put(key, val); } public void quickPut(String key, Object val) { put(key, val); } public void update(String key, Object val) { DataSegment.getLocal().update(key, val); } public void quickuUpdate(String key, Object val) { update(key, val); } /** * for remote */ public void put(String managerKey, String key, Object val) { if (!managerKey.equals("local")){ DataSegment.get(managerKey).put(key,val); } else { put(key, val); } } public void quickPut(String managerKey, String key, Object val) { if (!managerKey.equals("local")){ DataSegment.get(managerKey).quickPut(key, val); } else { put(key, val); } } public void update(String managerKey, String key, Object val) { if (!managerKey.equals("local")){ DataSegment.get(managerKey).update(key, val); } else { update(key, val); } } public void quickUpdate(String managerKey, String key, Object val) { if (!managerKey.equals("local")){ DataSegment.get(managerKey).update(key, val); } else { update(key, val); } } /** * kill the Alice process after send other messages. * * @param managerKey */ public void finish(String managerKey) { DataSegment.get(managerKey).finish(); } /** * close socket for RemoteDataSegment after send other messages. * * @param managerKey */ public void close(String managerKey) { DataSegment.get(managerKey).close(); } /** * "key" is not remote DataSegment's key. * "Ping Response" return in this "key" * * @param managerKey * @param key */ public void ping(String managerKey, String returnKey) { DataSegment.get(managerKey).ping(returnKey); } }