Package sample

Examples of sample.SimpleDomainObjGenerator


    long rangeFinish;
   
        @Override
        public void run() {
            final NamedCache cache = CacheFactory.getCache(cacheName);
            final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator();
           
            println("Loading " + (rangeFinish - rangeStart) + " objects ...");
            for(long i = rangeStart;  i < rangeFinish; i += 100) {
                if (i % 100000 == 0) {
                    println("Done " + (i - rangeStart));
                }
                long j = Math.min(rangeFinish, i + 100);
                cache.putAll(generator.generate(i, j));
            }          
           
        }
View Full Code Here


      System.setProperty("benchmark-default-scheme", "partitioned-false-external-distributed-scheme");
//      System.setProperty("benchmark-default-scheme", "simple-replicated-scheme");
     
    try {
      final NamedCache cache = CacheFactory.getCache("objects");
      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator();
   
//      cache.addIndex(new ReflectionExtractor("getA0"), false, null);
//      cache.addIndex(new ReflectionExtractor("getAs"), false, null);     
     
//      System.out.println(CacheFactory.getClusterConfig().toString());
     
      long objectCount = 1000000;
//      long objectCount = 100000;
     
      long rangeStart = 1000000;
      long rangeFinish = 1000000 + 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);
          cache.putAll(generator.generate(i, j));
      }     
     
      println("Loaded " + cache.size() + " objects");
      System.gc();
      println("Mem. usage " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());
View Full Code Here

//      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());
View Full Code Here

      System.setProperty("tangosol.coherence.distributed.localstorage", "false");
     
     
    try {
      final NamedCache cache = CacheFactory.getCache("t-objects");
      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator();
//      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator(100);
//      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator(400);
   
//      cache.addIndex(new ReflectionExtractor("getA0"), false, null);
//      cache.addIndex(new ReflectionExtractor("getAs"), false, null);     
     
//      System.out.println(CacheFactory.getClusterConfig().toString());
           
     
//      long objectCount = 1000000;
      long objectCount = 100000;
//      long objectCount = 200000;
//      long objectCount = 10000;
     
      long rangeStart = 1000000;
      long rangeFinish = 1000000 + objectCount;
     
      println("Loading " + objectCount + " objects ...");
      loadObjects(cache, generator, rangeStart, rangeFinish);     
     
      println("Loaded " + cache.size() + " objects");
      println("Key binary size: " + ExternalizableHelper.toBinary(generator.generate(1, 2).keySet().iterator().next()).length());
      println("Value binary size: " + ExternalizableHelper.toBinary(generator.generate(1, 2).values().iterator().next()).length());
      System.gc();
      println("Mem. usage " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());

//      checkAccess(cache, new EqualsFilter("getA0", new DomainObjAttrib("?")));
//      checkAccess(cache, new EqualsFilter(new ReflectionPofExtractor("a0"), new DomainObjAttrib("?")));
View Full Code Here

      System.setProperty("tangosol.coherence.distributed.localstorage", "false");
     
     
    try {
      final NamedCache cache = CacheFactory.getCache("t-objects");
      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator();
//      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator(100);
//      final ObjectGenerator<?, ?> generator = new SimpleDomainObjGenerator(400);
   
//      cache.addIndex(new ReflectionExtractor("getA0"), false, null);
//      cache.addIndex(new ReflectionExtractor("getAs"), false, null);     
     
//      System.out.println(CacheFactory.getClusterConfig().toString());
           
     
//      long objectCount = 1000000;
      long objectCount = 100000;
//      long objectCount = 200000;
//      long objectCount = 10000;
     
      long rangeStart = 1000000;
      long rangeFinish = 1000000 + objectCount;
     
      println("Cache size: " + cache.size());
      println("Loading " + objectCount + " objects ...");
      loadObjects(cache, generator, rangeStart, rangeFinish);     
     
      println("Loaded " + cache.size() + " objects");
      println("Key binary size: " + ExternalizableHelper.toBinary(generator.generate(1, 2).keySet().iterator().next()).length());
      println("Value binary size: " + ExternalizableHelper.toBinary(generator.generate(1, 2).values().iterator().next()).length());
      System.gc();
      println("Mem. usage " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage());

//      checkAccess(cache, new EqualsFilter("getA0", new DomainObjAttrib("?")));
//      checkAccess(cache, new EqualsFilter(new ReflectionPofExtractor("a0"), new DomainObjAttrib("?")));
View Full Code Here

TOP

Related Classes of sample.SimpleDomainObjGenerator

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.