Skip to content

Commit 53bfb98

Browse files
committed
Move the sample to use the final 2.4 release
1 parent d2239bc commit 53bfb98

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.sharrissf.sample</groupId>
55
<artifactId>ehcache-search-sample</artifactId>
6-
<version>0.0.9-SNAPSHOT</version>
6+
<version>1.0.0</version>
77
<name>Ehcache Search Sample</name>
88
<description>Quick samples with the Ehcache Search Nightly
99
</description>
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>net.sf.ehcache</groupId>
4141
<artifactId>ehcache-core</artifactId>
42-
<version>2.4.0-SNAPSHOT</version>
42+
<version>2.4.0</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.slf4j</groupId>
@@ -56,8 +56,8 @@
5656
</dependencies>
5757
<repositories>
5858
<repository>
59-
<id>terracotta-snapshots</id>
60-
<url>http://www.terracotta.org/download/reflector/snapshots</url>
59+
<id>terracotta-releases</id>
60+
<url>http://www.terracotta.org/download/reflector/releases</url>
6161
</repository>
6262
</repositories>
6363

src/assemble/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
java -Xms200m -Xmx200m -cp ".:./target/ehcache-search-sample-0.0.9-SNAPSHOT.jar:./lib/ehcache-core-2.4.0-SNAPSHOT.jar:./lib/slf4j-api-1.6.1.jar:./lib/slf4j-jdk14-1.6.1.jar" org.sharrissf.sample.EhcacheSearchPlaying
1+
java -Xms200m -Xmx200m -cp ".:./target/ehcache-search-sample-1.0.0.jar:./lib/ehcache-core-2.4.0.jar:./lib/slf4j-api-1.6.1.jar:./lib/slf4j-jdk14-1.6.1.jar" org.sharrissf.sample.EhcacheSearchPlaying

src/main/java/org/sharrissf/sample/EhcacheSearchPlaying.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,14 @@ private void initializeCache() {
4040
// Create Cache
4141
Configuration cacheManagerConfig = new Configuration();
4242

43-
// ***To Cluster With Terracotta***
44-
// add the ehcache-terracotta-ee jar to your class path and uncomment
45-
// the
46-
// code in the "To Cluster With Terracotta" sections
47-
//
4843
// TerracottaClientConfiguration tcConfig = new
4944
// TerracottaClientConfiguration()
5045
// .url("localhost:9510");
5146
// cacheManagerConfig.addTerracottaConfig(tcConfig);
5247

53-
// ***To Cluster With Terracotta***
54-
5548
CacheConfiguration cacheConfig = new CacheConfiguration("test", -1)
5649
.eternal(true)
57-
// ***To Cluster With Terracotta***
5850
// .terracotta(new TerracottaConfiguration())
59-
// ***To Cluster With Terracotta***
6051
;
6152
Searchable searchable = new Searchable();
6253
cacheConfig.addSearchable(searchable);
@@ -104,20 +95,18 @@ public void runTests() throws IOException {
10495
Attribute<Gender> gender = cache.getSearchAttribute("gender");
10596
Attribute<String> name = cache.getSearchAttribute("name");
10697
Attribute<String> state = cache.getSearchAttribute("state");
107-
98+
10899
Query query = cache.createQuery();
109100
query.includeKeys();
110101
query.includeValues();
111102
query.addCriteria(name.ilike("Ari*").and(gender.eq(Gender.MALE)))
112103
.addOrderBy(age, Direction.ASCENDING).maxResults(10);
113104

114-
long t = System.currentTimeMillis();
115105
System.out
116106
.println("Searching for all Person's who's name start with Ari and are Male:");
117107

118108
Results results = query.execute();
119-
System.out.println("Took: " + (System.currentTimeMillis() - t)
120-
+ " Size: " + results.size());
109+
System.out.println(" Size: " + results.size());
121110
System.out.println("----Results-----\n");
122111
for (Result result : results.all()) {
123112
System.out.println("Got: Key[" + result.getKey()
@@ -132,12 +121,10 @@ public void runTests() throws IOException {
132121
cache.put(new Element(1, new Person("Ari Eck", 36, Gender.MALE,
133122
"eck street", "San Mateo", "CA")));
134123

135-
t = System.currentTimeMillis();
136124
System.out
137125
.println("Again Searching for all Person's who's name start with Ari and are Male:");
138126
results = query.execute();
139-
System.out.println("Took: " + (System.currentTimeMillis() - t)
140-
+ " Size: " + results.size());
127+
System.out.println(" Size: " + results.size());
141128

142129
read();
143130

0 commit comments

Comments
 (0)