Skip to content

Commit

Permalink
WFLY-4601 Upgrade Infinispan to 7.2.1.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
pferraro committed May 7, 2015
1 parent d3d729d commit 7243294
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 12 deletions.
Expand Up @@ -22,12 +22,23 @@


package org.jboss.as.clustering.infinispan; package org.jboss.as.clustering.infinispan;


import static org.infinispan.factories.KnownComponentNames.ASYNC_TRANSPORT_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.GLOBAL_MARSHALLER;

import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.concurrent.ExecutorService;


import org.infinispan.commons.marshall.StreamingMarshaller;
import org.infinispan.factories.GlobalComponentRegistry;
import org.infinispan.factories.annotations.ComponentName;
import org.infinispan.factories.annotations.Inject;
import org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifier;
import org.infinispan.remoting.inboundhandler.InboundInvocationHandler;
import org.infinispan.remoting.responses.CacheNotFoundResponse; import org.infinispan.remoting.responses.CacheNotFoundResponse;
import org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher; import org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher;
import org.infinispan.remoting.transport.jgroups.JGroupsTransport; import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
import org.infinispan.remoting.transport.jgroups.MarshallerAdapter; import org.infinispan.remoting.transport.jgroups.MarshallerAdapter;
import org.infinispan.util.TimeService;
import org.jgroups.Channel; import org.jgroups.Channel;
import org.wildfly.clustering.jgroups.spi.ChannelFactory; import org.wildfly.clustering.jgroups.spi.ChannelFactory;


