Package org.apache.hadoop.ipc

Examples of org.apache.hadoop.ipc.RetryCache$CacheEntry


          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("NameNodeRetryCache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here


          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("Namenode Retry Cache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("Namenode Retry Cache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("Namenode Retry Cache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("Namenode Retry Cache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("NameNodeRetryCache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

          DFS_NAMENODE_RETRY_CACHE_EXPIRYTIME_MILLIS_DEFAULT);
      LOG.info("Retry cache will use " + heapPercent
          + " of total heap and retry cache entry expiry time is "
          + entryExpiryMillis + " millis");
      long entryExpiryNanos = entryExpiryMillis * 1000 * 1000;
      return new RetryCache("NameNodeRetryCache", heapPercent,
          entryExpiryNanos);
    }
    return null;
  }
View Full Code Here

*/
public class LeastRecentlyUsedEvictionAlgorithm implements EvictionAlgorithm {

    @SuppressWarnings("unchecked")
    public void evict(CacheImpl cache) {
        CacheEntry lruCacheEntry = null;
        for (Object o : cache.getAll()) {
            CacheEntry cacheEntry = (CacheEntry) o;
            if (lruCacheEntry == null) {
                lruCacheEntry = cacheEntry;
            } else if (lruCacheEntry.getLastAccessed() > cacheEntry.getLastAccessed()) {
                lruCacheEntry = cacheEntry;
            }
        }
        if (lruCacheEntry != null) {
            cache.evict(lruCacheEntry.getKey());
View Full Code Here

*/
public class MostRecentlyUsedEvictionAlgorithm implements EvictionAlgorithm {

    @SuppressWarnings("unchecked")
    public void evict(CacheImpl cache) {
        CacheEntry mruCacheEntry = null;
        for (Object o : cache.getAll()) {
            CacheEntry cacheEntry = (CacheEntry) o;
            if (mruCacheEntry == null) {
                mruCacheEntry = cacheEntry;
            } else if (mruCacheEntry.getLastAccessed() < cacheEntry.getLastAccessed()) {
                mruCacheEntry = cacheEntry;
            }
        }
        if (mruCacheEntry != null) {
            cache.evict(mruCacheEntry.getKey());
View Full Code Here

public class RandomEvictionAlgorithm implements EvictionAlgorithm {
    private static Random random = new Random();

    @SuppressWarnings("unchecked")
    public void evict(CacheImpl cache) {
        CacheEntry lruCacheEntry = null;
        Collection all = cache.getAll();
        int evictionIndex = random.nextInt(all.size());
        int index = 0;

        for (Object anAll : all) {
            CacheEntry cacheEntry = (CacheEntry) anAll;
            if (index == evictionIndex) {
                lruCacheEntry = cacheEntry;
                break;
            }
            index++;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.ipc.RetryCache$CacheEntry

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.