2 Replies Latest reply on Feb 14, 2014 2:26 PM by gabfssilva

    Creating a new Cache Store

    gabfssilva

      Hello everyone!

       

      I'm trying to implement my own cache store on Infinispan 6, but I'm having some issues.

      The principal is: when set low max-entries on eviction. the Infinispan doesn't replicate to new nodes at start up. It seems that it replicates only what it has in memory, not what it has in the store.

       

      I supposed that i needed to implement the process method:

       

      public void process(KeyFilter<K> filter, final CacheLoaderTask<K, V> task, Executor executor, final boolean fetchValue, final boolean fetchMetadata) {
        final TaskContextImpl taskContext = new TaskContextImpl();
        synchronized (cache) {
        for (K k : cache.keySet()) {
        if (filter == null || filter.shouldLoadKey(k)) {
        if (taskContext.isStopped()) {
        break;
        }
      
      
        try {
        final MarshalledEntry<K, V> marshalledEntry = load(k);
        if (marshalledEntry != null) {
        task.processEntry(marshalledEntry, taskContext);
        }
        } catch (Exception e) {
        e.printStackTrace();
        } finally {
        taskContext.stop();
        }
        }
        }
        }
        }
      
      

       

      But, still not working.


      Does anyone know what could be happen?


      Thanks!