You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2018/08/29 01:15:42 UTC
[geode] branch develop updated: Markdown format improvements.
This is an automated email from the ASF dual-hosted git repository.
jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 1c349b5 Markdown format improvements.
1c349b5 is described below
commit 1c349b50ec74c32f482905ba68609ed2f639067b
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Tue Aug 28 18:15:23 2018 -0700
Markdown format improvements.
---
BUILDING.md | 16 +++++-----
README.md | 99 +++++++++++++++++++++++++++++++++----------------------------
2 files changed, 62 insertions(+), 53 deletions(-)
diff --git a/BUILDING.md b/BUILDING.md
index 308ef8a..1086bdd 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -10,12 +10,13 @@ Set the JAVA\_HOME environment variable. For example:
| OSX | ``export JAVA_HOME=`/usr/libexec/java_home -v 1.8`` |
| Windows | ``set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_121"`` |
-Download the project source from the Releases page at [Apache Geode]
-(http://geode.apache.org/releases/), and unpack the source code.
+Download the project source from the Releases page at
+[Apache Geode](http://geode.apache.org/releases/), and unpack the source code.
Within the directory containing the unpacked source code, run the gradle build:
-
- $ ./gradlew build
+```console
+$ ./gradlew build
+```
Once the build completes, the project files will be installed at
`geode-assembly/build/install/apache-geode`. The distribution archives will be
@@ -23,8 +24,9 @@ created in `geode-assembly/build/distributions/`.
Verify the installation by invoking the `gfsh` shell command to print version
information:
-
- $ ./geode-assembly/build/install/apache-geode/bin/gfsh version
- v1.1.0
+```console
+$ ./geode-assembly/build/install/apache-geode/bin/gfsh version
+v1.1.0
+```
Note: on Windows invoke the `gfsh.bat` script to print the version string.
diff --git a/README.md b/README.md
index b9d94bd..54b9686 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ can load dependencies from [Maven
Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.geode%22).
Maven
-```
+```xml
<dependencies>
<dependency>
<groupId>org.apache.geode</groupId>
@@ -57,7 +57,7 @@ Maven
```
Gradle
-```
+```groovy
dependencies {
compile "org.apache.geode:geode-core:$VERSION"
}
@@ -117,69 +117,76 @@ instructions on how to build the project.
Geode requires installation of JDK version 1.8. After installing Apache Geode,
start a locator and server:
-
- $ gfsh
- gfsh> start locator
- gfsh> start server
+```console
+$ gfsh
+gfsh> start locator
+gfsh> start server
+```
Create a region:
-
- gfsh> create region --name=hello --type=REPLICATE
+```console
+gfsh> create region --name=hello --type=REPLICATE
+```
Write a client application (this example uses a [Gradle](https://gradle.org)
build script):
_build.gradle_
+```groovy
+apply plugin: 'java'
+apply plugin: 'application'
- apply plugin: 'java'
- apply plugin: 'application'
-
- mainClassName = 'HelloWorld'
+mainClassName = 'HelloWorld'
- repositories { mavenCentral() }
- dependencies {
- compile 'org.apache.geode:geode-core:1.4.0'
- runtime 'org.slf4j:slf4j-log4j12:1.7.24'
- }
+repositories { mavenCentral() }
+dependencies {
+ compile 'org.apache.geode:geode-core:1.4.0'
+ runtime 'org.slf4j:slf4j-log4j12:1.7.24'
+}
+```
_src/main/java/HelloWorld.java_
-
- import java.util.Map;
- import org.apache.geode.cache.Region;
- import org.apache.geode.cache.client.*;
-
- public class HelloWorld {
- public static void main(String[] args) throws Exception {
- ClientCache cache = new ClientCacheFactory()
- .addPoolLocator("localhost", 10334)
- .create();
- Region<String, String> region = cache
- .<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
- .create("hello");
-
- region.put("1", "Hello");
- region.put("2", "World");
-
- for (Map.Entry<String, String> entry : region.entrySet()) {
- System.out.format("key = %s, value = %s\n", entry.getKey(), entry.getValue());
- }
- cache.close();
- }
+```java
+import java.util.Map;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.*;
+
+public class HelloWorld {
+ public static void main(String[] args) throws Exception {
+ ClientCache cache = new ClientCacheFactory()
+ .addPoolLocator("localhost", 10334)
+ .create();
+ Region<String, String> region = cache
+ .<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
+ .create("hello");
+
+ region.put("1", "Hello");
+ region.put("2", "World");
+
+ for (Map.Entry<String, String> entry : region.entrySet()) {
+ System.out.format("key = %s, value = %s\n", entry.getKey(), entry.getValue());
}
+ cache.close();
+ }
+}
+```
Build and run the `HelloWorld` example:
-
- $ gradle run
+```console
+$ gradle run
+```
The application will connect to the running cluster, create a local cache, put
some data in the cache, and print the cached data to the console:
-
- key = 1, value = Hello
- key = 2, value = World
+```console
+key = 1, value = Hello
+key = 2, value = World
+```
Finally, shutdown the Geode server and locator:
-
- $ gfsh> shutdown --include-locators=true
+```console
+gfsh> shutdown --include-locators=true
+```
For more information see the [Geode
Examples](https://github.com/apache/geode-examples) repository or the