comparison src/alice/datasegment/RemoteDataSegmentManager.java @ 254:2ec10cfa8cc3

refactor
author sugi
date Mon, 01 Jul 2013 20:00:07 +0900
parents 32e7d5271477
children b4690114a0cd
comparison
equal deleted inserted replaced
253:32e7d5271477 254:2ec10cfa8cc3
81 logger.debug(cmd.getCommandString()); 81 logger.debug(cmd.getCommandString());
82 82
83 } 83 }
84 84
85 @Override 85 @Override
86 public void take(Receiver receiver, String key, int index, CodeSegment cs) { 86 public void take(Receiver receiver, CodeSegment cs) {
87 int seq = this.seq.getAndIncrement(); 87 int seq = this.seq.getAndIncrement();
88 Command cmd = new Command(CommandType.TAKE, receiver, key, null, index, seq, replyQueue, cs, null); 88 Command cmd = new Command(CommandType.TAKE, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null);
89 seqHash.put(seq, cmd); 89 seqHash.put(seq, cmd);
90 connection.sendCommand(cmd); 90 connection.sendCommand(cmd);
91 if (logger.isDebugEnabled()) 91 if (logger.isDebugEnabled())
92 logger.debug(cmd.getCommandString()); 92 logger.debug(cmd.getCommandString());
93 } 93 }
94 94
95 @Override 95 @Override
96 public void quickTake(Receiver receiver, String key, int index, CodeSegment cs) { 96 public void quickTake(Receiver receiver, CodeSegment cs) {
97 int seq = this.seq.getAndIncrement(); 97 int seq = this.seq.getAndIncrement();
98 Command cmd = new Command(CommandType.TAKE, receiver, key, null, index, seq, replyQueue, cs, null, true); 98 Command cmd = new Command(CommandType.TAKE, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null, true);
99 seqHash.put(seq, cmd); 99 seqHash.put(seq, cmd);
100 connection.write(cmd); 100 connection.write(cmd);
101 if (logger.isDebugEnabled()) 101 if (logger.isDebugEnabled())
102 logger.debug(cmd.getCommandString()); 102 logger.debug(cmd.getCommandString());
103 } 103 }
104 104
105 @Override 105 @Override
106 public void peek(Receiver receiver, String key, int index, CodeSegment cs) { 106 public void peek(Receiver receiver, CodeSegment cs) {
107 int seq = this.seq.getAndIncrement(); 107 int seq = this.seq.getAndIncrement();
108 Command cmd = new Command(CommandType.PEEK, receiver, key, null, index, seq, replyQueue, cs, null); 108 Command cmd = new Command(CommandType.PEEK, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null);
109 seqHash.put(seq, cmd); 109 seqHash.put(seq, cmd);
110 connection.sendCommand(cmd); 110 connection.sendCommand(cmd);
111 if (logger.isDebugEnabled()) 111 if (logger.isDebugEnabled())
112 logger.debug(cmd.getCommandString()); 112 logger.debug(cmd.getCommandString());
113 } 113 }
114 114
115 115
116 @Override 116 @Override
117 public void quickPeek(Receiver receiver, String key, int index, CodeSegment cs) { 117 public void quickPeek(Receiver receiver, CodeSegment cs) {
118 int seq = this.seq.getAndIncrement(); 118 int seq = this.seq.getAndIncrement();
119 Command cmd = new Command(CommandType.PEEK, receiver, key, null, index, seq, replyQueue, cs, null, true); 119 Command cmd = new Command(CommandType.PEEK, receiver, receiver.key, null, receiver.index, seq, replyQueue, cs, null, true);
120 seqHash.put(seq, cmd); 120 seqHash.put(seq, cmd);
121 connection.write(cmd); 121 connection.write(cmd);
122 if (logger.isDebugEnabled()) 122 if (logger.isDebugEnabled())
123 logger.debug(cmd.getCommandString()); 123 logger.debug(cmd.getCommandString());
124 124