Search in sources :

Example 1 with DelegatingNonBlockingStore

use of org.infinispan.persistence.support.DelegatingNonBlockingStore in project infinispan by infinispan.

the class TestingUtil method getStore.

@SuppressWarnings({ "unchecked", "unchecked cast" })
public static <T extends NonBlockingStore<K, V>, K, V> T getStore(Cache<K, V> cache, int position, boolean unwrapped) {
    PersistenceManagerImpl persistenceManager = getActualPersistenceManager(cache);
    NonBlockingStore<K, V> nonBlockingStore = persistenceManager.<K, V>getAllStores(characteristics -> !characteristics.contains(NonBlockingStore.Characteristic.WRITE_ONLY)).get(position);
    if (unwrapped && nonBlockingStore instanceof DelegatingNonBlockingStore) {
        nonBlockingStore = ((DelegatingNonBlockingStore<K, V>) nonBlockingStore).delegate();
    }
    return (T) nonBlockingStore;
}
Also used : Arrays(java.util.Arrays) Enumeration(java.util.Enumeration) LogFactory(org.infinispan.util.logging.LogFactory) GlobalConfiguration(org.infinispan.configuration.global.GlobalConfiguration) KnownComponentNames(org.infinispan.factories.KnownComponentNames) DISCARD(org.jgroups.protocols.DISCARD) StreamAwareMarshaller(org.infinispan.commons.marshall.StreamAwareMarshaller) Cache(org.infinispan.Cache) BasicComponentRegistry(org.infinispan.factories.impl.BasicComponentRegistry) Future(java.util.concurrent.Future) AdvancedCache(org.infinispan.AdvancedCache) ModuleLifecycle(org.infinispan.lifecycle.ModuleLifecycle) CacheWriter(org.infinispan.persistence.spi.CacheWriter) Map(java.util.Map) ConsistentHash(org.infinispan.distribution.ch.ConsistentHash) JGroupsTransport(org.infinispan.remoting.transport.jgroups.JGroupsTransport) EmbeddedMetadata(org.infinispan.metadata.EmbeddedMetadata) DummyInMemoryStore(org.infinispan.persistence.dummy.DummyInMemoryStore) GlobalComponentRegistry(org.infinispan.factories.GlobalComponentRegistry) MergeView(org.jgroups.MergeView) MBeanOperationInfo(javax.management.MBeanOperationInfo) Set(java.util.Set) CacheTopology(org.infinispan.topology.CacheTopology) GMS(org.jgroups.protocols.pbcast.GMS) Serializable(java.io.Serializable) LockSupport(java.util.concurrent.locks.LockSupport) MalformedObjectNameException(javax.management.MalformedObjectNameException) ConsistentHashFactory(org.infinispan.distribution.ch.ConsistentHashFactory) ComponentStatus(org.infinispan.lifecycle.ComponentStatus) IntSet(org.infinispan.commons.util.IntSet) CompletionStage(java.util.concurrent.CompletionStage) Stream(java.util.stream.Stream) AdvancedLoadWriteStore(org.infinispan.persistence.spi.AdvancedLoadWriteStore) Flag(org.infinispan.context.Flag) JMException(javax.management.JMException) DelegatingNonBlockingStore(org.infinispan.persistence.support.DelegatingNonBlockingStore) AsyncInterceptorChain(org.infinispan.interceptors.AsyncInterceptorChain) JChannel(org.jgroups.JChannel) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) Proxy(java.lang.reflect.Proxy) PersistenceManager(org.infinispan.persistence.manager.PersistenceManager) ProtobufUtil(org.infinispan.protostream.ProtobufUtil) JGroupsAddress(org.infinispan.remoting.transport.jgroups.JGroupsAddress) NonBlockingStoreAdapter(org.infinispan.persistence.support.NonBlockingStoreAdapter) Callable(java.util.concurrent.Callable) ComponentRegistry(org.infinispan.factories.ComponentRegistry) Supplier(java.util.function.Supplier) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) PersistenceMarshallerImpl(org.infinispan.marshall.persistence.impl.PersistenceMarshallerImpl) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) SerializationContextInitializer(org.infinispan.protostream.SerializationContextInitializer) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) BiConsumer(java.util.function.BiConsumer) MarshallableEntry(org.infinispan.persistence.spi.MarshallableEntry) LinkedHashSet(java.util.LinkedHashSet) Address(org.infinispan.remoting.transport.Address) ProtocolStack(org.jgroups.stack.ProtocolStack) AsyncInterceptor(org.infinispan.interceptors.AsyncInterceptor) Properties(java.util.Properties) CacheEntry(org.infinispan.container.entries.CacheEntry) Executor(java.util.concurrent.Executor) Publisher(org.reactivestreams.Publisher) FileOutputStream(java.io.FileOutputStream) AssertJUnit.assertFalse(org.testng.AssertJUnit.assertFalse) IOException(java.io.IOException) Field(java.lang.reflect.Field) AssertJUnit.fail(org.testng.AssertJUnit.fail) MBeanInfo(javax.management.MBeanInfo) ProtoStreamMarshaller(org.infinispan.commons.marshall.ProtoStreamMarshaller) SerializationContext(org.infinispan.protostream.SerializationContext) DistributionManager(org.infinispan.distribution.DistributionManager) InternalCacheRegistry(org.infinispan.registry.InternalCacheRegistry) ScheduledFuture(java.util.concurrent.ScheduledFuture) IntSets(org.infinispan.commons.util.IntSets) MarshalledEntryUtil(org.infinispan.marshall.persistence.impl.MarshalledEntryUtil) CacheLoader(org.infinispan.persistence.spi.CacheLoader) Random(java.util.Random) StateTransferManagerImpl(org.infinispan.statetransfer.StateTransferManagerImpl) BOTH(org.infinispan.persistence.manager.PersistenceManager.AccessMode.BOTH) StreamingMarshaller(org.infinispan.commons.marshall.StreamingMarshaller) WaitDelegatingNonBlockingStore(org.infinispan.persistence.support.WaitDelegatingNonBlockingStore) LockManager(org.infinispan.util.concurrent.locks.LockManager) SecureCacheImpl(org.infinispan.security.impl.SecureCacheImpl) ComponentRef(org.infinispan.factories.impl.ComponentRef) SingleSegmentPublisher(org.infinispan.persistence.support.SingleSegmentPublisher) CompletableFutures(org.infinispan.util.concurrent.CompletableFutures) CacheContainer(org.infinispan.manager.CacheContainer) Lifecycle(org.infinispan.commons.api.Lifecycle) AbstractDelegatingCache(org.infinispan.cache.impl.AbstractDelegatingCache) DependencyGraph(org.infinispan.util.DependencyGraph) Method(java.lang.reflect.Method) CommandsFactory(org.infinispan.commands.CommandsFactory) Predicate(java.util.function.Predicate) PersistenceManagerImpl(org.infinispan.persistence.manager.PersistenceManagerImpl) Collection(java.util.Collection) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) ObjectName(javax.management.ObjectName) Collectors(java.util.stream.Collectors) ViewId(org.jgroups.ViewId) List(java.util.List) Principal(java.security.Principal) PerCacheInboundInvocationHandler(org.infinispan.remoting.inboundhandler.PerCacheInboundInvocationHandler) Exceptions(org.infinispan.commons.test.Exceptions) SegmentPublisherWrapper(org.infinispan.persistence.support.SegmentPublisherWrapper) Pattern(java.util.regex.Pattern) CacheJmxRegistration(org.infinispan.jmx.CacheJmxRegistration) TimeoutException(org.infinispan.util.concurrent.TimeoutException) AssertJUnit(org.testng.AssertJUnit) MBeanParameterInfo(javax.management.MBeanParameterInfo) DELAY(org.jgroups.protocols.DELAY) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Metadata(org.infinispan.metadata.Metadata) CompletionStages(org.infinispan.util.concurrent.CompletionStages) TestComponentAccessors(org.infinispan.factories.impl.TestComponentAccessors) GlobalMarshaller(org.infinispan.marshall.core.GlobalMarshaller) Function(java.util.function.Function) AbstractDelegatingTransport(org.infinispan.remoting.transport.AbstractDelegatingTransport) HashSet(java.util.HashSet) Version(org.infinispan.commons.util.Version) KeyPartitioner(org.infinispan.distribution.ch.KeyPartitioner) MBeanServer(javax.management.MBeanServer) Log(org.infinispan.util.logging.Log) LinkedList(java.util.LinkedList) TP(org.jgroups.protocols.TP) OutputStream(java.io.OutputStream) CacheException(org.infinispan.commons.CacheException) DataContainer(org.infinispan.container.DataContainer) CacheManagerJmxRegistration(org.infinispan.jmx.CacheManagerJmxRegistration) Transport(org.infinispan.remoting.transport.Transport) Flowable(io.reactivex.rxjava3.core.Flowable) Iterator(java.util.Iterator) InternalDataContainer(org.infinispan.container.impl.InternalDataContainer) NonBlockingStore(org.infinispan.persistence.spi.NonBlockingStore) MutableDigest(org.jgroups.util.MutableDigest) DelegatingPersistenceManager(org.infinispan.persistence.support.DelegatingPersistenceManager) Subject(javax.security.auth.Subject) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) AbstractMap(java.util.AbstractMap) Status(javax.transaction.Status) CacheMode(org.infinispan.configuration.cache.CacheMode) LocalizedCacheTopology(org.infinispan.distribution.LocalizedCacheTopology) Configuration(org.infinispan.configuration.cache.Configuration) TransactionManager(javax.transaction.TransactionManager) Collections(java.util.Collections) TransactionTable(org.infinispan.transaction.impl.TransactionTable) InputStream(java.io.InputStream) View(org.jgroups.View) PersistenceManagerImpl(org.infinispan.persistence.manager.PersistenceManagerImpl) DelegatingNonBlockingStore(org.infinispan.persistence.support.DelegatingNonBlockingStore) WaitDelegatingNonBlockingStore(org.infinispan.persistence.support.WaitDelegatingNonBlockingStore)

Aggregations

Flowable (io.reactivex.rxjava3.core.Flowable)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Serializable (java.io.Serializable)1 Field (java.lang.reflect.Field)1 Method (java.lang.reflect.Method)1 Proxy (java.lang.reflect.Proxy)1 Principal (java.security.Principal)1 AbstractMap (java.util.AbstractMap)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Enumeration (java.util.Enumeration)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 LinkedHashSet (java.util.LinkedHashSet)1