Skip to content

Commit

Permalink
[tablestore] Add binding for Alibaba Cloud's TableStore (brianfrankco…
Browse files Browse the repository at this point in the history
  • Loading branch information
HoboChen authored and busbey committed Jun 4, 2019
1 parent 4c07fe4 commit d55ac2b
Show file tree
Hide file tree
Showing 10 changed files with 460 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/bindings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ s3:com.yahoo.ycsb.db.S3Client
solr:com.yahoo.ycsb.db.solr.SolrClient
solr6:com.yahoo.ycsb.db.solr6.SolrClient
tarantool:com.yahoo.ycsb.db.TarantoolClient

tablestore:com.yahoo.ycsb.db.tablestore.TableStoreClient
1 change: 1 addition & 0 deletions bin/ycsb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ DATABASES = {
"solr" : "com.yahoo.ycsb.db.solr.SolrClient",
"solr6" : "com.yahoo.ycsb.db.solr6.SolrClient",
"tarantool" : "com.yahoo.ycsb.db.TarantoolClient",
"tablestore" : "com.yahoo.ycsb.db.tablestore.TableStoreClient"
}

OPTIONS = {
Expand Down
5 changes: 5 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ LICENSE file.
<artifactId>tarantool-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>tablestore-binding</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>com.yahoo.ycsb</groupId>
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ LICENSE file.
<tarantool.version>1.6.5</tarantool.version>
<thrift.version>0.8.0</thrift.version>
<voldemort.version>0.81</voldemort.version>
<tablestore.version>4.8.0</tablestore.version>
</properties>

<modules>
Expand Down Expand Up @@ -163,6 +164,7 @@ LICENSE file.
<module>solr</module>
<module>solr6</module>
<module>tarantool</module>
<module>tablestore</module>
<!--<module>voldemort</module>-->
</modules>

Expand Down
61 changes: 61 additions & 0 deletions tablestore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!--
Copyright (c) 2018 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.
-->

# Alibaba Cloud TableStore Driver for YCSB

This driver provides a YCSB workload for Alibaba's hosted TableStore, a fully managed NoSQL cloud database service that enables storage of a massive amount of structured and semi-structured data.

This binding is based on the Java SDK for TableStore.

## Quick Start

### Setup a TableStore Instance

Login to the Alibaba Cloud Console and follow the [Create Instance](https://www.alibabacloud.com/help/doc-detail/55211.htm?spm=a2c63.p38356.b99.17.6822642crAxqTI).
Make a note of the instance name.

### Create a Table for YCSB Testing

Follow the [Create Table](https://www.alibabacloud.com/help/doc-detail/55212.htm?spm=a2c63.p38356.b99.18.1e4e50b9dXCcmC).

The primary key must be exactly one column; the type is 'String'.
Make a note of the table name and primary key name.

### `tablestore.properties`

tablestore.properties is the file specifying information needed by TableStore binding.
The minimal tablestore.properties should be look like:

```
alibaba.cloud.tablestore.access_id = $access_id
alibaba.cloud.tablestore.access_key = $access_key
# the Instance Access URL in 'instance details'
alibaba.cloud.tablestore.end_point = $end_point
alibaba.cloud.tablestore.instance_name = $instance_name
alibaba.cloud.tablestore.primary_key = $primary_key
```

For access_id and access_key, please refer to [Java SDK: Configure an AccessKey](https://www.alibabacloud.com/help/doc-detail/43009.htm?spm=a2c63.p38356.b99.134.728966fcMpTYD1).

### Load and Run a Workload

```zsh
table_name='table_name'

bin/ycsb load tablestore -P workloads/workloada -P tablestore/conf/tablestore.properties -p table=$table_name -threads 2
bin/ycsb run tablestore -P workloads/workloada -P tablestore/conf/tablestore.properties -p table=$table_name -threads 2
```
33 changes: 33 additions & 0 deletions tablestore/conf/tablestore.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2018 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.

alibaba.cloud.tablestore.access_id =
alibaba.cloud.tablestore.access_key =
alibaba.cloud.tablestore.end_point =
alibaba.cloud.tablestore.instance_name =
alibaba.cloud.tablestore.primary_key =

# alibaba.cloud.tablestore.max_version = 1

# the following parameters provided by Java SDK can be tuned

# max timeout in millisecond for open a http connection, default value in SDK is 15000
# alibaba.cloud.tablestore.connection_timeout =

# max timeout in millisecond for transfering data with a connection, default value in SDK is 15000
# alibaba.cloud.tablestore.socket_timeout =

# max http connections can be open, default value in SDK is 300
# alibaba.cloud.tablestore.max_connections =
34 changes: 34 additions & 0 deletions tablestore/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>binding-parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
<relativePath>../binding-parent</relativePath>
</parent>

<artifactId>tablestore-binding</artifactId>
<name>TableStore DB Binding</name>

<dependencies>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>tablestore</artifactId>
<version>${tablestore.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit d55ac2b

Please sign in to comment.