All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.spy.memcached.ArcusClientPool Maven / Gradle / Ivy

The newest version!
/*
 * arcus-java-client : Arcus Java client
 * Copyright 2010-2014 NAVER Corp.
 * Copyright 2014-2021 JaM2in Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.spy.memcached;

import java.net.SocketAddress;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import net.spy.memcached.collection.Attributes;
import net.spy.memcached.collection.BTreeGetResult;
import net.spy.memcached.collection.BTreeOrder;
import net.spy.memcached.collection.ByteArrayBKey;
import net.spy.memcached.collection.CollectionAttributes;
import net.spy.memcached.collection.CollectionPipedInsert;
import net.spy.memcached.collection.Element;
import net.spy.memcached.collection.ElementFlagFilter;
import net.spy.memcached.collection.ElementFlagUpdate;
import net.spy.memcached.collection.ElementValueType;
import net.spy.memcached.collection.SMGetElement;
import net.spy.memcached.collection.SMGetMode;
import net.spy.memcached.internal.BTreeStoreAndGetFuture;
import net.spy.memcached.internal.BulkFuture;
import net.spy.memcached.internal.CollectionFuture;
import net.spy.memcached.internal.CollectionGetBulkFuture;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.internal.SMGetFuture;
import net.spy.memcached.internal.GetFuture;
import net.spy.memcached.ops.CollectionOperationStatus;
import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.ops.StoreType;
import net.spy.memcached.transcoders.Transcoder;

/**
 * Bags for ArcusClient
 */
public class ArcusClientPool implements MemcachedClientIF, ArcusClientIF {

  private final int poolSize;
  private final ArcusClient[] client;
  private final Random rand;

  public ArcusClientPool(int poolSize, ArcusClient[] client) {

    this.poolSize = poolSize;
    this.client = client;
    rand = new Random();
  }

  /**
   * Returns single ArcusClient
   *
   * @return ArcusClient
   */
  public ArcusClient getClient() {
    return client[rand.nextInt(poolSize)];
  }

  /**
   * Returns all ArcusClient in pool
   *
   * @return ArcusClient array
   */
  public ArcusClient[] getAllClients() {
    return client;
  }

  @Override
  public void shutdown() {
    for (ArcusClient ac : client) {
      ac.shutdown();
    }
  }

  @Override
  public boolean shutdown(long timeout, TimeUnit unit) {
    boolean result = true;

    for (ArcusClient ac : client) {
      result = ac.shutdown(timeout, unit) && result;
    }

    return result;
  }

  @Override
  public Collection getAvailableServers() {
    return this.getClient().getAvailableServers();
  }

  @Override
  public Collection getUnavailableServers() {
    return this.getClient().getUnavailableServers();
  }

  @Override
  public Transcoder getTranscoder() {
    return this.getClient().getTranscoder();
  }

  @Override
  public NodeLocator getNodeLocator() {
    return this.getClient().getNodeLocator();
  }

  @Override
  public OperationFuture append(long cas, String key, Object val) {
    return this.getClient().append(cas, key, val);
  }

  @Override
  public  OperationFuture append(long cas, String key, T val,
                                             Transcoder tc) {
    return this.getClient().append(cas, key, val, tc);
  }

  @Override
  public OperationFuture prepend(long cas, String key, Object val) {
    return this.getClient().prepend(cas, key, val);
  }

  @Override
  public  OperationFuture prepend(long cas, String key, T val,
                                              Transcoder tc) {
    return this.getClient().prepend(cas, key, val, tc);
  }

  @Override
  public  OperationFuture asyncCAS(String key, long casId, T value,
                                                   Transcoder tc) {
    return this.getClient().asyncCAS(key, casId, value, tc);
  }

  @Override
  public OperationFuture asyncCAS(String key, long casId, Object value) {

    return this.getClient().asyncCAS(key, casId, value);
  }

  @Override
  public  OperationFuture asyncCAS(String key, long casId, int exp, T value,
                                          Transcoder tc) {
    return this.getClient().asyncCAS(key, casId, exp, value, tc);
  }

  @Override
  public OperationFuture asyncCAS(String key, long casId, int exp, Object value) {
    return this.getClient().asyncCAS(key, casId, exp, value);
  }

  @Override
  public  CASResponse cas(String key, long casId, int exp, T value, Transcoder tc)
      throws OperationTimeoutException {
    return this.getClient().cas(key, casId, exp, value, tc);
  }

  @Override
  public CASResponse cas(String key, long casId, int exp, Object value)
      throws OperationTimeoutException {
    return this.getClient().cas(key, casId, exp, value);
  }

  @Override
  public  CASResponse cas(String key, long casId, T value, Transcoder tc)
          throws OperationTimeoutException {
    return this.getClient().cas(key, casId, value, tc);
  }

  @Override
  public CASResponse cas(String key, long casId, Object value)
          throws OperationTimeoutException {
    return this.getClient().cas(key, casId, value);
  }

  @Override
  public  OperationFuture add(String key, int exp, T o, Transcoder tc) {
    return this.getClient().add(key, exp, o, tc);
  }

  @Override
  public OperationFuture add(String key, int exp, Object o) {
    return this.getClient().add(key, exp, o);
  }

