diff --git a/binding-parent/datastore-specific-descriptor/pom.xml b/binding-parent/datastore-specific-descriptor/pom.xml index 12e64807fe6fbef9603e336edeefb15693a70fd2..afcb1fcaa57e8477480dd0196968105f1d2f1e1a 100644 --- a/binding-parent/datastore-specific-descriptor/pom.xml +++ b/binding-parent/datastore-specific-descriptor/pom.xml @@ -39,17 +39,6 @@ LICENSE file. <artifactId>core</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.zookeeper</groupId> - <artifactId>zookeeper</artifactId> - <version>3.4.11</version> - </dependency> - <!-- https://mvnrepository.com/artifact/org.json/json --> - <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20160810</version> - </dependency> </dependencies> </project> diff --git a/pom.xml b/pom.xml index e0494121c5a4354d7ee036b64d8f7ec40920fe99..6b847e146a9b57ce414621ff62ee086f93503a30 100644 --- a/pom.xml +++ b/pom.xml @@ -205,6 +205,7 @@ LICENSE file. <module>tablestore</module> <!--<module>voldemort</module>--> <module>voltdb</module> + <module>zookeeper</module> </modules> <build> diff --git a/zookeeper/pom.xml b/zookeeper/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..56b64799f4778c58d0bfe00763ba78d5fad2a427 --- /dev/null +++ b/zookeeper/pom.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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"> + <parent> + <artifactId>root</artifactId> + <groupId>site.ycsb</groupId> + <version>0.18.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>zookeeper</artifactId> + <name>Zookeeper Binding</name> + + <dependencies> + <dependency> + <groupId>site.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.zookeeper</groupId> + <artifactId>zookeeper</artifactId> + <version>3.4.11</version> + </dependency> + <!-- https://mvnrepository.com/artifact/org.json/json --> + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>20160810</version> + </dependency> + </dependencies> + + +</project> \ No newline at end of file diff --git a/binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZKConnection.java b/zookeeper/src/main/java/site/ycsb/db/ZKConnection.java similarity index 86% rename from binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZKConnection.java rename to zookeeper/src/main/java/site/ycsb/db/ZKConnection.java index adf948097d2e654c78ce2160ec495721687118d2..db748a974f41d4d1ac3f69dd71ab7fb7b32f3a46 100644 --- a/binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZKConnection.java +++ b/zookeeper/src/main/java/site/ycsb/db/ZKConnection.java @@ -7,9 +7,12 @@ import org.apache.zookeeper.ZooKeeper; import java.io.IOException; import java.util.concurrent.CountDownLatch; +/** + * Used for connecting to Zookeeper. + */ public class ZKConnection { private ZooKeeper zoo; - CountDownLatch connectionLatch = new CountDownLatch(1); + private CountDownLatch connectionLatch = new CountDownLatch(1); // ... diff --git a/binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZookeeperClient.java b/zookeeper/src/main/java/site/ycsb/db/ZookeeperClient.java similarity index 89% rename from binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZookeeperClient.java rename to zookeeper/src/main/java/site/ycsb/db/ZookeeperClient.java index 4ed020c2290152ef63eef018f5a22e8f7361eff3..dac4aa671db0c8546216934d790112f59ee538e1 100644 --- a/binding-parent/datastore-specific-descriptor/src/main/java/site/ycsb/db/ZookeeperClient.java +++ b/zookeeper/src/main/java/site/ycsb/db/ZookeeperClient.java @@ -10,13 +10,15 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; -import java.util.Properties; import java.util.Set; import org.json.JSONObject; import java.util.Vector; +/** + * A client that can be used by YCSB to work with Zookeeper. + */ public class ZookeeperClient extends DB { private static ZooKeeper zooKeeper; @@ -37,7 +39,8 @@ public class ZookeeperClient extends DB { } @Override - public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + public Status scan(String table, String startkey, + int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { return null; } diff --git a/zookeeper/src/main/java/site/ycsb/db/package-info.java b/zookeeper/src/main/java/site/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..f8d624875d9d47eadf4d9c4b277c0a81ee07beb8 --- /dev/null +++ b/zookeeper/src/main/java/site/ycsb/db/package-info.java @@ -0,0 +1,4 @@ +/** + * Zookeeper integration with YCSB. + */ +package site.ycsb.db;