Package org.infinispan.loaders.modifications

Examples of org.infinispan.loaders.modifications.Remove


               state.put(store.getStoredEntry().getKey(), store);
               stateMapLock.unlock();
               asyncProcessorNeeded = true;
               break;
            case REMOVE:
               Remove remove = (Remove) mod;
               stateMapLock.lock();
               state.put(remove.getKey(), remove);
               stateMapLock.unlock();
               asyncProcessorNeeded = true;
               break;
            case CLEAR:
               performClear();
View Full Code Here


      @Override
      @SuppressWarnings("unchecked")
      public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable {
         Object key = command.getKey();
         if (!skipKey(key)) {
            modifications.add(new Remove(key));
            affectedKeys.add(command.getKey());
         }
         return null;
      }
View Full Code Here

                  break;
               case CLEAR:
                  cacheMap.clear();
                  break;
               case REMOVE:
                  Remove r = (Remove) modification;
                  cacheMap.remove(r.getKey());
                  break;
               case PURGE_EXPIRED:
                  purgeExpired();
                  break;
               default:
View Full Code Here

   public void testOnePhaseCommit() throws CacheLoaderException {
      List<Modification> mods = new ArrayList<Modification>();
      mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
      mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
      mods.add(new Remove("k1"));
      Transaction tx = EasyMock.createNiceMock(Transaction.class);
      prepare(mods, tx, true);

      Set s = loadAll();
View Full Code Here

   public void testTwoPhaseCommit() throws Throwable {
      final List<Throwable> throwables = new ArrayList<Throwable>();
      List<Modification> mods = new ArrayList<Modification>();
      mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
      mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
      mods.add(new Remove("k1"));
      Transaction tx = EasyMock.createNiceMock(Transaction.class);
      prepare(mods, tx, false);


      Thread gets1 = new Thread(
View Full Code Here


      List<Modification> mods = new ArrayList<Modification>();
      mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
      mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
      mods.add(new Remove("k1"));
      mods.add(new Remove("old"));
      Transaction tx = EasyMock.createNiceMock(Transaction.class);
      prepare(mods, tx, false);

      rollback(tx);
View Full Code Here

   @Override
   public void testTwoPhaseCommit() throws CacheLoaderException {
      List<Modification> mods = new ArrayList<Modification>();
      mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
      mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
      mods.add(new Remove("k1"));
      GlobalTransaction tx = new GlobalTransaction(false);
      cs.prepare(mods, tx, false);
      cs.commit(tx);

      assert cs.load("k2").getValue().equals("v2");
View Full Code Here

      cs.store(InternalEntryFactory.create("old", "old"));

      List<Modification> mods = new ArrayList<Modification>();
      mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
      mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
      mods.add(new Remove("k1"));
      mods.add(new Remove("old"));
      GlobalTransaction tx = new GlobalTransaction(false);
      cs.prepare(mods, tx, false);
      cs.rollback(tx);

      assert !cs.containsKey("k1");
View Full Code Here

   }

   @Test
   public void testDoWorkOnRemove() throws Exception {
      CacheStore cs = createMock(CacheStore.class);
      Remove store = createMock(Remove.class);
      expect(store.getType()).andReturn(Modification.Type.REMOVE);
      expect(store.getKey()).andReturn("1");
      expect(cs.remove("1")).andReturn(true);
      replay(cs);
      replay(store);

      ModificationsTransactionWorker worker =
View Full Code Here

   public void testPropagatingOnePhaseCommit() throws Exception {
      List<Modification> list = new LinkedList<Modification>();
      list.add(new Store(InternalEntryFactory.create("k1", "v1")));
      list.add(new Store(InternalEntryFactory.create("k2", "v2", lifespan)));
      list.add(new Store(InternalEntryFactory.create("k3", "v3")));
      list.add(new Remove("k3"));
      list.add(new Clear());
      list.add(new Store(InternalEntryFactory.create("k4", "v4")));
      list.add(new Store(InternalEntryFactory.create("k5", "v5", lifespan)));
      list.add(new Store(InternalEntryFactory.create("k6", "v6")));
      list.add(new Remove("k6"));
      GlobalTransaction t = new GlobalTransaction(false);
      cs.prepare(list, t, true);

      CacheStore[] allStores = new CacheStore[]{cs, store1, store2}; // for iteration
      for (int i = 1; i < 7; i++) {
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.modifications.Remove

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.