Package com.cetsoft.imcache.cache.offheap.bytebuffer

Examples of com.cetsoft.imcache.cache.offheap.bytebuffer.OffHeapByteBufferStore


   * The main method.
   *
   * @param args the arguments
   */
  public static void main(String[] args) {
    OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(10000, 10);
    final Cache<String, VersionedItem<String>> cache = CacheBuilder.versionedOffHeapCache().storage(bufferStore)
        .build();
    ExecutorService service = Executors.newFixedThreadPool(3);
    for (int i = 0; i < 100000; i++) {
      service.execute(new Runnable() {
View Full Code Here


   * @param args the arguments
   */
  @SuppressWarnings("null")
  public static void main(String[] args) {
    final CacheDao cacheDao = null;// This is just for example purposes.
    OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(10000, 10);
    final Cache<String, String> offHeapCache = CacheBuilder.offHeapCache().storage(bufferStore)
        .cacheLoader(new CacheLoader<String, String>() {
          public String load(String key) {
            return cacheDao.load(key);
          }
View Full Code Here

    final AtomicLong totalTimeForOffHeap = new AtomicLong();
    final AtomicLong totalTimeForMap = new AtomicLong();
    final int NO_OF_ITERATIONS = 1000000;
    final CountDownLatch offHeapLatch = new CountDownLatch(NO_OF_THREADS);
    final CountDownLatch mapLatch = new CountDownLatch(NO_OF_THREADS);
    OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(100000, 10);
    final Cache<Integer,SimpleObject> offHeapCache = CacheBuilder.offHeapCache().storage(bufferStore).build();
    for (int i = 0; i < NO_OF_THREADS; i++) {
      new Thread(new Runnable() {
        public void run() {
          long start = System.currentTimeMillis();
View Full Code Here

   *
   * @param args the arguments
   * @throws InterruptedException the interrupted exception
   */
  public static void main(String[] args) throws InterruptedException {
    OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(500, 2);
    final Cache<Integer,Long> offHeapCache = CacheBuilder.offHeapCache().bufferCleanerPeriod(10).
    bufferCleanerThreshold(0.01f).storage(bufferStore).build();
    offHeapCache.put(0, 0L);
    offHeapCache.put(1, 1L);
    offHeapCache.put(2, 2L);
View Full Code Here

TOP

Related Classes of com.cetsoft.imcache.cache.offheap.bytebuffer.OffHeapByteBufferStore

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.