-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PostgreNoSQL] Added NoSQL support for PostgreSQL. (#1242)
- Loading branch information
Showing
12 changed files
with
955 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
Copyright (c) 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. | ||
--> | ||
|
||
## Quick Start | ||
This section describes how to run YCSB on PostgreSQL and use it as a document store. | ||
|
||
## Download and Install Postgres Server Version | ||
You can find an instruction here: https://www.postgresql.org/download/. | ||
Otherwise download the official docker container from https://hub.docker.com/_/postgres/ and follow the instructions. | ||
Do not forget to expose the postgresql server port when running the container. | ||
The YCSB PostgreNoSQL is tested on PostgreSQL Server 9.5 and 9.6. | ||
|
||
In the next step grant access rights for the default postgres user to access the Postgres Server. | ||
In case you run the YCSB client and the Postgres Server on different machines make sure that the server is reachable. | ||
Then create a database, e.g., test and create a table that is able to store the documents. | ||
|
||
The following commands can be used for that: | ||
|
||
**CREATE DATABASE test;** | ||
|
||
**CREATE TABLE usertable (YCSB_KEY VARCHAR(255) PRIMARY KEY not NULL, YCSB_VALUE JSONB not NULL);** | ||
|
||
**GRANT ALL PRIVILEGES ON DATABASE test to postgres;** | ||
|
||
## Configure the parameters in the properties file | ||
**postgrenosql.url = jdbc:postgresql://localhost:5432/test** | ||
|
||
Defines the connection string to the Postgres Server. Replace localhost by the address of your Postgres Server, 5432 by the port your Server is listing to and test by the name of your database. | ||
|
||
**postgrenosql.user = postgres** | ||
|
||
Defines the username the client uses to connect to the Postgres Server. | ||
|
||
**postgrenosql.passwd = postgres** | ||
|
||
Defines the password of user the client uses to connect to the Postgres Server. | ||
|
||
**postgrenosql.autocommit = true** | ||
|
||
Defines whether transactions shoud by applied directly. | ||
|
||
Here are some basic commands to start the benchmark from the root directory: | ||
|
||
The following command loads the workload and uses the configuration defined in the properties file: | ||
.\bin\ycsb load postgrenosql -P .\workloads\workloada -P .\postgrenosql\conf\postgrenosql.properties | ||
|
||
The following command runs the workload and uses the configuration defined in the properties file: | ||
.\bin\ycsb run postgrenosql -P .\workloads\workloada -P .\postgrenosql\conf\postgrenosql.properties | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
postgrenosql.url = jdbc:postgresql://localhost:5432/test | ||
postgrenosql.user = postgres | ||
postgrenosql.passwd = postgres | ||
postgrenosql.autocommit = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!-- | ||
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/xsd/maven-4.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>postgrenosql-binding</artifactId> | ||
<name>PostgreNoSQL Binding</name> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.yahoo.ycsb</groupId> | ||
<artifactId>core</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>9.4.1212.jre7</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.googlecode.json-simple</groupId> | ||
<artifactId>json-simple</artifactId> | ||
<version>1.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>1.7.13</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Oops, something went wrong.