Skip to content

Commit

Permalink
Merge pull request #1113 from busbey/hbase-client-updates
Browse files Browse the repository at this point in the history
[hbase098, hbase10, hbase14, hbase20] HBase client updates
  • Loading branch information
busbey authored Mar 23, 2018
2 parents 2218649 + 326c244 commit 2a7a77f
Show file tree
Hide file tree
Showing 20 changed files with 928 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/bindings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ googledatastore:com.yahoo.ycsb.db.GoogleDatastoreClient
hbase098:com.yahoo.ycsb.db.HBaseClient
hbase10:com.yahoo.ycsb.db.HBaseClient10
hbase12:com.yahoo.ycsb.db.hbase12.HBaseClient12
hbase14:com.yahoo.ycsb.db.hbase14.HBaseClient14
hbase20:com.yahoo.ycsb.db.hbase14.HBaseClient20
hypertable:com.yahoo.ycsb.db.HypertableClient
infinispan-cs:com.yahoo.ycsb.db.InfinispanRemoteClient
infinispan:com.yahoo.ycsb.db.InfinispanClient
Expand Down
12 changes: 12 additions & 0 deletions bin/ycsb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ DATABASES = {
"hbase098" : "com.yahoo.ycsb.db.HBaseClient",
"hbase10" : "com.yahoo.ycsb.db.HBaseClient10",
"hbase12" : "com.yahoo.ycsb.db.hbase12.HBaseClient12",
"hbase14" : "com.yahoo.ycsb.db.hbase14.HBaseClient14",
"hbase20" : "com.yahoo.ycsb.db.hbase20.HBaseClient20",
"hypertable" : "com.yahoo.ycsb.db.HypertableClient",
"infinispan-cs": "com.yahoo.ycsb.db.InfinispanRemoteClient",
"infinispan" : "com.yahoo.ycsb.db.InfinispanClient",
Expand Down Expand Up @@ -267,6 +269,16 @@ def main():
warn("The 'couchbase' client has been deprecated. If you are using "
"Couchbase 4.0+ try using the 'couchbase2' client instead.")

if binding == "hbase098":
warn("The 'hbase098' client has been deprecated because HBase 0.98 "
"is EOM. If you are using HBase 1.2+ try using the 'hbase12' "
"client instead.")

if binding == "hbase10":
warn("The 'hbase10' client has been deprecated because HBase 1.0 "
"is EOM. If you are using HBase 1.2+ try using the 'hbase12' "
"client instead.")

if is_distribution():
db_dir = os.path.join(ycsb_home, binding + "-binding")
# include top-level conf for when we're a binding-specific artifact.
Expand Down
10 changes: 10 additions & 0 deletions bin/ycsb.bat
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ IF NOT "%BINDING_DIR%" == "couchbase" GOTO notOldCouchbase
echo [WARN] The 'couchbase' client is deprecated. If you are using Couchbase 4.0+ try using the 'couchbase2' client instead.
:notOldCouchbase

@REM HBase 0.98 deprecation message
IF NOT "%BINDING_DIR%" == "hbase098" GOTO not098HBase
echo [WARN] The 'hbase098' client is deprecated because HBase 0.98 is EOM. If you are using HBase 1.2+ try using the 'hbase12' client instead.
:not098HBase

@REM HBase 1.0 deprecation message
IF NOT "%BINDING_DIR%" == "hbase10" GOTO not10HBase
echo [WARN] The 'hbase10' client is deprecated because HBase 1.0 is EOM. If you are using HBase 1.2+ try using the 'hbase12' client instead.
:not10HBase

@REM Get the rest of the arguments, skipping the first 2
FOR /F "tokens=2*" %%G IN ("%*") DO (
SET YCSB_ARGS=%%H
Expand Down
14 changes: 14 additions & 0 deletions bin/ycsb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,20 @@ if [ "${BINDING_DIR}" = "couchbase" ] ; then
Couchbase 4.0+ try using the 'couchbase2' client instead."
fi
# HBase 0.98 deprecation message
if [ "${BINDING_DIR}" = "hbase098" ] ; then
echo "[WARN] The 'hbase098' client is deprecated because HBase 0.98 \
is EOM. If you are using HBase 1.2+ try using the 'hbase12' client \
instead."
fi
# HBase 1.0 deprecation message
if [ "${BINDING_DIR}" = "hbase10" ] ; then
echo "[WARN] The 'hbase10' client is deprecated because HBase 1.0 \
is EOM. If you are using HBase 1.2+ try using the 'hbase12' client \
instead."
fi
# For Cygwin, switch paths to Windows format before running java
if $CYGWIN; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
Expand Down
10 changes: 10 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ LICENSE file.
<artifactId>hbase12-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>hbase14-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>hbase20-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>hypertable-binding</artifactId>
Expand Down
27 changes: 27 additions & 0 deletions hbase14/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Copyright (c) 2015-2017 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.
-->

# HBase (1.4+) Driver for YCSB
This driver is a binding for the YCSB facilities to operate against a HBase 1.4+ Server cluster, using a shaded client that tries to avoid leaking third party libraries.

See `hbase098/README.md` for a quickstart to setup HBase for load testing and common configuration details.

## Configuration Options
In addition to those options available for the `hbase098` binding, the following options are available for the `hbase14` binding:

* `durability`: Whether or not writes should be appended to the WAL. Bypassing the WAL can improve throughput but data cannot be recovered in the event of a crash. The default is true.

85 changes: 85 additions & 0 deletions hbase14/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012 - 2016 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.
-->

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>binding-parent</artifactId>
<version>0.14.0-SNAPSHOT</version>
<relativePath>../binding-parent/</relativePath>
</parent>

<artifactId>hbase14-binding</artifactId>
<name>HBase 1.4 DB Binding</name>

<properties>
<!-- Tests do not run on jdk9 -->
<skipJDK9Tests>true</skipJDK9Tests>
<!-- Tests can't run without a shaded hbase testing util.
See HBASE-15666, which blocks us.
For now, we rely on the HBase 1.0 binding and manual testing.
-->
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>hbase10-binding</artifactId>
<version>${project.version}</version>
<!-- Should match all compile scoped dependencies -->
<exclusions>
<exclusion>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-shaded-client</artifactId>
<version>${hbase14.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- blocked on HBASE-15666
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-testing-util</artifactId>
<version>${hbase14.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
-->
</dependencies>
</project>
28 changes: 28 additions & 0 deletions hbase14/src/main/java/com/yahoo/ycsb/db/hbase14/HBaseClient14.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.
*/

package com.yahoo.ycsb.db.hbase14;

/**
* HBase 1.4 client for YCSB framework.
*
* A modified version of HBaseClient (which targets HBase v1.4) utilizing the
* shaded client.
*
* It should run equivalent to following the hbase098 binding README.
*
*/
public class HBaseClient14 extends com.yahoo.ycsb.db.HBaseClient10 {
}
23 changes: 23 additions & 0 deletions hbase14/src/main/java/com/yahoo/ycsb/db/hbase14/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2014, Yahoo!, Inc. 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.
*/

/**
* The YCSB binding for <a href="https://hbase.apache.org/">HBase</a>
* using the HBase 1.4+ shaded API.
*/
package com.yahoo.ycsb.db.hbase14;

Loading

0 comments on commit 2a7a77f

Please sign in to comment.