From c8ef6b922af4febad58a0199c0f2fcbf1b6a8767 Mon Sep 17 00:00:00 2001
From: Swapnil Bawaskar <sbawaskar@pivotal.io>
Date: Thu, 13 Aug 2015 21:37:35 -0700
Subject: [PATCH] Since GemFire is now incubating as Apache Geode renamed the
 GemFire driver.

---
 bin/ycsb                                      |  2 +-
 distribution/pom.xml                          |  2 +-
 gemfire/src/main/conf/cache.xml               | 25 -----------
 {gemfire => geode}/pom.xml                    | 16 +++----
 .../java/com/yahoo/ycsb/db/GeodeClient.java   | 44 +++++++++----------
 pom.xml                                       |  4 +-
 6 files changed, 34 insertions(+), 59 deletions(-)
 delete mode 100644 gemfire/src/main/conf/cache.xml
 rename {gemfire => geode}/pom.xml (81%)
 rename gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java => geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java (83%)

diff --git a/bin/ycsb b/bin/ycsb
index 3f32ea9a..03c40ee0 100755
--- a/bin/ycsb
+++ b/bin/ycsb
@@ -54,7 +54,7 @@ DATABASES = {
     "couchbase"    : "com.yahoo.ycsb.db.CouchbaseClient",
     "dynamodb"     : "com.yahoo.ycsb.db.DynamoDBClient",
     "elasticsearch": "com.yahoo.ycsb.db.ElasticSearchClient",
-    "gemfire"      : "com.yahoo.ycsb.db.GemFireClient",
+    "geode"        : "com.yahoo.ycsb.db.GeodeClient",
     "hbase"        : "com.yahoo.ycsb.db.HBaseClient",
     "hbase-10"     : "com.yahoo.ycsb.db.HBaseClient10",
     "hypertable"   : "com.yahoo.ycsb.db.HypertableClient",
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 2dd32d0c..893265b6 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -71,7 +71,7 @@ LICENSE file.
     </dependency>
     <dependency>
       <groupId>com.yahoo.ycsb</groupId>
-      <artifactId>gemfire-binding</artifactId>
+      <artifactId>geode-binding</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
diff --git a/gemfire/src/main/conf/cache.xml b/gemfire/src/main/conf/cache.xml
deleted file mode 100644
index 372e1c45..00000000
--- a/gemfire/src/main/conf/cache.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!-- 
-Copyright (c) 2012 YCSB contributors. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License"); you
-may not use this file except in compliance with the License. You
-may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied. See the License for the specific language governing
-permissions and limitations under the License. See accompanying
-LICENSE file.
--->
-
-<!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_5.dtd">
-<cache>
-  <region name="usertable" refid="PARTITION"/>
-</cache>
-
diff --git a/gemfire/pom.xml b/geode/pom.xml
similarity index 81%
rename from gemfire/pom.xml
rename to geode/pom.xml
index 8ce72d75..dd463b15 100644
--- a/gemfire/pom.xml
+++ b/geode/pom.xml
@@ -25,15 +25,15 @@ LICENSE file.
     <relativePath>../binding-parent</relativePath>
   </parent>
   
-  <artifactId>gemfire-binding</artifactId>
-  <name>Gemfire DB Binding</name>
+  <artifactId>geode-binding</artifactId>
+  <name>Geode DB Binding</name>
   <packaging>jar</packaging>
 
   <dependencies>
     <dependency>
-      <groupId>com.gemstone.gemfire</groupId>
-      <artifactId>gemfire</artifactId>
-      <version>${gemfire.version}</version>
+      <groupId>org.apache.geode</groupId>
+      <artifactId>gemfire-core</artifactId>
+      <version>${geode.version}</version>
     </dependency>
     <dependency>
       <groupId>com.yahoo.ycsb</groupId>
@@ -45,8 +45,8 @@ LICENSE file.
   
   <repositories>
     <repository>
-      <id>gemstone</id>
-      <url>http://dist.gemstone.com.s3.amazonaws.com/maven/release</url>
+      <id>apache.snapshots</id>
+      <url>https://repository.apache.org/content/repositories/snapshots</url>
     </repository>
-  </repositories>	
+  </repositories>
 </project>
diff --git a/gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java b/geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java
similarity index 83%
rename from gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java
rename to geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java
index 7e61bbeb..9fb8b63b 100644
--- a/gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java
+++ b/geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java
@@ -42,17 +42,17 @@ import com.yahoo.ycsb.DBException;
 import com.yahoo.ycsb.StringByteIterator;
 
 /**
- * VMware vFabric GemFire client for the YCSB benchmark.<br />
- * <p>By default acts as a GemFire client and tries to connect
- * to GemFire cache server running on localhost with default
- * cache server port. Hostname and port of a GemFire cacheServer
- * can be provided using <code>gemfire.serverport=port</code> and <code>
- * gemfire.serverhost=host</code> properties on YCSB command line.
+ * Apache Geode (incubating) client for the YCSB benchmark.<br /> 
+ * <p>By default acts as a Geode client and tries to connect
+ * to Geode cache server running on localhost with default
+ * cache server port. Hostname and port of a Geode cacheServer
+ * can be provided using <code>geode.serverport=port</code> and <code>
+ * geode.serverhost=host</code> properties on YCSB command line.
  * A locator may also be used for discovering a cacheServer
- * by using the property <code>gemfire.locator=host[port]</code></p>
+ * by using the property <code>geode.locator=host[port]</code></p>
  * 
- * <p>To run this client in a peer-to-peer topology with other GemFire
- * nodes, use the property <code>gemfire.topology=p2p</code>. Running
+ * <p>To run this client in a peer-to-peer topology with other Geode
+ * nodes, use the property <code>geode.topology=p2p</code>. Running
  * in p2p mode will enable embedded caching in this client.</p>
  * 
  * <p>YCSB by default does its operations against "usertable". When running
@@ -64,7 +64,7 @@ import com.yahoo.ycsb.StringByteIterator;
  * @author Swapnil Bawaskar (sbawaska at vmware)
  *
  */
-public class GemFireClient extends DB {
+public class GeodeClient extends DB {
 
   /** Return code when operation succeeded */
   private static final int SUCCESS = 0;
@@ -72,21 +72,21 @@ public class GemFireClient extends DB {
   /** Return code when operation did not succeed */
   private static final int ERROR = -1;
 
-  /** property name of the port where GemFire server is listening for connections */
-  private static final String SERVERPORT_PROPERTY_NAME = "gemfire.serverport";
+  /** property name of the port where Geode server is listening for connections */
+  private static final String SERVERPORT_PROPERTY_NAME = "geode.serverport";
 
-  /** property name of the host where GemFire server is running */
-  private static final String SERVERHOST_PROPERTY_NAME = "gemfire.serverhost";
+  /** property name of the host where Geode server is running */
+  private static final String SERVERHOST_PROPERTY_NAME = "geode.serverhost";
 
   /** default value of {@link #SERVERHOST_PROPERTY_NAME} */
   private static final String SERVERHOST_PROPERTY_DEFAULT = "localhost";
 
-  /** property name to specify a GemFire locator. This property can be used in both
+  /** property name to specify a Geode locator. This property can be used in both
    * client server and p2p topology */
-  private static final String LOCATOR_PROPERTY_NAME = "gemfire.locator";
+  private static final String LOCATOR_PROPERTY_NAME = "geode.locator";
 
-  /** property name to specify GemFire topology */
-  private static final String TOPOLOGY_PROPERTY_NAME = "gemfire.topology";
+  /** property name to specify Geode topology */
+  private static final String TOPOLOGY_PROPERTY_NAME = "geode.topology";
 
   /** value of {@value #TOPOLOGY_PROPERTY_NAME} when peer to peer topology should be used.
    *  (client-server topology is default) */
@@ -96,16 +96,16 @@ public class GemFireClient extends DB {
 
   /**
    * true if ycsb client runs as a client to a
-   * GemFire cache server
+   * Geode cache server
    */
   private boolean isClient;
   
   @Override
   public void init() throws DBException {
     Properties props = getProperties();
-    // hostName where GemFire cacheServer is running
+    // hostName where Geode cacheServer is running
     String serverHost = null;
-    // port of GemFire cacheServer
+    // port of Geode cacheServer
     int serverPort = 0;
     String locatorStr = null;
 
@@ -165,7 +165,7 @@ public class GemFireClient extends DB {
   @Override
   public int scan(String table, String startkey, int recordcount,
       Set<String> fields, Vector<HashMap<String, ByteIterator>> result) {
-    // GemFire does not support scan
+    // Geode does not support scan
     return ERROR;
   }
 
diff --git a/pom.xml b/pom.xml
index ed2b9b3f..ea5ee414 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,7 +73,7 @@ LICENSE file.
     <accumulo.version>1.6.0</accumulo.version>
     <cassandra.version>1.2.9</cassandra.version>
     <cassandra.cql.version>1.0.3</cassandra.cql.version>
-    <gemfire.version>8.1.0</gemfire.version>
+    <geode.version>1.0.0-incubating-SNAPSHOT</geode.version>
     <infinispan.version>7.2.2.Final</infinispan.version>
     <openjpa.jdbc.version>2.1.1</openjpa.jdbc.version>
     <!--<mapkeeper.version>1.0</mapkeeper.version>-->
@@ -102,7 +102,7 @@ LICENSE file.
     <module>distribution</module>
     <module>dynamodb</module>
     <module>elasticsearch</module>
-    <module>gemfire</module>
+    <module>geode</module>
     <module>hbase</module>
     <module>hypertable</module>
     <module>infinispan</module>
-- 
GitLab