Search in sources :

Example 1 with PassivationManagerStub

use of org.infinispan.eviction.impl.PassivationManagerStub in project infinispan by infinispan.

the class DataContainerStressTest method initializeDefaultDataContainer.

private void initializeDefaultDataContainer(DefaultDataContainer dc) {
    InternalEntryFactoryImpl entryFactory = new InternalEntryFactoryImpl();
    TimeService timeService = new EmbeddedTimeService();
    TestingUtil.inject(entryFactory, timeService);
    // Mockito cannot be used as it will run out of memory from keeping all the invocations, thus we use blank impls
    TestingUtil.inject(dc, (EvictionManager) (evicted, cmd) -> CompletableFutures.completedNull(), new PassivationManagerStub(), entryFactory, new ActivationManagerStub(), null, timeService, null, new InternalExpirationManager() {

        @Override
        public void processExpiration() {
        }

        @Override
        public boolean isEnabled() {
            return false;
        }

        @Override
        public CompletableFuture<Boolean> entryExpiredInMemory(InternalCacheEntry entry, long currentTime, boolean writeOperation) {
            return null;
        }

        @Override
        public CompletionStage<Void> handleInStoreExpirationInternal(Object key) {
            return null;
        }

        @Override
        public CompletionStage<Void> handleInStoreExpirationInternal(MarshallableEntry marshalledEntry) {
            return null;
        }

        @Override
        public CompletionStage<Boolean> handlePossibleExpiration(InternalCacheEntry entry, int segment, boolean isWrite) {
            return null;
        }

        @Override
        public void addInternalListener(ExpirationConsumer consumer) {
        }

        @Override
        public void removeInternalListener(Object listener) {
        }
    });
}
Also used : Arrays(java.util.Arrays) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) LogFactory(org.infinispan.util.logging.LogFactory) EvictionManager(org.infinispan.eviction.EvictionManager) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CompletableFuture(java.util.concurrent.CompletableFuture) Metadata(org.infinispan.metadata.Metadata) Test(org.testng.annotations.Test) EvictionType(org.infinispan.eviction.EvictionType) InternalExpirationManager(org.infinispan.expiration.impl.InternalExpirationManager) CompletableFutures(org.infinispan.util.concurrent.CompletableFutures) Map(java.util.Map) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Log(org.infinispan.util.logging.Log) PassivationManagerStub(org.infinispan.eviction.impl.PassivationManagerStub) MarshallableEntry(org.infinispan.persistence.spi.MarshallableEntry) TestingUtil(org.infinispan.test.TestingUtil) ActivationManagerStub(org.infinispan.eviction.impl.ActivationManagerStub) DataContainer(org.infinispan.container.DataContainer) EmbeddedTimeService(org.infinispan.util.EmbeddedTimeService) EmbeddedMetadata(org.infinispan.metadata.EmbeddedMetadata) DefaultDataContainer(org.infinispan.container.impl.DefaultDataContainer) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) CompletionStage(java.util.concurrent.CompletionStage) InternalEntryFactoryImpl(org.infinispan.container.impl.InternalEntryFactoryImpl) TimeService(org.infinispan.commons.time.TimeService) InternalEntryFactoryImpl(org.infinispan.container.impl.InternalEntryFactoryImpl) InternalExpirationManager(org.infinispan.expiration.impl.InternalExpirationManager) EmbeddedTimeService(org.infinispan.util.EmbeddedTimeService) TimeService(org.infinispan.commons.time.TimeService) PassivationManagerStub(org.infinispan.eviction.impl.PassivationManagerStub) CompletableFuture(java.util.concurrent.CompletableFuture) EmbeddedTimeService(org.infinispan.util.EmbeddedTimeService) ActivationManagerStub(org.infinispan.eviction.impl.ActivationManagerStub) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) MarshallableEntry(org.infinispan.persistence.spi.MarshallableEntry) CompletionStage(java.util.concurrent.CompletionStage)

Aggregations

Arrays (java.util.Arrays)1 Map (java.util.Map)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 CompletionStage (java.util.concurrent.CompletionStage)1 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 TimeService (org.infinispan.commons.time.TimeService)1 DataContainer (org.infinispan.container.DataContainer)1 InternalCacheEntry (org.infinispan.container.entries.InternalCacheEntry)1 DefaultDataContainer (org.infinispan.container.impl.DefaultDataContainer)1 InternalEntryFactoryImpl (org.infinispan.container.impl.InternalEntryFactoryImpl)1 EvictionManager (org.infinispan.eviction.EvictionManager)1 EvictionType (org.infinispan.eviction.EvictionType)1 ActivationManagerStub (org.infinispan.eviction.impl.ActivationManagerStub)1 PassivationManagerStub (org.infinispan.eviction.impl.PassivationManagerStub)1 InternalExpirationManager (org.infinispan.expiration.impl.InternalExpirationManager)1 EmbeddedMetadata (org.infinispan.metadata.EmbeddedMetadata)1