Expand All @@ -38,15 +49,26 @@
public class ChannelTransport extends JGroupsTransport { public class ChannelTransport extends JGroupsTransport {


final ChannelFactory factory; final ChannelFactory factory;
private TimeService timeService;


public ChannelTransport(Channel channel, ChannelFactory factory) { public ChannelTransport(Channel channel, ChannelFactory factory) {
super(channel); super(channel);
this.factory = factory; this.factory = factory;
} }


@Override
@Inject
public void initialize(@ComponentName(GLOBAL_MARSHALLER) StreamingMarshaller marshaller,
@ComponentName(ASYNC_TRANSPORT_EXECUTOR) ExecutorService asyncExecutor,
CacheManagerNotifier notifier, GlobalComponentRegistry gcr,
TimeService timeService, InboundInvocationHandler globalHandler) {
super.initialize(marshaller, asyncExecutor, notifier, gcr, timeService, globalHandler);
this.timeService = timeService;
}

@Override @Override
protected void initRPCDispatcher() { protected void initRPCDispatcher() {
this.dispatcher = new CommandAwareRpcDispatcher(this.channel, this, this.asyncExecutor, this.gcr, this.globalHandler); this.dispatcher = new CommandAwareRpcDispatcher(this.channel, this, this.asyncExecutor, this.timeService, this.globalHandler);
MarshallerAdapter adapter = new MarshallerAdapter(this.marshaller) { MarshallerAdapter adapter = new MarshallerAdapter(this.marshaller) {
@Override @Override
public Object objectFromBuffer(byte[] buffer, int offset, int length) throws Exception { public Object objectFromBuffer(byte[] buffer, int offset, int length) throws Exception {
Expand Down
Expand Up @@ -34,7 +34,7 @@
* Executor factory that produces {@link ManagedExecutorService} instances. * Executor factory that produces {@link ManagedExecutorService} instances.
* @author Paul Ferraro * @author Paul Ferraro
*/ */
public class ManagedExecutorFactory implements ExecutorFactory, ThreadPoolExecutorFactory { public class ManagedExecutorFactory implements ExecutorFactory, ThreadPoolExecutorFactory<ExecutorService> {


private final Executor executor; private final Executor executor;


Expand All @@ -47,7 +47,6 @@ public ExecutorService getExecutor(Properties p) {
return this.createExecutor(); return this.createExecutor();
} }


@SuppressWarnings("unchecked")
@Override @Override
public ExecutorService createExecutor(ThreadFactory factory) { public ExecutorService createExecutor(ThreadFactory factory) {
return this.createExecutor(); return this.createExecutor();
Expand Down
Expand Up @@ -33,7 +33,7 @@
* Executor factory that produces {@link ManagedScheduledExecutorService} instances. * Executor factory that produces {@link ManagedScheduledExecutorService} instances.
* @author Paul Ferraro * @author Paul Ferraro
*/ */
public class ManagedScheduledExecutorFactory implements ScheduledExecutorFactory, ThreadPoolExecutorFactory { public class ManagedScheduledExecutorFactory implements ScheduledExecutorFactory, ThreadPoolExecutorFactory<ScheduledExecutorService> {


private final ScheduledExecutorService executor; private final ScheduledExecutorService executor;


Expand All @@ -46,7 +46,6 @@ public ScheduledExecutorService getScheduledExecutor(Properties p) {
return this.createExecutor(); return this.createExecutor();
} }


@SuppressWarnings("unchecked")
@Override @Override
public ScheduledExecutorService createExecutor(ThreadFactory factory) { public ScheduledExecutorService createExecutor(ThreadFactory factory) {
return this.createExecutor(); return this.createExecutor();
Expand Down
Expand Up @@ -260,7 +260,7 @@ void processModelNode(OperationContext context, String containerName, ModelNode
builder.eviction().strategy(strategy); builder.eviction().strategy(strategy);


if (strategy.isEnabled()) { if (strategy.isEnabled()) {
final int maxEntries = EvictionResourceDefinition.MAX_ENTRIES.resolveModelAttribute(context, eviction).asInt(); final long maxEntries = EvictionResourceDefinition.MAX_ENTRIES.resolveModelAttribute(context, eviction).asLong();
builder.eviction().maxEntries(maxEntries); builder.eviction().maxEntries(maxEntries);
} }
} }
Expand Down
Expand Up @@ -156,7 +156,7 @@ public GlobalConfiguration getValue() {
} }
ScheduledExecutorService evictionExecutor = (this.evictionExecutor != null) ? this.evictionExecutor.getValue() : null; ScheduledExecutorService evictionExecutor = (this.evictionExecutor != null) ? this.evictionExecutor.getValue() : null;
if (evictionExecutor != null) { if (evictionExecutor != null) {
builder.evictionThreadPool().threadPoolFactory(new ManagedScheduledExecutorFactory(evictionExecutor)); builder.expirationThreadPool().threadPoolFactory(new ManagedScheduledExecutorFactory(evictionExecutor));
} }
ScheduledExecutorService replicationQueueExecutor = (this.replicationQueueExecutor != null) ? this.replicationQueueExecutor.getValue() : null; ScheduledExecutorService replicationQueueExecutor = (this.replicationQueueExecutor != null) ? this.replicationQueueExecutor.getValue() : null;
if (replicationQueueExecutor != null) { if (replicationQueueExecutor != null) {
Expand Down
Expand Up @@ -70,7 +70,7 @@ public ModelNode execute(Cache<?, ?> cache) {
@Override @Override
public ModelNode execute(Cache<?, ?> cache) { public ModelNode execute(Cache<?, ?> cache) {
CacheMgmtInterceptor interceptor = findInterceptor(cache, CacheMgmtInterceptor.class); CacheMgmtInterceptor interceptor = findInterceptor(cache, CacheMgmtInterceptor.class);
return new ModelNode((interceptor != null) ? interceptor.getElapsedTime() : 0); return new ModelNode((interceptor != null) ? interceptor.getTimeSinceStart() : 0);
} }
}, },
HIT_RATIO(MetricKeys.HIT_RATIO, ModelType.DOUBLE) { HIT_RATIO(MetricKeys.HIT_RATIO, ModelType.DOUBLE) {
Expand Down
Expand Up @@ -59,11 +59,11 @@ public class EvictionResourceDefinition extends SimpleResourceDefinition {
.setDefaultValue(new ModelNode().set(EvictionStrategy.NONE.name())) .setDefaultValue(new ModelNode().set(EvictionStrategy.NONE.name()))
.build(); .build();


static final SimpleAttributeDefinition MAX_ENTRIES = new SimpleAttributeDefinitionBuilder(ModelKeys.MAX_ENTRIES, ModelType.INT, true) static final SimpleAttributeDefinition MAX_ENTRIES = new SimpleAttributeDefinitionBuilder(ModelKeys.MAX_ENTRIES, ModelType.LONG, true)
.setXmlName(Attribute.MAX_ENTRIES.getLocalName()) .setXmlName(Attribute.MAX_ENTRIES.getLocalName())
.setAllowExpression(true) .setAllowExpression(true)
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES) .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setDefaultValue(new ModelNode().set(-1)) .setDefaultValue(new ModelNode(-1L))
.build(); .build();


static final AttributeDefinition[] ATTRIBUTES = new AttributeDefinition[] { STRATEGY, MAX_ENTRIES }; static final AttributeDefinition[] ATTRIBUTES = new AttributeDefinition[] { STRATEGY, MAX_ENTRIES };
Expand Down
4 changes: 4 additions & 0 deletions feature-pack/pom.xml
Expand Up @@ -1869,6 +1869,10 @@
<groupId>org.infinispan</groupId> <groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId> <artifactId>infinispan-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-directory-provider</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.infinispan</groupId> <groupId>org.infinispan</groupId>
<artifactId>infinispan-lucene-directory</artifactId> <artifactId>infinispan-lucene-directory</artifactId>
Expand Down
Expand Up @@ -29,6 +29,7 @@


<resources> <resources>
<artifact name="${org.infinispan:infinispan-lucene-directory}"/> <artifact name="${org.infinispan:infinispan-lucene-directory}"/>
<artifact name="${org.infinispan:infinispan-directory-provider}"/>
</resources> </resources>


<dependencies> <dependencies>
Expand Down
15 changes: 13 additions & 2 deletions pom.xml
Expand Up @@ -141,9 +141,9 @@
<version.org.hibernate.validator>5.1.3.Final</version.org.hibernate.validator> <version.org.hibernate.validator>5.1.3.Final</version.org.hibernate.validator>
<version.org.hibernate.javax.persistence.hibernate-jpa-2.1-api>1.0.0.Final</version.org.hibernate.javax.persistence.hibernate-jpa-2.1-api> <version.org.hibernate.javax.persistence.hibernate-jpa-2.1-api>1.0.0.Final</version.org.hibernate.javax.persistence.hibernate-jpa-2.1-api>
<version.org.hibernate.hql>1.1.0.Final</version.org.hibernate.hql> <version.org.hibernate.hql>1.1.0.Final</version.org.hibernate.hql>
<version.org.hibernate.search>5.1.2.Final</version.org.hibernate.search> <version.org.hibernate.search>5.2.0.Final</version.org.hibernate.search>
<version.org.hornetq>2.4.7.Final</version.org.hornetq> <version.org.hornetq>2.4.7.Final</version.org.hornetq>
<version.org.infinispan>7.1.1.Final</version.org.infinispan> <version.org.infinispan>7.2.1.Final</version.org.infinispan>
<version.org.jasypt>1.9.1</version.org.jasypt> <version.org.jasypt>1.9.1</version.org.jasypt>
<version.org.javassist>3.18.1-GA</version.org.javassist> <version.org.javassist>3.18.1-GA</version.org.javassist>
<version.org.jberet>1.1.0.Final</version.org.jberet> <version.org.jberet>1.1.0.Final</version.org.jberet>
Expand Down Expand Up @@ -4290,6 +4290,17 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-directory-provider</artifactId>
<version>${version.org.infinispan}</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.infinispan</groupId> <groupId>org.infinispan</groupId>
<artifactId>infinispan-lucene-directory</artifactId> <artifactId>infinispan-lucene-directory</artifactId>
Expand Down

0 comments on commit 7243294

Please sign in to comment.