  @Override
  public  OperationFuture set(String key, int exp, T o, Transcoder tc) {
    return this.getClient().set(key, exp, o, tc);
  }

  @Override
  public OperationFuture set(String key, int exp, Object o) {
    return this.getClient().set(key, exp, o);
  }

  @Override
  public  OperationFuture replace(String key, int exp, T o,
                                              Transcoder tc) {
    return this.getClient().replace(key, exp, o, tc);
  }

  @Override
  public OperationFuture replace(String key, int exp, Object o) {
    return this.getClient().replace(key, exp, o);
  }

  @Override
  public  GetFuture asyncGet(String key, Transcoder tc) {
    return this.getClient().asyncGet(key, tc);
  }

  @Override
  public GetFuture asyncGet(String key) {
    return this.getClient().asyncGet(key);
  }

  @Override
  public  OperationFuture> asyncGets(String key, Transcoder tc) {
    return this.getClient().asyncGets(key, tc);
  }

  @Override
  public OperationFuture> asyncGets(String key) {
    return this.getClient().asyncGets(key);
  }

  @Override
  public  CASValue gets(String key, Transcoder tc)
          throws OperationTimeoutException {
    return this.getClient().gets(key, tc);
  }

  @Override
  public CASValue gets(String key) throws OperationTimeoutException {
    return this.getClient().gets(key);
  }

  @Override
  public  T get(String key, Transcoder tc)
          throws OperationTimeoutException {
    return this.getClient().get(key, tc);
  }

  @Override
  public Object get(String key) throws OperationTimeoutException {
    return this.getClient().get(key);
  }

  @Override
  public  BulkFuture> asyncGetBulk(Collection keys,
                                                     Iterator> tcs) {
    return this.getClient().asyncGetBulk(keys, tcs);
  }

  @Override
  public  BulkFuture> asyncGetBulk(Collection keys,
                                                     Transcoder tc) {
    return this.getClient().asyncGetBulk(keys, tc);
  }

  @Override
  public BulkFuture> asyncGetBulk(Collection keys) {
    return this.getClient().asyncGetBulk(keys);
  }

  @Override
  public  BulkFuture> asyncGetBulk(Transcoder tc,
                                                     String... keys) {
    return this.getClient().asyncGetBulk(tc, keys);
  }

  @Override
  public BulkFuture> asyncGetBulk(String... keys) {
    return this.getClient().asyncGetBulk(keys);
  }

  @Override
  public  BulkFuture>> asyncGetsBulk(Collection keys,
                                                                Iterator> tcs) {
    return this.getClient().asyncGetsBulk(keys, tcs);
  }

  @Override
  public  BulkFuture>> asyncGetsBulk(Collection keys,
                                                                Transcoder tc) {
    return this.getClient().asyncGetsBulk(keys, tc);
  }

  @Override
  public BulkFuture>> asyncGetsBulk(Collection keys) {
    return this.getClient().asyncGetsBulk(keys);
  }

  @Override
  public  BulkFuture>> asyncGetsBulk(Transcoder tc,
                                                                String... keys) {
    return this.getClient().asyncGetsBulk(tc, keys);
  }

  @Override
  public BulkFuture>> asyncGetsBulk(String... keys) {
    return this.getClient().asyncGetsBulk(keys);
  }

  @Override
  public  Map getBulk(Collection keys, Transcoder tc)
          throws OperationTimeoutException {
    return this.getClient().getBulk(keys, tc);
  }

  @Override
  public Map getBulk(Collection keys)
          throws OperationTimeoutException {
    return this.getClient().getBulk(keys);
  }

  @Override
  public  Map getBulk(Transcoder tc, String... keys)
          throws OperationTimeoutException {
    return this.getClient().getBulk(tc, keys);
  }

  @Override
  public Map getBulk(String... keys)
          throws OperationTimeoutException {
    return this.getClient().getBulk(keys);
  }

  @Override
  public  Map> getsBulk(Collection keys, Transcoder tc)
          throws OperationTimeoutException {
    return this.getClient().getsBulk(keys, tc);
  }

  @Override
  public Map> getsBulk(Collection keys)
          throws OperationTimeoutException {
    return this.getClient().getsBulk(keys);
  }

  @Override
  public  Map> getsBulk(Transcoder tc, String... keys)
          throws OperationTimeoutException {
    return this.getClient().getsBulk(tc, keys);
  }

  @Override
  public Map> getsBulk(String... keys)
          throws OperationTimeoutException {
    return this.getClient().getsBulk(keys);
  }

  @Override
  public Map getVersions() {
    return this.getClient().getVersions();
  }

  @Override
  public Map> getStats() {
    return this.getClient().getStats();
  }

  @Override
  public Map> getStats(String prefix) {
    return this.getClient().getStats(prefix);
  }

  @Override
  public long incr(String key, int by) throws OperationTimeoutException {
    return this.getClient().incr(key, by);
  }

  @Override
  public long decr(String key, int by) throws OperationTimeoutException {
    return this.getClient().decr(key, by);
  }

  @Override
  public long incr(String key, int by, long def)
          throws OperationTimeoutException {
    return this.getClient().incr(key, by, def);
  }

