Examples of SerializingTranscoder


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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

  private TranscoderUtils tu;

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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

  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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

  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

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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

  private TranscoderUtils tu;

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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

  protected BufferAllocator bufferAllocator = new SimpleBufferAllocator();

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

Examples of net.rubyeye.xmemcached.transcoders.SerializingTranscoder

    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

Examples of net.spy.memcached.transcoders.SerializingTranscoder

  }

  @Override
  protected void setUp() throws Exception
  {
    SerializingTranscoder transcoder = new SerializingTranscoder(
        50 * 1024 * 1024 // 50 MB
    );
    // disable compression
    transcoder.setCompressionThreshold(Integer.MAX_VALUE);

    client = new MemcachedClient(
        new ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
                                      .setHashAlg(DefaultHashAlgorithm.FNV1A_64_HASH)
                                      .setLocatorType(ConnectionFactoryBuilder.Locator.CONSISTENT)
View Full Code Here

Examples of net.spy.memcached.transcoders.SerializingTranscoder

    }

    @Override
    public T get( String key )
    {
        Object value = client.get( prefix( key ), new SerializingTranscoder() );
        client.touch( prefix( key ), expiration );
        if( value == null )
        {
            return null;
        }
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.