Package com.caucho.util

Examples of com.caucho.util.HashKey


  /**
   * Gets a cache entry
   */
  public MnodeValue loadMnodeValue(DistCacheEntry cacheEntry)
  {
    HashKey key = cacheEntry.getKeyHash();
    MnodeValue mnodeValue = cacheEntry.getMnodeValue();

    long now = Alarm.getCurrentTime();

    if (mnodeValue == null) {
View Full Code Here


  /**
   * Gets a cache entry
   */
  private MnodeValue forceLoadMnodeValue(DistCacheEntry cacheEntry)
  {
    HashKey key = cacheEntry.getKeyHash();
    MnodeValue mnodeValue = cacheEntry.getMnodeValue();

    long now = Alarm.getCurrentTime();

    MnodeValue newMnodeValue = _mnodeStore.load(key);
View Full Code Here

  /**
   * Sets a cache entry
   */
  public boolean remove(E entry, CacheConfig config)
  {
    HashKey key = entry.getKeyHash();

    MnodeValue mnodeValue = loadMnodeValue(entry);
    HashKey oldValueHash = mnodeValue != null ? mnodeValue.getValueHashKey() : null;

    HashKey cacheKey = entry.getCacheHash();

    int flags = mnodeValue != null ? mnodeValue.getFlags() : 0;
    long version = mnodeValue != null ? mnodeValue.getVersion() : 0;

    long expireTimeout = config.getExpireTimeout();
View Full Code Here

  public boolean remove(HashKey key)
  {
    E entry = getCacheEntry(key);
    MnodeValue mnodeValue = entry.getMnodeValue();

    HashKey oldValueHash = mnodeValue != null ? mnodeValue.getValueHashKey() : null;
    HashKey cacheKey = mnodeValue != null ? mnodeValue.getCacheHashKey() : null;

    int flags = mnodeValue != null ? mnodeValue.getFlags() : 0;
    long version = mnodeValue != null ? mnodeValue.getVersion() : 0;

    long expireTimeout = mnodeValue != null ? mnodeValue.getExpireTimeout() : -1;
View Full Code Here

                           long idleTimeout,
                           long leaseTimeout,
                           long localReadTimeout,
                           int leaseOwner)
  {
    HashKey key = entry.getKeyHash();

    MnodeValue oldEntryValue = loadMnodeValue(entry);

    HashKey oldValueHash
      = oldEntryValue != null ? oldEntryValue.getValueHashKey() : null;

    long oldVersion = oldEntryValue != null ? oldEntryValue.getVersion() : 0;
    long now = Alarm.getCurrentTime();
View Full Code Here

      gzOut.finish();
      mOut.close();

      byte[] hash = mOut.getDigest();

      HashKey valueHash = new HashKey(hash);

      if (valueHash.equals(oldValueHash))
        return valueHash;

      int length = os.getLength();

      StreamSource source = new StreamSource(os);
View Full Code Here

      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

      Object []fullKey = new Object[] { config.getGuid(), key };

      config.getKeySerializer().serialize(fullKey, dOut);

      HashKey hashKey = new HashKey(dOut.digest());

      return hashKey;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

      NullDigestOutputStream dOut = new NullDigestOutputStream(digest);

      keySerializer.serialize(key, dOut);

      HashKey hashKey = new HashKey(dOut.digest());

      return hashKey;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
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.