-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56c18dc
commit 5eb4a51
Showing
25 changed files
with
220 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cache PUBLIC | ||
"-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN" | ||
"http://www.gemstone.com/dtd/cache8_0.dtd"> | ||
|
||
<cache> | ||
|
||
<pdx read-serialized="true"> | ||
<pdx-serializer> | ||
<class-name>com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer</class-name> | ||
<parameter name="classes"> | ||
<string>io.pivotal.domain.*</string> | ||
</parameter> | ||
</pdx-serializer> | ||
</pdx> | ||
|
||
<region name="Customer"> | ||
<region-attributes refid="REPLICATE" /> | ||
</region> | ||
|
||
</cache> | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /bin/bash | ||
|
||
gfsh << ! | ||
start server --name=server1 --cache-xml-file=config/cache.xml | ||
exit | ||
! | ||
|
||
echo $'\nLoading data...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/DeleteRecords.jar io.pivotal.app.PreLoader | ||
|
||
echo $'\nVerifying data...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/DeleteRecords.jar io.pivotal.app.QueryData | ||
|
||
echo $'\nDeleting Customer 1001...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/DeleteRecords.jar io.pivotal.app.DeleteOne | ||
|
||
echo $'\nVerifying data...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/DeleteRecords.jar io.pivotal.app.QueryData | ||
|
||
read -p $'\nPress any key to stop servers...' | ||
|
||
gfsh << ! | ||
stop server --dir=server1 | ||
exit | ||
! | ||
|
||
rm -rf server1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.pivotal.app; | ||
|
||
import io.pivotal.domain.Customer; | ||
|
||
import com.gemstone.gemfire.cache.Cache; | ||
import com.gemstone.gemfire.cache.CacheFactory; | ||
import com.gemstone.gemfire.cache.Region; | ||
|
||
public class DeleteOne { | ||
public static void main(String[] args) { | ||
// Create cache | ||
Cache cache = new CacheFactory().set("log-level", "error") | ||
.set("cache-xml-file", "config/cache.xml").create(); | ||
|
||
// Get the customer region | ||
Region<Integer, Customer> customers = cache.getRegion("Customer"); | ||
|
||
// Delete some records | ||
customers.remove(1001); | ||
System.out.println("Customer 1001 was deleted"); | ||
|
||
// Close cache | ||
cache.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.pivotal.app; | ||
|
||
import java.util.Collection; | ||
import java.util.Iterator; | ||
|
||
import io.pivotal.domain.Customer; | ||
|
||
import com.gemstone.gemfire.cache.Cache; | ||
import com.gemstone.gemfire.cache.CacheFactory; | ||
import com.gemstone.gemfire.cache.query.Query; | ||
import com.gemstone.gemfire.cache.query.QueryService; | ||
import com.gemstone.gemfire.cache.query.SelectResults; | ||
|
||
public class QueryData { | ||
public static void main(String[] args) throws Exception { | ||
// Create cache | ||
Cache cache = new CacheFactory().set("log-level", "error") | ||
.set("cache-xml-file", "config/cache.xml").create(); | ||
|
||
// Query the Data | ||
QueryService queryService = cache.getQueryService(); | ||
Query query = queryService.newQuery("SELECT * FROM /Customer"); | ||
Object result = query.execute(); | ||
Collection<?> collection = ((SelectResults<?>) result).asList(); | ||
Iterator<?> iter = collection.iterator(); | ||
while (iter.hasNext()) { | ||
Customer cus = (Customer) iter.next(); | ||
System.out.println(cus); | ||
} | ||
|
||
// Close cache | ||
cache.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding/<project>=UTF-8 |
11 changes: 4 additions & 7 deletions
11
FunctionService/src/main/java/io/pivotal/app/SizeFunctionExecution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
package io.pivotal.app; | ||
|
||
|
||
public class SizeFunctionExecution | ||
{ | ||
public static void main( String[] args ) | ||
{ | ||
System.out.println( "Hello World!" ); | ||
} | ||
public class SizeFunctionExecution { | ||
public static void main(String[] args) { | ||
System.out.println("Hello World!"); | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#! /bin/bash | ||
|
||
gfsh << ! | ||
start server --name=server1 --cache-xml-file=config/cache.xml | ||
exit | ||
! | ||
|
||
echo $'\nLoading data...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/Preloader.jar io.pivotal.app.PreLoader | ||
|
||
read -p $'\nPress any key to stop servers...' | ||
|
||
gfsh << ! | ||
stop server --dir=server1 | ||
exit | ||
! | ||
|
||
rm -rf server1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cache PUBLIC | ||
"-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN" | ||
"http://www.gemstone.com/dtd/cache8_0.dtd"> | ||
|
||
<cache> | ||
|
||
<pdx read-serialized="true"> | ||
<pdx-serializer> | ||
<class-name>com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer</class-name> | ||
<parameter name="classes"> | ||
<string>io.pivotal.domain.*</string> | ||
</parameter> | ||
</pdx-serializer> | ||
</pdx> | ||
|
||
<region name="Customer" > | ||
<region-attributes data-policy="partition" > | ||
<partition-attributes redundant-copies="1" total-num-buckets="11"/> | ||
</region-attributes> | ||
</region> | ||
|
||
</cache> | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#! /bin/bash | ||
|
||
gfsh << ! | ||
start server --name=server1 --cache-xml-file=config/cache.xml | ||
exit | ||
! | ||
|
||
echo $'\nLoading data...'; sleep 1; | ||
|
||
java -cp $GEMFIRE/lib/server-dependencies.jar:lib/QueryRegion.jar io.pivotal.app.QueryRegion | ||
|
||
read -p $'\nPress any key to stop servers...' | ||
|
||
gfsh << ! | ||
stop server --dir=server1 | ||
exit | ||
! | ||
|
||
rm -rf server1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cache PUBLIC | ||
"-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN" | ||
"http://www.gemstone.com/dtd/cache8_0.dtd"> | ||
|
||
<cache> | ||
|
||
<pdx read-serialized="true"> | ||
<pdx-serializer> | ||
<class-name>com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer</class-name> | ||
<parameter name="classes"> | ||
<string>io.pivotal.domain.*</string> | ||
</parameter> | ||
</pdx-serializer> | ||
</pdx> | ||
|
||
<region name="Customer" > | ||
<region-attributes data-policy="partition" > | ||
<partition-attributes redundant-copies="1" total-num-buckets="11"/> | ||
</region-attributes> | ||
</region> | ||
|
||
</cache> | ||
|
File renamed without changes.