Package com.kylin.infinispan.helloworld.cacheManager

Source Code of com.kylin.infinispan.helloworld.cacheManager.CachePressTest

package com.kylin.infinispan.helloworld.cacheManager;

import java.util.Properties;

import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;

import com.kylin.infinispan.common.User;

public class CachePressTest {

  public static void main(String[] args) throws InterruptedException {

    Properties props = new Properties();
    props.put("infinispan.client.hotrod.server_list", "127.0.0.1:11222");
    RemoteCacheManager cacheManager = new RemoteCacheManager(props);
    RemoteCache<Object, Object> cache = cacheManager.getCache();
   
    for(int i = 0 ; i < 1000000 ; i ++) {
      cache.put("key---" + i, new User(i, "Kylin Soong", "SoftWare Engineer"));
    }
   
    System.out.println(cache.size());
   
    Thread.sleep(Long.MAX_VALUE);
  }

}
TOP

Related Classes of com.kylin.infinispan.helloworld.cacheManager.CachePressTest

TOP
Copyright © 2018 www.massapi.com. 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.