Package com.tangosol.net

Examples of com.tangosol.net.NamedCache


  @Test
  @SuppressWarnings("unchecked")
  public void putAll() {
   
    // using default coherence-cache-config.xml
    NamedCache cache = CacheFactory.getCache("A");
    cache.clear();

    Map<String, String> data = new HashMap<String, String>();
    for(int i = 0; i != 1000; ++i) {
      data.put(String.valueOf(i), String.valueOf(i));
    }
View Full Code Here


  @Test
  @SuppressWarnings("unchecked")
  public void multiplePutAll() {
   
    // using default coherence-cache-config.xml
    NamedCache cache = CacheFactory.getCache("A");
    cache.clear();
   
    Map<String, String> data = new HashMap<String, String>();
    for(int i = 0; i != 1000; ++i) {
      data.put(String.valueOf(i), String.valueOf(i));
    }
View Full Code Here

  @Test
  public void near_singlePut() {
   
    // using default coherence-cache-config.xml
    NamedCache cache = CacheFactory.getCache("near-A");
    cache.clear();
   
    FlashUpdater fu = new FlashUpdater(cache);
    fu.put("A", "A");
    fu.commit();
   
    Assert.assertEquals("A", cache.get("A"));   
   
  }
View Full Code Here

  @Test
  @SuppressWarnings("unchecked")
  public void near_putAll() {
   
    // using default coherence-cache-config.xml
    NamedCache cache = CacheFactory.getCache("near-A");
    cache.clear();

    Map<String, String> data = new HashMap<String, String>();
    for(int i = 0; i != 1000; ++i) {
      data.put(String.valueOf(i), String.valueOf(i));
    }
View Full Code Here

  @Test
  @SuppressWarnings("unchecked")
  public void near_multiplePutAll() {
   
    // using default coherence-cache-config.xml
    NamedCache cache = CacheFactory.getCache("near-A");
    cache.clear();
   
    Map<String, String> data = new HashMap<String, String>();
    for(int i = 0; i != 1000; ++i) {
      data.put(String.valueOf(i), String.valueOf(i));
    }
View Full Code Here

    }
  }
 
  // for internal use
  NamedCache getVersionedCache(String cacheName) {
    NamedCache cache = CacheFactory.getCache(cacheName);
    if (cache instanceof TxWrappedCache) {
      cache = ((TxWrappedCache)cache).getVersionedCache();
    }
    return cache;
  }
View Full Code Here

        }
      }
    }
   
    for(Map.Entry<String, List<Object>> entry :  updateMap.entrySet()) {
      NamedCache cache = getVersionedCache(entry.getKey());
      cache.invokeAll(entry.getValue(), new RollbackProcessor(activeTx));
      cache.keySet().removeAll(markerMap.get(entry.getKey()));
    }
   
    activeTx = null;
  }
View Full Code Here

        }
      }
    }
   
    for(Map.Entry<String, List<Object>> entry :  updateMap.entrySet()) {
      NamedCache cache = getVersionedCache(entry.getKey());
      cache.invokeAll(entry.getValue(), new RecycleProcessor(minVersion - 1));
      cache.keySet().removeAll(markerMap.get(entry.getKey()));
    }
  }
View Full Code Here

      ss.close();
    }
  }

  private static TxSuperviser createSuperviser(String systemCache) {
    NamedCache cache = CacheFactory.getCache(systemCache);
    TxSuperviser sv = new TxSuperviser(cache);
    // TODO how to manage sweepers;
//    TxSweeper txSweeper = new TxSweeper(sv);
//    txSweeper.start();
    return sv;
View Full Code Here

   public NamedCache getCache(String name) {
      assertStarted();
      if (name == null) {
         name = cacheName;
      }
      NamedCache nc = caches.get(name);
      if (nc == null) {
         nc = CacheFactory.getCache(name);
         if (nc == null) {
            throw new IllegalArgumentException("Cache " + name + " cannot be retrieved.");
         }
         caches.put(name, nc);
         queryable.registerIndices(nc, indexedColumns);
         log.info("Started Coherence cache " + nc.getCacheName());
      }
      return nc;
   }
View Full Code Here

TOP

Related Classes of com.tangosol.net.NamedCache

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.