Package net.rubyeye.xmemcached.transcoders

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder


        .buf().array()));
    optimiezeCommand.decode(null, ByteBuffer.wrap("VALUE 0 0 2\r\n10\r\n"
        .getBytes()));

    assertEquals(0, this.currentCmd.getLatch().getCount());
    Transcoder transcoder = new SerializingTranscoder();
    assertEquals("10", transcoder.decode((CachedData) this.currentCmd
        .getResult()));
    for (Command cmd : localQueue) {
      assertEquals(0, cmd.getLatch().getCount());
      assertEquals("10", transcoder.decode((CachedData) this.currentCmd
          .getResult()));
    }
    assertEquals(0, optimiezeCommand.getMergeCount());
  }
View Full Code Here


  private TranscoderUtils tu;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    tc=new SerializingTranscoder();
    setTranscoder(tc);
    tu=new TranscoderUtils(true);
  }
View Full Code Here

  public void testOptimiezeSetLimitBuffer() {
    this.optimiezer = new Optimizer(Protocol.Binary);
    this.commandFactory = new BinaryCommandFactory();
    this.writeQueue = new LinkedTransferQueue<Command>();
    this.executingCmds = new LinkedTransferQueue<Command>();
    SerializingTranscoder transcoder = new SerializingTranscoder();
    int oneBufferSize = 0;
    for (int i = 0; i < 10; i++) {
      Command cmd = this.commandFactory.createSetCommand(
          String.valueOf(i), String.valueOf(i).getBytes(), 0, i,
          false, transcoder);
View Full Code Here

  public void testOptimiezeSetAllBuffers() {
    this.optimiezer = new Optimizer(Protocol.Binary);
    this.commandFactory = new BinaryCommandFactory();
    this.writeQueue = new LinkedTransferQueue<Command>();
    this.executingCmds = new LinkedTransferQueue<Command>();
    SerializingTranscoder transcoder = new SerializingTranscoder();
    for (int i = 0; i < 10; i++) {
      Command cmd = this.commandFactory.createSetCommand(
          String.valueOf(i), String.valueOf(i).getBytes(), 0, i,
          false, transcoder);
      cmd.encode();
View Full Code Here

        .buf().array()));
    optimiezeCommand.decode(null,
        ByteBuffer.wrap("VALUE 0 0 2\r\n10\r\n".getBytes()));

    assertEquals(0, this.currentCmd.getLatch().getCount());
    Transcoder transcoder = new SerializingTranscoder();
    assertEquals("10",
        transcoder.decode((CachedData) this.currentCmd.getResult()));
    for (Command cmd : localQueue) {
      assertEquals(0, cmd.getLatch().getCount());
      assertEquals("10",
          transcoder.decode((CachedData) this.currentCmd.getResult()));
    }
    assertEquals(0, optimiezeCommand.getMergeCount());
  }
View Full Code Here

  private TranscoderUtils tu;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    tc = new SerializingTranscoder();
    setTranscoder(tc);
    tu = new TranscoderUtils(true);
  }
View Full Code Here

  protected BufferAllocator bufferAllocator = new SimpleBufferAllocator();

  @Override
  protected void setUp() throws Exception {
    commandFactory = new BinaryCommandFactory();
    this.transcoder = new SerializingTranscoder();
  }
View Full Code Here

    builder.setConnectionPoolSize(100);

    try {
      memcachedClient = builder.build();
      memcachedClient.setOpTimeout(30000);
      SerializingTranscoder st = new SerializingTranscoder(memcacheSize);
      memcachedClient.setTranscoder(st);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

Copyright © 2018 www.massapicom. 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.