Examples of BinaryStoreCommand


Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

  }

  final Command createStoreCommand(String key, byte[] keyBytes, int exp,
      Object value, CommandType cmdType, boolean noreply,
      Transcoder transcoder) {
    return new BinaryStoreCommand(key, keyBytes, cmdType,
        new CountDownLatch(1), exp, -1, value, noreply, transcoder);
  }
View Full Code Here

Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

    this.mocksControl.verify();
  }

  @Test
  public void testOnMessageSent_BinaryCommand_NoReply() {
    Command cmd = new BinaryStoreCommand(null, null, CommandType.ADD, null,
        1, 1, null, true, null);
    EasyMock.expect(this.memcachedClient.getProtocol()).andReturn(
        Protocol.Binary);
    this.session.addCommand(cmd);
    EasyMock.expectLastCall();
View Full Code Here

Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

  }

  final Command createStoreCommand(String key, byte[] keyBytes, int exp,
      Object value, CommandType cmdType, boolean noreply,
      Transcoder transcoder) {
    return new BinaryStoreCommand(key, keyBytes, cmdType,
        new CountDownLatch(1), exp, -1, value, noreply, transcoder);
  }
View Full Code Here

Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

    public void visit(Command command) {

      // Encode prev command
      if (this.prevCommand != null) {
        // first n-1 send setq command
        BinaryStoreCommand setqCmd = new BinaryStoreCommand(
            this.prevCommand.getKey(), this.prevCommand.getKeyBytes(),
            CommandType.SET, null, this.prevCommand.getExpTime(),
            this.prevCommand.getCas(),
            // set noreply to be true
            this.prevCommand.getValue(), true,
            this.prevCommand.getTranscoder());
        // We must set the opaque to get error message.
        int opaque = OpaqueGenerater.getInstance().getNextValue();
        setqCmd.setOpaque(opaque);
        setqCmd.encode();
        this.totalBytes += setqCmd.getIoBuffer().remaining();


        this.bufferList.add(setqCmd.getIoBuffer());
        // GC friendly
        setqCmd.setIoBuffer(MemcachedHandler.EMPTY_BUF);
        setqCmd.setValue(null);
        this.prevCommand.setValue(null);
        this.prevCommand.setIoBuffer(MemcachedHandler.EMPTY_BUF);
        if (this.mergeCommands == null) {
          this.mergeCommands = new HashMap<Object, Command>();
        }
View Full Code Here

Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

        return;
      }
      // prevCommand is the last command,last command must be a SET
      // command,ensure
      // previous SETQ commands sending response back
      BinaryStoreCommand setqCmd = new BinaryStoreCommand(
          this.prevCommand.getKey(), this.prevCommand.getKeyBytes(),
          CommandType.SET, null, this.prevCommand.getExpTime(),
          this.prevCommand.getCas(),
          // set noreply to be false.
          this.prevCommand.getValue(), false, this.prevCommand.getTranscoder());
      // We must set the opaque to get error message.
      int opaque = OpaqueGenerater.getInstance().getNextValue();
      setqCmd.setOpaque(opaque);
      setqCmd.encode();
      this.bufferList.add(setqCmd.getIoBuffer());
      this.totalBytes += setqCmd.getIoBuffer().remaining();
      if (this.mergeCommands != null) {
        this.mergeCommands.put(opaque, this.prevCommand);
      }
    }
View Full Code Here

Examples of net.rubyeye.xmemcached.command.binary.BinaryStoreCommand

    this.mocksControl.verify();
  }

  @Test
  public void testOnMessageSent_BinaryCommand_NoReply() {
    Command cmd = new BinaryStoreCommand(null, null, CommandType.ADD, null,
        1, 1, null, true, null);
    EasyMock.expect(this.memcachedClient.getProtocol()).andReturn(
        Protocol.Binary);
    this.session.addCommand(cmd);
    EasyMock.expectLastCall();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.