diff --git a/arangodb/README.md b/arangodb/README.md index 001892fd912ac6dcfe8f134272a52c3c91caf109..6a2fdfdeffceaff6ea6c25340b9342135ee96c5b 100644 --- a/arangodb/README.md +++ b/arangodb/README.md @@ -75,6 +75,10 @@ Then, run the workload: See the next section for the list of configuration parameters for ArangoDB. +### 5. Run against ArangoDB 3.0 and previews versions + +Running YCSB on ArangoDB in version 3.0 or previews versions requires to use HTTP as network protocol. Since VST (VelcoyStream) is the default used protocol one have to set the configuration parameter `arangodb.protocol` to `HTTP_JSON`. For more infos take a look into the official [ArangoDB Java Driver Docs](https://github.com/arangodb/arangodb-java-driver/blob/master/docs/Drivers/Java/Reference/README.md#network-protocol). + ## ArangoDB Configuration Parameters - `arangodb.ip` @@ -82,7 +86,10 @@ See the next section for the list of configuration parameters for ArangoDB. - `arangodb.port` - Default value is `8529`. - + +- `arangodb.protocol` + - Default value is 'VST' + - `arangodb.waitForSync` - Default value is `true`. diff --git a/arangodb/pom.xml b/arangodb/pom.xml index c88719feabf88e142c33fb492c813785d3ce76bc..9459f08e722df4716f3b9b5d1f64bbe4cc06b74d 100644 --- a/arangodb/pom.xml +++ b/arangodb/pom.xml @@ -41,6 +41,11 @@ LICENSE file. <artifactId>core</artifactId> <version>${project.version}</version> <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.5.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> diff --git a/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java b/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java deleted file mode 100644 index 838f944a1a1721cd0e23b353fd7c9e4ca2d38ad3..0000000000000000000000000000000000000000 --- a/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java +++ /dev/null @@ -1,466 +0,0 @@ -/** - * 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. - */ -package com.yahoo.ycsb.db; - -import com.arangodb.ArangoConfigure; -import com.arangodb.ArangoDriver; -import com.arangodb.ArangoException; -import com.arangodb.ArangoHost; -import com.arangodb.DocumentCursor; -import com.arangodb.ErrorNums; -import com.arangodb.entity.BaseDocument; -import com.arangodb.entity.DocumentEntity; -import com.arangodb.entity.EntityFactory; -import com.arangodb.entity.TransactionEntity; -import com.arangodb.util.MapBuilder; - -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.Status; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.StringByteIterator; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; -import java.util.concurrent.atomic.AtomicInteger; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ArangoDB binding for YCSB framework using the ArangoDB Inc. <a - * href="https://github.com/arangodb/arangodb-java-driver">driver</a> - * <p> - * See the <code>README.md</code> for configuration information. - * </p> - * - * @see <a href="https://github.com/arangodb/arangodb-java-driver">ArangoDB Inc. - * driver</a> - */ -public class ArangoDBClient extends DB { - - private static Logger logger = LoggerFactory.getLogger(ArangoDBClient.class); - - /** - * The database name to access. - */ - private static String databaseName = "ycsb"; - - /** - * Count the number of times initialized to teardown on the last - * {@link #cleanup()}. - */ - private static final AtomicInteger INIT_COUNT = new AtomicInteger(0); - - /** ArangoDB Driver related, Singleton. */ - private static ArangoDriver arangoDriver; - private static Boolean dropDBBeforeRun; - private static Boolean waitForSync = true; - private static Boolean transactionUpdate = false; - - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - * - * Actually, one client process will share one DB instance here.(Coincide to - * mongoDB driver) - */ - @Override - public void init() throws DBException { - INIT_COUNT.incrementAndGet(); - synchronized (ArangoDBClient.class) { - if (arangoDriver != null) { - return; - } - - Properties props = getProperties(); - - // Set the DB address - String ip = props.getProperty("arangodb.ip", "localhost"); - String portStr = props.getProperty("arangodb.port", "8529"); - int port = Integer.parseInt(portStr); - - // If clear db before run - String dropDBBeforeRunStr = props.getProperty("arangodb.dropDBBeforeRun", "false"); - dropDBBeforeRun = Boolean.parseBoolean(dropDBBeforeRunStr); - - // Set the sync mode - String waitForSyncStr = props.getProperty("arangodb.waitForSync", "false"); - waitForSync = Boolean.parseBoolean(waitForSyncStr); - - // Set if transaction for update - String transactionUpdateStr = props.getProperty("arangodb.transactionUpdate", "false"); - transactionUpdate = Boolean.parseBoolean(transactionUpdateStr); - - // Init ArangoDB connection - try { - ArangoConfigure arangoConfigure = new ArangoConfigure(); - arangoConfigure.setArangoHost(new ArangoHost(ip, port)); - arangoConfigure.init(); - arangoDriver = new ArangoDriver(arangoConfigure); - } catch (Exception e) { - logger.error("Failed to initialize ArangoDB", e); - System.exit(-1); - } - - // Init the database - if (dropDBBeforeRun) { - // Try delete first - try { - arangoDriver.deleteDatabase(databaseName); - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DATABASE_NOT_FOUND) { - logger.error("Failed to delete database: {} with ex: {}", databaseName, e.toString()); - System.exit(-1); - } else { - logger.info("Fail to delete DB, already deleted: {}", databaseName); - } - } - } - try { - arangoDriver.createDatabase(databaseName); - logger.info("Database created: " + databaseName); - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DUPLICATE_NAME) { - logger.error("Failed to create database: {} with ex: {}", databaseName, e.toString()); - System.exit(-1); - } else { - logger.info("DB already exists: {}", databaseName); - } - } - // Always set the default db - arangoDriver.setDefaultDatabase(databaseName); - logger.info("ArangoDB client connection created to {}:{}", ip, port); - - // Log the configuration - logger.info("Arango Configuration: dropDBBeforeRun: {}; address: {}:{}; databaseName: {};" - + " waitForSync: {}; transactionUpdate: {};", - dropDBBeforeRun, ip, port, databaseName, waitForSync, transactionUpdate); - } - } - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - * - * Actually, one client process will share one DB instance here.(Coincide to - * mongoDB driver) - */ - @Override - public void cleanup() throws DBException { - if (INIT_COUNT.decrementAndGet() == 0) { - arangoDriver = null; - logger.info("Local cleaned up."); - } - } - - /** - * Insert a record in the database. Any field/value pairs in the specified - * values HashMap will be written into the record with the specified record - * key. - * - * @param table - * The name of the table - * @param key - * The record key of the record to insert. - * @param values - * A HashMap of field/value pairs to insert in the record - * @return Zero on success, a non-zero error code on error. See the - * {@link DB} class's description for a discussion of error codes. - */ - @Override - public Status insert(String table, String key, Map<String, ByteIterator> values) { - try { - BaseDocument toInsert = new BaseDocument(key); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - toInsert.addAttribute(entry.getKey(), byteIteratorToString(entry.getValue())); - } - arangoDriver.createDocument(table, toInsert, true/*create collection if not exist*/, - waitForSync); - return Status.OK; - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED) { - logger.error("Fail to insert: {} {} with ex {}", table, key, e.toString()); - } else { - logger.debug("Trying to create document with duplicate key: {} {}", table, key); - return Status.BAD_REQUEST; - } - } catch (RuntimeException e) { - logger.error("Exception while trying insert {} {} with ex {}", table, key, e.toString()); - } - return Status.ERROR; - } - - /** - * Read a record from the database. Each field/value pair from the result - * will be stored in a HashMap. - * - * @param table - * The name of the table - * @param key - * The record key of the record to read. - * @param fields - * The list of fields to read, or null for all of them - * @param result - * A HashMap of field/value pairs for the result - * @return Zero on success, a non-zero error code on error or "not found". - */ - @SuppressWarnings("unchecked") - @Override - public Status read(String table, String key, Set<String> fields, Map<String, ByteIterator> result) { - try { - DocumentEntity<BaseDocument> targetDoc = arangoDriver.getDocument(table, key, BaseDocument.class); - BaseDocument aDocument = targetDoc.getEntity(); - if (!this.fillMap(result, aDocument.getProperties(), fields)) { - return Status.ERROR; - } - return Status.OK; - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { - logger.error("Fail to read: {} {} with ex {}", table, key, e.toString()); - } else { - logger.debug("Trying to read document not exist: {} {}", table, key); - return Status.NOT_FOUND; - } - } catch (RuntimeException e) { - logger.error("Exception while trying read {} {} with ex {}", table, key, e.toString()); - } - return Status.ERROR; - } - - /** - * Update a record in the database. Any field/value pairs in the specified - * values HashMap will be written into the record with the specified record - * key, overwriting any existing values with the same field name. - * - * @param table - * The name of the table - * @param key - * The record key of the record to write. - * @param values - * A HashMap of field/value pairs to update in the record - * @return Zero on success, a non-zero error code on error. See this class's - * description for a discussion of error codes. - */ - @Override - public Status update(String table, String key, Map<String, ByteIterator> values) { - try { - - if (!transactionUpdate) { - BaseDocument updateDoc = new BaseDocument(); - for (String field : values.keySet()) { - updateDoc.addAttribute(field, byteIteratorToString(values.get(field))); - } - arangoDriver.updateDocument(table, key, updateDoc); - return Status.OK; - } else { - // id for documentHandle - String transactionAction = "function (id) {" - // use internal database functions - + "var db = require('internal').db;" - // collection.update(document, data, overwrite, keepNull, waitForSync) - + String.format("db._update(id, %s, true, false, %s);}", - mapToJson(values), Boolean.toString(waitForSync).toLowerCase()); - TransactionEntity transaction = arangoDriver.createTransaction(transactionAction); - transaction.addWriteCollection(table); - transaction.setParams(createDocumentHandle(table, key)); - arangoDriver.executeTransaction(transaction); - return Status.OK; - } - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { - logger.error("Fail to update: {} {} with ex {}", table, key, e.toString()); - } else { - logger.debug("Trying to update document not exist: {} {}", table, key); - return Status.NOT_FOUND; - } - } catch (RuntimeException e) { - logger.error("Exception while trying update {} {} with ex {}", table, key, e.toString()); - } - return Status.ERROR; - } - - /** - * Delete a record from the database. - * - * @param table - * The name of the table - * @param key - * The record key of the record to delete. - * @return Zero on success, a non-zero error code on error. See the - * {@link DB} class's description for a discussion of error codes. - */ - @Override - public Status delete(String table, String key) { - try { - arangoDriver.deleteDocument(table, key); - return Status.OK; - } catch (ArangoException e) { - if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { - logger.error("Fail to delete: {} {} with ex {}", table, key, e.toString()); - } else { - logger.debug("Trying to delete document not exist: {} {}", table, key); - return Status.NOT_FOUND; - } - } catch (RuntimeException e) { - logger.error("Exception while trying delete {} {} with ex {}", table, key, e.toString()); - } - return Status.ERROR; - } - - /** - * Perform a range scan for a set of records in the database. Each - * field/value pair from the result will be stored in a HashMap. - * - * @param table - * The name of the table - * @param startkey - * The record key of the first record to read. - * @param recordcount - * The number of records to read - * @param fields - * The list of fields to read, or null for all of them - * @param result - * A Vector of HashMaps, where each HashMap is a set field/value - * pairs for one record - * @return Zero on success, a non-zero error code on error. See the - * {@link DB} class's description for a discussion of error codes. - */ - @Override - public Status scan(String table, String startkey, int recordcount, Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) { - DocumentCursor<BaseDocument> cursor = null; - try { - String aqlQuery = String.format( - "FOR target IN %s FILTER target._key >= @key SORT target._key ASC LIMIT %d RETURN %s ", table, - recordcount, constructReturnForAQL(fields, "target")); - - Map<String, Object> bindVars = new MapBuilder().put("key", startkey).get(); - cursor = arangoDriver.executeDocumentQuery(aqlQuery, bindVars, null, BaseDocument.class); - Iterator<BaseDocument> iterator = cursor.entityIterator(); - while (iterator.hasNext()) { - BaseDocument aDocument = iterator.next(); - HashMap<String, ByteIterator> aMap = new HashMap<String, ByteIterator>(aDocument.getProperties().size()); - if (!this.fillMap(aMap, aDocument.getProperties())) { - return Status.ERROR; - } - result.add(aMap); - } - return Status.OK; - } catch (Exception e) { - logger.error("Exception while trying scan {} {} {} with ex {}", table, startkey, recordcount, e.toString()); - } finally { - if (cursor != null) { - try { - cursor.close(); - } catch (ArangoException e) { - logger.error("Fail to close cursor", e); - } - } - } - return Status.ERROR; - } - - private String createDocumentHandle(String collectionName, String documentKey) throws ArangoException { - validateCollectionName(collectionName); - return collectionName + "/" + documentKey; - } - - private void validateCollectionName(String name) throws ArangoException { - if (name.indexOf('/') != -1) { - throw new ArangoException("does not allow '/' in name."); - } - } - - - private String constructReturnForAQL(Set<String> fields, String targetName) { - // Construct the AQL query string. - String resultDes = targetName; - if (fields != null && fields.size() != 0) { - StringBuilder builder = new StringBuilder("{"); - for (String field : fields) { - builder.append(String.format("\n\"%s\" : %s.%s,", field, targetName, field)); - } - //Replace last ',' to newline. - builder.setCharAt(builder.length() - 1, '\n'); - builder.append("}"); - resultDes = builder.toString(); - } - return resultDes; - } - - private boolean fillMap(Map<String, ByteIterator> resultMap, Map<String, Object> properties) { - return fillMap(resultMap, properties, null); - } - - /** - * Fills the map with the properties from the BaseDocument. - * - * @param resultMap - * The map to fill/ - * @param obj - * The object to copy values from. - * @return isSuccess - */ - @SuppressWarnings("unchecked") - private boolean fillMap(Map<String, ByteIterator> resultMap, Map<String, Object> properties, Set<String> fields) { - if (fields == null || fields.size() == 0) { - for (Map.Entry<String, Object> entry : properties.entrySet()) { - if (entry.getValue() instanceof String) { - resultMap.put(entry.getKey(), - stringToByteIterator((String)(entry.getValue()))); - } else { - logger.error("Error! Not the format expected! Actually is {}", - entry.getValue().getClass().getName()); - return false; - } - } - } else { - for (String field : fields) { - if (properties.get(field) instanceof String) { - resultMap.put(field, stringToByteIterator((String)(properties.get(field)))); - } else { - logger.error("Error! Not the format expected! Actually is {}", - properties.get(field).getClass().getName()); - return false; - } - } - } - return true; - } - - private String byteIteratorToString(ByteIterator byteIter) { - return new String(byteIter.toArray()); - } - - private ByteIterator stringToByteIterator(String content) { - return new StringByteIterator(content); - } - - private String mapToJson(Map<String, ByteIterator> values) { - Map<String, String> intervalRst = new HashMap<String, String>(); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - intervalRst.put(entry.getKey(), byteIteratorToString(entry.getValue())); - } - return EntityFactory.toJsonString(intervalRst); - } - -} diff --git a/arangodb3/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDB3Client.java b/arangodb/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDBClient.java similarity index 97% rename from arangodb3/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDB3Client.java rename to arangodb/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDBClient.java index 1a02624d1dee2937868ca66dc0a05dfd92a7db22..8ccc28042aff56134a90dc80099a5d7097edc5ab 100644 --- a/arangodb3/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDB3Client.java +++ b/arangodb/src/main/java/com/yahoo/ycsb/db/arangodb/ArangoDBClient.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import com.arangodb.ArangoCursor; import com.arangodb.ArangoDB; import com.arangodb.ArangoDBException; +import com.arangodb.Protocol; import com.arangodb.entity.BaseDocument; import com.arangodb.model.DocumentCreateOptions; import com.arangodb.model.TransactionOptions; @@ -55,9 +56,9 @@ import com.yahoo.ycsb.StringByteIterator; * @see <a href="https://github.com/arangodb/arangodb-java-driver">ArangoDB Inc. * driver</a> */ -public class ArangoDB3Client extends DB { +public class ArangoDBClient extends DB { - private static Logger logger = LoggerFactory.getLogger(ArangoDB3Client.class); + private static Logger logger = LoggerFactory.getLogger(ArangoDBClient.class); /** * Count the number of times initialized to teardown on the last @@ -82,7 +83,7 @@ public class ArangoDB3Client extends DB { */ @Override public void init() throws DBException { - synchronized (ArangoDB3Client.class) { + synchronized (ArangoDBClient.class) { Properties props = getProperties(); collectionName = props.getProperty("table", "usertable"); @@ -92,6 +93,10 @@ public class ArangoDB3Client extends DB { String portStr = props.getProperty("arangodb.port", "8529"); int port = Integer.parseInt(portStr); + // Set network protocol + String protocolStr = props.getProperty("arangodb.protocol", "VST"); + Protocol protocol = Protocol.valueOf(protocolStr); + // If clear db before run String dropDBBeforeRunStr = props.getProperty("arangodb.dropDBBeforeRun", "false"); dropDBBeforeRun = Boolean.parseBoolean(dropDBBeforeRunStr); @@ -106,7 +111,7 @@ public class ArangoDB3Client extends DB { // Init ArangoDB connection try { - arangoDB = new ArangoDB.Builder().host(ip).port(port).build(); + arangoDB = new ArangoDB.Builder().host(ip).port(port).useProtocol(protocol).build(); } catch (Exception e) { logger.error("Failed to initialize ArangoDB", e); System.exit(-1); diff --git a/arangodb3/src/main/java/com/yahoo/ycsb/db/arangodb/package-info.java b/arangodb/src/main/java/com/yahoo/ycsb/db/arangodb/package-info.java similarity index 100% rename from arangodb3/src/main/java/com/yahoo/ycsb/db/arangodb/package-info.java rename to arangodb/src/main/java/com/yahoo/ycsb/db/arangodb/package-info.java diff --git a/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java b/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java deleted file mode 100644 index 0f3c7e78773f780f08d8c15c8242296c374bacff..0000000000000000000000000000000000000000 --- a/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - -/** - * The YCSB binding for <a href="https://www.arangodb.com/">ArangoDB</a>. - */ -package com.yahoo.ycsb.db; - diff --git a/arangodb3/.gitignore b/arangodb3/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/arangodb3/README.md b/arangodb3/README.md deleted file mode 100644 index 81d229b2fbae8ec0f8fd2176e67c9e8a9013ce82..0000000000000000000000000000000000000000 --- a/arangodb3/README.md +++ /dev/null @@ -1,93 +0,0 @@ -<!-- -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 ArangoDB. - -### 1. Start ArangoDB -See https://docs.arangodb.com/Installing/index.html - -### 2. Install Java and Maven - -Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html - -and get the url to download the rpm into your server. For example: - - wget http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.rpm?AuthParam=11232426132 -o jdk-7u40-linux-x64.rpm - rpm -Uvh jdk-7u40-linux-x64.rpm - -Or install via yum/apt-get - - sudo yum install java-devel - -Download MVN from http://maven.apache.org/download.cgi - - wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz - sudo tar xzf apache-maven-*-bin.tar.gz -C /usr/local - cd /usr/local - sudo ln -s apache-maven-* maven - sudo vi /etc/profile.d/maven.sh - -Add the following to `maven.sh` - - export M2_HOME=/usr/local/maven - export PATH=${M2_HOME}/bin:${PATH} - -Reload bash and test mvn - - bash - mvn -version - -### 3. Set Up YCSB - -Clone this YCSB source code: - - git clone https://github.com/brianfrankcooper/YCSB.git - -### 4. Run YCSB - -Now you are ready to run! First, drop the existing collection: "usertable" under database "ycsb": - - db._collection("usertable").drop() - -Then, load the data: - - ./bin/ycsb load arangodb3 -s -P workloads/workloada -p arangodb.ip=xxx -p arangodb.port=xxx - -Then, run the workload: - - ./bin/ycsb run arangodb3 -s -P workloads/workloada -p arangodb.ip=xxx -p arangodb.port=xxx - -See the next section for the list of configuration parameters for ArangoDB. - -## ArangoDB Configuration Parameters - -- `arangodb.ip` - - Default value is `localhost` - -- `arangodb.port` - - Default value is `8529`. - -- `arangodb.waitForSync` - - Default value is `true`. - -- `arangodb.transactionUpdate` - - Default value is `false`. - -- `arangodb.dropDBBeforeRun` - - Default value is `false`. diff --git a/arangodb3/conf/logback.xml b/arangodb3/conf/logback.xml deleted file mode 100644 index 2a59f9fd1765033422ef116fbc1e470149828853..0000000000000000000000000000000000000000 --- a/arangodb3/conf/logback.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!-- -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. ---> - -<configuration> - - <appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender"> - <!-- encoders are assigned the type - ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> - <encoder> - <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> - </encoder> - </appender> - - <root level="info"> - <appender-ref ref="STDERR" /> - </root> -</configuration> diff --git a/arangodb3/pom.xml b/arangodb3/pom.xml deleted file mode 100644 index b32bcd7e606e48bdabb021bc9c5a18674adcadd4..0000000000000000000000000000000000000000 --- a/arangodb3/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -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. ---> - -<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.15.0-SNAPSHOT</version> - <relativePath>../binding-parent</relativePath> - </parent> - - <artifactId>arangodb3-binding</artifactId> - <name>ArangoDB3 Binding</name> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>com.arangodb</groupId> - <artifactId>arangodb-java-driver</artifactId> - <version>${arangodb3.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>core</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.13</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.1.3</version> - <type>jar</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.1.3</version> - <type>jar</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/bin/bindings.properties b/bin/bindings.properties index 40758c4ac5fc929f7b2dfdf59a4fccc1f25dd854..0298165ddcef4d4d5bea0977f33dc6c5e7b561c7 100644 --- a/bin/bindings.properties +++ b/bin/bindings.properties @@ -31,8 +31,8 @@ accumulo1.7:com.yahoo.ycsb.db.accumulo.AccumuloClient accumulo1.8:com.yahoo.ycsb.db.accumulo.AccumuloClient aerospike:com.yahoo.ycsb.db.AerospikeClient asynchbase:com.yahoo.ycsb.db.AsyncHBaseClient -arangodb:com.yahoo.ycsb.db.ArangoDBClient -arangodb3:com.yahoo.ycsb.db.arangodb.ArangoDB3Client +arangodb:com.yahoo.ycsb.db.arangodb.ArangoDBClient +arangodb3:com.yahoo.ycsb.db.arangodb.ArangoDBClient azuredocumentdb:com.yahoo.ycsb.db.azuredocumentdb.AzureDocumentDBClient azuretablestorage:com.yahoo.ycsb.db.azuretablestorage.AzureClient basic:com.yahoo.ycsb.BasicDB diff --git a/bin/ycsb b/bin/ycsb index 61573294c27baee44c57d20f108159b6fa791b52..d80bd034893cc54809bec7c821261f012cbbad7e 100755 --- a/bin/ycsb +++ b/bin/ycsb @@ -56,8 +56,8 @@ DATABASES = { "accumulo1.7" : "com.yahoo.ycsb.db.accumulo.AccumuloClient", "accumulo1.8" : "com.yahoo.ycsb.db.accumulo.AccumuloClient", "aerospike" : "com.yahoo.ycsb.db.AerospikeClient", - "arangodb" : "com.yahoo.ycsb.db.ArangoDBClient", - "arangodb3" : "com.yahoo.ycsb.db.arangodb.ArangoDB3Client", + "arangodb" : "com.yahoo.ycsb.db.arangodb.ArangoDBClient", + "arangodb3" : "com.yahoo.ycsb.db.arangodb.ArangoDBClient", "asynchbase" : "com.yahoo.ycsb.db.AsyncHBaseClient", "azuredocumentdb" : "com.yahoo.ycsb.db.azuredocumentdb.AzureDocumentDBClient", "azuretablestorage" : "com.yahoo.ycsb.db.azuretablestorage.AzureClient", @@ -289,6 +289,12 @@ def main(): "is EOM. If you are using HBase 1.2+ try using the 'hbase12' " "client instead.") + if binding == "arangodb3": + warn("The 'arangodb3' client has been deprecated. The binding 'arangodb' " + "now covers every ArangoDB version. This alias will be removed " + "in the next YCSB release.") + binding = "arangodb" + if is_distribution(): db_dir = os.path.join(ycsb_home, binding + "-binding") # include top-level conf for when we're a binding-specific artifact. diff --git a/bin/ycsb.bat b/bin/ycsb.bat index 10ada42c95e1ef3616e7fff2bcb234c686ad3561..92eeaa1a0dcec83f302b0b647a78a327b8d6f8aa 100644 --- a/bin/ycsb.bat +++ b/bin/ycsb.bat @@ -134,6 +134,14 @@ echo [WARN] The 'cassandra2-cql' client has been deprecated. It has been renamed SET BINDING_DIR=cassandra :notAliasCassandra +@REM arangodb3 deprecation message +IF NOT "%BINDING_DIR%" == "arangodb3" GOTO notAliasArangodb3 +echo [WARN] The 'arangodb3' client has been deprecated. The binding 'arangodb' now covers every ArangoDB version. This alias will be removed in the next YCSB release. +SET BINDING_DIR=arangodb +:notAliasArangodb3 + +@REM Build classpath according to source checkout or release distribution +IF EXIST "%YCSB_HOME%\pom.xml" GOTO gotSource @REM Build classpath according to source checkout or release distribution IF EXIST "%YCSB_HOME%\pom.xml" GOTO gotSource diff --git a/bin/ycsb.sh b/bin/ycsb.sh index 9443df6d6b97e53f10eb14f40270c545632e1d61..ca10cf8212b07dbdb0ac69dc42ca7524678d1cd1 100755 --- a/bin/ycsb.sh +++ b/bin/ycsb.sh @@ -158,6 +158,14 @@ YCSB release." BINDING_DIR="cassandra" fi +# arangodb3 deprecation message +if [ "${BINDING_DIR}" = "arangodb3" ] ; then + echo "[WARN] The 'arangodb3' client has been deprecated. The binding 'arangodb' \ +now covers every ArangoDB version. This alias will be removed \ +in the next YCSB release." + BINDING_DIR="arangodb" +fi + # Build classpath # The "if" check after the "for" is because glob may just return the pattern # when no files are found. The "if" makes sure the file is really there. diff --git a/distribution/pom.xml b/distribution/pom.xml index 40a0ffa7452bd2344834013951fdf99de009e7c5..18158db0f696a5c2a31890af22bce352d60ea100 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -64,11 +64,6 @@ LICENSE file. <artifactId>arangodb-binding</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>arangodb3-binding</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>asynchbase-binding</artifactId> diff --git a/pom.xml b/pom.xml index 008964d079fc6d65d33da9aa6677a84ae4f39985..6945a52b93f7ed5464653e20aee909cefea3eaac 100644 --- a/pom.xml +++ b/pom.xml @@ -70,8 +70,7 @@ LICENSE file. <accumulo.1.7.version>1.7.4</accumulo.1.7.version> <accumulo.1.8.version>1.9.1</accumulo.1.8.version> <aerospike.version>3.1.2</aerospike.version> - <arangodb.version>2.7.3</arangodb.version> - <arangodb3.version>4.1.7</arangodb3.version> + <arangodb.version>4.4.1</arangodb.version> <asynchbase.version>1.7.1</asynchbase.version> <azuredocumentdb.version>1.8.1</azuredocumentdb.version> <azurestorage.version>4.0.0</azurestorage.version> @@ -120,7 +119,6 @@ LICENSE file. <module>accumulo1.8</module> <module>aerospike</module> <module>arangodb</module> - <module>arangodb3</module> <module>asynchbase</module> <module>azuredocumentdb</module> <module>azuretablestorage</module>