Package com.caucho.util

Examples of com.caucho.util.HashKey


      mOut.close();

      byte[] hash = mOut.getDigest();

      HashKey valueHash = new HashKey(hash);

      if (valueHash.equals(oldValueHash)) {
        os.destroy();
        return valueHash;
      }

      int length = os.getLength();
View Full Code Here


        long expireTimeout = rs.getLong(7);
        long idleTimeout = rs.getLong(8);
        long leaseTimeout = rs.getLong(9);
        long localReadTimeout = rs.getLong(10);

        HashKey value = valueHash != null ? new HashKey(valueHash) : null;
        HashKey cacheKey = cacheHash != null ? new HashKey(cacheHash) : null;

        if (keyHash == null)
          continue;

        entryList.add(new CacheData(new HashKey(keyHash),
                                    value,
                                    cacheKey,
                                    flags,
                                    version,
                                    itemUpdateTime,
View Full Code Here

        long leaseTimeout = rs.getLong(8);
        long localReadTimeout = rs.getLong(9);
        long updateTime = rs.getLong(10);
        long accessTime = Alarm.getExactTime();

        HashKey cacheHashKey
          = cacheHash != null ? new HashKey(cacheHash) : null;

        HashKey valueHashKey
          = valueHash != null ? new HashKey(valueHash) : null;

        if (log.isLoggable(Level.FINER))
          log.finer(this + " load " + id + " value=" + valueHashKey + " cache=" + cacheHashKey);

        return new MnodeValue(valueHashKey, null, cacheHashKey,
View Full Code Here

  _digest.update((byte) ch);
  _digest.update((byte) (ch >> 8));
      }

      return new HashKey(_digest.digest());
    }
  }
View Full Code Here

  _digest.update((byte) ch);
  _digest.update((byte) (ch >> 8));
      }

      return new HashKey(_digest.digest());
    }
  }
View Full Code Here

   * Returns the key entry.
   */
  @Override
  public E getCacheEntry(Object key, CacheConfig config)
  {
    HashKey hashKey = createHashKey(key, config);

    E cacheEntry = _entryCache.get(hashKey);

    while (cacheEntry == null) {
      cacheEntry = createCacheEntry(key, hashKey);
View Full Code Here

    Object value = mnodeValue.getValue();

    if (value != null)
      return value;

    HashKey valueHash = mnodeValue.getValueHashKey();

    if (valueHash == null || valueHash == HashManager.NULL)
      return null;

    updateAccessTime(entry, mnodeValue, now);
View Full Code Here

    if (mnodeValue == null)
      return false;

    updateAccessTime(entry, mnodeValue, now);

    HashKey valueHash = mnodeValue.getValueHashKey();

    if (valueHash == null || valueHash == HashManager.NULL)
      return false;

    boolean isData = readData(valueHash, config.getFlags(), os);
View Full Code Here

                       CacheConfig config,
                       long now,
                       MnodeValue mnodeValue)
  {
    long idleTimeout = config.getIdleTimeout() * 5L / 4;
    HashKey key = entry.getKeyHash();

    HashKey oldValueHash = (mnodeValue != null
                            ? mnodeValue.getValueHashKey()
                            : null);
    Object oldValue = mnodeValue != null ? mnodeValue.getValue() : null;
    long version = mnodeValue != null ? mnodeValue.getVersion() : 0;

    HashKey valueHash = writeData(oldValueHash, value,
                                  config.getValueSerializer());

    HashKey cacheKey = config.getCacheKey();

    int leaseOwner = mnodeValue != null ? mnodeValue.getLeaseOwner() : -1;

    mnodeValue = putLocalValue(entry, version + 1,
                               valueHash, value, cacheKey,
View Full Code Here

                                 InputStream is,
                                 CacheConfig config,
                                 long idleTimeout)
    throws IOException
  {
    HashKey key = entry.getKeyHash();
    MnodeValue mnodeValue = loadMnodeValue(entry);

    HashKey oldValueHash = (mnodeValue != null
                            ? mnodeValue.getValueHashKey()
                            : null);
    long version = mnodeValue != null ? mnodeValue.getVersion() : 0;

    HashKey valueHash = writeData(oldValueHash, is);

    if (valueHash != null && valueHash.equals(oldValueHash)) {
      return mnodeValue;
    }

    HashKey cacheHash = config.getCacheKey();

    // add 25% window for update efficiency
    idleTimeout = idleTimeout * 5L / 4;

    int leaseOwner = (mnodeValue != null) ? mnodeValue.getLeaseOwner() : -1;
View Full Code Here

TOP

Related Classes of com.caucho.util.HashKey

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.