diff --git a/bin/ycsb b/bin/ycsb index 3f32ea9ad8404691c246c387250d0f2be8aeeafa..1f83648617149c9cf774d17df8a795fd5f5406e9 100755 --- a/bin/ycsb +++ b/bin/ycsb @@ -56,7 +56,7 @@ DATABASES = { "elasticsearch": "com.yahoo.ycsb.db.ElasticSearchClient", "gemfire" : "com.yahoo.ycsb.db.GemFireClient", "hbase" : "com.yahoo.ycsb.db.HBaseClient", - "hbase-10" : "com.yahoo.ycsb.db.HBaseClient10", + "hbase1" : "com.yahoo.ycsb.db.HBaseClient10", "hypertable" : "com.yahoo.ycsb.db.HypertableClient", "infinispan-cs": "com.yahoo.ycsb.db.InfinispanRemoteClient", "infinispan" : "com.yahoo.ycsb.db.InfinispanClient", diff --git a/distribution/pom.xml b/distribution/pom.xml index 2dd32d0cdccee8617716807ceeb7aae2aa8d91b0..66675125b792c84202871d05ff27fa3bbebaf4da 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -79,6 +79,11 @@ LICENSE file. <artifactId>hbase-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>hbase1-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>hypertable-binding</artifactId> diff --git a/hbase/README.md b/hbase/README.md index 7316c6206e9bcef5801efaf113a32d15f6cfa912..9bc01c4c0364f270942d38cde78647a859949b94 100644 --- a/hbase/README.md +++ b/hbase/README.md @@ -15,8 +15,9 @@ permissions and limitations under the License. See accompanying LICENSE file. --> -# HBase Driver for YCSB -This driver is a binding for the YCSB facilities to operate against a HBase Server cluster. +# HBase (0.9x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a HBase 0.9x Server cluster. +To run against an HBase >= 1.0 cluster, use the `hbase1` binding. ## Quickstart @@ -68,6 +69,4 @@ bin/ycsb run hbase -P workloads/workloada -cp /HBASE-HOME-DIR/conf -p table=user Following options can be configurable using `-p`. * `columnfamily`: The HBase column family to target. -* `clientbuffering` : If true, buffer mutations on the client. The default is false. -* `writebuffersize` : Buffer size to be used when `clientbuffering` is activated. The default is 12MB. * `debug` : If true, debugging logs are activated. The default is false. diff --git a/hbase/pom.xml b/hbase/pom.xml index a5241798a5573ba8488d554d03c44e6b5a9e6284..1d42f71bf3618d714ca91d827e6e3c20436d6738 100644 --- a/hbase/pom.xml +++ b/hbase/pom.xml @@ -26,7 +26,7 @@ LICENSE file. </parent> <artifactId>hbase-binding</artifactId> - <name>HBase DB Binding</name> + <name>HBase 0.9x DB Binding</name> <dependencies> <dependency> diff --git a/hbase1/README.md b/hbase1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d1b8255057e2222f759129b6e6a10abc1d122053 --- /dev/null +++ b/hbase1/README.md @@ -0,0 +1,74 @@ +<!-- +Copyright (c) 2015 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.x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a HBase 1.x Server cluster. +To run against an HBase 0.9x cluster, use the `hbase` binding. + +## Quickstart + +### 1. Start a HBase Server +You need to start a single node or a cluster to point the client at. Please see [Apache HBase Reference Guide](http://hbase.apache.org/book.html) for more details and instructions. + +### 2. Set up YCSB +You need to clone the repository and compile everything. + +``` +git clone git://github.com/brianfrankcooper/YCSB.git +cd YCSB +mvn clean package +``` + +### 3. Create a HBase table for testing + +For best results, use the pre-splitting strategy recommended in [HBASE-4163](https://issues.apache.org/jira/browse/HBASE-4163): + +``` +hbase(main):001:0> n_splits = 200 # HBase recommends (10 * number of regionservers) +hbase(main):002:0> create 'usertable', 'family', {SPLITS => (1..n_splits).map {|i| "user#{1000+i*(9999-1000)/n_splits}"}} +``` + +*Failing to do so will cause all writes to initially target a single region server*. + +### 4. Run the Workload +Before you can actually run the workload, you need to "load" the data first. + +You should specify a HBase config directory(or any other directory containing your hbase-site.xml) and a table name and a column family(-cp is used to set java classpath and -p is used to set various properties). + +``` +bin/ycsb load hbase10 -P workloads/workloada -cp /HBASE-HOME-DIR/conf -p table=usertable -p columnfamily=family +``` + +Then, you can run the workload: + +``` +bin/ycsb run hbase10 -P workloads/workloada -cp /HBASE-HOME-DIR/conf -p table=usertable -p columnfamily=family +``` + +Please see the general instructions in the `doc` folder if you are not sure how it all works. You can apply additional properties (as seen in the next section) like this: + +``` +bin/ycsb run hbase10 -P workloads/workloada -cp /HBASE-HOME-DIR/conf -p table=usertable -p columnfamily=family -p clientbuffering=true +``` + +## Configuration Options +Following options can be configurable using `-p`. + +* `columnfamily`: The HBase column family to target. +* `clientbuffering` : If true, buffer mutations on the client. The default is false. +* `writebuffersize` : Buffer size to be used when `clientbuffering` is activated. The default is 12MB. +* `debug` : If true, debugging logs are activated. The default is false. diff --git a/hbase1/pom.xml b/hbase1/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..6d5ea1fd2728a75745d8d32f3bc51a975e661457 --- /dev/null +++ b/hbase1/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2012 - 2015 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.4.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>hbase1-binding</artifactId> + <name>HBase 1.0 DB Binding</name> + + <dependencies> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-client</artifactId> + <version>${hbase1.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java b/hbase1/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java similarity index 100% rename from hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java rename to hbase1/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java diff --git a/pom.xml b/pom.xml index ed2b9b3fe989f960242d525dabb8bca7bfbeffcf..9e15425f9bd8d3ef72a96c68add0207aaebe4611 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,8 @@ LICENSE file. <properties> <maven.assembly.version>2.5.5</maven.assembly.version> <maven.dependency.version>2.10</maven.dependency.version> - <hbase.version>1.0.0</hbase.version> + <hbase.version>0.98.13-hadoop2</hbase.version> + <hbase1.version>1.0.0</hbase1.version> <accumulo.version>1.6.0</accumulo.version> <cassandra.version>1.2.9</cassandra.version> <cassandra.cql.version>1.0.3</cassandra.cql.version> @@ -104,6 +105,7 @@ LICENSE file. <module>elasticsearch</module> <module>gemfire</module> <module>hbase</module> + <module>hbase1</module> <module>hypertable</module> <module>infinispan</module> <module>jdbc</module>