Skip to content

Commit

Permalink
Split Hazelcast plugin versions (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanfx authored and rvansa committed Jul 29, 2016
1 parent adfcc75 commit a951383
Show file tree
Hide file tree
Showing 21 changed files with 173 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</setup>
</config>
<config name="Hazelcast 3">
<setup plugin="hazelcast3">
<hazelcast xmlns="urn:radargun:plugins:hazelcast3:3.0" file="dist-sync.xml"/>
<setup plugin="hazelcast36">
<hazelcast xmlns="urn:radargun:plugins:hazelcast36:3.0" file="dist-sync.xml"/>
</setup>
</config>
<config name="Infinispan 7.0">
Expand Down
6 changes: 3 additions & 3 deletions extensions/cache/src/main/resources/benchmark-jcache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
cache-name="testCache" />
</setup>
</config>
<config name="JCache (Hazelcast 3.4.x) - local">
<setup plugin="hazelcast3">
<jcache xmlns="urn:radargun:plugins:hazelcast3:3.0"
<config name="JCache (Hazelcast 3.6.x) - local">
<setup plugin="hazelcast36">
<jcache xmlns="urn:radargun:plugins:hazelcast36:3.0"
cache-name="testCache" />
</setup>
</config>
Expand Down
3 changes: 0 additions & 3 deletions plugins/hazelcast3/src/main/resources/plugin.properties

This file was deleted.

6 changes: 3 additions & 3 deletions plugins/hazelcast3/pom.xml → plugins/hazelcast36/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>plugin-hazelcast3</artifactId>
<name>Hazelcast 3.x plugin for RadarGun</name>
<artifactId>plugin-hazelcast36</artifactId>
<name>Hazelcast 3.6.x plugin for RadarGun</name>

<properties>
<version.hazelcast>3.5.3</version.hazelcast>
<version.hazelcast>3.6.4</version.hazelcast>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*
* @author Radim Vansa &lt;rvansa@redhat.com&gt;
*/
public class Hazelcast3Operations extends HazelcastOperations {
public class Hazelcast36Operations extends HazelcastOperations {

public Hazelcast3Operations(Hazelcast3Service service) {
public Hazelcast36Operations(Hazelcast36Service service) {
super(service);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
* @author Maido Kaara
*/
@Service(doc = "Hazelcast")
public class Hazelcast3Service extends HazelcastService {
public class Hazelcast36Service extends HazelcastService {
@Property(doc = "Indices that should be build.", complexConverter = IndexConverter.class)
protected List<Index> indices = Collections.EMPTY_LIST;

@ProvidesTrait
@Override
public Transactional createTransactional() {
return new Hazelcast3Transactional(this);
return new Hazelcast36Transactional(this);
}

@ProvidesTrait
@Override
public HazelcastOperations createOperations() {
return new Hazelcast3Operations(this);
return new Hazelcast36Operations(this);
}

@ProvidesTrait
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
*
* @author Radim Vansa &lt;rvansa@redhat.com&gt;
*/
public class Hazelcast3Transactional implements Transactional {
protected final Hazelcast3Service service;
private static final Log log = LogFactory.getLog(Hazelcast3Transactional.class);
public class Hazelcast36Transactional implements Transactional {
protected final Hazelcast36Service service;
private static final Log log = LogFactory.getLog(Hazelcast36Transactional.class);
private static final boolean trace = log.isTraceEnabled();

public Hazelcast3Transactional(Hazelcast3Service service) {
public Hazelcast36Transactional(Hazelcast36Service service) {
this.service = service;
}

Expand Down Expand Up @@ -47,9 +47,9 @@ public <T> T wrap(T resource) {
if (!started) begin();
if (resource instanceof DistributedObject) {
return (T) transactionContext.getMap(((DistributedObject) resource).getName());
} else if (resource instanceof Hazelcast3Operations.Cache) {
String cacheName = ((Hazelcast3Operations.Cache) resource).map.getName();
return (T) new Hazelcast3Operations.Cache(transactionContext.getMap(cacheName));
} else if (resource instanceof Hazelcast36Operations.Cache) {
String cacheName = ((Hazelcast36Operations.Cache) resource).map.getName();
return (T) new Hazelcast36Operations.Cache(transactionContext.getMap(cacheName));
} else if (resource instanceof HazelcastQuery.Context) {
String cacheName = ((HazelcastQuery.Context) resource).map.getName();
return (T) new HazelcastQuery.Context(transactionContext.getMap(cacheName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*/
public class HazelcastContinuousQuery implements ContinuousQuery {

protected final Hazelcast3Service service;
protected final Hazelcast36Service service;
private String hazelcastCQListenerId;

public HazelcastContinuousQuery(Hazelcast3Service service) {
public HazelcastContinuousQuery(Hazelcast36Service service) {
this.service = service;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
public class HazelcastQueryable implements Queryable {
private static final Log log = LogFactory.getLog(HazelcastQueryable.class);
protected final Hazelcast3Service service;
protected final Hazelcast36Service service;

public HazelcastQueryable(Hazelcast3Service service) {
public HazelcastQueryable(Hazelcast36Service service) {
this.service = service;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.0.xsd"
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.6.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.0.xsd"
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.6.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Expand Down Expand Up @@ -38,4 +38,4 @@
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
</map>

</hazelcast>
</hazelcast>
4 changes: 4 additions & 0 deletions plugins/hazelcast36/src/main/resources/plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
service.default org.radargun.service.Hazelcast36Service
service.hazelcast org.radargun.service.Hazelcast36Service
service.jcache org.radargun.service.JCacheService
classpath ${env.JAVA_HOME}/lib/tools.jar
51 changes: 51 additions & 0 deletions plugins/hazelcast37/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.radargun</groupId>
<artifactId>radargun-plugin-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>plugin-hazelcast37</artifactId>
<name>Hazelcast 3.7.x plugin for RadarGun</name>

<properties>
<version.hazelcast>3.7-EA</version.hazelcast>
</properties>

<dependencies>
<dependency>
<groupId>org.radargun</groupId>
<artifactId>radargun-cache</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.radargun</groupId>
<artifactId>radargun-query</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>${version.hazelcast}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.radargun</groupId>
<artifactId>plugin-hazelcast36</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.radargun</groupId>
<artifactId>plugin-jcache</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

</project>
43 changes: 43 additions & 0 deletions plugins/hazelcast37/src/main/resources/dist-sync-object-format.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<group>
<name>dev</name>
<password>dev-pass</password>
</group>

<network>
<port auto-increment="true">5701</port>
<outbound-ports>
<ports>0</ports>
</outbound-ports>
<join>
<multicast enabled="true">
<multicast-group>224.0.2.128</multicast-group>
<multicast-port>54327</multicast-port>
</multicast>
</join>
</network>

<executor-service>
<core-pool-size>16</core-pool-size>
<max-pool-size>64</max-pool-size>
<keep-alive-seconds>60</keep-alive-seconds>
</executor-service>

<map name="default">
<backup-count>1</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>NONE</eviction-policy>
<max-size policy="PER_PARTITION">0</max-size>
<eviction-percentage>25</eviction-percentage>
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
<in-memory-format>OBJECT</in-memory-format>
</map>

</hazelcast>
41 changes: 41 additions & 0 deletions plugins/hazelcast37/src/main/resources/dist-sync.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<group>
<name>dev</name>
<password>dev-pass</password>
</group>

<network>
<port auto-increment="true">5701</port>
<outbound-ports>
<ports>0</ports>
</outbound-ports>
<join>
<multicast enabled="true">
<multicast-group>224.0.2.128</multicast-group>
<multicast-port>54327</multicast-port>
</multicast>
</join>
</network>

<executor-service>
<pool-size>16</pool-size>
<queue-capacity>0</queue-capacity>
</executor-service>

<map name="default">
<backup-count>1</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>NONE</eviction-policy>
<max-size policy="PER_PARTITION">0</max-size>
<eviction-percentage>25</eviction-percentage>
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
</map>

</hazelcast>
4 changes: 4 additions & 0 deletions plugins/hazelcast37/src/main/resources/plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
service.default org.radargun.service.Hazelcast36Service
service.hazelcast org.radargun.service.Hazelcast36Service
service.jcache org.radargun.service.JCacheService
classpath ${env.JAVA_HOME}/lib/tools.jar
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@
</activation>
<modules>
<module>plugins/hazelcast2</module>
<module>plugins/hazelcast3</module>
<module>plugins/hazelcast36</module>
<module>plugins/hazelcast37</module>
</modules>
<properties>
<plugins.hazelcast>hazelcast2,hazelcast3</plugins.hazelcast>
<plugins.hazelcast>hazelcast2,hazelcast36,hazelcast37</plugins.hazelcast>
</properties>
</profile>
<profile>
Expand Down

0 comments on commit a951383

Please sign in to comment.