Package com.googlecode.concurrentlinkedhashmap.caches

Examples of com.googlecode.concurrentlinkedhashmap.caches.CacheBuilder


  }

  @Override
  @SuppressWarnings("rawtypes")
  public void init(Map parameters) throws Exception {
    map = new CacheBuilder()
        .concurrencyLevel(concurrencyLevel)
        .initialCapacity(initialCapacity)
        .maximumCapacity(maximumCapacity)
        .makeCache(cache);
  }
View Full Code Here


    Set<Policy> seen = EnumSet.noneOf(Policy.class);
    for (Cache cache : Cache.values()) {
      if (!seen.add(cache.policy())) {
        continue;
      }
      Map<String, String> map = new CacheBuilder()
          .maximumCapacity(capacity)
          .makeCache(cache);
      System.out.println(cache.policy().toString() + ":");
      for (List<String> workingSet : workingSets) {
        System.out.println(determineEfficiency(map, workingSet));
View Full Code Here

    assertThat(evictionList, is(equalTo(asList(expect))));
  }

  @Test
  public void evict_efficiency() {
    Map<String, String> expected = new CacheBuilder()
        .maximumCapacity(capacity())
        .makeCache(Cache.LinkedHashMap_Lru_Sync);
    Map<String, String> actual = new Builder<String, String>()
        .maximumWeightedCapacity(capacity())
        .build();
View Full Code Here

    case 2: return null; // new CliffWrapHerlihy(); // was a non-blocking HashSet implementation from Maurice Herlihy
    case 3: return new ConcurrentHashMap<String,String>(_table_size,0.75f16); // force to   16 striping
    case 4: return new ConcurrentHashMap<String,String>(_table_size,0.75f, 256); // force to  256 striping
    case 5: return new ConcurrentHashMap<String,String>(_table_size,0.75f,4096); // force to 4096 striping
    case 6: return new NonBlockingHashMap<String,String>();
    case 7: return new CacheBuilder().maximumCapacity(Integer.MAX_VALUE).makeCache(Cache.LinkedHashMap_Lru_Sync);
    case 8:
      return new ConcurrentLinkedHashMap.Builder<String, String>()
          .concurrencyLevel(16) // force to 16 striping
          .initialCapacity(_table_size)
          .maximumWeightedCapacity(Integer.MAX_VALUE)
View Full Code Here

  private ConcurrentMap<Integer, Integer> map;
  private int index;

  @Override
  protected void setUp() {
    map = new CacheBuilder()
        .maximumCapacity(Integer.MAX_VALUE)
        .makeCache(cache);
    for (int i = 0; i < ints.size(); i++) {
      map.put(ints.get(i), DUMMY);
    }
View Full Code Here

TOP

Related Classes of com.googlecode.concurrentlinkedhashmap.caches.CacheBuilder

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.