  @Override
  public long incr(String key, int by, long def, int exp)
          throws OperationTimeoutException {
    return this.getClient().incr(key, by, def, exp);
  }

  @Override
  public long decr(String key, int by, long def)
          throws OperationTimeoutException {
    return this.getClient().decr(key, by, def);
  }

  @Override
  public long decr(String key, int by, long def, int exp)
          throws OperationTimeoutException {
    return this.getClient().decr(key, by, def, exp);
  }

  @Override
  public OperationFuture asyncIncr(String key, int by) {
    return this.getClient().asyncIncr(key, by);
  }

  @Override
  public OperationFuture asyncIncr(String key, int by, long def, int exp) {
    return this.getClient().asyncIncr(key, by, def, exp);
  }

  @Override
  public OperationFuture asyncDecr(String key, int by) {
    return this.getClient().asyncDecr(key, by);
  }

  @Override
  public OperationFuture asyncDecr(String key, int by, long def, int exp) {
    return this.getClient().asyncDecr(key, by, def, exp);
  }

  @Override
  public OperationFuture delete(String key) {
    return this.getClient().delete(key);
  }

  @Override
  public Future flush(int delay) {
    return this.getClient().flush(delay);
  }

  @Override
  public Future flush() {
    return this.getClient().flush();
  }

  @Override
  public boolean waitForQueues(long timeout, TimeUnit unit) {
    return this.getClient().waitForQueues(timeout, unit);
  }

  @Override
  public boolean addObserver(ConnectionObserver obs) {
    return this.getClient().addObserver(obs);
  }

  @Override
  public boolean removeObserver(ConnectionObserver obs) {
    return this.getClient().removeObserver(obs);
  }

  @Override
  public Set listSaslMechanisms() {
    return this.getClient().listSaslMechanisms();
  }

  @Override
  public CollectionFuture asyncSetAttr(String key, Attributes attrs) {
    return this.getClient().asyncSetAttr(key, attrs);
  }

  @Override
  public CollectionFuture asyncGetAttr(String key) {
    return this.getClient().asyncGetAttr(key);
  }

  @Override
  public  CollectionFuture asyncSopExist(String key, T value,
                                                     Transcoder tc) {
    return this.getClient().asyncSopExist(key, value, tc);
  }

  @Override
  public CollectionFuture asyncSopExist(String key, Object value) {
    return this.getClient().asyncSopExist(key, value);
  }

  @Deprecated
  @Override
  public  Future> asyncSetBulk(
          List key, int exp, T o, Transcoder tc) {
    return this.getClient().asyncSetBulk(key, exp, o, tc);
  }

  @Deprecated
  @Override
  public Future> asyncSetBulk(
          List key, int exp, Object o) {
    return this.getClient().asyncSetBulk(key, exp, o);
  }

  @Deprecated
  @Override
  public  Future> asyncSetBulk(
          Map o, int exp, Transcoder tc) {
    return this.getClient().asyncSetBulk(o, exp, tc);
  }

  @Deprecated
  @Override
  public Future> asyncSetBulk(
          Map o, int exp) {
    return this.getClient().asyncSetBulk(o, exp);
  }


  @Override
  public  Future> asyncStoreBulk(
          StoreType type, List key, int exp, T o, Transcoder tc) {
    return this.getClient().asyncStoreBulk(type, key, exp, o, tc);
  }

  @Override
  public Future> asyncStoreBulk(
          StoreType type, List key, int exp, Object o) {
    return this.getClient().asyncStoreBulk(type, key, exp, o);
  }

  @Override
  public  Future> asyncStoreBulk(
          StoreType type, Map o, int exp, Transcoder tc) {
    return this.getClient().asyncStoreBulk(type, o, exp, tc);
  }

  @Override
  public Future> asyncStoreBulk(
          StoreType type, Map o, int exp) {
    return this.getClient().asyncStoreBulk(type, o, exp);
  }

  @Override
  public Future> asyncDeleteBulk(
          List key) {
    return this.getClient().asyncDeleteBulk(key);
  }

  @Override
  public Future> asyncDeleteBulk(
          String... key) {
    return this.getClient().asyncDeleteBulk(key);
  }

  @Override
  public  Future> asyncBopInsertBulk(
          List keyList, long bkey, byte[] eFlag, T value,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncBopInsertBulk(keyList, bkey, eFlag, value,
            attributesForCreate, tc);
  }

  @Override
  public Future> asyncBopInsertBulk(
          List keyList, long bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsertBulk(keyList, bkey, eFlag, value,
            attributesForCreate);
  }

  @Override
  public  Future> asyncMopInsertBulk(
          List keyList, String mkey, T value,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncMopInsertBulk(keyList, mkey, value,
            attributesForCreate, tc);
  }

  @Override
  public Future> asyncMopInsertBulk(
          List keyList, String mkey, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncMopInsertBulk(keyList, mkey, value,
            attributesForCreate);
  }

  @Override
  public  Future> asyncLopInsertBulk(
          List keyList, int index, T value,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncLopInsertBulk(keyList, index, value,
            attributesForCreate, tc);
  }

