Mercurial > hg > RemoteEditor > REPSessionManager
changeset 463:3c2918368de3
slow merge mode
author | one |
---|---|
date | Fri, 01 Oct 2010 17:20:12 +0900 |
parents | d295e84c5e03 |
children | 295c257ac073 |
files | rep/handler/Editor.java |
diffstat | 1 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/handler/Editor.java Fri Oct 01 15:58:20 2010 +0900 +++ b/rep/handler/Editor.java Fri Oct 01 17:20:12 2010 +0900 @@ -25,7 +25,7 @@ public static boolean noMergeMode=false; static final boolean doOptimize = false; private LinkedList<REPCommand> writeQueue = new LinkedList<REPCommand>(); - static boolean slowMerge = true; + static boolean slowMerge = false; public Editor(SessionManager manager,int editorNo){ // no translator case @@ -281,6 +281,12 @@ translator.startMerge(command); } + /** + * sentList と ack を見比べて、正しい順序で来たかどうかを調べる。途中参加したEditorの場合は、Ackは + * 無視して良い。 + * @param command + * @return + */ private boolean checkAck(REPCommand command) { assert(!isMerging()); REPCommand prev; @@ -337,8 +343,9 @@ sendToEditor(mergeEnd); checkAck(preMergeCommand); if (preMergeCommand.eid==eid) { - if (!slowMerge) + if (!slowMerge) { sendAck(preMergeCommand); + } } else { next.send(preMergeCommand); } @@ -355,9 +362,13 @@ case REPCMD_DELETE: keep.cmd = REP.REPCMD_DELETE_ACK;break; default: assert(false); } - sentList.addLast(command); - //ServerMainLoop.logger.writeLog("Editor eid:"+eid+" sentList = "+sentList); + if (slowMerge) + sentList.addLast(keep); + else + sentList.addLast(command); + ServerMainLoop.logger.writeLog("Editor"+eid+": sendAck sentList = "+sentList); assert(sentList.size()<limit); + keep.string = ""; next.send(keep); }