Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentSkipListMap


      else if (clazz.isAssignableFrom(SortedMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(NavigableMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(ConcurrentNavigableMap.class))
        return new ConcurrentSkipListMap();
      else
        return null;
    } else {
      Map map = null;
      try {
View Full Code Here


      else if (clazz.isAssignableFrom(SortedMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(NavigableMap.class))
        return new TreeMap();
      else if (clazz.isAssignableFrom(ConcurrentNavigableMap.class))
        return new ConcurrentSkipListMap();
      else
        return null;
    } else {
      Map map = null;
      try {
View Full Code Here

      final NamedCache cache = CacheFactory.getCache("objects");
//      final Map map = cache;
//      final Map map = new ContinuousQueryCache(cache, new ClassFilter(DomainObject.class), true);
//      final Map map = new ConcurrentHashMap();
//      final Map map = new HashMap();
      final Map map = new ConcurrentSkipListMap();
//      final Map map = Collections.synchronizedMap(new HashMap());
      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator();
   
//      cache.addIndex(new ReflectionExtractor("getA0"), false, null);
//      cache.addIndex(new ReflectionExtractor("getAs"), false, null);     
     
//      long objectCount = 1000000;
      long objectCount = 100000;
     
      long rangeStart = 0;
      long rangeFinish = objectCount;
     
      println("Loading " + objectCount + " objects ...");
      for(long i = rangeStart;  i < rangeFinish; i += 100) {
          if (i % 100000 == 0) {
              println("Done " + (i - rangeStart));
          }
          long j = Math.min(rangeFinish, i + 100);
          map.putAll(generator.generate(i, j));
      }     
     
      println("Loaded " + cache.size() + " objects");
      System.gc();
      println("Mem. usage " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());

//      checkAccess(cache, new EqualsFilter("getA0", new DomainObjAttrib("?")));
//      checkAccess(cache, new EqualsFilter("getAs", Collections.EMPTY_LIST));
//      checkAccess(cache, new ContainsAnyFilter("getAs", Collections.singleton(new DomainObjAttrib("?"))));
     
//      ContinuousQueryCache view = new ContinuousQueryCache(cache, new EqualsFilter("getHashSegment", 0));
//      System.out.println("View size " + view.size());
     
//      view.addIndex(new ReflectionExtractor("getA0"), false, null);
//            checkAccess(view, new EqualsFilter("getA0", new DomainObjAttrib("?")));
//            checkAccess(view, new EqualsFilter("getA1", new DomainObjAttrib("?")));
     
      if (map instanceof NearCache) {

          println("Warming up near cache");
          for(long i = rangeFinish-1; i >= rangeStart; --i) {
              map.get(new DomainObjKey(i));
          }
      }
     
      println("Starting access threads");
View Full Code Here

        } else if (WeakHashMap.class == cl) {
            return new WeakHashMap();
        } else if (ConcurrentHashMap.class == cl) {
            result = new ConcurrentHashMap();
        } else if (ConcurrentSkipListMap.class == cl) {
            result = new ConcurrentSkipListMap();
        } else {
            try {
                result = cl.newInstance();
            } catch (Exception e) { /* ignore */ }

View Full Code Here

    public void testCollections() {
        assertEquals(144, deepSizeOf(new ArrayList()));
        assertEquals(216, deepSizeOf(new HashMap()));
        assertEquals(296, deepSizeOf(new LinkedHashMap()));
        assertEquals(176, deepSizeOf(new ReentrantReadWriteLock()));
        assertEquals(192, deepSizeOf(new ConcurrentSkipListMap()));
    }
View Full Code Here

        } else if (WeakHashMap.class == cl) {
            return new WeakHashMap();
        } else if (ConcurrentHashMap.class == cl) {
            result = new ConcurrentHashMap();
        } else if (ConcurrentSkipListMap.class == cl) {
            result = new ConcurrentSkipListMap();
        } else {
            try {
                result = cl.newInstance();
            } catch (Exception e) { /* ignore */ }

View Full Code Here

TOP

Related Classes of java.util.concurrent.ConcurrentSkipListMap

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.