  @Override
  public Future> asyncLopInsertBulk(
          List keyList, int index, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncLopInsertBulk(keyList, index, value,
            attributesForCreate);
  }

  @Override
  public  Future> asyncSopInsertBulk(
          List keyList, T value,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncSopInsertBulk(keyList, value,
            attributesForCreate, tc);
  }

  @Override
  public Future> asyncSopInsertBulk(
          List keyList, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncSopInsertBulk(keyList, value,
            attributesForCreate);
  }

  @Override
  public int getMaxPipedItemCount() {
    return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
  }

  @Override
  public CollectionFuture asyncBopCreate(String key,
                                                  ElementValueType valueType,
                                                  CollectionAttributes attributes) {
    return this.getClient().asyncBopCreate(key, valueType, attributes);
  }

  @Override
  public CollectionFuture asyncMopCreate(String key,
                                                  ElementValueType type,
                                                  CollectionAttributes attributes) {
    return this.getClient().asyncMopCreate(key, type, attributes);
  }

  @Override
  public CollectionFuture asyncSopCreate(String key,
                                                  ElementValueType type,
                                                  CollectionAttributes attributes) {
    return this.getClient().asyncSopCreate(key, type, attributes);
  }

  @Override
  public CollectionFuture asyncLopCreate(String key,
                                                  ElementValueType type,
                                                  CollectionAttributes attributes) {
    return this.getClient().asyncLopCreate(key, type, attributes);
  }

  @Override
  public CollectionFuture>> asyncBopGet(String key,
                                                                  long bkey,
                                                                  ElementFlagFilter eFlagFilter,
                                                                  boolean withDelete,
                                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopGet(key, bkey, eFlagFilter, withDelete,
            dropIfEmpty);
  }

  @Override
  public CollectionFuture>> asyncBopGet(String key,
                                                                  long from, long to,
                                                                  ElementFlagFilter eFlagFilter,
                                                                  int offset, int count,
                                                                  boolean withDelete,
                                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopGet(key, from, to, eFlagFilter, offset,
            count, withDelete, dropIfEmpty);
  }

  @Override
  public  CollectionFuture>> asyncBopGet(String key, long bkey,
                                                                 ElementFlagFilter eFlagFilter,
                                                                 boolean withDelete,
                                                                 boolean dropIfEmpty,
                                                                 Transcoder tc) {
    return this.getClient().asyncBopGet(key, bkey, eFlagFilter, withDelete,
            dropIfEmpty, tc);
  }

