Package net.spy.memcached

Examples of net.spy.memcached.HashAlgorithm


    throws JSONException {
    final JSONObject vBucketServerMap =
      source.getJSONObject("vBucketServerMap");

    final String algorithm = vBucketServerMap.getString("hashAlgorithm");
    HashAlgorithm hashAlgorithm =
      HashAlgorithmRegistry.lookupHashAlgorithm(algorithm);
    if (hashAlgorithm == null) {
      throw new IllegalArgumentException("Unhandled hash algorithm type: "
          + algorithm);
    }
View Full Code Here


    throws JSONException {
    final JSONObject vBucketServerMap =
      source.getJSONObject("vBucketServerMap");

    final String algorithm = vBucketServerMap.getString("hashAlgorithm");
    HashAlgorithm hashAlgorithm =
      HashAlgorithmRegistry.lookupHashAlgorithm(algorithm);
    if (hashAlgorithm == null) {
      throw new IllegalArgumentException("Unhandled hash algorithm type: "
          + algorithm);
    }
View Full Code Here

  /* ep is for ep-engine, a.k.a. couchbase */
  private Config parseEpJSON(JSONObject jsonObject) throws JSONException {
    JSONObject vbMap = jsonObject.getJSONObject("vBucketServerMap");
    String algorithm = vbMap.getString("hashAlgorithm");
    HashAlgorithm hashAlgorithm =
        HashAlgorithmRegistry.lookupHashAlgorithm(algorithm);
    if (hashAlgorithm == null) {
      throw new IllegalArgumentException("Unhandled hash algorithm type: "
          + algorithm);
    }
View Full Code Here

                    + jsonObject, e);
        }
    }

    private HashAlgorithm lookupHashAlgorithm(String algorithm) {
        HashAlgorithm ha = HashAlgorithm.NATIVE_HASH;
        if ("crc".equalsIgnoreCase(algorithm)) {
            ha = HashAlgorithm.CRC32_HASH;
        } else if ("fnv1_32".equalsIgnoreCase(algorithm)) {
            ha = HashAlgorithm.FNV1_32_HASH;
        } else if ("fnv1_64".equalsIgnoreCase(algorithm)) {
View Full Code Here

    }

  /* ep is for ep-engine, a.k.a. membase */
    private Config parseEpJSON(JSONObject jsonObject) throws JSONException {

        HashAlgorithm hashAlgorithm = lookupHashAlgorithm(jsonObject.getString("hashAlgorithm"));
        int replicasCount = jsonObject.getInt("numReplicas");
        if (replicasCount > VBucket.MAX_REPLICAS) {
            throw new ConfigParsingException("Expected number <= "
                    + VBucket.MAX_REPLICAS + " for replicas.");
        }
View Full Code Here

    throws JSONException {
    final JSONObject vBucketServerMap =
      source.getJSONObject("vBucketServerMap");

    final String algorithm = vBucketServerMap.getString("hashAlgorithm");
    HashAlgorithm hashAlgorithm =
      HashAlgorithmRegistry.lookupHashAlgorithm(algorithm);
    if (hashAlgorithm == null) {
      throw new IllegalArgumentException("Unhandled hash algorithm type: "
          + algorithm);
    }
View Full Code Here

    throws JSONException {
    final JSONObject vBucketServerMap =
      source.getJSONObject("vBucketServerMap");

    final String algorithm = vBucketServerMap.getString("hashAlgorithm");
    HashAlgorithm hashAlgorithm =
      HashAlgorithmRegistry.lookupHashAlgorithm(algorithm);
    if (hashAlgorithm == null) {
      throw new IllegalArgumentException("Unhandled hash algorithm type: "
          + algorithm);
    }
View Full Code Here

TOP

Related Classes of net.spy.memcached.HashAlgorithm

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.