Package net.rubyeye.xmemcached.command

Examples of net.rubyeye.xmemcached.command.BinaryCommandFactory


    if (commandFactoryNameEquals(TextCommandFactory.class)) {
      return new TextCommandFactory();
    }

    if (commandFactoryNameEquals(BinaryCommandFactory.class)) {
      return new BinaryCommandFactory();
    }

    throw new IllegalArgumentException("Unsupported "
        + PROP_COMMAND_FACTORY + " value: " + getCommandFactoryName());
  }
View Full Code Here


  TranscoderUtils transcoderUtils = new TranscoderUtils(false);
  protected BufferAllocator bufferAllocator = new SimpleBufferAllocator();

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

    }
    int NUM = Integer.parseInt(args[0]);
    MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil
        .getAddresses(args[1]));
    // use binary protocol
    builder.setCommandFactory(new BinaryCommandFactory());
    MemcachedClient mc = builder.build();
    // initial value is 0
    mc.set("a", 0, 0);
    CountDownLatch cdl = new CountDownLatch(NUM * 100);
    long start = System.currentTimeMillis();
View Full Code Here

      MemcachedClientBuilder builder = new XMemcachedClientBuilder(
          AddrUtil.getAddresses(servers));
      builder.addAuthInfo(AddrUtil.getOneAddress(servers), AuthInfo
          .typical(username, password));
      // Must use binary protocol
      builder.setCommandFactory(new BinaryCommandFactory());
      return builder.build();
    } catch (IOException e) {
      System.err.println("Create MemcachedClient fail");
      e.printStackTrace();
    }
View Full Code Here

  public static MemcachedClient getMemcachedClient(String servers) {
    try {
      MemcachedClientBuilder builder = new XMemcachedClientBuilder(
          AddrUtil.getAddresses(servers));
      // use binary protocol
      builder.setCommandFactory(new BinaryCommandFactory());
      return builder.build();
    } catch (IOException e) {
      System.err.println("Create MemcachedClient fail");
      e.printStackTrace();
    }
View Full Code Here

    String servers = (String) properties.get("servers");
    MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil
        .getAddresses(servers));
    builder.setConnectionPoolSize(connCount);
    if (useBinaryProtocl) {
      builder.setCommandFactory(new BinaryCommandFactory());
    }

    MemcachedClient memcachedClient = builder.build();
    System.out.println("Xmemcached startup");
    warmUp(memcachedClient);
View Full Code Here

  }

  @Override
  protected XMemcachedClientBuilder getClientBuilder(String serverString) {
    XMemcachedClientBuilder builder = super.getClientBuilder(serverString);
    builder.setCommandFactory(new BinaryCommandFactory());
    return builder;
  }
View Full Code Here

    } else {
      memcachePort = port.toString();
    }

    MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(memcacheHostName + ":" + memcachePort));
    builder.setCommandFactory(new BinaryCommandFactory());
    builder.setConnectionPoolSize(100);

    try {
      memcachedClient = builder.build();
      memcachedClient.setOpTimeout(30000);
View Full Code Here

TOP

Related Classes of net.rubyeye.xmemcached.command.BinaryCommandFactory

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.