  @Override
  public  CollectionFuture>> asyncBopGet(String key,
                                                                 long from, long to,
                                                                 ElementFlagFilter eFlagFilter,
                                                                 int offset, int count,
                                                                 boolean withDelete,
                                                                 boolean dropIfEmpty,
                                                                 Transcoder tc) {
    return this.getClient().asyncBopGet(key, from, to, eFlagFilter, offset,
            count, withDelete, dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture> asyncMopGet(String key, List mkeyList,
                                                           boolean withDelete,
                                                           boolean dropIfEmpty) {
    return this.getClient().asyncMopGet(key, mkeyList, withDelete, dropIfEmpty);
  }

  @Override
  public CollectionFuture> asyncMopGet(String key,
                                                           boolean withDelete,
                                                           boolean dropIfEmpty) {
    return this.getClient().asyncMopGet(key, withDelete, dropIfEmpty);
  }

  @Override
  public CollectionFuture> asyncMopGet(String key, String mkey,
                                                           boolean withDelete,
                                                           boolean dropIfEmpty) {
    return this.getClient().asyncMopGet(key, mkey, withDelete, dropIfEmpty);
  }

  @Override
  public  CollectionFuture> asyncMopGet(String key, List mkeyList,
                                                          boolean withDelete,
                                                          boolean dropIfEmpty,
                                                          Transcoder tc) {
    return this.getClient().asyncMopGet(key, mkeyList, withDelete, dropIfEmpty, tc);
  }

  @Override
  public  CollectionFuture> asyncMopGet(String key,
                                                          boolean withDelete,
                                                          boolean dropIfEmpty,
                                                          Transcoder tc) {
    return this.getClient().asyncMopGet(key, withDelete, dropIfEmpty, tc);
  }

  @Override
  public  CollectionFuture> asyncMopGet(String key, String mkey,
                                                          boolean withDelete,
                                                          boolean dropIfEmpty,
                                                          Transcoder tc) {
    return this.getClient().asyncMopGet(key, mkey, withDelete, dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture> asyncLopGet(String key, int index,
                                                    boolean withDelete,
                                                    boolean dropIfEmpty) {
    return this.getClient()
            .asyncLopGet(key, index, withDelete, dropIfEmpty);
  }

  @Override
  public CollectionFuture> asyncLopGet(String key,
                                                    int from, int to,
                                                    boolean withDelete,
                                                    boolean dropIfEmpty) {
    return this.getClient().asyncLopGet(key, from, to, withDelete,
            dropIfEmpty);
  }

  @Override
  public  CollectionFuture> asyncLopGet(String key, int index,
                                                   boolean withDelete,
                                                   boolean dropIfEmpty,
                                                   Transcoder tc) {
    return this.getClient().asyncLopGet(key, index, withDelete,
            dropIfEmpty, tc);
  }

  @Override
  public  CollectionFuture> asyncLopGet(String key,
                                                   int from, int to,
                                                   boolean withDelete,
                                                   boolean dropIfEmpty,
                                                   Transcoder tc) {
    return this.getClient().asyncLopGet(key, from, to, withDelete,
            dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture> asyncSopGet(String key,
                                                   int count,
                                                   boolean withDelete,
                                                   boolean dropIfEmpty) {
    return this.getClient()
            .asyncSopGet(key, count, withDelete, dropIfEmpty);
  }

  @Override
  public  CollectionFuture> asyncSopGet(String key,
                                                  int count,
                                                  boolean withDelete,
                                                  boolean dropIfEmpty,
                                                  Transcoder tc) {
    return this.getClient().asyncSopGet(key, count, withDelete,
            dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture asyncBopDelete(String key, long bkey,
                                                  ElementFlagFilter eFlagFilter,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopDelete(key, bkey, eFlagFilter,
            dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncBopDelete(String key,
                                                  long from, long to,
                                                  ElementFlagFilter eFlagFilter,
                                                  int count,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopDelete(key, from, to, eFlagFilter,
            count, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncMopDelete(String key,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncMopDelete(key, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncMopDelete(String key, String mkey,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncMopDelete(key, mkey, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncLopDelete(String key, int index,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncLopDelete(key, index, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncLopDelete(String key, int from,
                                                  int to, boolean dropIfEmpty) {
    return this.getClient().asyncLopDelete(key, from, to, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncSopDelete(String key, Object value,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncSopDelete(key, value, dropIfEmpty);
  }

  @Override
  public  CollectionFuture asyncSopDelete(String key, T value,
                                                      boolean dropIfEmpty, Transcoder tc) {
    return this.getClient().asyncSopDelete(key, value, dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture asyncBopGetItemCount(String key,
                                                        long from, long to,
                                                        ElementFlagFilter eFlagFilter) {
    return this.getClient()
            .asyncBopGetItemCount(key, from, to, eFlagFilter);
  }

  @Override
  public CollectionFuture asyncBopInsert(String key, long bkey,
                                                  byte[] eFlag, Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsert(key, bkey, eFlag, value,
            attributesForCreate);
  }

  @Override
  public CollectionFuture asyncMopInsert(String key, String mkey,
                                                  Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncMopInsert(key, mkey, value,
            attributesForCreate);
  }

  @Override
  public CollectionFuture asyncLopInsert(String key, int index,
                                                  Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncLopInsert(key, index, value,
            attributesForCreate);
  }

  @Override
  public CollectionFuture asyncSopInsert(String key, Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncSopInsert(key, value, attributesForCreate);
  }

  @Override
  public  CollectionFuture asyncBopInsert(String key, long bkey,
                                                      byte[] eFlag, T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncBopInsert(key, bkey, eFlag, value,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture asyncMopInsert(String key, String mkey,
                                                      T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncMopInsert(key, mkey, value,
            attributesForCreate, tc);
  }

  @Override
  public  CollectionFuture asyncLopInsert(String key, int index,
                                                      T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncLopInsert(key, index, value,
            attributesForCreate, tc);
  }

  @Override
  public  CollectionFuture asyncSopInsert(String key, T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncSopInsert(key, value, attributesForCreate,
            tc);
  }

  @Override
  public CollectionFuture> asyncBopPipedInsertBulk(
          String key, Map elements,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopPipedInsertBulk(key, elements,
            attributesForCreate);
  }

  @Override
  public CollectionFuture> asyncMopPipedInsertBulk(
          String key, Map elements,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncMopPipedInsertBulk(key, elements,
            attributesForCreate);
  }

  @Override
  public CollectionFuture> asyncLopPipedInsertBulk(
          String key, int index, List valueList,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncLopPipedInsertBulk(key, index, valueList,
            attributesForCreate);
  }

  @Override
  public CollectionFuture> asyncSopPipedInsertBulk(
          String key, List valueList,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncSopPipedInsertBulk(key, valueList,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture> asyncBopPipedInsertBulk(
          String key, Map elements,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncBopPipedInsertBulk(key, elements,
            attributesForCreate, tc);
  }

  @Override
  public  CollectionFuture> asyncMopPipedInsertBulk(
          String key, Map elements,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncMopPipedInsertBulk(key, elements,
            attributesForCreate, tc);
  }

  @Override
  public  CollectionFuture> asyncLopPipedInsertBulk(
          String key, int index, List valueList,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncLopPipedInsertBulk(key, index, valueList,
            attributesForCreate, tc);
  }

  @Override
  public  CollectionFuture> asyncSopPipedInsertBulk(
          String key, List valueList,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncSopPipedInsertBulk(key, valueList,
            attributesForCreate, tc);
  }

  @Override
  public OperationFuture flush(String prefix) {
    return this.getClient().flush(prefix);
  }

  @Override
  public OperationFuture flush(String prefix, int delay) {
    return this.getClient().flush(prefix, delay);
  }

  @Override
  public SMGetFuture>> asyncBopSortMergeGet(
          List keyList, long from, long to,
          ElementFlagFilter eFlagFilter, int offset, int count) {
    return this.getClient().asyncBopSortMergeGet(keyList, from, to,
            eFlagFilter, offset, count);
  }

  @Override
  public SMGetFuture>> asyncBopSortMergeGet(
          List keyList, long from, long to,
          ElementFlagFilter eFlagFilter, int count, SMGetMode smgetMode) {
    return this.getClient().asyncBopSortMergeGet(keyList, from, to,
            eFlagFilter, count, smgetMode);
  }

  @Override
  public CollectionFuture asyncBopUpsert(String key, long bkey,
                                                  byte[] elementFlag, Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopUpsert(key, bkey, elementFlag, value,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture asyncBopUpsert(String key, long bkey,
                                                      byte[] elementFlag, T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncBopUpsert(key, bkey, elementFlag, value,
            attributesForCreate, tc);
  }

  @Override
  public CollectionFuture asyncBopInsert(String key, byte[] bkey,
                                                  byte[] eFlag, Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsert(key, bkey, eFlag, value,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture asyncBopInsert(String key,
                                                      byte[] bkey, byte[] eFlag, T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncBopInsert(key, bkey, eFlag, value,
            attributesForCreate, tc);
  }

  @Override
  public CollectionFuture>> asyncBopGet(
          String key, byte[] from, byte[] to, ElementFlagFilter eFlagFilter,
          int offset, int count, boolean withDelete, boolean dropIfEmpty) {
    return this.getClient().asyncBopGet(key, from, to, eFlagFilter, offset,
            count, withDelete, dropIfEmpty);
  }

  @Override
  public  CollectionFuture>> asyncBopGet(
          String key, byte[] from, byte[] to, ElementFlagFilter eFlagFilter,
          int offset, int count, boolean withDelete, boolean dropIfEmpty,
          Transcoder tc) {
    return this.getClient().asyncBopGet(key, from, to, eFlagFilter, offset,
            count, withDelete, dropIfEmpty, tc);
  }

  @Override
  public CollectionFuture asyncBopDelete(String key, byte[] from,
                                                  byte[] to, ElementFlagFilter eFlagFilter,
                                                  int count,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopDelete(key, from, to, eFlagFilter,
            count, dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncBopDelete(String key, byte[] bkey,
                                                  ElementFlagFilter eFlagFilter,
                                                  boolean dropIfEmpty) {
    return this.getClient().asyncBopDelete(key, bkey, eFlagFilter,
            dropIfEmpty);
  }

  @Override
  public CollectionFuture asyncBopUpsert(String key, byte[] bkey,
                                                  byte[] elementFlag, Object value,
                                                  CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopUpsert(key, bkey, elementFlag, value,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture asyncBopUpsert(String key,
                                                      byte[] bkey, byte[] elementFlag, T value,
                                                      CollectionAttributes attributesForCreate,
                                                      Transcoder tc) {
    return this.getClient().asyncBopUpsert(key, bkey, elementFlag, value,
            attributesForCreate, tc);
  }

  @Override
  public CollectionFuture asyncBopGetItemCount(String key,
                                                        byte[] from, byte[] to,
                                                        ElementFlagFilter eFlagFilter) {
    return this.getClient()
            .asyncBopGetItemCount(key, from, to, eFlagFilter);
  }

  @Override
  public CollectionFuture asyncBopUpdate(String key, long bkey,
                                                  ElementFlagUpdate eFlagUpdate, Object value) {
    return this.getClient().asyncBopUpdate(key, bkey, eFlagUpdate, value);
  }

  @Override
  public  CollectionFuture asyncBopUpdate(String key, long bkey,
                                                      ElementFlagUpdate eFlagUpdate, T value,
                                                      Transcoder tc) {
    return this.getClient().asyncBopUpdate(key, bkey, eFlagUpdate, value,
            tc);
  }

  @Override
  public CollectionFuture asyncBopUpdate(String key, byte[] bkey,
                                                  ElementFlagUpdate eFlagUpdate, Object value) {
    return this.getClient().asyncBopUpdate(key, bkey, eFlagUpdate, value);
  }

  @Override
  public  CollectionFuture asyncBopUpdate(String key,
                                                      byte[] bkey, ElementFlagUpdate eFlagUpdate,
                                                      T value,
                                                      Transcoder tc) {
    return this.getClient().asyncBopUpdate(key, bkey, eFlagUpdate, value,
            tc);
  }

  @Override
  public CollectionFuture asyncMopUpdate(String key, String mkey,
                                                  Object value) {
    return this.getClient().asyncMopUpdate(key, mkey, value);
  }

  @Override
  public  CollectionFuture asyncMopUpdate(String key, String mkey,
                                                      T value, Transcoder tc) {
    return this.getClient().asyncMopUpdate(key, mkey, value, tc);
  }

  @Override
  public CollectionFuture> asyncBopPipedUpdateBulk(
          String key, List> elements) {
    return this.getClient().asyncBopPipedUpdateBulk(key, elements);
  }

  @Override
  public  CollectionFuture> asyncBopPipedUpdateBulk(
          String key, List> elements, Transcoder tc) {
    return this.getClient().asyncBopPipedUpdateBulk(key, elements, tc);
  }

  @Override
  public CollectionFuture> asyncMopPipedUpdateBulk(
          String key, Map elements) {
    return this.getClient().asyncMopPipedUpdateBulk(key, elements);
  }

  @Override
  public  CollectionFuture> asyncMopPipedUpdateBulk(
          String key, Map elements, Transcoder tc) {
    return this.getClient().asyncMopPipedUpdateBulk(key, elements, tc);
  }

  @Override
  public CollectionFuture> asyncSopPipedExistBulk(
          String key, List values) {
    return this.getClient().asyncSopPipedExistBulk(key, values);
  }

  @Override
  public  CollectionFuture> asyncSopPipedExistBulk(
          String key, List values, Transcoder tc) {
    return this.getClient().asyncSopPipedExistBulk(key, values, tc);
  }

  @Override
  public CollectionFuture> asyncBopPipedInsertBulk(
          String key, List> elements,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopPipedInsertBulk(key, elements,
            attributesForCreate);
  }

  @Override
  public  CollectionFuture> asyncBopPipedInsertBulk(
          String key, List> elements,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncBopPipedInsertBulk(key, elements,
            attributesForCreate, tc);
  }

  @Override
  public CollectionFuture>> asyncBopGet(
          String key, byte[] bkey, ElementFlagFilter eFlagFilter,
          boolean withDelete, boolean dropIfEmpty) {
    return this.getClient().asyncBopGet(key, bkey, eFlagFilter, withDelete,
            dropIfEmpty);
  }

  @Override
  public  CollectionFuture>> asyncBopGet(
          String key, byte[] bkey, ElementFlagFilter eFlagFilter,
          boolean withDelete, boolean dropIfEmpty, Transcoder tc) {
    return this.getClient().asyncBopGet(key, bkey, eFlagFilter, withDelete,
            dropIfEmpty, tc);
  }

  @Override
  public SMGetFuture>> asyncBopSortMergeGet(
          List keyList, byte[] from, byte[] to,
          ElementFlagFilter eFlagFilter, int offset, int count) {
    return this.getClient().asyncBopSortMergeGet(keyList, from, to,
            eFlagFilter, offset, count);
  }

  @Override
  public SMGetFuture>> asyncBopSortMergeGet(
          List keyList, byte[] from, byte[] to,
          ElementFlagFilter eFlagFilter, int count, SMGetMode smgetMode) {
    return this.getClient().asyncBopSortMergeGet(keyList, from, to,
            eFlagFilter, count, smgetMode);
  }

  @Override
  public Future> asyncBopInsertBulk(
          List keyList, byte[] bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsertBulk(keyList, bkey, eFlag, value,
            attributesForCreate);
  }

  @Override
  public  Future> asyncBopInsertBulk(
          List keyList, byte[] bkey, byte[] eFlag, T value,
          CollectionAttributes attributesForCreate, Transcoder tc) {
    return this.getClient().asyncBopInsertBulk(keyList, bkey, eFlag, value,
            attributesForCreate, tc);
  }

  @Override
  public CollectionGetBulkFuture>>
      asyncBopGetBulk(List keyList, byte[] from, byte[] to,
                      ElementFlagFilter eFlagFilter, int offset, int count) {
    return this.getClient().asyncBopGetBulk(keyList, from, to, eFlagFilter,
            offset, count);
  }

  @Override
  public  CollectionGetBulkFuture>> asyncBopGetBulk(
          List keyList, byte[] from, byte[] to,
          ElementFlagFilter eFlagFilter, int offset, int count,
          Transcoder tc) {
    return this.getClient().asyncBopGetBulk(keyList, from, to, eFlagFilter,
            offset, count, tc);
  }

  @Override
  public CollectionGetBulkFuture>> asyncBopGetBulk(
          List keyList, long from, long to,
          ElementFlagFilter eFlagFilter, int offset, int count) {
    return this.getClient().asyncBopGetBulk(keyList, from, to, eFlagFilter,
            offset, count);
  }

  @Override
  public  CollectionGetBulkFuture>> asyncBopGetBulk(
          List keyList, long from, long to,
          ElementFlagFilter eFlagFilter, int offset, int count,
          Transcoder tc) {
    return this.getClient().asyncBopGetBulk(keyList, from, to, eFlagFilter,
            offset, count, tc);
  }

  @Override
  public CollectionFuture asyncBopIncr(String key, long subkey, int by) {
    return this.getClient().asyncBopIncr(key, subkey, by);
  }

  @Override
  public CollectionFuture asyncBopIncr(String key, byte[] subkey, int by) {
    return this.getClient().asyncBopIncr(key, subkey, by);
  }

  @Override
  public CollectionFuture asyncBopIncr(String key, long subkey,
                                             int by, long initial, byte[] eFlag) {
    return this.getClient().asyncBopIncr(key, subkey, by, initial, eFlag);
  }

  @Override
  public CollectionFuture asyncBopIncr(String key, byte[] subkey,
                                             int by, long initial, byte[] eFlag) {
    return this.getClient().asyncBopIncr(key, subkey, by, initial, eFlag);
  }

  @Override
  public CollectionFuture asyncBopDecr(String key, long subkey, int by) {
    return this.getClient().asyncBopDecr(key, subkey, by);
  }

  @Override
  public CollectionFuture asyncBopDecr(String key, byte[] subkey, int by) {
    return this.getClient().asyncBopDecr(key, subkey, by);
  }

  @Override
  public CollectionFuture asyncBopDecr(String key, long subkey,
                                             int by, long initial, byte[] eFlag) {
    return this.getClient().asyncBopDecr(key, subkey, by, initial, eFlag);
  }

  @Override
  public CollectionFuture asyncBopDecr(String key, byte[] subkey,
                                             int by, long initial, byte[] eFlag) {
    return this.getClient().asyncBopDecr(key, subkey, by, initial, eFlag);
  }

  @Override
  public CollectionFuture>> asyncBopGetByPosition(
          String key, BTreeOrder order, int pos) {
    return this.getClient().asyncBopGetByPosition(key, order, pos);
  }

  @Override
  public  CollectionFuture>> asyncBopGetByPosition(
          String key, BTreeOrder order, int pos, Transcoder tc) {
    return this.getClient().asyncBopGetByPosition(key, order, pos, tc);
  }

  @Override
  public CollectionFuture>> asyncBopGetByPosition(
          String key, BTreeOrder order, int from, int to) {
    return this.getClient().asyncBopGetByPosition(key, order, from, to);
  }

  @Override
  public  CollectionFuture>> asyncBopGetByPosition(
          String key, BTreeOrder order, int from, int to, Transcoder tc) {
    return this.getClient().asyncBopGetByPosition(key, order, from, to, tc);
  }

  @Override
  public CollectionFuture asyncBopFindPosition(String key,
                                                        long longBKey, BTreeOrder order) {
    return this.getClient().asyncBopFindPosition(key, longBKey, order);
  }

  @Override
  public CollectionFuture asyncBopFindPosition(String key,
                                                        byte[] byteArrayBKey, BTreeOrder order) {
    return this.getClient().asyncBopFindPosition(key, byteArrayBKey, order);
  }

  @Override
  public CollectionFuture>> asyncBopFindPositionWithGet(
          String key, long longBKey, BTreeOrder order, int count) {
    return this.getClient().asyncBopFindPositionWithGet(key, longBKey, order, count);
  }

  @Override
  public  CollectionFuture>> asyncBopFindPositionWithGet(
          String key, long longBKey, BTreeOrder order, int count, Transcoder tc) {
    return this.getClient().asyncBopFindPositionWithGet(key, longBKey, order, count, tc);
  }

  @Override
  public CollectionFuture>> asyncBopFindPositionWithGet(
          String key, byte[] byteArrayBKey, BTreeOrder order, int count) {
    return this.getClient().asyncBopFindPositionWithGet(key, byteArrayBKey, order, count);
  }

  @Override
  public  CollectionFuture>> asyncBopFindPositionWithGet(
          String key, byte[] byteArrayBKey, BTreeOrder order, int count, Transcoder tc) {
    return this.getClient().asyncBopFindPositionWithGet(key, byteArrayBKey, order, count, tc);
  }

  @Override
  public BTreeStoreAndGetFuture asyncBopInsertAndGetTrimmed(
          String key, long bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate);
  }

  @Override
  public  BTreeStoreAndGetFuture asyncBopInsertAndGetTrimmed(
          String key, long bkey, byte[] eFlag, E value,
          CollectionAttributes attributesForCreate, Transcoder transcoder) {
    return this.getClient().asyncBopInsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate, transcoder);
  }

  @Override
  public BTreeStoreAndGetFuture asyncBopInsertAndGetTrimmed(
          String key, byte[] bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopInsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate);
  }

  @Override
  public  BTreeStoreAndGetFuture asyncBopInsertAndGetTrimmed(
          String key, byte[] bkey, byte[] eFlag, E value,
          CollectionAttributes attributesForCreate, Transcoder transcoder) {
    return this.getClient().asyncBopInsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate, transcoder);
  }

  @Override
  public BTreeStoreAndGetFuture asyncBopUpsertAndGetTrimmed(
          String key, long bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopUpsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate);
  }

  @Override
  public  BTreeStoreAndGetFuture asyncBopUpsertAndGetTrimmed(
          String key, long bkey, byte[] eFlag, E value,
          CollectionAttributes attributesForCreate, Transcoder transcoder) {
    return this.getClient().asyncBopUpsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate, transcoder);
  }

  @Override
  public BTreeStoreAndGetFuture asyncBopUpsertAndGetTrimmed(
          String key, byte[] bkey, byte[] eFlag, Object value,
          CollectionAttributes attributesForCreate) {
    return this.getClient().asyncBopUpsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate);
  }

  @Override
  public  BTreeStoreAndGetFuture asyncBopUpsertAndGetTrimmed(
          String key, byte[] bkey, byte[] eFlag, E value,
          CollectionAttributes attributesForCreate, Transcoder transcoder) {
    return this.getClient().asyncBopUpsertAndGetTrimmed(key, bkey, eFlag,
            value, attributesForCreate, transcoder);
  }

}