Esempio n. 1
0
 public void finish() {
   // prev command is the last command,last command must be getk,ensure
   // getq commands send response back
   Command lastGetKCommand =
       new BinaryGetCommand(
           prevCommand.getKey(),
           prevCommand.getKeyBytes(),
           CommandType.GET_ONE,
           new CountDownLatch(1),
           OpCode.GET_KEY,
           false);
   lastGetKCommand.encode();
   bufferList.add(lastGetKCommand.getIoBuffer());
   totalBytes += lastGetKCommand.getIoBuffer().remaining();
 }
Esempio n. 2
0
 public void visit(Command command) {
   // Encode prev command
   if (prevCommand != null) {
     // first n-1 send getq command
     Command getqCommand =
         new BinaryGetCommand(
             prevCommand.getKey(),
             prevCommand.getKeyBytes(),
             null,
             null,
             OpCode.GET_KEY_QUIETLY,
             true);
     getqCommand.encode();
     totalBytes += getqCommand.getIoBuffer().remaining();
     bufferList.add(getqCommand.getIoBuffer());
   }
   prevCommand = command;
 }