diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..8e478f8c079f2f2b48bdc809c2b1497502337461 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# For more info, see: http://EditorConfig.org +root = true + +[*.java] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +indent_size = 2 + +[*.xml] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index ee88a7870b58ef6150e56b2f50e8244873e391d9..f6c0392d9e40155edbbabb0992a56e2a0932c086 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,21 @@ target # ignore output files from testing output* -# ignore standard eclipse +# ignore standard Eclipse files .project .classpath .settings .checkstyle +# ignore standard IntelliJ files +.idea/ +*.iml +*.ipr +*.iws + +# ignore standard Vim and Emacs temp files +*.swp +*~ + +# ignore standard Mac OS X files/dirs .DS_Store diff --git a/.travis.yml b/.travis.yml index a0dcb824026d2d282887b3115927cd084e506fa9..a34a295a70c7aab459368db2979a121ccc86e205 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,29 @@ +# Copyright (c) 2010 Yahoo! Inc., 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. + # more info here about TravisCI and Java projects # http://docs.travis-ci.com/user/languages/java/ language: java jdk: + - oraclejdk8 - oraclejdk7 - - openjdk7 - + - openjdk7 + install: mvn install -q -DskipTests=true script: mvn test -q @@ -14,3 +31,8 @@ script: mvn test -q # Services to start for tests. services: - mongodb + - riak + + +# Use the Container based infrastructure. +sudo: false \ No newline at end of file diff --git a/BUILD b/BUILD deleted file mode 100644 index e520c2d9ce6b4919d30cad8a35c7f61991b38833..0000000000000000000000000000000000000000 --- a/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -# Building YCSB - -To build YCSB, run: - - mvn clean package - -# Running YCSB - -Once `mvn clean package` succeeds, you can run `ycsb` command: - - ./bin/ycsb load basic workloads/workloada - ./bin/ycsb run basic workloads/workloada - -# Oracle NoSQL Database - -Oracle NoSQL Database binding doesn't get built by default because there is no -Maven repository for it. To build the binding: - -1. Download kv-ce-1.2.123.tar.gz from here: - - http://www.oracle.com/technetwork/database/nosqldb/downloads/index.html - -2. Untar kv-ce-1.2.123.tar.gz and install kvclient-1.2.123.jar in your local - maven repository: - - tar xfvz kv-ce-1.2.123.tar.gz - mvn install:install-file -Dfile=kv-1.2.123/lib/kvclient-1.2.123.jar \ - -DgroupId=com.oracle -DartifactId=kvclient -Dversion=1.2.123 - -Dpackaging=jar - -3. Uncomment `<module>nosqldb</module>` and run `mvn clean package`. diff --git a/NOTICE.txt b/NOTICE.txt index e516aff24f395969ae7e5bb4f0cba12e630f6120..cd1f104f541a88181cf99f8cd3f7f58d60316297 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -7,3 +7,7 @@ in this case for the YCSB project. This product includes software developed by Yahoo! Inc. (www.yahoo.com) Copyright (c) 2010 Yahoo! Inc. All rights reserved. + + This product includes software developed by + Google Inc. (www.google.com) + Copyright (c) 2015 Google Inc. All rights reserved. diff --git a/README.md b/README.md index 774510c5d76bfe3c361e92f25990e661f1873cc7..b3c2642ed5be2861319ce23b80e73174b36f3735 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ +<!-- +Copyright (c) 2010 Yahoo! Inc., 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. +--> + Yahoo! Cloud System Benchmark (YCSB) ==================================== [](https://travis-ci.org/brianfrankcooper/YCSB) @@ -5,28 +23,35 @@ Yahoo! Cloud System Benchmark (YCSB) Links ----- http://wiki.github.com/brianfrankcooper/YCSB/ -http://research.yahoo.com/Web_Information_Management/YCSB/ +https://labs.yahoo.com/news/yahoo-cloud-serving-benchmark/ ycsb-users@yahoogroups.com Getting Started --------------- -1. Download the latest release of YCSB: +1. Download the [latest release of YCSB](https://github.com/brianfrankcooper/YCSB/releases/latest): ```sh - curl -O https://github.com/brianfrankcooper/YCSB/releases/download/0.2.0/ycsb-0.2.0.tar.gz - tar xfvz ycsb-0.2.0.tar.gz - cd ycsb-0.2.0 + curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.11.0/ycsb-0.11.0.tar.gz + tar xfvz ycsb-0.11.0.tar.gz + cd ycsb-0.11.0 ``` 2. Set up a database to benchmark. There is a README file under each binding directory. 3. Run YCSB command. - + + On Linux: ```sh - bin/ycsb load basic -P workloads/workloada - bin/ycsb run basic -P workloads/workloada + bin/ycsb.sh load basic -P workloads/workloada + bin/ycsb.sh run basic -P workloads/workloada + ``` + + On Windows: + ```bat + bin/ycsb.bat load basic -P workloads\workloada + bin/ycsb.bat run basic -P workloads\workloada ``` Running the `ycsb` command without any argument will print the usage. @@ -40,6 +65,9 @@ Getting Started Building from source -------------------- +YCSB requires the use of Maven 3; if you use Maven 2, you may see [errors +such as these](https://github.com/brianfrankcooper/YCSB/issues/406). + To build the full distribution, with all database bindings: mvn clean package diff --git a/accumulo/README.md b/accumulo/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fd9b4e8d7a3381c4e377669230022b022c4977a3 --- /dev/null +++ b/accumulo/README.md @@ -0,0 +1,83 @@ +<!-- +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. +--> + +## Quick Start + +This section describes how to run YCSB on [Accumulo](https://accumulo.apache.org/). + +### 1. Start Accumulo + +See the [Accumulo Documentation](https://accumulo.apache.org/1.7/accumulo_user_manual.html#_installation) +for details on installing and running Accumulo. + +Before running the YCSB test you must create the Accumulo table. Again see the +[Accumulo Documentation](https://accumulo.apache.org/1.7/accumulo_user_manual.html#_basic_administration) +for details. The default table name is `ycsb`. + +### 2. Set Up YCSB + +Git clone YCSB and compile: + + git clone http://github.com/brianfrankcooper/YCSB.git + cd YCSB + mvn -pl com.yahoo.ycsb:aerospike-binding -am clean package + +### 3. Load Data and Run Tests + +Load the data: + + ./bin/ycsb load accumulo -s -P workloads/workloada \ + -p accumulo.zooKeepers=localhost \ + -p accumulo.columnFamily=ycsb \ + -p accumulo.instanceName=ycsb \ + -p accumulo.username=user \ + -p accumulo.password=supersecret \ + > outputLoad.txt + +Run the workload test: + + ./bin/ycsb run accumulo -s -P workloads/workloada \ + -p accumulo.zooKeepers=localhost \ + -p accumulo.columnFamily=ycsb \ + -p accumulo.instanceName=ycsb \ + -p accumulo.username=user \ + -p accumulo.password=supersecret \ + > outputLoad.txt + +## Accumulo Configuration Parameters + +- `accumulo.zooKeepers` + - The Accumulo cluster's [zookeeper servers](https://accumulo.apache.org/1.7/accumulo_user_manual.html#_connecting). + - Should contain a comma separated list of of hostname or hostname:port values. + - No default value. + +- `accumulo.columnFamily` + - The name of the column family to use to store the data within the table. + - No default value. + +- `accumulo.instanceName` + - Name of the Accumulo [instance](https://accumulo.apache.org/1.7/accumulo_user_manual.html#_connecting). + - No default value. + +- `accumulo.username` + - The username to use when connecting to Accumulo. + - No default value. + +- `accumulo.password` + - The password for the user connecting to Accumulo. + - No default value. + diff --git a/accumulo/pom.xml b/accumulo/pom.xml index cdf867c7c1e10df1c439359d518a7a4eaa38d214..eb098f88c13b73f37ba15e8460ca737d75b85718 100644 --- a/accumulo/pom.xml +++ b/accumulo/pom.xml @@ -1,43 +1,47 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2011 YCSB++ project, 2014 - 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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> <artifactId>accumulo-binding</artifactId> <name>Accumulo DB Binding</name> + <properties> + <!-- This should match up to the one from your Accumulo version --> + <hadoop.version>2.2.0</hadoop.version> + </properties> <dependencies> <dependency> <groupId>org.apache.accumulo</groupId> <artifactId>accumulo-core</artifactId> <version>${accumulo.version}</version> - <exclusions> - <exclusion> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-common</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.thrift</groupId> - <artifactId>thrift</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.zookeeper</groupId> - <artifactId>zookeeper</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.zookeeper</groupId> - <artifactId>zookeeper</artifactId> - <version>3.3.1</version> </dependency> + <!-- Needed for hadoop.io.Text :( --> <dependency> <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-core</artifactId> - <version>0.20.203.0</version> + <artifactId>hadoop-common</artifactId> + <version>${hadoop.version}</version> </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> @@ -45,5 +49,35 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-minicluster</artifactId> + <version>${accumulo.version}</version> + <scope>test</scope> + </dependency> + <!-- needed directly only in test, but transitive + at runtime for accumulo, hadoop, and thrift. --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.13</version> + </dependency> </dependencies> + <build> + <testResources> + <testResource> + <directory>../workloads</directory> + <targetPath>workloads</targetPath> + </testResource> + <testResource> + <directory>src/test/resources</directory> + </testResource> + </testResources> + </build> </project> diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java b/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java deleted file mode 100644 index 0551849ce5e7e711d6eaa99aad5841158fb5ebc4..0000000000000000000000000000000000000000 --- a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java +++ /dev/null @@ -1,435 +0,0 @@ -package com.yahoo.ycsb.db; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Random; -import java.util.Set; -import java.util.TreeSet; -import java.util.Vector; -import java.util.concurrent.TimeUnit; - -import org.apache.accumulo.core.client.AccumuloException; -import org.apache.accumulo.core.client.AccumuloSecurityException; -import org.apache.accumulo.core.client.BatchWriter; -import org.apache.accumulo.core.client.BatchWriterConfig; -import org.apache.accumulo.core.client.Connector; -import org.apache.accumulo.core.client.MutationsRejectedException; -import org.apache.accumulo.core.client.Scanner; -import org.apache.accumulo.core.client.TableNotFoundException; -import org.apache.accumulo.core.client.ZooKeeperInstance; -import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; -import org.apache.accumulo.core.client.security.tokens.PasswordToken; -import org.apache.accumulo.core.data.Key; -import org.apache.accumulo.core.data.Mutation; -import org.apache.accumulo.core.data.Range; -import org.apache.accumulo.core.data.Value; -import org.apache.accumulo.core.security.Authorizations; -import org.apache.accumulo.core.util.CleanUp; -import org.apache.hadoop.io.Text; -import org.apache.zookeeper.KeeperException; - -import com.yahoo.ycsb.ByteArrayByteIterator; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; - -public class AccumuloClient extends DB { - // Error code constants. - public static final int Ok = 0; - public static final int ServerError = -1; - public static final int HttpError = -2; - public static final int NoMatchingRecord = -3; - - private ZooKeeperInstance _inst; - private Connector _connector; - private String _table = ""; - private BatchWriter _bw = null; - private Text _colFam = new Text(""); - private Scanner _singleScanner = null; // A scanner for reads/deletes. - private Scanner _scanScanner = null; // A scanner for use by scan() - - private static final String PC_PRODUCER = "producer"; - private static final String PC_CONSUMER = "consumer"; - private String _PC_FLAG = ""; - private ZKProducerConsumer.Queue q = null; - private static Hashtable<String,Long> hmKeyReads = null; - private static Hashtable<String,Integer> hmKeyNumReads = null; - private Random r = null; - - - @Override - public void init() throws DBException { - _colFam = new Text(getProperties().getProperty("accumulo.columnFamily")); - - _inst = new ZooKeeperInstance(getProperties().getProperty("accumulo.instanceName"), - getProperties().getProperty("accumulo.zooKeepers")); - try { - String principal = getProperties().getProperty("accumulo.username"); - AuthenticationToken token = new PasswordToken(getProperties().getProperty("accumulo.password")); - _connector = _inst.getConnector(principal, token); - } catch (AccumuloException e) { - throw new DBException(e); - } catch (AccumuloSecurityException e) { - throw new DBException(e); - } - - _PC_FLAG = getProperties().getProperty("accumulo.PC_FLAG","none"); - if (_PC_FLAG.equals(PC_PRODUCER) || _PC_FLAG.equals(PC_CONSUMER)) { - System.out.println("*** YCSB Client is "+_PC_FLAG); - String address = getProperties().getProperty("accumulo.PC_SERVER"); - String root = getProperties().getProperty("accumulo.PC_ROOT_IN_ZK"); - System.out.println("*** PC_INFO(server:"+address+";root="+root+")"); - q = new ZKProducerConsumer.Queue(address, root); - r = new Random(); - } - - if (_PC_FLAG.equals(PC_CONSUMER)) { - hmKeyReads = new Hashtable<String,Long>(); - hmKeyNumReads = new Hashtable<String,Integer>(); - keyNotification(null); - } - } - - - @Override - public void cleanup() throws DBException - { - try { - if (_bw != null) { - _bw.close(); - } - } catch (MutationsRejectedException e) { - throw new DBException(e); - } - CleanUp.shutdownNow(); - } - - /** - * Commonly repeated functionality: Before doing any operation, make sure - * we're working on the correct table. If not, open the correct one. - * - * @param table - */ - public void checkTable(String table) throws TableNotFoundException { - if (!_table.equals(table)) { - getTable(table); - } - } - - /** - * Called when the user specifies a table that isn't the same as the - * existing table. Connect to it and if necessary, close our current - * connection. - * - * @param table - */ - public void getTable(String table) throws TableNotFoundException { - if (_bw != null) { // Close the existing writer if necessary. - try { - _bw.close(); - } catch (MutationsRejectedException e) { - // Couldn't spit out the mutations we wanted. - // Ignore this for now. - } - } - - BatchWriterConfig bwc = new BatchWriterConfig(); - bwc.setMaxLatency(Long.parseLong(getProperties().getProperty("accumulo.batchWriterMaxLatency", "30000")), TimeUnit.MILLISECONDS); - bwc.setMaxMemory(Long.parseLong(getProperties().getProperty("accumulo.batchWriterSize", "100000"))); - bwc.setMaxWriteThreads(Integer.parseInt(getProperties().getProperty("accumulo.batchWriterThreads", "1"))); - - _bw = _connector.createBatchWriter(table, bwc); - - // Create our scanners - _singleScanner = _connector.createScanner(table, Authorizations.EMPTY); - _scanScanner = _connector.createScanner(table, Authorizations.EMPTY); - - _table = table; // Store the name of the table we have open. - } - - /** - * Gets a scanner from Accumulo over one row - * - * @param row the row to scan - * @param fields the set of columns to scan - * @return an Accumulo {@link Scanner} bound to the given row and columns - */ - private Scanner getRow(Text row, Set<String> fields) - { - _singleScanner.clearColumns(); - _singleScanner.setRange(new Range(row)); - if (fields != null) { - for(String field:fields) - { - _singleScanner.fetchColumn(_colFam, new Text(field)); - } - } - return _singleScanner; - } - - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - - try { - checkTable(table); - } catch (TableNotFoundException e) { - System.err.println("Error trying to connect to Accumulo table." + e); - return ServerError; - } - - try { - // Pick out the results we care about. - for (Entry<Key, Value> entry : getRow(new Text(key), null)) { - Value v = entry.getValue(); - byte[] buf = v.get(); - result.put(entry.getKey().getColumnQualifier().toString(), - new ByteArrayByteIterator(buf)); - } - } catch (Exception e) { - System.err.println("Error trying to reading Accumulo table" + key + e); - return ServerError; - } - return Ok; - - } - - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - try { - checkTable(table); - } catch (TableNotFoundException e) { - System.err.println("Error trying to connect to Accumulo table." + e); - return ServerError; - } - - // There doesn't appear to be a way to create a range for a given - // LENGTH. Just start and end keys. So we'll do this the hard way for now: - // Just make the end 'infinity' and only read as much as we need. - _scanScanner.clearColumns(); - _scanScanner.setRange(new Range(new Text(startkey), null)); - - // Batch size is how many key/values to try to get per call. Here, I'm - // guessing that the number of keys in a row is equal to the number of fields - // we're interested in. - // We try to fetch one more so as to tell when we've run out of fields. - - if (fields != null) { - // And add each of them as fields we want. - for(String field:fields) - { - _scanScanner.fetchColumn(_colFam, new Text(field)); - } - } else { - // If no fields are provided, we assume one column/row. - } - - String rowKey = ""; - HashMap<String, ByteIterator> currentHM = null; - int count = 0; - - // Begin the iteration. - for (Entry<Key, Value> entry : _scanScanner) { - // Check for a new row. - if (!rowKey.equals(entry.getKey().getRow().toString())) { - if (count++ == recordcount) { // Done reading the last row. - break; - } - rowKey = entry.getKey().getRow().toString(); - if (fields != null) { - // Initial Capacity for all keys. - currentHM = new HashMap<String, ByteIterator>(fields.size()); - } - else - { - // An empty result map. - currentHM = new HashMap<String, ByteIterator>(); - } - result.add(currentHM); - } - // Now add the key to the hashmap. - Value v = entry.getValue(); - byte[] buf = v.get(); - currentHM.put(entry.getKey().getColumnQualifier().toString(), new ByteArrayByteIterator(buf)); - } - - return Ok; - - } - - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - try { - checkTable(table); - } catch (TableNotFoundException e) { - System.err.println("Error trying to connect to Accumulo table." + e); - return ServerError; - } - - Mutation mutInsert = new Mutation(new Text(key)); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - mutInsert.put(_colFam, new Text(entry.getKey()), System - .currentTimeMillis(), - new Value(entry.getValue().toArray())); - } - - try { - _bw.addMutation(mutInsert); - // Distributed YCSB co-ordination: YCSB on a client produces the key to - // be stored in the shared queue in ZooKeeper. - if (_PC_FLAG.equals(PC_PRODUCER)) { - if (r.nextFloat() < 0.01) - keyNotification(key); - } - } catch (MutationsRejectedException e) { - System.err.println("Error performing update."); - e.printStackTrace(); - return ServerError; - } - - - return Ok; - } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - return update(table, key, values); - } - - @Override - public int delete(String table, String key) { - try { - checkTable(table); - } catch (TableNotFoundException e) { - System.err.println("Error trying to connect to Accumulo table." + e); - return ServerError; - } - - try { - deleteRow(new Text(key)); - } catch (RuntimeException e) { - System.err.println("Error performing delete."); - e.printStackTrace(); - return ServerError; - } - - return Ok; - } - - // These functions are adapted from RowOperations.java: - private void deleteRow(Text row) { - deleteRow(getRow(row, null)); - } - - - /** - * Deletes a row, given a Scanner of JUST that row - * - */ - private void deleteRow(Scanner scanner) { - Mutation deleter = null; - // iterate through the keys - for (Entry<Key,Value> entry : scanner) { - // create a mutation for the row - if (deleter == null) - deleter = new Mutation(entry.getKey().getRow()); - // the remove function adds the key with the delete flag set to true - deleter.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier()); - } - try { - _bw.addMutation(deleter); - } catch (MutationsRejectedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - private void keyNotification(String key) { - - if (_PC_FLAG.equals(PC_PRODUCER)) { - try { - q.produce(key); - } catch (KeeperException e) { - - } catch (InterruptedException e) { - - } - } else { - //XXX: do something better to keep the loop going (while??) - for (int i = 0; i < 10000000; i++) { - try { - String strKey = q.consume(); - - if ((hmKeyReads.containsKey(strKey) == false) && - (hmKeyNumReads.containsKey(strKey) == false)) { - hmKeyReads.put(strKey, new Long(System.currentTimeMillis())); - hmKeyNumReads.put(strKey, new Integer(1)); - } - - //YCSB Consumer will read the key that was fetched from the - //queue in ZooKeeper. - //(current way is kind of ugly but works, i think) - //TODO : Get table name from configuration or argument - String table = "usertable"; - HashSet<String> fields = new HashSet<String>(); - for (int j=0; j<9; j++) - fields.add("field"+j); - HashMap<String,ByteIterator> result = new HashMap<String,ByteIterator>(); - - int retval = read(table, strKey, fields, result); - //If the results are empty, the key is enqueued in Zookeeper - //and tried again, until the results are found. - if (result.size() == 0) { - q.produce(strKey); - int count = ((Integer)hmKeyNumReads.get(strKey)).intValue(); - hmKeyNumReads.put(strKey, new Integer(count+1)); - } - else { - if (((Integer)hmKeyNumReads.get(strKey)).intValue() > 1) { - long currTime = System.currentTimeMillis(); - long writeTime = ((Long)hmKeyReads.get(strKey)).longValue(); - System.out.println("Key="+strKey+ - //";StartSearch="+writeTime+ - //";EndSearch="+currTime+ - ";TimeLag="+(currTime-writeTime)); - } - } - - } catch (KeeperException e) { - - } catch (InterruptedException e) { - - } - } - } - - } - - public int presplit(String table, String[] keys) - { - TreeSet<Text> splits = new TreeSet<Text>(); - for (int i = 0;i < keys.length; i ++) - { - splits.add(new Text(keys[i])); - } - try { - _connector.tableOperations().addSplits(table, splits); - } catch (TableNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (AccumuloException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (AccumuloSecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return Ok; - } - -} diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java b/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java deleted file mode 100644 index 2daec51939a6e270914bb31eb204f268b86a98ae..0000000000000000000000000000000000000000 --- a/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.yahoo.ycsb.db; - -import java.io.IOException; -import java.util.List; - - -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.KeeperException; -import org.apache.zookeeper.WatchedEvent; -import org.apache.zookeeper.Watcher; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.ZooDefs.Ids; -import org.apache.zookeeper.data.Stat; - -// Implementing the PC Queue in ZooKeeper -// -public class ZKProducerConsumer implements Watcher { - - static ZooKeeper zk = null; - static Integer mutex; - - String root; - - // Constructor that takes tha address of the ZK server - // - ZKProducerConsumer(String address) { - if(zk == null){ - try { - System.out.println("Starting ZK:"); - zk = new ZooKeeper(address, 3000, this); - mutex = new Integer(-1); - System.out.println("Finished starting ZK: " + zk); - } catch (IOException e) { - System.out.println(e.toString()); - zk = null; - } - } - //else mutex = new Integer(-1); - } - - synchronized public void process(WatchedEvent event) { - synchronized (mutex) { - //System.out.println("Process: " + event.getType()); - mutex.notify(); - } - } - - - static public class QueueElement { - public String key; - public long writeTime; - - QueueElement(String key, long writeTime) { - this.key = key; - this.writeTime = writeTime; - } - } - - // Producer-Consumer queue - static public class Queue extends ZKProducerConsumer { - - // Constructor of producer-consumer queue - Queue(String address, String name) { - super(address); - this.root = name; - // Create ZK node name - if (zk != null) { - try { - Stat s = zk.exists(root, false); - if (s == null) { - zk.create(root, new byte[0], Ids.OPEN_ACL_UNSAFE, - CreateMode.PERSISTENT); - } - } catch (KeeperException e) { - System.out - .println("Keeper exception when instantiating queue: " - + e.toString()); - } catch (InterruptedException e) { - System.out.println("Interrupted exception"); - } - } - } - - // Producer calls this method to insert the key in the queue - // - boolean produce(String key) throws KeeperException, InterruptedException{ - byte[] value; - value = key.getBytes(); - zk.create(root + "/key", value, - Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); - - return true; - } - - // Consumer calls this method to "wait" for the key to the available - // - String consume() throws KeeperException, InterruptedException { - String retvalue = null; - Stat stat = null; - - // Get the first element available - while (true) { - synchronized (mutex) { - List<String> list = zk.getChildren(root, true); - if (list.size() == 0) { - System.out.println("Going to wait"); - mutex.wait(); - } else { - String path = root+"/"+list.get(0); - byte[] b = zk.getData(path, false, stat); - retvalue = new String(b); - zk.delete(path, -1); - - return retvalue; - - } - } - } - } - } -} - diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/AccumuloClient.java b/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/AccumuloClient.java new file mode 100644 index 0000000000000000000000000000000000000000..96b869e2b73b8cf9fcbcc5e9c2e3bd21154a73a8 --- /dev/null +++ b/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/AccumuloClient.java @@ -0,0 +1,348 @@ +/** + * Copyright (c) 2011 YCSB++ project, 2014-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. + */ + +package com.yahoo.ycsb.db.accumulo; + +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.client.BatchWriter; +import org.apache.accumulo.core.client.BatchWriterConfig; +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.MutationsRejectedException; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.client.TableNotFoundException; +import org.apache.accumulo.core.client.ZooKeeperInstance; +import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; +import org.apache.accumulo.core.client.security.tokens.PasswordToken; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Mutation; +import org.apache.accumulo.core.data.Range; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.accumulo.core.util.CleanUp; +import org.apache.hadoop.io.Text; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.TimeUnit; + +/** + * <a href="https://accumulo.apache.org/">Accumulo</a> binding for YCSB. + */ +public class AccumuloClient extends DB { + + private ZooKeeperInstance inst; + private Connector connector; + private String table = ""; + private BatchWriter bw = null; + private Text colFam = new Text(""); + private Scanner singleScanner = null; // A scanner for reads/deletes. + private Scanner scanScanner = null; // A scanner for use by scan() + + static { + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + CleanUp.shutdownNow(); + } + }); + } + + @Override + public void init() throws DBException { + colFam = new Text(getProperties().getProperty("accumulo.columnFamily")); + + inst = new ZooKeeperInstance( + getProperties().getProperty("accumulo.instanceName"), + getProperties().getProperty("accumulo.zooKeepers")); + try { + String principal = getProperties().getProperty("accumulo.username"); + AuthenticationToken token = + new PasswordToken(getProperties().getProperty("accumulo.password")); + connector = inst.getConnector(principal, token); + } catch (AccumuloException e) { + throw new DBException(e); + } catch (AccumuloSecurityException e) { + throw new DBException(e); + } + + if (!(getProperties().getProperty("accumulo.pcFlag", "none").equals("none"))) { + System.err.println("Sorry, the ZK based producer/consumer implementation has been removed. " + + "Please see YCSB issue #416 for work on adding a general solution to coordinated work."); + } + } + + @Override + public void cleanup() throws DBException { + try { + if (bw != null) { + bw.close(); + } + } catch (MutationsRejectedException e) { + throw new DBException(e); + } + } + + /** + * Commonly repeated functionality: Before doing any operation, make sure + * we're working on the correct table. If not, open the correct one. + * + * @param t + * The table to open. + */ + public void checkTable(String t) throws TableNotFoundException { + if (!table.equals(t)) { + getTable(t); + } + } + + /** + * Called when the user specifies a table that isn't the same as the existing + * table. Connect to it and if necessary, close our current connection. + * + * @param t + * The table to open. + */ + public void getTable(String t) throws TableNotFoundException { + if (bw != null) { // Close the existing writer if necessary. + try { + bw.close(); + } catch (MutationsRejectedException e) { + // Couldn't spit out the mutations we wanted. + // Ignore this for now. + System.err.println("MutationsRejectedException: " + e.getMessage()); + } + } + + BatchWriterConfig bwc = new BatchWriterConfig(); + bwc.setMaxLatency( + Long.parseLong(getProperties() + .getProperty("accumulo.batchWriterMaxLatency", "30000")), + TimeUnit.MILLISECONDS); + bwc.setMaxMemory(Long.parseLong( + getProperties().getProperty("accumulo.batchWriterSize", "100000"))); + bwc.setMaxWriteThreads(Integer.parseInt( + getProperties().getProperty("accumulo.batchWriterThreads", "1"))); + + bw = connector.createBatchWriter(t, bwc); + + // Create our scanners + singleScanner = connector.createScanner(t, Authorizations.EMPTY); + scanScanner = connector.createScanner(t, Authorizations.EMPTY); + + table = t; // Store the name of the table we have open. + } + + /** + * Gets a scanner from Accumulo over one row. + * + * @param row the row to scan + * @param fields the set of columns to scan + * @return an Accumulo {@link Scanner} bound to the given row and columns + */ + private Scanner getRow(Text row, Set<String> fields) { + singleScanner.clearColumns(); + singleScanner.setRange(new Range(row)); + if (fields != null) { + for (String field : fields) { + singleScanner.fetchColumn(colFam, new Text(field)); + } + } + return singleScanner; + } + + @Override + public Status read(String t, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + + try { + checkTable(t); + } catch (TableNotFoundException e) { + System.err.println("Error trying to connect to Accumulo table." + e); + return Status.ERROR; + } + + try { + // Pick out the results we care about. + for (Entry<Key, Value> entry : getRow(new Text(key), null)) { + Value v = entry.getValue(); + byte[] buf = v.get(); + result.put(entry.getKey().getColumnQualifier().toString(), + new ByteArrayByteIterator(buf)); + } + } catch (Exception e) { + System.err.println("Error trying to reading Accumulo table" + key + e); + return Status.ERROR; + } + return Status.OK; + + } + + @Override + public Status scan(String t, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + try { + checkTable(t); + } catch (TableNotFoundException e) { + System.err.println("Error trying to connect to Accumulo table." + e); + return Status.ERROR; + } + + // There doesn't appear to be a way to create a range for a given + // LENGTH. Just start and end keys. So we'll do this the hard way for + // now: + // Just make the end 'infinity' and only read as much as we need. + scanScanner.clearColumns(); + scanScanner.setRange(new Range(new Text(startkey), null)); + + // Batch size is how many key/values to try to get per call. Here, I'm + // guessing that the number of keys in a row is equal to the number of + // fields we're interested in. + + // We try to fetch one more so as to tell when we've run out of fields. + + // If no fields are provided, we assume one column/row. + if (fields != null) { + // And add each of them as fields we want. + for (String field : fields) { + scanScanner.fetchColumn(colFam, new Text(field)); + } + } + + String rowKey = ""; + HashMap<String, ByteIterator> currentHM = null; + int count = 0; + + // Begin the iteration. + for (Entry<Key, Value> entry : scanScanner) { + // Check for a new row. + if (!rowKey.equals(entry.getKey().getRow().toString())) { + if (count++ == recordcount) { // Done reading the last row. + break; + } + rowKey = entry.getKey().getRow().toString(); + if (fields != null) { + // Initial Capacity for all keys. + currentHM = new HashMap<String, ByteIterator>(fields.size()); + } else { + // An empty result map. + currentHM = new HashMap<String, ByteIterator>(); + } + result.add(currentHM); + } + // Now add the key to the hashmap. + Value v = entry.getValue(); + byte[] buf = v.get(); + currentHM.put(entry.getKey().getColumnQualifier().toString(), + new ByteArrayByteIterator(buf)); + } + + return Status.OK; + } + + @Override + public Status update(String t, String key, + HashMap<String, ByteIterator> values) { + try { + checkTable(t); + } catch (TableNotFoundException e) { + System.err.println("Error trying to connect to Accumulo table." + e); + return Status.ERROR; + } + + Mutation mutInsert = new Mutation(new Text(key)); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + mutInsert.put(colFam, new Text(entry.getKey()), + System.currentTimeMillis(), new Value(entry.getValue().toArray())); + } + + try { + bw.addMutation(mutInsert); + } catch (MutationsRejectedException e) { + System.err.println("Error performing update."); + e.printStackTrace(); + return Status.ERROR; + } + + return Status.OK; + } + + @Override + public Status insert(String t, String key, + HashMap<String, ByteIterator> values) { + return update(t, key, values); + } + + @Override + public Status delete(String t, String key) { + try { + checkTable(t); + } catch (TableNotFoundException e) { + System.err.println("Error trying to connect to Accumulo table." + e); + return Status.ERROR; + } + + try { + deleteRow(new Text(key)); + } catch (MutationsRejectedException e) { + System.err.println("Error performing delete."); + e.printStackTrace(); + return Status.ERROR; + } catch (RuntimeException e) { + System.err.println("Error performing delete."); + e.printStackTrace(); + return Status.ERROR; + } + + return Status.OK; + } + + // These functions are adapted from RowOperations.java: + private void deleteRow(Text row) throws MutationsRejectedException { + deleteRow(getRow(row, null)); + } + + /** + * Deletes a row, given a Scanner of JUST that row. + */ + private void deleteRow(Scanner scanner) throws MutationsRejectedException { + Mutation deleter = null; + // iterate through the keys + for (Entry<Key, Value> entry : scanner) { + // create a mutation for the row + if (deleter == null) { + deleter = new Mutation(entry.getKey().getRow()); + } + // the remove function adds the key with the delete flag set to true + deleter.putDelete(entry.getKey().getColumnFamily(), + entry.getKey().getColumnQualifier()); + } + + bw.addMutation(deleter); + } +} diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/package-info.java b/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..e38d200c774c03138f6ba8f642b2d2fe9bebc578 --- /dev/null +++ b/accumulo/src/main/java/com/yahoo/ycsb/db/accumulo/package-info.java @@ -0,0 +1,22 @@ +/** + * 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. + */ + +/** + * YCSB binding for <a href="https://accumulo.apache.org/">Apache Accumulo</a>. + */ +package com.yahoo.ycsb.db.accumulo; + diff --git a/accumulo/src/test/java/com/yahoo/ycsb/db/accumulo/AccumuloTest.java b/accumulo/src/test/java/com/yahoo/ycsb/db/accumulo/AccumuloTest.java new file mode 100644 index 0000000000000000000000000000000000000000..ce0b160f785ff94c6301d68a99b1e644289d7233 --- /dev/null +++ b/accumulo/src/test/java/com/yahoo/ycsb/db/accumulo/AccumuloTest.java @@ -0,0 +1,218 @@ +/* + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.db.accumulo; + + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; + +import java.util.Map.Entry; +import java.util.Properties; + +import com.yahoo.ycsb.Workload; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.measurements.Measurements; +import com.yahoo.ycsb.workloads.CoreWorkload; + +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.client.Scanner; +import org.apache.accumulo.core.client.security.tokens.PasswordToken; +import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.core.security.Authorizations; +import org.apache.accumulo.core.security.TablePermission; +import org.apache.accumulo.minicluster.MiniAccumuloCluster; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.junit.rules.TestName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Use an Accumulo MiniCluster to test out basic workload operations with + * the Accumulo binding. + */ +public class AccumuloTest { + private static final Logger LOG = LoggerFactory.getLogger(AccumuloTest.class); + private static final int INSERT_COUNT = 2000; + private static final int TRANSACTION_COUNT = 2000; + + @ClassRule + public static TemporaryFolder workingDir = new TemporaryFolder(); + @Rule + public TestName test = new TestName(); + + private static MiniAccumuloCluster cluster; + private static Properties properties; + private Workload workload; + private DB client; + private Properties workloadProps; + + private static boolean isWindows() { + final String os = System.getProperty("os.name"); + return os.startsWith("Windows"); + } + + @BeforeClass + public static void setup() throws Exception { + // Minicluster setup fails on Windows with an UnsatisfiedLinkError. + // Skip if windows. + assumeTrue(!isWindows()); + cluster = new MiniAccumuloCluster(workingDir.newFolder("accumulo").getAbsoluteFile(), "protectyaneck"); + LOG.debug("starting minicluster"); + cluster.start(); + LOG.debug("creating connection for admin operations."); + // set up the table and user + final Connector admin = cluster.getConnector("root", "protectyaneck"); + admin.tableOperations().create(CoreWorkload.TABLENAME_PROPERTY_DEFAULT); + admin.securityOperations().createLocalUser("ycsb", new PasswordToken("protectyaneck")); + admin.securityOperations().grantTablePermission("ycsb", CoreWorkload.TABLENAME_PROPERTY_DEFAULT, TablePermission.READ); + admin.securityOperations().grantTablePermission("ycsb", CoreWorkload.TABLENAME_PROPERTY_DEFAULT, TablePermission.WRITE); + + // set properties the binding will read + properties = new Properties(); + properties.setProperty("accumulo.zooKeepers", cluster.getZooKeepers()); + properties.setProperty("accumulo.instanceName", cluster.getInstanceName()); + properties.setProperty("accumulo.columnFamily", "family"); + properties.setProperty("accumulo.username", "ycsb"); + properties.setProperty("accumulo.password", "protectyaneck"); + // cut down the batch writer timeout so that writes will push through. + properties.setProperty("accumulo.batchWriterMaxLatency", "4"); + // set these explicitly to the defaults at the time we're compiled, since they'll be inlined in our class. + properties.setProperty(CoreWorkload.TABLENAME_PROPERTY, CoreWorkload.TABLENAME_PROPERTY_DEFAULT); + properties.setProperty(CoreWorkload.FIELD_COUNT_PROPERTY, CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT); + properties.setProperty(CoreWorkload.INSERT_ORDER_PROPERTY, "ordered"); + } + + @AfterClass + public static void clusterCleanup() throws Exception { + if (cluster != null) { + LOG.debug("shutting down minicluster"); + cluster.stop(); + cluster = null; + } + } + + @Before + public void client() throws Exception { + + LOG.debug("Loading workload properties for {}", test.getMethodName()); + workloadProps = new Properties(); + workloadProps.load(getClass().getResourceAsStream("/workloads/" + test.getMethodName())); + + for (String prop : properties.stringPropertyNames()) { + workloadProps.setProperty(prop, properties.getProperty(prop)); + } + + // TODO we need a better test rig for 'run this ycsb workload' + LOG.debug("initializing measurements and workload"); + Measurements.setProperties(workloadProps); + workload = new CoreWorkload(); + workload.init(workloadProps); + + LOG.debug("initializing client"); + client = new AccumuloClient(); + client.setProperties(workloadProps); + client.init(); + } + + @After + public void cleanup() throws Exception { + if (client != null) { + LOG.debug("cleaning up client"); + client.cleanup(); + client = null; + } + if (workload != null) { + LOG.debug("cleaning up workload"); + workload.cleanup(); + } + } + + @After + public void truncateTable() throws Exception { + if (cluster != null) { + LOG.debug("truncating table {}", CoreWorkload.TABLENAME_PROPERTY_DEFAULT); + final Connector admin = cluster.getConnector("root", "protectyaneck"); + admin.tableOperations().deleteRows(CoreWorkload.TABLENAME_PROPERTY_DEFAULT, null, null); + } + } + + @Test + public void workloada() throws Exception { + runWorkload(); + } + + @Test + public void workloadb() throws Exception { + runWorkload(); + } + + @Test + public void workloadc() throws Exception { + runWorkload(); + } + + @Test + public void workloadd() throws Exception { + runWorkload(); + } + + @Test + public void workloade() throws Exception { + runWorkload(); + } + + /** + * go through a workload cycle. + * <ol> + * <li>initialize thread-specific state + * <li>load the workload dataset + * <li>run workload transactions + * </ol> + */ + private void runWorkload() throws Exception { + final Object state = workload.initThread(workloadProps,0,0); + LOG.debug("load"); + for (int i = 0; i < INSERT_COUNT; i++) { + assertTrue("insert failed.", workload.doInsert(client, state)); + } + // Ensure we wait long enough for the batch writer to flush + // TODO accumulo client should be flushing per insert by default. + Thread.sleep(2000); + LOG.debug("verify number of cells"); + final Scanner scanner = cluster.getConnector("root", "protectyaneck").createScanner(CoreWorkload.TABLENAME_PROPERTY_DEFAULT, Authorizations.EMPTY); + int count = 0; + for (Entry<Key, Value> entry : scanner) { + count++; + } + assertEquals("Didn't get enough total cells.", (Integer.valueOf(CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT) * INSERT_COUNT), count); + LOG.debug("run"); + for (int i = 0; i < TRANSACTION_COUNT; i++) { + assertTrue("transaction failed.", workload.doTransaction(client, state)); + } + } +} diff --git a/accumulo/src/test/resources/log4j.properties b/accumulo/src/test/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..e03d54a31a8e20a926c453d6057a41d128ed1f44 --- /dev/null +++ b/accumulo/src/test/resources/log4j.properties @@ -0,0 +1,29 @@ +# +# 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. +# + +# Root logger option +log4j.rootLogger=INFO, stderr + +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n + +# Suppress messages from ZooKeeper +log4j.logger.com.yahoo.ycsb.db.accumulo=INFO +log4j.logger.org.apache.zookeeper=ERROR +log4j.logger.org.apache.accumulo=WARN diff --git a/aerospike/README.md b/aerospike/README.md index 4c5e5dc66775b3608e00efe783e53f0c07c8b330..c5bb13ef820fe7881d9e5b45c5609b8d6be0f03e 100644 --- a/aerospike/README.md +++ b/aerospike/README.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + ## Quick Start This section describes how to run YCSB on Aerospike. diff --git a/aerospike/pom.xml b/aerospike/pom.xml index a9e7f208e28fc4ff616e014c19dac6cdc5f79173..bd0c77c3f5162aa9cbb464988f4cce13b65756c6 100644 --- a/aerospike/pom.xml +++ b/aerospike/pom.xml @@ -1,10 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2015-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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> diff --git a/aerospike/src/main/java/com/yahoo/ycsb/db/AerospikeClient.java b/aerospike/src/main/java/com/yahoo/ycsb/db/AerospikeClient.java index 73ccd3866e02edec03deb82d5bf51f19cb4da221..5aa80e46cfc9dfcb7de2ed6ff9d4e1589c759c08 100644 --- a/aerospike/src/main/java/com/yahoo/ycsb/db/AerospikeClient.java +++ b/aerospike/src/main/java/com/yahoo/ycsb/db/AerospikeClient.java @@ -1,39 +1,50 @@ -package com.yahoo.ycsb.db; +/** + * 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. + */ -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; +package com.yahoo.ycsb.db; import com.aerospike.client.AerospikeException; import com.aerospike.client.Bin; import com.aerospike.client.Key; import com.aerospike.client.Record; -import com.aerospike.client.ResultCode; import com.aerospike.client.policy.ClientPolicy; import com.aerospike.client.policy.Policy; import com.aerospike.client.policy.RecordExistsAction; import com.aerospike.client.policy.WritePolicy; - import com.yahoo.ycsb.ByteArrayByteIterator; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; -public class AerospikeClient extends com.yahoo.ycsb.DB { - private static final boolean DEBUG = false; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; +/** + * YCSB binding for <a href="http://www.aerospike.com/">Areospike</a>. + */ +public class AerospikeClient extends com.yahoo.ycsb.DB { private static final String DEFAULT_HOST = "localhost"; private static final String DEFAULT_PORT = "3000"; private static final String DEFAULT_TIMEOUT = "10000"; private static final String DEFAULT_NAMESPACE = "ycsb"; - private static final int RESULT_OK = 0; - private static final int RESULT_ERROR = -1; - - private static final int WRITE_OVERLOAD_DELAY = 5; - private static final int WRITE_OVERLOAD_TRIES = 3; - private String namespace = null; private com.aerospike.client.AerospikeClient client = null; @@ -86,7 +97,7 @@ public class AerospikeClient extends com.yahoo.ycsb.DB { } @Override - public int read(String table, String key, Set<String> fields, + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { Record record; @@ -99,11 +110,8 @@ public class AerospikeClient extends com.yahoo.ycsb.DB { } if (record == null) { - if (DEBUG) { - System.err.println("Record key " + key + " not found (read)"); - } - - return RESULT_ERROR; + System.err.println("Record key " + key + " not found (read)"); + return Status.ERROR; } for (Map.Entry<String, Object> entry: record.bins.entrySet()) { @@ -111,21 +119,21 @@ public class AerospikeClient extends com.yahoo.ycsb.DB { new ByteArrayByteIterator((byte[])entry.getValue())); } - return RESULT_OK; + return Status.OK; } catch (AerospikeException e) { System.err.println("Error while reading key " + key + ": " + e); - return RESULT_ERROR; + return Status.ERROR; } } @Override - public int scan(String table, String start, int count, Set<String> fields, + public Status scan(String table, String start, int count, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { System.err.println("Scan not implemented"); - return RESULT_ERROR; + return Status.ERROR; } - private int write(String table, String key, WritePolicy writePolicy, + private Status write(String table, String key, WritePolicy writePolicy, HashMap<String, ByteIterator> values) { Bin[] bins = new Bin[values.size()]; int index = 0; @@ -135,65 +143,41 @@ public class AerospikeClient extends com.yahoo.ycsb.DB { ++index; } - int delay = WRITE_OVERLOAD_DELAY; Key keyObj = new Key(namespace, table, key); - for (int tries = 0; tries < WRITE_OVERLOAD_TRIES; ++tries) { - try { - client.put(writePolicy, keyObj, bins); - return RESULT_OK; - } catch (AerospikeException e) { - if (e.getResultCode() != ResultCode.DEVICE_OVERLOAD) { - System.err.println("Error while writing key " + key + ": " + e); - return RESULT_ERROR; - } - - try { - Thread.sleep(delay); - } catch (InterruptedException e2) { - if (DEBUG) { - System.err.println("Interrupted: " + e2); - } - } - - delay *= 2; - } - } - - if (DEBUG) { - System.err.println("Device overload"); + try { + client.put(writePolicy, keyObj, bins); + return Status.OK; + } catch (AerospikeException e) { + System.err.println("Error while writing key " + key + ": " + e); + return Status.ERROR; } - - return RESULT_ERROR; } @Override - public int update(String table, String key, + public Status update(String table, String key, HashMap<String, ByteIterator> values) { return write(table, key, updatePolicy, values); } @Override - public int insert(String table, String key, + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { return write(table, key, insertPolicy, values); } @Override - public int delete(String table, String key) { + public Status delete(String table, String key) { try { if (!client.delete(deletePolicy, new Key(namespace, table, key))) { - if (DEBUG) { - System.err.println("Record key " + key + " not found (delete)"); - } - - return RESULT_ERROR; + System.err.println("Record key " + key + " not found (delete)"); + return Status.ERROR; } - return RESULT_OK; + return Status.OK; } catch (AerospikeException e) { System.err.println("Error while deleting key " + key + ": " + e); - return RESULT_ERROR; + return Status.ERROR; } } } diff --git a/aerospike/src/main/java/com/yahoo/ycsb/db/package-info.java b/aerospike/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..1436a02835b0eaae386be5ae25bb5f4eb7aadc61 --- /dev/null +++ b/aerospike/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/** + * 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. + */ + +/** + * YCSB binding for <a href="http://www.aerospike.com/">Areospike</a>. + */ +package com.yahoo.ycsb.db; diff --git a/arangodb/.gitignore b/arangodb/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1726048cd06b9a143e0376ed46dd9b9a8d53 --- /dev/null +++ b/arangodb/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/arangodb/README.md b/arangodb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..001892fd912ac6dcfe8f134272a52c3c91caf109 --- /dev/null +++ b/arangodb/README.md @@ -0,0 +1,93 @@ +<!-- +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. +--> + +## 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 arangodb -s -P workloads/workloada -p arangodb.ip=xxx -p arangodb.port=xxx + +Then, run the workload: + + ./bin/ycsb run arangodb -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/arangodb/conf/logback.xml b/arangodb/conf/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..95668c700c6c7850bf3294d49fb12e2601c1441d --- /dev/null +++ b/arangodb/conf/logback.xml @@ -0,0 +1,31 @@ +<!-- +Copyright (c) 2012 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="STDOUT" 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="STDOUT" /> + </root> +</configuration> diff --git a/arangodb/pom.xml b/arangodb/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..717224d69338bdd4d3d92aa2472c7da6d1c91ca0 --- /dev/null +++ b/arangodb/pom.xml @@ -0,0 +1,73 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>arangodb-binding</artifactId> + <name>ArangoDB Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.arangodb</groupId> + <artifactId>arangodb-java-driver</artifactId> + <version>${arangodb.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/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java b/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java new file mode 100644 index 0000000000000000000000000000000000000000..1a9d185f53009ddceee5e841ca779c7201cba86e --- /dev/null +++ b/arangodb/src/main/java/com/yahoo/ycsb/db/ArangoDBClient.java @@ -0,0 +1,466 @@ +/** + * 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, HashMap<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, HashMap<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, HashMap<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(HashMap<String, ByteIterator> values) { + HashMap<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/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java b/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..0f3c7e78773f780f08d8c15c8242296c374bacff --- /dev/null +++ b/arangodb/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/** + * 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/asynchbase/README.md b/asynchbase/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1a300c9bd2358e7aec03d09f0c51d36232b039b2 --- /dev/null +++ b/asynchbase/README.md @@ -0,0 +1,59 @@ +<!-- +Copyright (c) 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. +--> + +# AsyncHBase Driver for YCSB + +This driver provides a YCSB workload binding for Apache HBase using an alternative to the included HBase client. AsyncHBase is completely asynchronous for all operations and is particularly useful for write heavy workloads. Note that it supports a subset of the HBase client APIs but supports all public released versions of HBase. + +## Quickstart + +### 1. Setup Hbase + +Follow directions 1 to 3 from ``hbase098``'s readme. + +### 2. Load a Workload + +Switch to the root of the YCSB repo and choose the workload you want to run and `load` it first. With the CLI you must provide the column family at a minimum if HBase is running on localhost. Otherwise you must provide connection properties via CLI or the path to a config file. Additional configuration parameters are available below. + +``` +bin/ycsb load asynchbase -p columnfamily=cf -P workloads/workloada + +``` + +The `load` step only executes inserts into the datastore. After loading data, run the same workload to mix reads with writes. + +``` +bin/ycsb run asynchbase -p columnfamily=cf -P workloads/workloada + +``` + +## Configuration Options + +The following options can be configured using CLI (using the `-p` parameter) or via a JAVA style properties configuration file.. Check the [AsyncHBase Configuration](http://opentsdb.github.io/asynchbase/docs/build/html/configuration.html) project for additional tuning parameters. + +* `columnfamily`: (Required) The column family to target. +* `config`: Optional full path to a configuration file with AsyncHBase options. +* `hbase.zookeeper.quorum`: Zookeeper quorum list. +* `hbase.zookeeper.znode.parent`: Path used by HBase in Zookeeper. Default is "/hbase". +* `debug`: If true, prints debug information to standard out. The default is false. +* `clientbuffering`: Whether or not to use client side buffering and batching of write operations. This can significantly improve performance and defaults to true. +* `durable`: When set to false, writes and deletes bypass the WAL for quicker responses. Default is true. +* `jointimeout`: A timeout value, in milliseconds, for waiting on operations synchronously before an error is thrown. +* `prefetchmeta`: Whether or not to read meta for all regions in the table and connect to the proper region servers before starting operations. Defaults to false. + + +Note: This module includes some Google Guava source files from version 12 that were later removed but are still required by HBase's test modules for setting up the mini cluster during integration testing. \ No newline at end of file diff --git a/asynchbase/pom.xml b/asynchbase/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..2092a88bc2c6fce2c70c6685d493b0e45c14f1cc --- /dev/null +++ b/asynchbase/pom.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>asynchbase-binding</artifactId> + <name>AsyncHBase Client Binding for Apache HBase</name> + + <dependencies> + <dependency> + <groupId>org.hbase</groupId> + <artifactId>asynchbase</artifactId> + <version>${asynchbase.version}</version> + </dependency> + + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.zookeeper</groupId> + <artifactId>zookeeper</artifactId> + <version>3.4.5</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>jline</groupId> + <artifactId>jline</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.netty</groupId> + <artifactId>netty</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-testing-util</artifactId> + <version>${hbase10.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-client</artifactId> + <version>${hbase10.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>log4j-over-slf4j</artifactId> + <version>1.7.7</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/asynchbase/src/main/java/com/yahoo/ycsb/db/AsyncHBaseClient.java b/asynchbase/src/main/java/com/yahoo/ycsb/db/AsyncHBaseClient.java new file mode 100644 index 0000000000000000000000000000000000000000..fddd1a7aef3b9be60178d7d36cb1852b547b8086 --- /dev/null +++ b/asynchbase/src/main/java/com/yahoo/ycsb/db/AsyncHBaseClient.java @@ -0,0 +1,409 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.db; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map.Entry; +import java.util.Set; +import java.util.Vector; + +import org.hbase.async.Bytes; +import org.hbase.async.Config; +import org.hbase.async.DeleteRequest; +import org.hbase.async.GetRequest; +import org.hbase.async.HBaseClient; +import org.hbase.async.KeyValue; +import org.hbase.async.PutRequest; +import org.hbase.async.Scanner; + +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +/** + * Alternative Java client for Apache HBase. + * + * This client provides a subset of the main HBase client and uses a completely + * asynchronous pipeline for all calls. It is particularly useful for write heavy + * workloads. It is also compatible with all production versions of HBase. + */ +public class AsyncHBaseClient extends com.yahoo.ycsb.DB { + public static final Charset UTF8_CHARSET = Charset.forName("UTF8"); + private static final String CLIENT_SIDE_BUFFERING_PROPERTY = "clientbuffering"; + private static final String DURABILITY_PROPERTY = "durability"; + private static final String PREFETCH_META_PROPERTY = "prefetchmeta"; + private static final String CONFIG_PROPERTY = "config"; + private static final String COLUMN_FAMILY_PROPERTY = "columnfamily"; + private static final String JOIN_TIMEOUT_PROPERTY = "jointimeout"; + private static final String JOIN_TIMEOUT_PROPERTY_DEFAULT = "30000"; + + /** Mutex for instantiating a single instance of the client. */ + private static final Object MUTEX = new Object(); + + /** Use for tracking running thread counts so we know when to shutdown the client. */ + private static int threadCount = 0; + + /** The client that's used for all threads. */ + private static HBaseClient client; + + /** Print debug information to standard out. */ + private boolean debug = false; + + /** The column family use for the workload. */ + private byte[] columnFamilyBytes; + + /** Cache for the last table name/ID to avoid byte conversions. */ + private String lastTable = ""; + private byte[] lastTableBytes; + + private long joinTimeout; + + /** Whether or not to bypass the WAL for puts and deletes. */ + private boolean durability = true; + + /** + * If true, buffer mutations on the client. This is the default behavior for + * AsyncHBase. For measuring insert/update/delete latencies, client side + * buffering should be disabled. + * + * A single instance of this + */ + private boolean clientSideBuffering = false; + + @Override + public void init() throws DBException { + if (getProperties().getProperty(CLIENT_SIDE_BUFFERING_PROPERTY, "false") + .toLowerCase().equals("true")) { + clientSideBuffering = true; + } + if (getProperties().getProperty(DURABILITY_PROPERTY, "true") + .toLowerCase().equals("false")) { + durability = false; + } + final String columnFamily = getProperties().getProperty(COLUMN_FAMILY_PROPERTY); + if (columnFamily == null || columnFamily.isEmpty()) { + System.err.println("Error, must specify a columnfamily for HBase table"); + throw new DBException("No columnfamily specified"); + } + columnFamilyBytes = columnFamily.getBytes(); + + if ((getProperties().getProperty("debug") != null) + && (getProperties().getProperty("debug").compareTo("true") == 0)) { + debug = true; + } + + joinTimeout = Integer.parseInt(getProperties().getProperty( + JOIN_TIMEOUT_PROPERTY, JOIN_TIMEOUT_PROPERTY_DEFAULT)); + + final boolean prefetchMeta = getProperties() + .getProperty(PREFETCH_META_PROPERTY, "false") + .toLowerCase().equals("true") ? true : false; + try { + synchronized (MUTEX) { + ++threadCount; + if (client == null) { + final String configPath = getProperties().getProperty(CONFIG_PROPERTY); + final Config config; + if (configPath == null || configPath.isEmpty()) { + config = new Config(); + final Iterator<Entry<Object, Object>> iterator = getProperties() + .entrySet().iterator(); + while (iterator.hasNext()) { + final Entry<Object, Object> property = iterator.next(); + config.overrideConfig((String)property.getKey(), + (String)property.getValue()); + } + } else { + config = new Config(configPath); + } + client = new HBaseClient(config); + + // Terminate right now if table does not exist, since the client + // will not propagate this error upstream once the workload + // starts. + String table = com.yahoo.ycsb.workloads.CoreWorkload.table; + try { + client.ensureTableExists(table).join(joinTimeout); + } catch (InterruptedException e1) { + Thread.currentThread().interrupt(); + } catch (Exception e) { + throw new DBException(e); + } + + if (prefetchMeta) { + try { + if (debug) { + System.out.println("Starting meta prefetch for table " + table); + } + client.prefetchMeta(table).join(joinTimeout); + if (debug) { + System.out.println("Completed meta prefetch for table " + table); + } + } catch (InterruptedException e) { + System.err.println("Interrupted during prefetch"); + Thread.currentThread().interrupt(); + } catch (Exception e) { + throw new DBException("Failed prefetch", e); + } + } + } + } + } catch (IOException e) { + throw new DBException("Failed instantiation of client", e); + } + } + + @Override + public void cleanup() throws DBException { + synchronized (MUTEX) { + --threadCount; + if (client != null && threadCount < 1) { + try { + if (debug) { + System.out.println("Shutting down client"); + } + client.shutdown().joinUninterruptibly(joinTimeout); + } catch (Exception e) { + System.err.println("Failed to shutdown the AsyncHBase client " + + "properly: " + e.getMessage()); + } + client = null; + } + } + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + setTable(table); + + final GetRequest get = new GetRequest( + lastTableBytes, key.getBytes(), columnFamilyBytes); + if (fields != null) { + get.qualifiers(getQualifierList(fields)); + } + + try { + if (debug) { + System.out.println("Doing read from HBase columnfamily " + + Bytes.pretty(columnFamilyBytes)); + System.out.println("Doing read for key: " + key); + } + + final ArrayList<KeyValue> row = client.get(get).join(joinTimeout); + if (row == null || row.isEmpty()) { + return Status.NOT_FOUND; + } + + // got something so populate the results + for (final KeyValue column : row) { + result.put(new String(column.qualifier()), + // TODO - do we need to clone this array? YCSB may keep it in memory + // for a while which would mean the entire KV would hang out and won't + // be GC'd. + new ByteArrayByteIterator(column.value())); + + if (debug) { + System.out.println( + "Result for field: " + Bytes.pretty(column.qualifier()) + + " is: " + Bytes.pretty(column.value())); + } + } + return Status.OK; + } catch (InterruptedException e) { + System.err.println("Thread interrupted"); + Thread.currentThread().interrupt(); + } catch (Exception e) { + System.err.println("Failure reading from row with key " + key + + ": " + e.getMessage()); + return Status.ERROR; + } + return Status.ERROR; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + setTable(table); + + final Scanner scanner = client.newScanner(lastTableBytes); + scanner.setFamily(columnFamilyBytes); + scanner.setStartKey(startkey.getBytes(UTF8_CHARSET)); + // No end key... *sniff* + if (fields != null) { + scanner.setQualifiers(getQualifierList(fields)); + } + + // no filters? *sniff* + ArrayList<ArrayList<KeyValue>> rows = null; + try { + int numResults = 0; + while ((rows = scanner.nextRows().join(joinTimeout)) != null) { + for (final ArrayList<KeyValue> row : rows) { + final HashMap<String, ByteIterator> rowResult = + new HashMap<String, ByteIterator>(row.size()); + for (final KeyValue column : row) { + rowResult.put(new String(column.qualifier()), + // TODO - do we need to clone this array? YCSB may keep it in memory + // for a while which would mean the entire KV would hang out and won't + // be GC'd. + new ByteArrayByteIterator(column.value())); + if (debug) { + System.out.println("Got scan result for key: " + + Bytes.pretty(column.key())); + } + } + result.add(rowResult); + numResults++; + + if (numResults >= recordcount) {// if hit recordcount, bail out + break; + } + } + } + scanner.close().join(joinTimeout); + return Status.OK; + } catch (InterruptedException e) { + System.err.println("Thread interrupted"); + Thread.currentThread().interrupt(); + } catch (Exception e) { + System.err.println("Failure reading from row with key " + startkey + + ": " + e.getMessage()); + return Status.ERROR; + } + + return Status.ERROR; + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + setTable(table); + + if (debug) { + System.out.println("Setting up put for key: " + key); + } + + final byte[][] qualifiers = new byte[values.size()][]; + final byte[][] byteValues = new byte[values.size()][]; + + int idx = 0; + for (final Entry<String, ByteIterator> entry : values.entrySet()) { + qualifiers[idx] = entry.getKey().getBytes(); + byteValues[idx++] = entry.getValue().toArray(); + if (debug) { + System.out.println("Adding field/value " + entry.getKey() + "/" + + Bytes.pretty(entry.getValue().toArray()) + " to put request"); + } + } + + final PutRequest put = new PutRequest(lastTableBytes, key.getBytes(), + columnFamilyBytes, qualifiers, byteValues); + if (!durability) { + put.setDurable(false); + } + if (!clientSideBuffering) { + put.setBufferable(false); + try { + client.put(put).join(joinTimeout); + } catch (InterruptedException e) { + System.err.println("Thread interrupted"); + Thread.currentThread().interrupt(); + } catch (Exception e) { + System.err.println("Failure reading from row with key " + key + + ": " + e.getMessage()); + return Status.ERROR; + } + } else { + // hooray! Asynchronous write. But without a callback and an async + // YCSB call we don't know whether it succeeded or not + client.put(put); + } + + return Status.OK; + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + return update(table, key, values); + } + + @Override + public Status delete(String table, String key) { + setTable(table); + + if (debug) { + System.out.println("Doing delete for key: " + key); + } + + final DeleteRequest delete = new DeleteRequest( + lastTableBytes, key.getBytes(), columnFamilyBytes); + if (!durability) { + delete.setDurable(false); + } + if (!clientSideBuffering) { + delete.setBufferable(false); + try { + client.delete(delete).join(joinTimeout); + } catch (InterruptedException e) { + System.err.println("Thread interrupted"); + Thread.currentThread().interrupt(); + } catch (Exception e) { + System.err.println("Failure reading from row with key " + key + + ": " + e.getMessage()); + return Status.ERROR; + } + } else { + // hooray! Asynchronous write. But without a callback and an async + // YCSB call we don't know whether it succeeded or not + client.delete(delete); + } + return Status.OK; + } + + /** + * Little helper to set the table byte array. If it's different than the last + * table we reset the byte array. Otherwise we just use the existing array. + * @param table The table we're operating against + */ + private void setTable(final String table) { + if (!lastTable.equals(table)) { + lastTable = table; + lastTableBytes = table.getBytes(); + } + } + + /** + * Little helper to build a qualifier byte array from a field set. + * @param fields The fields to fetch. + * @return The column qualifier byte arrays. + */ + private byte[][] getQualifierList(final Set<String> fields) { + final byte[][] qualifiers = new byte[fields.size()][]; + int idx = 0; + for (final String field : fields) { + qualifiers[idx++] = field.getBytes(); + } + return qualifiers; + } +} \ No newline at end of file diff --git a/asynchbase/src/main/java/com/yahoo/ycsb/db/package-info.java b/asynchbase/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..72faa5016162c0e8d69f866c5d8f8ab0a8929f86 --- /dev/null +++ b/asynchbase/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 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. + */ + +/** + * The YCSB binding for HBase using the AsyncHBase client. + */ +package com.yahoo.ycsb.db; diff --git a/asynchbase/src/test/java/com/google/common/base/Stopwatch.java b/asynchbase/src/test/java/com/google/common/base/Stopwatch.java new file mode 100644 index 0000000000000000000000000000000000000000..4d46924bda1ce1f78dafa50cce93b0f70634b13b --- /dev/null +++ b/asynchbase/src/test/java/com/google/common/base/Stopwatch.java @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2008 The Guava Authors + * + * 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. + */ + +package com.google.common.base; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; +import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.NANOSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import com.google.common.annotations.Beta; +import com.google.common.annotations.GwtCompatible; +import com.google.common.annotations.GwtIncompatible; + +import java.util.concurrent.TimeUnit; + +/** + * An object that measures elapsed time in nanoseconds. It is useful to measure + * elapsed time using this class instead of direct calls to {@link + * System#nanoTime} for a few reasons: + * + * <ul> + * <li>An alternate time source can be substituted, for testing or performance + * reasons. + * <li>As documented by {@code nanoTime}, the value returned has no absolute + * meaning, and can only be interpreted as relative to another timestamp + * returned by {@code nanoTime} at a different time. {@code Stopwatch} is a + * more effective abstraction because it exposes only these relative values, + * not the absolute ones. + * </ul> + * + * <p>Basic usage: + * <pre> + * Stopwatch stopwatch = Stopwatch.{@link #createStarted createStarted}(); + * doSomething(); + * stopwatch.{@link #stop stop}(); // optional + * + * long millis = stopwatch.elapsed(MILLISECONDS); + * + * log.info("that took: " + stopwatch); // formatted string like "12.3 ms" + * </pre> + * + * <p>Stopwatch methods are not idempotent; it is an error to start or stop a + * stopwatch that is already in the desired state. + * + * <p>When testing code that uses this class, use the {@linkplain + * #Stopwatch(Ticker) alternate constructor} to supply a fake or mock ticker. + * <!-- TODO(kevinb): restore the "such as" --> This allows you to + * simulate any valid behavior of the stopwatch. + * + * <p><b>Note:</b> This class is not thread-safe. + * + * @author Kevin Bourrillion + * @since 10.0 + */ +@Beta +@GwtCompatible(emulated = true) +public final class Stopwatch { + private final Ticker ticker; + private boolean isRunning; + private long elapsedNanos; + private long startTick; + + /** + * Creates (but does not start) a new stopwatch using {@link System#nanoTime} + * as its time source. + * + * @since 15.0 + */ + public static Stopwatch createUnstarted() { + return new Stopwatch(); + } + + /** + * Creates (but does not start) a new stopwatch, using the specified time + * source. + * + * @since 15.0 + */ + public static Stopwatch createUnstarted(Ticker ticker) { + return new Stopwatch(ticker); + } + + /** + * Creates (and starts) a new stopwatch using {@link System#nanoTime} + * as its time source. + * + * @since 15.0 + */ + public static Stopwatch createStarted() { + return new Stopwatch().start(); + } + + /** + * Creates (and starts) a new stopwatch, using the specified time + * source. + * + * @since 15.0 + */ + public static Stopwatch createStarted(Ticker ticker) { + return new Stopwatch(ticker).start(); + } + + /** + * Creates (but does not start) a new stopwatch using {@link System#nanoTime} + * as its time source. + * + * @deprecated Use {@link Stopwatch#createUnstarted()} instead. + */ + @Deprecated + public Stopwatch() { + this(Ticker.systemTicker()); + } + + /** + * Creates (but does not start) a new stopwatch, using the specified time + * source. + * + * @deprecated Use {@link Stopwatch#createUnstarted(Ticker)} instead. + */ + @Deprecated + public Stopwatch(Ticker ticker) { + this.ticker = checkNotNull(ticker, "ticker"); + } + + /** + * Returns {@code true} if {@link #start()} has been called on this stopwatch, + * and {@link #stop()} has not been called since the last call to {@code + * start()}. + */ + public boolean isRunning() { + return isRunning; + } + + /** + * Starts the stopwatch. + * + * @return this {@code Stopwatch} instance + * @throws IllegalStateException if the stopwatch is already running. + */ + public Stopwatch start() { + checkState(!isRunning, "This stopwatch is already running."); + isRunning = true; + startTick = ticker.read(); + return this; + } + + /** + * Stops the stopwatch. Future reads will return the fixed duration that had + * elapsed up to this point. + * + * @return this {@code Stopwatch} instance + * @throws IllegalStateException if the stopwatch is already stopped. + */ + public Stopwatch stop() { + long tick = ticker.read(); + checkState(isRunning, "This stopwatch is already stopped."); + isRunning = false; + elapsedNanos += tick - startTick; + return this; + } + + /** + * Sets the elapsed time for this stopwatch to zero, + * and places it in a stopped state. + * + * @return this {@code Stopwatch} instance + */ + public Stopwatch reset() { + elapsedNanos = 0; + isRunning = false; + return this; + } + + private long elapsedNanos() { + return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos; + } + + /** + * Returns the current elapsed time shown on this stopwatch, expressed + * in the desired time unit, with any fraction rounded down. + * + * <p>Note that the overhead of measurement can be more than a microsecond, so + * it is generally not useful to specify {@link TimeUnit#NANOSECONDS} + * precision here. + * + * @since 14.0 (since 10.0 as {@code elapsedTime()}) + */ + public long elapsed(TimeUnit desiredUnit) { + return desiredUnit.convert(elapsedNanos(), NANOSECONDS); + } + + /** + * Returns the current elapsed time shown on this stopwatch, expressed + * in the desired time unit, with any fraction rounded down. + * + * <p>Note that the overhead of measurement can be more than a microsecond, so + * it is generally not useful to specify {@link TimeUnit#NANOSECONDS} + * precision here. + * + * @deprecated Use {@link Stopwatch#elapsed(TimeUnit)} instead. This method is + * scheduled to be removed in Guava release 16.0. + */ + @Deprecated + public long elapsedTime(TimeUnit desiredUnit) { + return elapsed(desiredUnit); + } + + /** + * Returns the current elapsed time shown on this stopwatch, expressed + * in milliseconds, with any fraction rounded down. This is identical to + * {@code elapsed(TimeUnit.MILLISECONDS)}. + * + * @deprecated Use {@code stopwatch.elapsed(MILLISECONDS)} instead. This + * method is scheduled to be removed in Guava release 16.0. + */ + @Deprecated + public long elapsedMillis() { + return elapsed(MILLISECONDS); + } + + /** + * Returns a string representation of the current elapsed time. + */ + @GwtIncompatible("String.format()") + @Override public String toString() { + long nanos = elapsedNanos(); + + TimeUnit unit = chooseUnit(nanos); + double value = (double) nanos / NANOSECONDS.convert(1, unit); + + // Too bad this functionality is not exposed as a regular method call + return String.format("%.4g %s", value, abbreviate(unit)); + } + + private static TimeUnit chooseUnit(long nanos) { + if (SECONDS.convert(nanos, NANOSECONDS) > 0) { + return SECONDS; + } + if (MILLISECONDS.convert(nanos, NANOSECONDS) > 0) { + return MILLISECONDS; + } + if (MICROSECONDS.convert(nanos, NANOSECONDS) > 0) { + return MICROSECONDS; + } + return NANOSECONDS; + } + + private static String abbreviate(TimeUnit unit) { + switch (unit) { + case NANOSECONDS: + return "ns"; + case MICROSECONDS: + return "\u03bcs"; // μs + case MILLISECONDS: + return "ms"; + case SECONDS: + return "s"; + default: + throw new AssertionError(); + } + } +} \ No newline at end of file diff --git a/asynchbase/src/test/java/com/google/common/io/Closeables.java b/asynchbase/src/test/java/com/google/common/io/Closeables.java new file mode 100644 index 0000000000000000000000000000000000000000..4a92c9c09883709deb66f625d9cd3ade79f9a9a2 --- /dev/null +++ b/asynchbase/src/test/java/com/google/common/io/Closeables.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2007 The Guava Authors + * + * 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. + */ + +package com.google.common.io; + +import com.google.common.annotations.Beta; +import com.google.common.annotations.VisibleForTesting; + +import java.io.Closeable; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.annotation.Nullable; + +/** + * Utility methods for working with {@link Closeable} objects. + * + * @author Michael Lancaster + * @since 1.0 + */ +@Beta +public final class Closeables { + @VisibleForTesting static final Logger logger + = Logger.getLogger(Closeables.class.getName()); + + private Closeables() {} + + /** + * Closes a {@link Closeable}, with control over whether an + * {@code IOException} may be thrown. This is primarily useful in a + * finally block, where a thrown exception needs to be logged but not + * propagated (otherwise the original exception will be lost). + * + * <p>If {@code swallowIOException} is true then we never throw + * {@code IOException} but merely log it. + * + * <p>Example: + * + * <p><pre>public void useStreamNicely() throws IOException { + * SomeStream stream = new SomeStream("foo"); + * boolean threw = true; + * try { + * // Some code which does something with the Stream. May throw a + * // Throwable. + * threw = false; // No throwable thrown. + * } finally { + * // Close the stream. + * // If an exception occurs, only rethrow it if (threw==false). + * Closeables.close(stream, threw); + * } + * </pre> + * + * @param closeable the {@code Closeable} object to be closed, or null, + * in which case this method does nothing + * @param swallowIOException if true, don't propagate IO exceptions + * thrown by the {@code close} methods + * @throws IOException if {@code swallowIOException} is false and + * {@code close} throws an {@code IOException}. + */ + public static void close(@Nullable Closeable closeable, + boolean swallowIOException) throws IOException { + if (closeable == null) { + return; + } + try { + closeable.close(); + } catch (IOException e) { + if (swallowIOException) { + logger.log(Level.WARNING, + "IOException thrown while closing Closeable.", e); + } else { + throw e; + } + } + } + + /** + * Equivalent to calling {@code close(closeable, true)}, but with no + * IOException in the signature. + * @param closeable the {@code Closeable} object to be closed, or null, in + * which case this method does nothing + */ + public static void closeQuietly(@Nullable Closeable closeable) { + try { + close(closeable, true); + } catch (IOException e) { + logger.log(Level.SEVERE, "IOException should not have been thrown.", e); + } + } +} \ No newline at end of file diff --git a/asynchbase/src/test/java/com/google/common/io/LimitInputStream.java b/asynchbase/src/test/java/com/google/common/io/LimitInputStream.java new file mode 100644 index 0000000000000000000000000000000000000000..a529f5e127fc422cf287693f18da105fbe78aacc --- /dev/null +++ b/asynchbase/src/test/java/com/google/common/io/LimitInputStream.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2007 The Guava Authors + * + * 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. + */ + +package com.google.common.io; + +import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * An InputStream that limits the number of bytes which can be read. + * + * @author Charles Fry + * @since 1.0 + */ +@Beta +public final class LimitInputStream extends FilterInputStream { + + private long left; + private long mark = -1; + + /** + * Wraps another input stream, limiting the number of bytes which can be read. + * + * @param in the input stream to be wrapped + * @param limit the maximum number of bytes to be read + */ + public LimitInputStream(InputStream in, long limit) { + super(in); + Preconditions.checkNotNull(in); + Preconditions.checkArgument(limit >= 0, "limit must be non-negative"); + left = limit; + } + + @Override public int available() throws IOException { + return (int) Math.min(in.available(), left); + } + + @Override public synchronized void mark(int readlimit) { + in.mark(readlimit); + mark = left; + // it's okay to mark even if mark isn't supported, as reset won't work + } + + @Override public int read() throws IOException { + if (left == 0) { + return -1; + } + + int result = in.read(); + if (result != -1) { + --left; + } + return result; + } + + @Override public int read(byte[] b, int off, int len) throws IOException { + if (left == 0) { + return -1; + } + + len = (int) Math.min(len, left); + int result = in.read(b, off, len); + if (result != -1) { + left -= result; + } + return result; + } + + @Override public synchronized void reset() throws IOException { + if (!in.markSupported()) { + throw new IOException("Mark not supported"); + } + if (mark == -1) { + throw new IOException("Mark not set"); + } + + in.reset(); + left = mark; + } + + @Override public long skip(long n) throws IOException { + n = Math.min(n, left); + long skipped = in.skip(n); + left -= skipped; + return skipped; + } +} \ No newline at end of file diff --git a/asynchbase/src/test/java/com/yahoo/ycsb/db/AsyncHBaseTest.java b/asynchbase/src/test/java/com/yahoo/ycsb/db/AsyncHBaseTest.java new file mode 100644 index 0000000000000000000000000000000000000000..29a09a79677c7c42dd1b0a9177d9e24f0bbd0b53 --- /dev/null +++ b/asynchbase/src/test/java/com/yahoo/ycsb/db/AsyncHBaseTest.java @@ -0,0 +1,211 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; +import com.yahoo.ycsb.db.AsyncHBaseClient; +import com.yahoo.ycsb.measurements.Measurements; +import com.yahoo.ycsb.workloads.CoreWorkload; + +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Properties; +import java.util.Vector; + +/** + * Integration tests for the YCSB AsyncHBase client, using an HBase minicluster. + * These are the same as those for the hbase10 client. + */ +public class AsyncHBaseTest { + + private final static String COLUMN_FAMILY = "cf"; + + private static HBaseTestingUtility testingUtil; + private AsyncHBaseClient client; + private Table table = null; + + private static boolean isWindows() { + final String os = System.getProperty("os.name"); + return os.startsWith("Windows"); + } + + /** + * Creates a mini-cluster for use in these tests. + * + * This is a heavy-weight operation, so invoked only once for the test class. + */ + @BeforeClass + public static void setUpClass() throws Exception { + // Minicluster setup fails on Windows with an UnsatisfiedLinkError. + // Skip if windows. + assumeTrue(!isWindows()); + testingUtil = HBaseTestingUtility.createLocalHTU(); + testingUtil.startMiniCluster(); + } + + /** + * Tears down mini-cluster. + */ + @AfterClass + public static void tearDownClass() throws Exception { + if (testingUtil != null) { + testingUtil.shutdownMiniCluster(); + } + } + + /** + * Sets up the mini-cluster for testing. + * + * We re-create the table for each test. + */ + @Before + public void setUp() throws Exception { + Properties p = new Properties(); + p.setProperty("columnfamily", COLUMN_FAMILY); + + Measurements.setProperties(p); + final CoreWorkload workload = new CoreWorkload(); + workload.init(p); + + table = testingUtil.createTable(TableName.valueOf(CoreWorkload.table), Bytes.toBytes(COLUMN_FAMILY)); + + final String zkQuorum = "127.0.0.1:" + testingUtil.getZkCluster().getClientPort(); + p.setProperty("hbase.zookeeper.quorum", zkQuorum); + client = new AsyncHBaseClient(); + client.setProperties(p); + client.init(); + } + + @After + public void tearDown() throws Exception { + table.close(); + testingUtil.deleteTable(CoreWorkload.table); + } + + @Test + public void testRead() throws Exception { + final String rowKey = "row1"; + final Put p = new Put(Bytes.toBytes(rowKey)); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes("column1"), Bytes.toBytes("value1")); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes("column2"), Bytes.toBytes("value2")); + table.put(p); + + final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); + final Status status = client.read(CoreWorkload.table, rowKey, null, result); + assertEquals(Status.OK, status); + assertEquals(2, result.size()); + assertEquals("value1", result.get("column1").toString()); + assertEquals("value2", result.get("column2").toString()); + } + + @Test + public void testReadMissingRow() throws Exception { + final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); + final Status status = client.read(CoreWorkload.table, "Missing row", null, result); + assertEquals(Status.NOT_FOUND, status); + assertEquals(0, result.size()); + } + + @Test + public void testScan() throws Exception { + // Fill with data + final String colStr = "row_number"; + final byte[] col = Bytes.toBytes(colStr); + final int n = 10; + final List<Put> puts = new ArrayList<Put>(n); + for(int i = 0; i < n; i++) { + final byte[] key = Bytes.toBytes(String.format("%05d", i)); + final byte[] value = java.nio.ByteBuffer.allocate(4).putInt(i).array(); + final Put p = new Put(key); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), col, value); + puts.add(p); + } + table.put(puts); + + // Test + final Vector<HashMap<String, ByteIterator>> result = + new Vector<HashMap<String, ByteIterator>>(); + + // Scan 5 records, skipping the first + client.scan(CoreWorkload.table, "00001", 5, null, result); + + assertEquals(5, result.size()); + for(int i = 0; i < 5; i++) { + final HashMap<String, ByteIterator> row = result.get(i); + assertEquals(1, row.size()); + assertTrue(row.containsKey(colStr)); + final byte[] bytes = row.get(colStr).toArray(); + final ByteBuffer buf = ByteBuffer.wrap(bytes); + final int rowNum = buf.getInt(); + assertEquals(i + 1, rowNum); + } + } + + @Test + public void testUpdate() throws Exception{ + final String key = "key"; + final HashMap<String, String> input = new HashMap<String, String>(); + input.put("column1", "value1"); + input.put("column2", "value2"); + final Status status = client.insert(CoreWorkload.table, key, StringByteIterator.getByteIteratorMap(input)); + assertEquals(Status.OK, status); + + // Verify result + final Get get = new Get(Bytes.toBytes(key)); + final Result result = this.table.get(get); + assertFalse(result.isEmpty()); + assertEquals(2, result.size()); + for(final java.util.Map.Entry<String, String> entry : input.entrySet()) { + assertEquals(entry.getValue(), + new String(result.getValue(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes(entry.getKey())))); + } + } + + @Test + @Ignore("Not yet implemented") + public void testDelete() { + fail("Not yet implemented"); + } +} + diff --git a/asynchbase/src/test/resources/hbase-site.xml b/asynchbase/src/test/resources/hbase-site.xml new file mode 100644 index 0000000000000000000000000000000000000000..a8b29e451f440ad7c09b3b2f25eebaf56f07e6bb --- /dev/null +++ b/asynchbase/src/test/resources/hbase-site.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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. +--> + +<configuration> + <property> + <name>hbase.master.info.port</name> + <value>-1</value> + <description>The port for the hbase master web UI + Set to -1 if you do not want the info server to run. + </description> + </property> + <property> + <name>hbase.regionserver.info.port</name> + <value>-1</value> + <description>The port for the hbase regionserver web UI + Set to -1 if you do not want the info server to run. + </description> + </property> +</configuration> diff --git a/asynchbase/src/test/resources/log4j.properties b/asynchbase/src/test/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..a9df32e044b9374097b9c110a79f35ff34b5a793 --- /dev/null +++ b/asynchbase/src/test/resources/log4j.properties @@ -0,0 +1,28 @@ +# +# 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. +# + +# Root logger option +log4j.rootLogger=WARN, stderr + +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n + +# Suppress messages from ZKTableStateManager: Creates a large number of table +# state change messages. +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKTableStateManager=ERROR diff --git a/bin/bindings.properties b/bin/bindings.properties new file mode 100644 index 0000000000000000000000000000000000000000..da5dac7a53769fd0a792291e0fdfbc4c6cfb030e --- /dev/null +++ b/bin/bindings.properties @@ -0,0 +1,63 @@ +# +# 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. +# + +#DATABASE BINDINGS +# +# Available bindings should be listed here in the form of +# name:class +# +# - the name must start in column 0. +# - the name is also the directory where the class can be found. +# - if the directory contains multiple versions with different classes, +# use a dash with the version. (e.g. cassandra-7, cassandra-cql) +# +accumulo:com.yahoo.ycsb.db.accumulo.AccumuloClient +aerospike:com.yahoo.ycsb.db.AerospikeClient +asynchbase:com.yahoo.ycsb.db.AsyncHBaseClient +arangodb:com.yahoo.ycsb.db.ArangoDBClient +basic:com.yahoo.ycsb.BasicDB +cassandra-cql:com.yahoo.ycsb.db.CassandraCQLClient +cassandra2-cql:com.yahoo.ycsb.db.CassandraCQLClient +couchbase:com.yahoo.ycsb.db.CouchbaseClient +couchbase2:com.yahoo.ycsb.db.couchbase2.Couchbase2Client +dynamodb:com.yahoo.ycsb.db.DynamoDBClient +elasticsearch:com.yahoo.ycsb.db.ElasticsearchClient +geode:com.yahoo.ycsb.db.GeodeClient +googlebigtable:com.yahoo.ycsb.db.GoogleBigtableClient +googledatastore:com.yahoo.ycsb.db.GoogleDatastoreClient +hbase094:com.yahoo.ycsb.db.HBaseClient +hbase098:com.yahoo.ycsb.db.HBaseClient +hbase10:com.yahoo.ycsb.db.HBaseClient10 +hypertable:com.yahoo.ycsb.db.HypertableClient +infinispan-cs:com.yahoo.ycsb.db.InfinispanRemoteClient +infinispan:com.yahoo.ycsb.db.InfinispanClient +jdbc:com.yahoo.ycsb.db.JdbcDBClient +kudu:com.yahoo.ycsb.db.KuduYCSBClient +mapkeeper:com.yahoo.ycsb.db.MapKeeperClient +memcached:com.yahoo.ycsb.db.MemcachedClient +mongodb:com.yahoo.ycsb.db.MongoDbClient +mongodb-async:com.yahoo.ycsb.db.AsyncMongoDbClient +nosqldb:com.yahoo.ycsb.db.NoSqlDbClient +orientdb:com.yahoo.ycsb.db.OrientDBClient +rados:com.yahoo.ycsb.db.RadosClient +redis:com.yahoo.ycsb.db.RedisClient +riak:com.yahoo.ycsb.db.riak.RiakKVClient +s3:com.yahoo.ycsb.db.S3Client +solr:com.yahoo.ycsb.db.SolrClient +tarantool:com.yahoo.ycsb.db.TarantoolClient +voldemort:com.yahoo.ycsb.db.VoldemortClient + diff --git a/bin/ycsb b/bin/ycsb index ea1f653011d2fd28750a2be77815d2b79b8cf60e..470fdd8d2ad32900a62ea7e872bddd1bd114c248 100755 --- a/bin/ycsb +++ b/bin/ycsb @@ -1,6 +1,22 @@ #!/usr/bin/env python +# +# 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. +# -import argparse +import errno import fnmatch import io import os @@ -8,6 +24,13 @@ import shlex import sys import subprocess +try: + mod = __import__('argparse') + import argparse +except ImportError: + print >> sys.stderr, '[ERROR] argparse not found. Try installing it via "pip".' + exit(1) + BASE_URL = "https://github.com/brianfrankcooper/YCSB/tree/master/" COMMANDS = { "shell" : { @@ -28,29 +51,39 @@ COMMANDS = { } DATABASES = { - "accumulo" : "com.yahoo.ycsb.db.AccumuloClient", + "accumulo" : "com.yahoo.ycsb.db.accumulo.AccumuloClient", "aerospike" : "com.yahoo.ycsb.db.AerospikeClient", + "arangodb" : "com.yahoo.ycsb.db.ArangoDBClient", + "asynchbase" : "com.yahoo.ycsb.db.AsyncHBaseClient", "basic" : "com.yahoo.ycsb.BasicDB", - "cassandra-7" : "com.yahoo.ycsb.db.CassandraClient7", - "cassandra-8" : "com.yahoo.ycsb.db.CassandraClient8", - "cassandra-10" : "com.yahoo.ycsb.db.CassandraClient10", "cassandra-cql": "com.yahoo.ycsb.db.CassandraCQLClient", + "cassandra2-cql": "com.yahoo.ycsb.db.CassandraCQLClient", "couchbase" : "com.yahoo.ycsb.db.CouchbaseClient", + "couchbase2" : "com.yahoo.ycsb.db.couchbase2.Couchbase2Client", "dynamodb" : "com.yahoo.ycsb.db.DynamoDBClient", - "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", + "elasticsearch": "com.yahoo.ycsb.db.ElasticsearchClient", + "geode" : "com.yahoo.ycsb.db.GeodeClient", + "googlebigtable" : "com.yahoo.ycsb.db.GoogleBigtableClient", + "googledatastore" : "com.yahoo.ycsb.db.GoogleDatastoreClient", + "hbase094" : "com.yahoo.ycsb.db.HBaseClient", + "hbase098" : "com.yahoo.ycsb.db.HBaseClient", + "hbase10" : "com.yahoo.ycsb.db.HBaseClient10", "hypertable" : "com.yahoo.ycsb.db.HypertableClient", "infinispan-cs": "com.yahoo.ycsb.db.InfinispanRemoteClient", "infinispan" : "com.yahoo.ycsb.db.InfinispanClient", "jdbc" : "com.yahoo.ycsb.db.JdbcDBClient", + "kudu" : "com.yahoo.ycsb.db.KuduYCSBClient", "mapkeeper" : "com.yahoo.ycsb.db.MapKeeperClient", + "memcached" : "com.yahoo.ycsb.db.MemcachedClient", "mongodb" : "com.yahoo.ycsb.db.MongoDbClient", "mongodb-async": "com.yahoo.ycsb.db.AsyncMongoDbClient", "nosqldb" : "com.yahoo.ycsb.db.NoSqlDbClient", "orientdb" : "com.yahoo.ycsb.db.OrientDBClient", + "rados" : "com.yahoo.ycsb.db.RadosClient", "redis" : "com.yahoo.ycsb.db.RedisClient", + "riak" : "com.yahoo.ycsb.db.riak.RiakKVClient", + "s3" : "com.yahoo.ycsb.db.S3Client", + "solr" : "com.yahoo.ycsb.db.SolrClient", "tarantool" : "com.yahoo.ycsb.db.TarantoolClient", "voldemort" : "com.yahoo.ycsb.db.VoldemortClient" } @@ -90,6 +123,42 @@ def usage(): return output.getvalue() +# Python 2.6 doesn't have check_output. Add the method as it is in Python 2.7 +# Based on https://github.com/python/cpython/blob/2.7/Lib/subprocess.py#L545 +def check_output(*popenargs, **kwargs): + r"""Run command with arguments and return its output as a byte string. + + If the exit code was non-zero it raises a CalledProcessError. The + CalledProcessError object will have the return code in the returncode + attribute and output in the output attribute. + + The arguments are the same as for the Popen constructor. Example: + + >>> check_output(["ls", "-l", "/dev/null"]) + 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + + The stdout argument is not allowed as it is used internally. + To capture standard error in the result, use stderr=STDOUT. + + >>> check_output(["/bin/sh", "-c", + ... "ls -l non_existent_file ; exit 0"], + ... stderr=STDOUT) + 'ls: non_existent_file: No such file or directory\n' + """ + if 'stdout' in kwargs: + raise ValueError('stdout argument not allowed, it will be overridden.') + process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) + output, unused_err = process.communicate() + retcode = process.poll() + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + error = subprocess.CalledProcessError(retcode, cmd) + error.output = output + raise error + return output + def debug(message): print >> sys.stderr, "[DEBUG] ", message @@ -106,7 +175,6 @@ def find_jars(dir, glob='*.jar'): jars.append(os.path.join(dirpath, filename)) return jars - def get_ycsb_home(): dir = os.path.abspath(os.path.dirname(sys.argv[0])) while "LICENSE.txt" not in os.listdir(dir): @@ -121,15 +189,16 @@ def is_distribution(): # presumes maven can run, so should only be run on source checkouts # will invoke the 'package' goal for the given binding in order to resolve intra-project deps # presumes maven properly handles system-specific path separators -def get_classpath_from_maven(database): +# Given module is full module name eg. 'core' or 'couchbase-binding' +def get_classpath_from_maven(module): try: - debug("Running 'mvn -pl com.yahoo.ycsb:"+database+"-binding -am package -DskipTests " + debug("Running 'mvn -pl com.yahoo.ycsb:" + module + " -am package -DskipTests " "dependency:build-classpath -DincludeScope=compile -Dmdep.outputFilterFile=true'") - mvn_output = subprocess.check_output(["mvn", "-pl", "com.yahoo.ycsb:"+database+"-binding", - "-am", "package", "-DskipTests", - "dependency:build-classpath", - "-DincludeScope=compile", - "-Dmdep.outputFilterFile=true"]) + mvn_output = check_output(["mvn", "-pl", "com.yahoo.ycsb:" + module, + "-am", "package", "-DskipTests", + "dependency:build-classpath", + "-DincludeScope=compile", + "-Dmdep.outputFilterFile=true"]) # the above outputs a "classpath=/path/tojar:/path/to/other/jar" for each module # the last module will be the datastore binding line = [x for x in mvn_output.splitlines() if x.startswith("classpath=")][-1:] @@ -171,6 +240,17 @@ def main(): # Classpath set up binding = args.database.split("-")[0] + + if binding == "cassandra2": + warn("The 'cassandra2-cql' client has been deprecated. It has been " + "renamed to simply 'cassandra-cql'. This alias will be removed" + " in the next YCSB release.") + binding = "cassandra" + + if binding == "couchbase": + warn("The 'couchbase' client has been deprecated. If you are using " + "Couchbase 4.0+ try using the 'couchbase2' 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. @@ -183,12 +263,14 @@ def main(): warn("Running against a source checkout. In order to get our runtime " "dependencies we'll have to invoke Maven. Depending on the state " "of your system, this may take ~30-45 seconds") - db_dir = os.path.join(ycsb_home, binding) + db_location = "core" if binding == "basic" else binding + project = "core" if binding == "basic" else binding + "-binding" + db_dir = os.path.join(ycsb_home, db_location) # goes first so we can rely on side-effect of package - maven_says = get_classpath_from_maven(binding) + maven_says = get_classpath_from_maven(project) # TODO when we have a version property, skip the glob cp = find_jars(os.path.join(db_dir, "target"), - binding + "-binding*.jar") + project + "*.jar") # alredy in jar:jar:jar form cp.append(maven_says) cp.insert(0, os.path.join(db_dir, "conf")) @@ -202,8 +284,14 @@ def main(): if command: ycsb_command.append(command) print >> sys.stderr, " ".join(ycsb_command) - return subprocess.call(ycsb_command) - + try: + return subprocess.call(ycsb_command) + except OSError as e: + if e.errno == errno.ENOENT: + error('Command failed. Is java installed and on your PATH?') + return 1 + else: + raise if __name__ == '__main__': sys.exit(main()) diff --git a/bin/ycsb.bat b/bin/ycsb.bat new file mode 100644 index 0000000000000000000000000000000000000000..f8ea7b4e25671b35586e1b9309993d610e69a7ac --- /dev/null +++ b/bin/ycsb.bat @@ -0,0 +1,208 @@ +@REM +@REM Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); you +@REM may not use this file except in compliance with the License. You +@REM may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +@REM implied. See the License for the specific language governing +@REM permissions and limitations under the License. See accompanying +@REM LICENSE file. +@REM +@REM ----------------------------------------------------------------------- +@REM Control Script for YCSB +@REM +@REM Environment Variable Prerequisites +@REM +@REM Do not set the variables in this script. Instead put them into a script +@REM setenv.sh in YCSB_HOME/bin to keep your customizations separate. +@REM +@REM YCSB_HOME (Optional) YCSB installation directory. If not set +@REM this script will use the parent directory of where this +@REM script is run from. +@REM +@REM JAVA_HOME (Required) Must point at your Java Development Kit +@REM or Java Runtime Environment installation. +@REM +@REM JAVA_OPTS (Optional) Java runtime options used when any command +@REM is executed. +@REM +@REM WARNING!!! YCSB home must be located in a directory path that doesn't +@REM contain spaces. +@REM + +@ECHO OFF +SETLOCAL ENABLEDELAYEDEXPANSION + +@REM Only set YCSB_HOME if not already set +PUSHD %~dp0.. +IF NOT DEFINED YCSB_HOME SET YCSB_HOME=%CD% +POPD + +@REM Ensure that any extra CLASSPATH variables are set via setenv.bat +SET CLASSPATH= + +@REM Pull in customization options +if exist "%YCSB_HOME%\bin\setenv.bat" call "%YCSB_HOME%\bin\setenv.bat" + +@REM Check if we have a usable JDK +IF "%JAVA_HOME%." == "." GOTO noJavaHome +IF NOT EXIST "%JAVA_HOME%\bin\java.exe" GOTO noJavaHome +GOTO okJava +:noJavaHome +ECHO The JAVA_HOME environment variable is not defined correctly. +GOTO exit +:okJava + +@REM Determine YCSB command argument +IF NOT "load" == "%1" GOTO noload +SET YCSB_COMMAND=-load +SET YCSB_CLASS=com.yahoo.ycsb.Client +GOTO gotCommand +:noload +IF NOT "run" == "%1" GOTO noRun +SET YCSB_COMMAND=-t +SET YCSB_CLASS=com.yahoo.ycsb.Client +GOTO gotCommand +:noRun +IF NOT "shell" == "%1" GOTO noShell +SET YCSB_COMMAND= +SET YCSB_CLASS=com.yahoo.ycsb.CommandLine +GOTO gotCommand +:noShell +ECHO [ERROR] Found unknown command '%1' +ECHO [ERROR] Expected one of 'load', 'run', or 'shell'. Exiting. +GOTO exit +:gotCommand + +@REM Find binding information +FOR /F "delims=" %%G in ( + 'FINDSTR /B "%2:" %YCSB_HOME%\bin\bindings.properties' +) DO SET "BINDING_LINE=%%G" + +IF NOT "%BINDING_LINE%." == "." GOTO gotBindingLine +ECHO [ERROR] The specified binding '%2' was not found. Exiting. +GOTO exit +:gotBindingLine + +@REM Pull out binding name and class +FOR /F "tokens=1-2 delims=:" %%G IN ("%BINDING_LINE%") DO ( + SET BINDING_NAME=%%G + SET BINDING_CLASS=%%H +) + +@REM Some bindings have multiple versions that are managed in the same +@REM directory. +@REM They are noted with a '-' after the binding name. +@REM (e.g. cassandra-7 & cassandra-8) +FOR /F "tokens=1 delims=-" %%G IN ("%BINDING_NAME%") DO ( + SET BINDING_DIR=%%G +) + +@REM The 'basic' binding is core functionality +IF NOT "%BINDING_NAME%" == "basic" GOTO noBasic +SET BINDING_DIR=core +:noBasic + +@REM Add Top level conf to classpath +IF "%CLASSPATH%." == "." GOTO emptyClasspath +SET CLASSPATH=%CLASSPATH%;%YCSB_HOME%\conf +GOTO confAdded +:emptyClasspath +SET CLASSPATH=%YCSB_HOME%\conf +:confAdded + +@REM Cassandra2 deprecation message +IF NOT "%BINDING_DIR%" == "cassandra2" GOTO notAliasCassandra +echo [WARN] The 'cassandra2-cql' client has been deprecated. It has been renamed to simply 'cassandra-cql'. This alias will be removed in the next YCSB release. +SET BINDING_DIR=cassandra +:notAliasCassandra + +@REM Build classpath according to source checkout or release distribution +IF EXIST "%YCSB_HOME%\pom.xml" GOTO gotSource + +@REM Core libraries +FOR %%F IN (%YCSB_HOME%\lib\*.jar) DO ( + SET CLASSPATH=!CLASSPATH!;%%F% +) + +@REM Database conf dir +IF NOT EXIST "%YCSB_HOME%\%BINDING_DIR%-binding\conf" GOTO noBindingConf +set CLASSPATH=%CLASSPATH%;%YCSB_HOME%\%BINDING_DIR%-binding\conf +:noBindingConf + +@REM Database libraries +FOR %%F IN (%YCSB_HOME%\%BINDING_DIR%-binding\lib\*.jar) DO ( + SET CLASSPATH=!CLASSPATH!;%%F% +) +GOTO classpathComplete + +:gotSource +@REM Check for some basic libraries to see if the source has been built. +IF EXIST "%YCSB_HOME%\%BINDING_DIR%\target\*.jar" GOTO gotJars + +@REM Call mvn to build source checkout. +IF "%BINDING_NAME%" == "basic" GOTO buildCore +SET MVN_PROJECT=%BINDING_DIR%-binding +goto gotMvnProject +:buildCore +SET MVN_PROJECT=core +:gotMvnProject + +ECHO [WARN] YCSB libraries not found. Attempting to build... +CALL mvn -pl com.yahoo.ycsb:%MVN_PROJECT% -am package -DskipTests +IF %ERRORLEVEL% NEQ 0 ( + ECHO [ERROR] Error trying to build project. Exiting. + GOTO exit +) + +:gotJars +@REM Core libraries +FOR %%F IN (%YCSB_HOME%\core\target\*.jar) DO ( + SET CLASSPATH=!CLASSPATH!;%%F% +) + +@REM Database conf (need to find because location is not consistent) +FOR /D /R %YCSB_HOME%\%BINDING_DIR% %%F IN (*) DO ( + IF "%%~nxF" == "conf" SET CLASSPATH=!CLASSPATH!;%%F% +) + +@REM Database libraries +FOR %%F IN (%YCSB_HOME%\%BINDING_DIR%\target\*.jar) DO ( + SET CLASSPATH=!CLASSPATH!;%%F% +) + +@REM Database dependency libraries +FOR %%F IN (%YCSB_HOME%\%BINDING_DIR%\target\dependency\*.jar) DO ( + SET CLASSPATH=!CLASSPATH!;%%F% +) + +:classpathComplete + +@REM Couchbase deprecation message +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 Get the rest of the arguments, skipping the first 2 +FOR /F "tokens=2*" %%G IN ("%*") DO ( + SET YCSB_ARGS=%%H +) + +@REM Run YCSB +@ECHO ON +"%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% -classpath "%CLASSPATH%" %YCSB_CLASS% %YCSB_COMMAND% -db %BINDING_CLASS% %YCSB_ARGS% +@ECHO OFF + +GOTO end + +:exit +EXIT /B 1; + +:end + diff --git a/bin/ycsb.sh b/bin/ycsb.sh new file mode 100755 index 0000000000000000000000000000000000000000..d62c22a4e4a8659e25817d44624e8f4782ff49ff --- /dev/null +++ b/bin/ycsb.sh @@ -0,0 +1,243 @@ +#!/bin/sh +# +# 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. +# +# ----------------------------------------------------------------------------- +# Control Script for YCSB +# +# Environment Variable Prerequisites +# +# Do not set the variables in this script. Instead put them into a script +# setenv.sh in YCSB_HOME/bin to keep your customizations separate. +# +# YCSB_HOME (Optional) YCSB installation directory. If not set +# this script will use the parent directory of where this +# script is run from. +# +# JAVA_HOME (Optional) Must point at your Java Development Kit +# installation. If empty, this script tries use the +# available java executable. +# +# JAVA_OPTS (Optional) Java runtime options used when any command +# is executed. +# +# WARNING!!! YCSB home must be located in a directory path that doesn't +# contain spaces. +# +# www.shellcheck.net was used to validate this script + +# Cygwin support +CYGWIN=false +case "$(uname)" in +CYGWIN*) CYGWIN=true;; +esac + +# Get script path +SCRIPT_DIR=$(dirname "$0" 2>/dev/null) + +# Only set YCSB_HOME if not already set +[ -z "$YCSB_HOME" ] && YCSB_HOME=$(cd "$SCRIPT_DIR/.." || exit; pwd) + +# Ensure that any extra CLASSPATH variables are set via setenv.sh +CLASSPATH= + +# Pull in customization options +if [ -r "$YCSB_HOME/bin/setenv.sh" ]; then + # Shellcheck wants a source, but this directive only runs if available + # So, tell shellcheck to ignore + # shellcheck source=/dev/null + . "$YCSB_HOME/bin/setenv.sh" +fi + +# Attempt to find the available JAVA, if JAVA_HOME not set +if [ -z "$JAVA_HOME" ]; then + JAVA_PATH=$(which java 2>/dev/null) + if [ "x$JAVA_PATH" != "x" ]; then + JAVA_HOME=$(dirname "$(dirname "$JAVA_PATH" 2>/dev/null)") + fi +fi + +# If JAVA_HOME still not set, error +if [ -z "$JAVA_HOME" ]; then + echo "[ERROR] Java executable not found. Exiting." + exit 1; +fi + +# Determine YCSB command argument +if [ "load" = "$1" ] ; then + YCSB_COMMAND=-load + YCSB_CLASS=com.yahoo.ycsb.Client +elif [ "run" = "$1" ] ; then + YCSB_COMMAND=-t + YCSB_CLASS=com.yahoo.ycsb.Client +elif [ "shell" = "$1" ] ; then + YCSB_COMMAND= + YCSB_CLASS=com.yahoo.ycsb.CommandLine +else + echo "[ERROR] Found unknown command '$1'" + echo "[ERROR] Expected one of 'load', 'run', or 'shell'. Exiting." + exit 1; +fi + +# Find binding information +BINDING_LINE=$(grep "^$2:" "$YCSB_HOME/bin/bindings.properties" -m 1) + +if [ -z "$BINDING_LINE" ] ; then + echo "[ERROR] The specified binding '$2' was not found. Exiting." + exit 1; +fi + +# Get binding name and class +BINDING_NAME=$(echo "$BINDING_LINE" | cut -d':' -f1) +BINDING_CLASS=$(echo "$BINDING_LINE" | cut -d':' -f2) + +# Some bindings have multiple versions that are managed in the same directory. +# They are noted with a '-' after the binding name. +# (e.g. cassandra-7 & cassandra-8) +BINDING_DIR=$(echo "$BINDING_NAME" | cut -d'-' -f1) + +# The 'basic' binding is core functionality +if [ "$BINDING_NAME" = "basic" ] ; then + BINDING_DIR=core +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $CYGWIN; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# Check if source checkout, or release distribution +DISTRIBUTION=true +if [ -r "$YCSB_HOME/pom.xml" ]; then + DISTRIBUTION=false; +fi + +# Add Top level conf to classpath +if [ -z "$CLASSPATH" ] ; then + CLASSPATH="$YCSB_HOME/conf" +else + CLASSPATH="$CLASSPATH:$YCSB_HOME/conf" +fi + +# Cassandra2 deprecation message +if [ "${BINDING_DIR}" = "cassandra2" ] ; then + echo "[WARN] The 'cassandra2-cql' client has been deprecated. It has been \ +renamed to simply 'cassandra-cql'. This alias will be removed in the next \ +YCSB release." + BINDING_DIR="cassandra" +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. +if $DISTRIBUTION; then + # Core libraries + for f in "$YCSB_HOME"/lib/*.jar ; do + if [ -r "$f" ] ; then + CLASSPATH="$CLASSPATH:$f" + fi + done + + # Database conf dir + if [ -r "$YCSB_HOME"/"$BINDING_DIR"-binding/conf ] ; then + CLASSPATH="$CLASSPATH:$YCSB_HOME/$BINDING_DIR-binding/conf" + fi + + # Database libraries + for f in "$YCSB_HOME"/"$BINDING_DIR"-binding/lib/*.jar ; do + if [ -r "$f" ] ; then + CLASSPATH="$CLASSPATH:$f" + fi + done + +# Source checkout +else + # Check for some basic libraries to see if the source has been built. + for f in "$YCSB_HOME"/"$BINDING_DIR"/target/*.jar ; do + + # Call mvn to build source checkout. + if [ ! -e "$f" ] ; then + if [ "$BINDING_NAME" = "basic" ] ; then + MVN_PROJECT=core + else + MVN_PROJECT="$BINDING_DIR"-binding + fi + + echo "[WARN] YCSB libraries not found. Attempting to build..." + mvn -pl com.yahoo.ycsb:"$MVN_PROJECT" -am package -DskipTests + if [ "$?" -ne 0 ] ; then + echo "[ERROR] Error trying to build project. Exiting." + exit 1; + fi + fi + + done + + # Core libraries + for f in "$YCSB_HOME"/core/target/*.jar ; do + if [ -r "$f" ] ; then + CLASSPATH="$CLASSPATH:$f" + fi + done + + # Database conf (need to find because location is not consistent) + CLASSPATH_CONF=$(find "$YCSB_HOME"/$BINDING_DIR -name "conf" | while IFS="" read -r file; do echo ":$file"; done) + if [ "x$CLASSPATH_CONF" != "x" ]; then + CLASSPATH="$CLASSPATH$CLASSPATH_CONF" + fi + + + # Database libraries + for f in "$YCSB_HOME"/"$BINDING_DIR"/target/*.jar ; do + if [ -r "$f" ] ; then + CLASSPATH="$CLASSPATH:$f" + fi + done + + # Database dependency libraries + for f in "$YCSB_HOME"/"$BINDING_DIR"/target/dependency/*.jar ; do + if [ -r "$f" ] ; then + CLASSPATH="$CLASSPATH:$f" + fi + done +fi + +# Couchbase deprecation message +if [ "${BINDING_DIR}" = "couchbase" ] ; then + echo "[WARN] The 'couchbase' client is deprecated. If you are using \ +Couchbase 4.0+ try using the 'couchbase2' 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") + [ -n "$CLASSPATH" ] && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") +fi + +# Get the rest of the arguments +YCSB_ARGS=$(echo "$@" | cut -d' ' -f3-) + +# About to run YCSB +echo "$JAVA_HOME/bin/java $JAVA_OPTS -classpath $CLASSPATH $YCSB_CLASS $YCSB_COMMAND -db $BINDING_CLASS $YCSB_ARGS" + +# Run YCSB +# Shellcheck reports the following line as needing double quotes to prevent +# globbing and word splitting. However, word splitting is the desired effect +# here. So, the shellcheck error is disabled for this line. +# shellcheck disable=SC2086 +"$JAVA_HOME/bin/java" $JAVA_OPTS -classpath "$CLASSPATH" $YCSB_CLASS $YCSB_COMMAND -db $BINDING_CLASS $YCSB_ARGS + diff --git a/binding-parent/datastore-specific-descriptor/pom.xml b/binding-parent/datastore-specific-descriptor/pom.xml index 12704be14398ddb974442a69aba4a2713af754de..f10a8bdd99773c27af294c7b413b93a6ca57896a 100644 --- a/binding-parent/datastore-specific-descriptor/pom.xml +++ b/binding-parent/datastore-specific-descriptor/pom.xml @@ -1,10 +1,27 @@ +<!-- +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. +--> + <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>root</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../../</relativePath> </parent> diff --git a/binding-parent/datastore-specific-descriptor/src/main/resources/assemblies/datastore-specific-assembly.xml b/binding-parent/datastore-specific-descriptor/src/main/resources/assemblies/datastore-specific-assembly.xml index 0d667dffb9e691e68807209a3a74477740eea6c7..2bf1900f2d29058665d65a2f0b562f6922033ea6 100644 --- a/binding-parent/datastore-specific-descriptor/src/main/resources/assemblies/datastore-specific-assembly.xml +++ b/binding-parent/datastore-specific-descriptor/src/main/resources/assemblies/datastore-specific-assembly.xml @@ -1,3 +1,20 @@ +<!-- +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. +--> + <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>dist</id> @@ -24,7 +41,7 @@ <outputDirectory>bin</outputDirectory> <fileMode>0755</fileMode> <includes> - <include>ycsb</include> + <include>ycsb*</include> </includes> </fileSet> <fileSet> diff --git a/binding-parent/pom.xml b/binding-parent/pom.xml index f8a5d0d9fd935f7ab4f3497ab768da2583775c28..a05a0ae36370bee60e6c8d878c16ba6c5f6668cb 100644 --- a/binding-parent/pom.xml +++ b/binding-parent/pom.xml @@ -1,10 +1,27 @@ +<!-- +Copyright (c) 2015-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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.yahoo.ycsb</groupId> <artifactId>root</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> </parent> <artifactId>binding-parent</artifactId> @@ -43,6 +60,7 @@ <format>tar.gz</format> </formats> <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>posix</tarLongFileMode> </configuration> <executions> <execution> @@ -53,6 +71,18 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <executions> + <execution> + <id>validate</id> + <configuration> + <configLocation>../checkstyle.xml</configLocation> + </configuration> + </execution> + </executions> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> diff --git a/cassandra/README.md b/cassandra/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bee44c8d8c41a36f459d0b38b54d35422dddac1a --- /dev/null +++ b/cassandra/README.md @@ -0,0 +1,80 @@ +<!-- +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. +--> + +# Apache Cassandra 2.x CQL binding + +Binding for [Apache Cassandra](http://cassandra.apache.org), using the CQL API +via the [DataStax +driver](http://docs.datastax.com/en/developer/java-driver/2.1/java-driver/whatsNew2.html). + +To run against the (deprecated) Cassandra Thrift API, use the `cassandra-10` binding. + +## Creating a table for use with YCSB + +For keyspace `ycsb`, table `usertable`: + + cqlsh> create keyspace ycsb + WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 3 }; + cqlsh> USE ycsb; + cqlsh> create table usertable ( + y_id varchar primary key, + field0 varchar, + field1 varchar, + field2 varchar, + field3 varchar, + field4 varchar, + field5 varchar, + field6 varchar, + field7 varchar, + field8 varchar, + field9 varchar); + +**Note that `replication_factor` and consistency levels (below) will affect performance.** + +## Cassandra Configuration Parameters + +- `hosts` (**required**) + - Cassandra nodes to connect to. + - No default. + +* `port` + * CQL port for communicating with Cassandra cluster. + * Default is `9042`. + +- `cassandra.keyspace` + Keyspace name - must match the keyspace for the table created (see above). + See http://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_keyspace_r.html for details. + + - Default value is `ycsb` + +- `cassandra.username` +- `cassandra.password` + - Optional user name and password for authentication. See http://docs.datastax.com/en/cassandra/2.0/cassandra/security/security_config_native_authenticate_t.html for details. + +* `cassandra.readconsistencylevel` +* `cassandra.writeconsistencylevel` + + * Default value is `ONE` + - Consistency level for reads and writes, respectively. See the [DataStax documentation](http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html) for details. + * *Note that the default setting does not provide durability in the face of node failure. Changing this setting will affect observed performance.* See also `replication_factor`, above. + +* `cassandra.maxconnections` +* `cassandra.coreconnections` + * Defaults for max and core connections can be found here: https://datastax.github.io/java-driver/2.1.8/features/pooling/#pool-size. Cassandra 2.0.X falls under protocol V2, Cassandra 2.1+ falls under protocol V3. +* `cassandra.connecttimeoutmillis` +* `cassandra.readtimeoutmillis` + * Defaults for connect and read timeouts can be found here: https://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/SocketOptions.html. \ No newline at end of file diff --git a/cassandra/pom.xml b/cassandra/pom.xml index db7785d0a564601b85c5efcef3e9d344d9eecf88..15a145eafc896387a6045d05a3fecdae04350936 100644 --- a/cassandra/pom.xml +++ b/cassandra/pom.xml @@ -1,34 +1,81 @@ <?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"> + +<!-- +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.3.0-SNAPSHOT</version> - <relativePath>../binding-parent</relativePath> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>binding-parent</artifactId> + <version>0.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> </parent> - + <artifactId>cassandra-binding</artifactId> - <name>Cassandra DB Binding</name> + <name>Cassandra 2.1+ DB Binding</name> <packaging>jar</packaging> + <properties> + <!-- Skip tests by default. will be activated by jdk8 profile --> + <skipTests>true</skipTests> + </properties> + <dependencies> - <dependency> - <groupId>org.apache.cassandra</groupId> - <artifactId>cassandra-all</artifactId> - <version>${cassandra.version}</version> - </dependency> - <!-- CQL driver --> - <dependency> - <groupId>com.datastax.cassandra</groupId> - <artifactId>cassandra-driver-core</artifactId> - <version>${cassandra.cql.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>core</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> + <!-- CQL driver --> + <dependency> + <groupId>com.datastax.cassandra</groupId> + <artifactId>cassandra-driver-core</artifactId> + <version>${cassandra.cql.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.cassandraunit</groupId> + <artifactId>cassandra-unit</artifactId> + <version>3.0.0.1</version> + <classifier>shaded</classifier> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> </dependencies> + + <profiles> + <!-- Cassandra 2.2+ requires JDK8 to run, so none of our tests + will work unless we're using jdk8. + --> + <profile> + <id>jdk8-tests</id> + <activation> + <jdk>1.8</jdk> + </activation> + <properties> + <skipTests>false</skipTests> + </properties> + </profile> + </profiles> </project> diff --git a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraCQLClient.java b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraCQLClient.java old mode 100755 new mode 100644 index cac333424c12a9531a80a23337f0664cfd39c422..d4dc8c7707b429f090561967d35acaa5052c4cac --- a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraCQLClient.java +++ b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraCQLClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2013 Yahoo! Inc. All rights reserved. + * Copyright (c) 2013-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 @@ -17,402 +17,464 @@ */ package com.yahoo.ycsb.db; -import com.datastax.driver.core.*; +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.ColumnDefinitions; +import com.datastax.driver.core.ConsistencyLevel; +import com.datastax.driver.core.Host; +import com.datastax.driver.core.HostDistance; +import com.datastax.driver.core.Metadata; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Session; +import com.datastax.driver.core.SimpleStatement; +import com.datastax.driver.core.Statement; import com.datastax.driver.core.querybuilder.Insert; import com.datastax.driver.core.querybuilder.QueryBuilder; import com.datastax.driver.core.querybuilder.Select; -import com.yahoo.ycsb.*; -import java.nio.ByteBuffer; +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import java.nio.ByteBuffer; +import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.HashMap; import java.util.Vector; import java.util.concurrent.atomic.AtomicInteger; - /** - * Tested with Cassandra 2.0, CQL client for YCSB framework - * - * In CQLSH, create keyspace and table. Something like: - * cqlsh> create keyspace ycsb - * WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1 }; - * cqlsh> create table usertable ( - * y_id varchar primary key, - * field0 varchar, - * field1 varchar, - * field2 varchar, - * field3 varchar, - * field4 varchar, - * field5 varchar, - * field6 varchar, - * field7 varchar, - * field8 varchar, - * field9 varchar); + * Cassandra 2.x CQL client. + * + * See {@code cassandra2/README.md} for details. * * @author cmatser */ public class CassandraCQLClient extends DB { - private static Cluster cluster = null; - private static Session session = null; - - private static ConsistencyLevel readConsistencyLevel = ConsistencyLevel.ONE; - private static ConsistencyLevel writeConsistencyLevel = ConsistencyLevel.ONE; - - public static final int OK = 0; - public static final int ERR = -1; - - public static final String YCSB_KEY = "y_id"; - public static final String KEYSPACE_PROPERTY = "cassandra.keyspace"; - public static final String KEYSPACE_PROPERTY_DEFAULT = "ycsb"; - public static final String USERNAME_PROPERTY = "cassandra.username"; - public static final String PASSWORD_PROPERTY = "cassandra.password"; - - public static final String READ_CONSISTENCY_LEVEL_PROPERTY = "cassandra.readconsistencylevel"; - public static final String READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY = "cassandra.writeconsistencylevel"; - public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - - /** Count the number of times initialized to teardown on the last {@link #cleanup()}. */ - private static final AtomicInteger initCount = new AtomicInteger(0); - - private static boolean _debug = false; - - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - */ - @Override - public void init() throws DBException { - - //Keep track of number of calls to init (for later cleanup) - initCount.incrementAndGet(); - - //Synchronized so that we only have a single - // cluster/session instance for all the threads. - synchronized (initCount) { - - //Check if the cluster has already been initialized - if (cluster != null) { - return; - } - - try { - - _debug = Boolean.parseBoolean(getProperties().getProperty("debug", "false")); - - String host = getProperties().getProperty("host"); - if (host == null) { - throw new DBException("Required property \"host\" missing for CassandraClient"); - } - String hosts[] = host.split(" "); - String port = getProperties().getProperty("port", "9160"); - if (port == null) { - throw new DBException("Required property \"port\" missing for CassandraClient"); - } - - String username = getProperties().getProperty(USERNAME_PROPERTY); - String password = getProperties().getProperty(PASSWORD_PROPERTY); - - String keyspace = getProperties().getProperty(KEYSPACE_PROPERTY, KEYSPACE_PROPERTY_DEFAULT); - - readConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(READ_CONSISTENCY_LEVEL_PROPERTY, READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - writeConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(WRITE_CONSISTENCY_LEVEL_PROPERTY, WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - - // public void connect(String node) {} - if ((username != null) && !username.isEmpty()) { - cluster = Cluster.builder() - .withCredentials(username, password) - .withPort(Integer.valueOf(port)) - .addContactPoints(hosts).build(); - } - else { - cluster = Cluster.builder() - .withPort(Integer.valueOf(port)) - .addContactPoints(hosts).build(); - } - - //Update number of connections based on threads - int threadcount = Integer.parseInt(getProperties().getProperty("threadcount","1")); - cluster.getConfiguration().getPoolingOptions().setMaxConnectionsPerHost(HostDistance.LOCAL, threadcount); - - //Set connection timeout 3min (default is 5s) - cluster.getConfiguration().getSocketOptions().setConnectTimeoutMillis(3*60*1000); - //Set read (execute) timeout 3min (default is 12s) - cluster.getConfiguration().getSocketOptions().setReadTimeoutMillis(3*60*1000); - - Metadata metadata = cluster.getMetadata(); - System.out.printf("Connected to cluster: %s\n", metadata.getClusterName()); - - for (Host discoveredHost : metadata.getAllHosts()) { - System.out.printf("Datacenter: %s; Host: %s; Rack: %s\n", - discoveredHost.getDatacenter(), - discoveredHost.getAddress(), - discoveredHost.getRack()); - } - - session = cluster.connect(keyspace); - - } catch (Exception e) { - throw new DBException(e); - } - }//synchronized - } - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - @Override - public void cleanup() throws DBException { - if (initCount.decrementAndGet() <= 0) { - cluster.shutdown(); + private static Cluster cluster = null; + private static Session session = null; + + private static ConsistencyLevel readConsistencyLevel = ConsistencyLevel.ONE; + private static ConsistencyLevel writeConsistencyLevel = ConsistencyLevel.ONE; + + public static final String YCSB_KEY = "y_id"; + public static final String KEYSPACE_PROPERTY = "cassandra.keyspace"; + public static final String KEYSPACE_PROPERTY_DEFAULT = "ycsb"; + public static final String USERNAME_PROPERTY = "cassandra.username"; + public static final String PASSWORD_PROPERTY = "cassandra.password"; + + public static final String HOSTS_PROPERTY = "hosts"; + public static final String PORT_PROPERTY = "port"; + public static final String PORT_PROPERTY_DEFAULT = "9042"; + + public static final String READ_CONSISTENCY_LEVEL_PROPERTY = + "cassandra.readconsistencylevel"; + public static final String READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; + public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY = + "cassandra.writeconsistencylevel"; + public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; + + public static final String MAX_CONNECTIONS_PROPERTY = + "cassandra.maxconnections"; + public static final String CORE_CONNECTIONS_PROPERTY = + "cassandra.coreconnections"; + public static final String CONNECT_TIMEOUT_MILLIS_PROPERTY = + "cassandra.connecttimeoutmillis"; + public static final String READ_TIMEOUT_MILLIS_PROPERTY = + "cassandra.readtimeoutmillis"; + + /** + * Count the number of times initialized to teardown on the last + * {@link #cleanup()}. + */ + private static final AtomicInteger INIT_COUNT = new AtomicInteger(0); + + private static boolean debug = false; + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public void init() throws DBException { + + // Keep track of number of calls to init (for later cleanup) + INIT_COUNT.incrementAndGet(); + + // Synchronized so that we only have a single + // cluster/session instance for all the threads. + synchronized (INIT_COUNT) { + + // Check if the cluster has already been initialized + if (cluster != null) { + return; + } + + try { + + debug = + Boolean.parseBoolean(getProperties().getProperty("debug", "false")); + + String host = getProperties().getProperty(HOSTS_PROPERTY); + if (host == null) { + throw new DBException(String.format( + "Required property \"%s\" missing for CassandraCQLClient", + HOSTS_PROPERTY)); + } + String[] hosts = host.split(","); + String port = getProperties().getProperty(PORT_PROPERTY, PORT_PROPERTY_DEFAULT); + + String username = getProperties().getProperty(USERNAME_PROPERTY); + String password = getProperties().getProperty(PASSWORD_PROPERTY); + + String keyspace = getProperties().getProperty(KEYSPACE_PROPERTY, + KEYSPACE_PROPERTY_DEFAULT); + + readConsistencyLevel = ConsistencyLevel.valueOf( + getProperties().getProperty(READ_CONSISTENCY_LEVEL_PROPERTY, + READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); + writeConsistencyLevel = ConsistencyLevel.valueOf( + getProperties().getProperty(WRITE_CONSISTENCY_LEVEL_PROPERTY, + WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); + + if ((username != null) && !username.isEmpty()) { + cluster = Cluster.builder().withCredentials(username, password) + .withPort(Integer.valueOf(port)).addContactPoints(hosts).build(); + } else { + cluster = Cluster.builder().withPort(Integer.valueOf(port)) + .addContactPoints(hosts).build(); } - } - /** - * 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 - */ - @Override - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { - - try { - Statement stmt; - Select.Builder selectBuilder; - - if (fields == null) { - selectBuilder = QueryBuilder.select().all(); - } - else { - selectBuilder = QueryBuilder.select(); - for (String col : fields) { - ((Select.Selection) selectBuilder).column(col); - } - } - - stmt = selectBuilder.from(table).where(QueryBuilder.eq(YCSB_KEY, key)).limit(1); - stmt.setConsistencyLevel(readConsistencyLevel); - - if (_debug) { - System.out.println(stmt.toString()); - } - - ResultSet rs = session.execute(stmt); - - //Should be only 1 row - if (!rs.isExhausted()) { - Row row = rs.one(); - ColumnDefinitions cd = row.getColumnDefinitions(); - - for (ColumnDefinitions.Definition def : cd) { - ByteBuffer val = row.getBytesUnsafe(def.getName()); - if (val != null) { - result.put(def.getName(), - new ByteArrayByteIterator(val.array())); - } - else { - result.put(def.getName(), null); - } - } - - } - - return OK; - - } catch (Exception e) { - e.printStackTrace(); - System.out.println("Error reading key: " + key); - return ERR; + String maxConnections = getProperties().getProperty( + MAX_CONNECTIONS_PROPERTY); + if (maxConnections != null) { + cluster.getConfiguration().getPoolingOptions() + .setMaxConnectionsPerHost(HostDistance.LOCAL, + Integer.valueOf(maxConnections)); } - } + String coreConnections = getProperties().getProperty( + CORE_CONNECTIONS_PROPERTY); + if (coreConnections != null) { + cluster.getConfiguration().getPoolingOptions() + .setCoreConnectionsPerHost(HostDistance.LOCAL, + Integer.valueOf(coreConnections)); + } - /** - * 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. - * - * Cassandra CQL uses "token" method for range scan which doesn't always - * yield intuitive results. - * - * @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 - */ - @Override - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - - try { - Statement stmt; - Select.Builder selectBuilder; - - if (fields == null) { - selectBuilder = QueryBuilder.select().all(); - } - else { - selectBuilder = QueryBuilder.select(); - for (String col : fields) { - ((Select.Selection) selectBuilder).column(col); - } - } - - stmt = selectBuilder.from(table); - - //The statement builder is not setup right for tokens. - // So, we need to build it manually. - String initialStmt = stmt.toString(); - StringBuilder scanStmt = new StringBuilder(); - scanStmt.append( - initialStmt.substring(0, initialStmt.length()-1)); - scanStmt.append(" WHERE "); - scanStmt.append(QueryBuilder.token(YCSB_KEY)); - scanStmt.append(" >= "); - scanStmt.append("token('"); - scanStmt.append(startkey); - scanStmt.append("')"); - scanStmt.append(" LIMIT "); - scanStmt.append(recordcount); - - stmt = new SimpleStatement(scanStmt.toString()); - stmt.setConsistencyLevel(readConsistencyLevel); - - if (_debug) { - System.out.println(stmt.toString()); - } - - ResultSet rs = session.execute(stmt); - - HashMap<String, ByteIterator> tuple; - while (!rs.isExhausted()) { - Row row = rs.one(); - tuple = new HashMap<String, ByteIterator> (); - - ColumnDefinitions cd = row.getColumnDefinitions(); - - for (ColumnDefinitions.Definition def : cd) { - ByteBuffer val = row.getBytesUnsafe(def.getName()); - if (val != null) { - tuple.put(def.getName(), - new ByteArrayByteIterator(val.array())); - } - else { - tuple.put(def.getName(), null); - } - } - - result.add(tuple); - } - - return OK; - - } catch (Exception e) { - e.printStackTrace(); - System.out.println("Error scanning with startkey: " + startkey); - return ERR; + String connectTimoutMillis = getProperties().getProperty( + CONNECT_TIMEOUT_MILLIS_PROPERTY); + if (connectTimoutMillis != null) { + cluster.getConfiguration().getSocketOptions() + .setConnectTimeoutMillis(Integer.valueOf(connectTimoutMillis)); } - } + String readTimoutMillis = getProperties().getProperty( + READ_TIMEOUT_MILLIS_PROPERTY); + if (readTimoutMillis != null) { + cluster.getConfiguration().getSocketOptions() + .setReadTimeoutMillis(Integer.valueOf(readTimoutMillis)); + } - /** - * 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 - */ - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - //Insert and updates provide the same functionality - return insert(table, key, values); - } + Metadata metadata = cluster.getMetadata(); + System.err.printf("Connected to cluster: %s\n", + metadata.getClusterName()); - /** - * 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 - */ - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - - try { - Insert insertStmt = QueryBuilder.insertInto(table); - - //Add key - insertStmt.value(YCSB_KEY, key); - - //Add fields - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - Object value; - ByteIterator byteIterator = entry.getValue(); - value = byteIterator.toString(); - - insertStmt.value(entry.getKey(), value); - } - - insertStmt.setConsistencyLevel(writeConsistencyLevel); - - if (_debug) { - System.out.println(insertStmt.toString()); - } - - ResultSet rs = session.execute(insertStmt); - - return OK; - } catch (Exception e) { - e.printStackTrace(); + for (Host discoveredHost : metadata.getAllHosts()) { + System.out.printf("Datacenter: %s; Host: %s; Rack: %s\n", + discoveredHost.getDatacenter(), discoveredHost.getAddress(), + discoveredHost.getRack()); } - return ERR; + session = cluster.connect(keyspace); + + } catch (Exception e) { + throw new DBException(e); + } + } // synchronized + } + + /** + * Cleanup any state for this DB. Called once per DB instance; there is one DB + * instance per client thread. + */ + @Override + public void cleanup() throws DBException { + synchronized (INIT_COUNT) { + final int curInitCount = INIT_COUNT.decrementAndGet(); + if (curInitCount <= 0) { + session.close(); + cluster.close(); + cluster = null; + session = null; + } + if (curInitCount < 0) { + // This should never happen. + throw new DBException( + String.format("initCount is negative: %d", curInitCount)); + } } + } + + /** + * 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 + */ + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + try { + Statement stmt; + Select.Builder selectBuilder; + + if (fields == null) { + selectBuilder = QueryBuilder.select().all(); + } else { + selectBuilder = QueryBuilder.select(); + for (String col : fields) { + ((Select.Selection) selectBuilder).column(col); + } + } + + stmt = selectBuilder.from(table).where(QueryBuilder.eq(YCSB_KEY, key)) + .limit(1); + stmt.setConsistencyLevel(readConsistencyLevel); - /** - * 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 - */ - @Override - public int delete(String table, String key) { + if (debug) { + System.out.println(stmt.toString()); + } - try { - Statement stmt; + ResultSet rs = session.execute(stmt); - stmt = QueryBuilder.delete().from(table).where(QueryBuilder.eq(YCSB_KEY, key)); - stmt.setConsistencyLevel(writeConsistencyLevel); + if (rs.isExhausted()) { + return Status.NOT_FOUND; + } - if (_debug) { - System.out.println(stmt.toString()); - } + // Should be only 1 row + Row row = rs.one(); + ColumnDefinitions cd = row.getColumnDefinitions(); + + for (ColumnDefinitions.Definition def : cd) { + ByteBuffer val = row.getBytesUnsafe(def.getName()); + if (val != null) { + result.put(def.getName(), new ByteArrayByteIterator(val.array())); + } else { + result.put(def.getName(), null); + } + } - ResultSet rs = session.execute(stmt); + return Status.OK; - return OK; - } catch (Exception e) { - e.printStackTrace(); - System.out.println("Error deleting key: " + key); + } catch (Exception e) { + e.printStackTrace(); + System.out.println("Error reading key: " + key); + 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. + * + * Cassandra CQL uses "token" method for range scan which doesn't always yield + * intuitive results. + * + * @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 + */ + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + + try { + Statement stmt; + Select.Builder selectBuilder; + + if (fields == null) { + selectBuilder = QueryBuilder.select().all(); + } else { + selectBuilder = QueryBuilder.select(); + for (String col : fields) { + ((Select.Selection) selectBuilder).column(col); + } + } + + stmt = selectBuilder.from(table); + + // The statement builder is not setup right for tokens. + // So, we need to build it manually. + String initialStmt = stmt.toString(); + StringBuilder scanStmt = new StringBuilder(); + scanStmt.append(initialStmt.substring(0, initialStmt.length() - 1)); + scanStmt.append(" WHERE "); + scanStmt.append(QueryBuilder.token(YCSB_KEY)); + scanStmt.append(" >= "); + scanStmt.append("token('"); + scanStmt.append(startkey); + scanStmt.append("')"); + scanStmt.append(" LIMIT "); + scanStmt.append(recordcount); + + stmt = new SimpleStatement(scanStmt.toString()); + stmt.setConsistencyLevel(readConsistencyLevel); + + if (debug) { + System.out.println(stmt.toString()); + } + + ResultSet rs = session.execute(stmt); + + HashMap<String, ByteIterator> tuple; + while (!rs.isExhausted()) { + Row row = rs.one(); + tuple = new HashMap<String, ByteIterator>(); + + ColumnDefinitions cd = row.getColumnDefinitions(); + + for (ColumnDefinitions.Definition def : cd) { + ByteBuffer val = row.getBytesUnsafe(def.getName()); + if (val != null) { + tuple.put(def.getName(), new ByteArrayByteIterator(val.array())); + } else { + tuple.put(def.getName(), null); + } } - return ERR; + result.add(tuple); + } + + return Status.OK; + + } catch (Exception e) { + e.printStackTrace(); + System.out.println("Error scanning with startkey: " + startkey); + 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 + */ + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + // Insert and updates provide the same functionality + return insert(table, key, values); + } + + /** + * 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 + */ + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + + try { + Insert insertStmt = QueryBuilder.insertInto(table); + + // Add key + insertStmt.value(YCSB_KEY, key); + + // Add fields + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + Object value; + ByteIterator byteIterator = entry.getValue(); + value = byteIterator.toString(); + + insertStmt.value(entry.getKey(), value); + } + + insertStmt.setConsistencyLevel(writeConsistencyLevel); + + if (debug) { + System.out.println(insertStmt.toString()); + } + + session.execute(insertStmt); + + return Status.OK; + } catch (Exception e) { + e.printStackTrace(); } + 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 + */ + @Override + public Status delete(String table, String key) { + + try { + Statement stmt; + + stmt = QueryBuilder.delete().from(table) + .where(QueryBuilder.eq(YCSB_KEY, key)); + stmt.setConsistencyLevel(writeConsistencyLevel); + + if (debug) { + System.out.println(stmt.toString()); + } + + session.execute(stmt); + + return Status.OK; + } catch (Exception e) { + e.printStackTrace(); + System.out.println("Error deleting key: " + key); + } + + return Status.ERROR; + } + } diff --git a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient10.java b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient10.java deleted file mode 100644 index 669cf0294da83164f93695f6cff883eb5f2cfe55..0000000000000000000000000000000000000000 --- a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient10.java +++ /dev/null @@ -1,650 +0,0 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.db; - -import com.yahoo.ycsb.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Vector; -import java.util.Random; -import java.util.Properties; -import java.nio.ByteBuffer; - -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.cassandra.thrift.*; - - -//XXXX if we do replication, fix the consistency levels -/** - * Cassandra 1.0.6 client for YCSB framework - */ -public class CassandraClient10 extends DB -{ - static Random random = new Random(); - public static final int Ok = 0; - public static final int Error = -1; - public static final ByteBuffer emptyByteBuffer = ByteBuffer.wrap(new byte[0]); - - public int ConnectionRetries; - public int OperationRetries; - public String column_family; - - public static final String CONNECTION_RETRY_PROPERTY = "cassandra.connectionretries"; - public static final String CONNECTION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String OPERATION_RETRY_PROPERTY = "cassandra.operationretries"; - public static final String OPERATION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String USERNAME_PROPERTY = "cassandra.username"; - public static final String PASSWORD_PROPERTY = "cassandra.password"; - - public static final String COLUMN_FAMILY_PROPERTY = "cassandra.columnfamily"; - public static final String COLUMN_FAMILY_PROPERTY_DEFAULT = "data"; - - public static final String READ_CONSISTENCY_LEVEL_PROPERTY = "cassandra.readconsistencylevel"; - public static final String READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - - public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY = "cassandra.writeconsistencylevel"; - public static final String WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - - public static final String SCAN_CONSISTENCY_LEVEL_PROPERTY = "cassandra.scanconsistencylevel"; - public static final String SCAN_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - - public static final String DELETE_CONSISTENCY_LEVEL_PROPERTY = "cassandra.deleteconsistencylevel"; - public static final String DELETE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT = "ONE"; - - - TTransport tr; - Cassandra.Client client; - - boolean _debug = false; - - String _table = ""; - Exception errorexception = null; - - List<Mutation> mutations = new ArrayList<Mutation>(); - Map<String, List<Mutation>> mutationMap = new HashMap<String, List<Mutation>>(); - Map<ByteBuffer, Map<String, List<Mutation>>> record = new HashMap<ByteBuffer, Map<String, List<Mutation>>>(); - - ColumnParent parent; - - ConsistencyLevel readConsistencyLevel = ConsistencyLevel.ONE; - ConsistencyLevel writeConsistencyLevel = ConsistencyLevel.ONE; - ConsistencyLevel scanConsistencyLevel = ConsistencyLevel.ONE; - ConsistencyLevel deleteConsistencyLevel = ConsistencyLevel.ONE; - - - /** - * Initialize any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - public void init() throws DBException - { - String hosts = getProperties().getProperty("hosts"); - if (hosts == null) - { - throw new DBException("Required property \"hosts\" missing for CassandraClient"); - } - - column_family = getProperties().getProperty(COLUMN_FAMILY_PROPERTY, COLUMN_FAMILY_PROPERTY_DEFAULT); - parent = new ColumnParent(column_family); - - ConnectionRetries = Integer.parseInt(getProperties().getProperty(CONNECTION_RETRY_PROPERTY, - CONNECTION_RETRY_PROPERTY_DEFAULT)); - OperationRetries = Integer.parseInt(getProperties().getProperty(OPERATION_RETRY_PROPERTY, - OPERATION_RETRY_PROPERTY_DEFAULT)); - - String username = getProperties().getProperty(USERNAME_PROPERTY); - String password = getProperties().getProperty(PASSWORD_PROPERTY); - - readConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(READ_CONSISTENCY_LEVEL_PROPERTY, READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - writeConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(WRITE_CONSISTENCY_LEVEL_PROPERTY, WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - scanConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(SCAN_CONSISTENCY_LEVEL_PROPERTY, SCAN_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - deleteConsistencyLevel = ConsistencyLevel.valueOf(getProperties().getProperty(DELETE_CONSISTENCY_LEVEL_PROPERTY, DELETE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); - - - _debug = Boolean.parseBoolean(getProperties().getProperty("debug", "false")); - - String[] allhosts = hosts.split(","); - String myhost = allhosts[random.nextInt(allhosts.length)]; - - Exception connectexception = null; - - for (int retry = 0; retry < ConnectionRetries; retry++) - { - tr = new TFramedTransport(new TSocket(myhost, Integer.parseInt(getProperties().getProperty("port","9160")))); - TProtocol proto = new TBinaryProtocol(tr); - client = new Cassandra.Client(proto); - try - { - tr.open(); - connectexception = null; - break; - } catch (Exception e) - { - connectexception = e; - } - try - { - Thread.sleep(1000); - } catch (InterruptedException e) - { - } - } - if (connectexception != null) - { - System.err.println("Unable to connect to " + myhost + " after " + ConnectionRetries - + " tries"); - throw new DBException(connectexception); - } - - if (username != null && password != null) - { - Map<String,String> cred = new HashMap<String,String>(); - cred.put("username", username); - cred.put("password", password); - AuthenticationRequest req = new AuthenticationRequest(cred); - try - { - client.login(req); - } - catch (Exception e) - { - throw new DBException(e); - } - } - } - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one DB - * instance per client thread. - */ - public void cleanup() throws DBException - { - tr.close(); - } - - /** - * 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 - */ - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - List<ColumnOrSuperColumn> results = client.get_slice(ByteBuffer.wrap(key.getBytes("UTF-8")), parent, predicate, readConsistencyLevel); - - if (_debug) - { - System.out.print("Reading key: " + key); - } - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn oneresult : results) - { - - column = oneresult.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - result.put(name,value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - if (_debug) - { - System.out.println(); - System.out.println("ConsistencyLevel=" + readConsistencyLevel.toString()); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - KeyRange kr = new KeyRange().setStart_key(startkey.getBytes("UTF-8")).setEnd_key(new byte[] {}).setCount(recordcount); - - List<KeySlice> results = client.get_range_slices(parent, predicate, kr, scanConsistencyLevel); - - if (_debug) - { - System.out.println("Scanning startkey: " + startkey); - } - - HashMap<String, ByteIterator> tuple; - for (KeySlice oneresult : results) - { - tuple = new HashMap<String, ByteIterator>(); - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn onecol : oneresult.columns) - { - column = onecol.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - tuple.put(name, value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - result.add(tuple); - if (_debug) - { - System.out.println(); - System.out.println("ConsistencyLevel=" + scanConsistencyLevel.toString()); - } - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int update(String table, String key, HashMap<String, ByteIterator> values) - { - return insert(table, key, values); - } - - /** - * 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 - */ - public int insert(String table, String key, HashMap<String, ByteIterator> values) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - if (_debug) - { - System.out.println("Inserting key: " + key); - } - - try - { - ByteBuffer wrappedKey = ByteBuffer.wrap(key.getBytes("UTF-8")); - - Column col; - ColumnOrSuperColumn column; - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) - { - col = new Column(); - col.setName(ByteBuffer.wrap(entry.getKey().getBytes("UTF-8"))); - col.setValue(ByteBuffer.wrap(entry.getValue().toArray())); - col.setTimestamp(System.currentTimeMillis()); - - column = new ColumnOrSuperColumn(); - column.setColumn(col); - - mutations.add(new Mutation().setColumn_or_supercolumn(column)); - } - - mutationMap.put(column_family, mutations); - record.put(wrappedKey, mutationMap); - - client.batch_mutate(record, writeConsistencyLevel); - - mutations.clear(); - mutationMap.clear(); - record.clear(); - - if (_debug) - { - System.out.println("ConsistencyLevel=" + writeConsistencyLevel.toString()); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int delete(String table, String key) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - try - { - client.remove(ByteBuffer.wrap(key.getBytes("UTF-8")), - new ColumnPath(column_family), - System.currentTimeMillis(), - deleteConsistencyLevel); - - if (_debug) - { - System.out.println("Delete key: " + key); - System.out.println("ConsistencyLevel=" + deleteConsistencyLevel.toString()); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return Error; - } - - public static void main(String[] args) - { - CassandraClient10 cli = new CassandraClient10(); - - Properties props = new Properties(); - - props.setProperty("hosts", args[0]); - cli.setProperties(props); - - try - { - cli.init(); - } catch (Exception e) - { - e.printStackTrace(); - System.exit(0); - } - - HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>(); - vals.put("age", new StringByteIterator("57")); - vals.put("middlename", new StringByteIterator("bradley")); - vals.put("favoritecolor", new StringByteIterator("blue")); - int res = cli.insert("usertable", "BrianFrankCooper", vals); - System.out.println("Result of insert: " + res); - - HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); - HashSet<String> fields = new HashSet<String>(); - fields.add("middlename"); - fields.add("age"); - fields.add("favoritecolor"); - res = cli.read("usertable", "BrianFrankCooper", null, result); - System.out.println("Result of read: " + res); - for (String s : result.keySet()) - { - System.out.println("[" + s + "]=[" + result.get(s) + "]"); - } - - res = cli.delete("usertable", "BrianFrankCooper"); - System.out.println("Result of delete: " + res); - } - - /* - * public static void main(String[] args) throws TException, - * InvalidRequestException, UnavailableException, - * UnsupportedEncodingException, NotFoundException { - * - * - * - * String key_user_id = "1"; - * - * - * - * - * client.insert("Keyspace1", key_user_id, new ColumnPath("Standard1", null, - * "age".getBytes("UTF-8")), "24".getBytes("UTF-8"), timestamp, - * ConsistencyLevel.ONE); - * - * - * // read single column ColumnPath path = new ColumnPath("Standard1", null, - * "name".getBytes("UTF-8")); - * - * System.out.println(client.get("Keyspace1", key_user_id, path, - * ConsistencyLevel.ONE)); - * - * - * // read entire row SlicePredicate predicate = new SlicePredicate(null, new - * SliceRange(new byte[0], new byte[0], false, 10)); - * - * ColumnParent parent = new ColumnParent("Standard1", null); - * - * List<ColumnOrSuperColumn> results = client.get_slice("Keyspace1", - * key_user_id, parent, predicate, ConsistencyLevel.ONE); - * - * for (ColumnOrSuperColumn result : results) { - * - * Column column = result.column; - * - * System.out.println(new String(column.name, "UTF-8") + " -> " + new - * String(column.value, "UTF-8")); - * - * } - * - * - * - * - * } - */ -} diff --git a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient7.java b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient7.java deleted file mode 100644 index e60bc2986abbf46688ae711259e5238d488b82dd..0000000000000000000000000000000000000000 --- a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient7.java +++ /dev/null @@ -1,619 +0,0 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.db; - -import com.yahoo.ycsb.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Vector; -import java.util.Random; -import java.util.Properties; -import java.nio.ByteBuffer; - -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.cassandra.thrift.*; - - -//XXXX if we do replication, fix the consistency levels -/** - * Cassandra 0.7 client for YCSB framework - */ -public class CassandraClient7 extends DB -{ - static Random random = new Random(); - public static final int Ok = 0; - public static final int Error = -1; - public static final ByteBuffer emptyByteBuffer = ByteBuffer.wrap(new byte[0]); - - public int ConnectionRetries; - public int OperationRetries; - public String column_family; - - public static final String CONNECTION_RETRY_PROPERTY = "cassandra.connectionretries"; - public static final String CONNECTION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String OPERATION_RETRY_PROPERTY = "cassandra.operationretries"; - public static final String OPERATION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String USERNAME_PROPERTY = "cassandra.username"; - public static final String PASSWORD_PROPERTY = "cassandra.password"; - - public static final String COLUMN_FAMILY_PROPERTY = "cassandra.columnfamily"; - public static final String COLUMN_FAMILY_PROPERTY_DEFAULT = "data"; - - TTransport tr; - Cassandra.Client client; - - boolean _debug = false; - - String _table = ""; - Exception errorexception = null; - - List<Mutation> mutations = new ArrayList<Mutation>(); - Map<String, List<Mutation>> mutationMap = new HashMap<String, List<Mutation>>(); - Map<ByteBuffer, Map<String, List<Mutation>>> record = new HashMap<ByteBuffer, Map<String, List<Mutation>>>(); - - ColumnParent parent; - - /** - * Initialize any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - public void init() throws DBException - { - String hosts = getProperties().getProperty("hosts"); - if (hosts == null) - { - throw new DBException("Required property \"hosts\" missing for CassandraClient"); - } - - column_family = getProperties().getProperty(COLUMN_FAMILY_PROPERTY, COLUMN_FAMILY_PROPERTY_DEFAULT); - parent = new ColumnParent(column_family); - - ConnectionRetries = Integer.parseInt(getProperties().getProperty(CONNECTION_RETRY_PROPERTY, - CONNECTION_RETRY_PROPERTY_DEFAULT)); - OperationRetries = Integer.parseInt(getProperties().getProperty(OPERATION_RETRY_PROPERTY, - OPERATION_RETRY_PROPERTY_DEFAULT)); - - String username = getProperties().getProperty(USERNAME_PROPERTY); - String password = getProperties().getProperty(PASSWORD_PROPERTY); - - _debug = Boolean.parseBoolean(getProperties().getProperty("debug", "false")); - - String[] allhosts = hosts.split(","); - String myhost = allhosts[random.nextInt(allhosts.length)]; - - Exception connectexception = null; - - for (int retry = 0; retry < ConnectionRetries; retry++) - { - tr = new TFramedTransport(new TSocket(myhost, 9160)); - TProtocol proto = new TBinaryProtocol(tr); - client = new Cassandra.Client(proto); - try - { - tr.open(); - connectexception = null; - break; - } catch (Exception e) - { - connectexception = e; - } - try - { - Thread.sleep(1000); - } catch (InterruptedException e) - { - } - } - if (connectexception != null) - { - System.err.println("Unable to connect to " + myhost + " after " + ConnectionRetries - + " tries"); - System.out.println("Unable to connect to " + myhost + " after " + ConnectionRetries - + " tries"); - throw new DBException(connectexception); - } - - if (username != null && password != null) - { - Map<String,String> cred = new HashMap<String,String>(); - cred.put("username", username); - cred.put("password", password); - AuthenticationRequest req = new AuthenticationRequest(cred); - try - { - client.login(req); - } - catch (Exception e) - { - throw new DBException(e); - } - } - } - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one DB - * instance per client thread. - */ - public void cleanup() throws DBException - { - tr.close(); - } - - /** - * 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 - */ - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - List<ColumnOrSuperColumn> results = client.get_slice(ByteBuffer.wrap(key.getBytes("UTF-8")), parent, predicate, ConsistencyLevel.ONE); - - if (_debug) - { - System.out.print("Reading key: " + key); - } - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn oneresult : results) - { - - column = oneresult.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - result.put(name,value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - if (_debug) - { - System.out.println(); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - KeyRange kr = new KeyRange().setStart_key(startkey.getBytes("UTF-8")).setEnd_key(new byte[] {}).setCount(recordcount); - - List<KeySlice> results = client.get_range_slices(parent, predicate, kr, ConsistencyLevel.ONE); - - if (_debug) - { - System.out.println("Scanning startkey: " + startkey); - } - - HashMap<String, ByteIterator> tuple; - for (KeySlice oneresult : results) - { - tuple = new HashMap<String, ByteIterator>(); - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn onecol : oneresult.columns) - { - column = onecol.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - tuple.put(name, value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - result.add(tuple); - if (_debug) - { - System.out.println(); - } - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int update(String table, String key, HashMap<String, ByteIterator> values) - { - return insert(table, key, values); - } - - /** - * 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 - */ - public int insert(String table, String key, HashMap<String, ByteIterator> values) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - if (_debug) - { - System.out.println("Inserting key: " + key); - } - - try - { - ByteBuffer wrappedKey = ByteBuffer.wrap(key.getBytes("UTF-8")); - - Column col; - ColumnOrSuperColumn column; - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) - { - col = new Column(); - col.setName(ByteBuffer.wrap(entry.getKey().getBytes("UTF-8"))); - col.setValue(ByteBuffer.wrap(entry.getValue().toArray())); - col.setTimestamp(System.currentTimeMillis()); - - column = new ColumnOrSuperColumn(); - column.setColumn(col); - - mutations.add(new Mutation().setColumn_or_supercolumn(column)); - } - - mutationMap.put(column_family, mutations); - record.put(wrappedKey, mutationMap); - - client.batch_mutate(record, ConsistencyLevel.ONE); - - mutations.clear(); - mutationMap.clear(); - record.clear(); - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int delete(String table, String key) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - try - { - client.remove(ByteBuffer.wrap(key.getBytes("UTF-8")), - new ColumnPath(column_family), - System.currentTimeMillis(), - ConsistencyLevel.ONE); - - if (_debug) - { - System.out.println("Delete key: " + key); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return Error; - } - - public static void main(String[] args) - { - CassandraClient7 cli = new CassandraClient7(); - - Properties props = new Properties(); - - props.setProperty("hosts", args[0]); - cli.setProperties(props); - - try - { - cli.init(); - } catch (Exception e) - { - e.printStackTrace(); - System.exit(0); - } - - HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>(); - vals.put("age", new StringByteIterator("57")); - vals.put("middlename", new StringByteIterator("bradley")); - vals.put("favoritecolor", new StringByteIterator("blue")); - int res = cli.insert("usertable", "BrianFrankCooper", vals); - System.out.println("Result of insert: " + res); - - HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); - HashSet<String> fields = new HashSet<String>(); - fields.add("middlename"); - fields.add("age"); - fields.add("favoritecolor"); - res = cli.read("usertable", "BrianFrankCooper", null, result); - System.out.println("Result of read: " + res); - for (String s : result.keySet()) - { - System.out.println("[" + s + "]=[" + result.get(s) + "]"); - } - - res = cli.delete("usertable", "BrianFrankCooper"); - System.out.println("Result of delete: " + res); - } - - /* - * public static void main(String[] args) throws TException, - * InvalidRequestException, UnavailableException, - * UnsupportedEncodingException, NotFoundException { - * - * - * - * String key_user_id = "1"; - * - * - * - * - * client.insert("Keyspace1", key_user_id, new ColumnPath("Standard1", null, - * "age".getBytes("UTF-8")), "24".getBytes("UTF-8"), timestamp, - * ConsistencyLevel.ONE); - * - * - * // read single column ColumnPath path = new ColumnPath("Standard1", null, - * "name".getBytes("UTF-8")); - * - * System.out.println(client.get("Keyspace1", key_user_id, path, - * ConsistencyLevel.ONE)); - * - * - * // read entire row SlicePredicate predicate = new SlicePredicate(null, new - * SliceRange(new byte[0], new byte[0], false, 10)); - * - * ColumnParent parent = new ColumnParent("Standard1", null); - * - * List<ColumnOrSuperColumn> results = client.get_slice("Keyspace1", - * key_user_id, parent, predicate, ConsistencyLevel.ONE); - * - * for (ColumnOrSuperColumn result : results) { - * - * Column column = result.column; - * - * System.out.println(new String(column.name, "UTF-8") + " -> " + new - * String(column.value, "UTF-8")); - * - * } - * - * - * - * - * } - */ -} diff --git a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient8.java b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient8.java deleted file mode 100644 index ec8abf3234eea3aec767789ba09b0275e0a6bdf5..0000000000000000000000000000000000000000 --- a/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraClient8.java +++ /dev/null @@ -1,619 +0,0 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.db; - -import com.yahoo.ycsb.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Vector; -import java.util.Random; -import java.util.Properties; -import java.nio.ByteBuffer; - -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.cassandra.thrift.*; - - -//XXXX if we do replication, fix the consistency levels -/** - * Cassandra 0.8 client for YCSB framework - */ -public class CassandraClient8 extends DB -{ - static Random random = new Random(); - public static final int Ok = 0; - public static final int Error = -1; - public static final ByteBuffer emptyByteBuffer = ByteBuffer.wrap(new byte[0]); - - public int ConnectionRetries; - public int OperationRetries; - public String column_family; - - public static final String CONNECTION_RETRY_PROPERTY = "cassandra.connectionretries"; - public static final String CONNECTION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String OPERATION_RETRY_PROPERTY = "cassandra.operationretries"; - public static final String OPERATION_RETRY_PROPERTY_DEFAULT = "300"; - - public static final String USERNAME_PROPERTY = "cassandra.username"; - public static final String PASSWORD_PROPERTY = "cassandra.password"; - - public static final String COLUMN_FAMILY_PROPERTY = "cassandra.columnfamily"; - public static final String COLUMN_FAMILY_PROPERTY_DEFAULT = "data"; - - TTransport tr; - Cassandra.Client client; - - boolean _debug = false; - - String _table = ""; - Exception errorexception = null; - - List<Mutation> mutations = new ArrayList<Mutation>(); - Map<String, List<Mutation>> mutationMap = new HashMap<String, List<Mutation>>(); - Map<ByteBuffer, Map<String, List<Mutation>>> record = new HashMap<ByteBuffer, Map<String, List<Mutation>>>(); - - ColumnParent parent; - - /** - * Initialize any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - public void init() throws DBException - { - String hosts = getProperties().getProperty("hosts"); - if (hosts == null) - { - throw new DBException("Required property \"hosts\" missing for CassandraClient"); - } - - column_family = getProperties().getProperty(COLUMN_FAMILY_PROPERTY, COLUMN_FAMILY_PROPERTY_DEFAULT); - parent = new ColumnParent(column_family); - - ConnectionRetries = Integer.parseInt(getProperties().getProperty(CONNECTION_RETRY_PROPERTY, - CONNECTION_RETRY_PROPERTY_DEFAULT)); - OperationRetries = Integer.parseInt(getProperties().getProperty(OPERATION_RETRY_PROPERTY, - OPERATION_RETRY_PROPERTY_DEFAULT)); - - String username = getProperties().getProperty(USERNAME_PROPERTY); - String password = getProperties().getProperty(PASSWORD_PROPERTY); - - _debug = Boolean.parseBoolean(getProperties().getProperty("debug", "false")); - - String[] allhosts = hosts.split(","); - String myhost = allhosts[random.nextInt(allhosts.length)]; - - Exception connectexception = null; - - for (int retry = 0; retry < ConnectionRetries; retry++) - { - tr = new TFramedTransport(new TSocket(myhost, 9160)); - TProtocol proto = new TBinaryProtocol(tr); - client = new Cassandra.Client(proto); - try - { - tr.open(); - connectexception = null; - break; - } catch (Exception e) - { - connectexception = e; - } - try - { - Thread.sleep(1000); - } catch (InterruptedException e) - { - } - } - if (connectexception != null) - { - System.err.println("Unable to connect to " + myhost + " after " + ConnectionRetries - + " tries"); - System.out.println("Unable to connect to " + myhost + " after " + ConnectionRetries - + " tries"); - throw new DBException(connectexception); - } - - if (username != null && password != null) - { - Map<String,String> cred = new HashMap<String,String>(); - cred.put("username", username); - cred.put("password", password); - AuthenticationRequest req = new AuthenticationRequest(cred); - try - { - client.login(req); - } - catch (Exception e) - { - throw new DBException(e); - } - } - } - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one DB - * instance per client thread. - */ - public void cleanup() throws DBException - { - tr.close(); - } - - /** - * 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 - */ - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - List<ColumnOrSuperColumn> results = client.get_slice(ByteBuffer.wrap(key.getBytes("UTF-8")), parent, predicate, ConsistencyLevel.ONE); - - if (_debug) - { - System.out.print("Reading key: " + key); - } - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn oneresult : results) - { - - column = oneresult.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - result.put(name,value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - if (_debug) - { - System.out.println(); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - - try - { - SlicePredicate predicate; - if (fields == null) - { - predicate = new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer, emptyByteBuffer, false, 1000000)); - - } else { - ArrayList<ByteBuffer> fieldlist = new ArrayList<ByteBuffer>(fields.size()); - for (String s : fields) - { - fieldlist.add(ByteBuffer.wrap(s.getBytes("UTF-8"))); - } - - predicate = new SlicePredicate().setColumn_names(fieldlist); - } - - KeyRange kr = new KeyRange().setStart_key(startkey.getBytes("UTF-8")).setEnd_key(new byte[] {}).setCount(recordcount); - - List<KeySlice> results = client.get_range_slices(parent, predicate, kr, ConsistencyLevel.ONE); - - if (_debug) - { - System.out.println("Scanning startkey: " + startkey); - } - - HashMap<String, ByteIterator> tuple; - for (KeySlice oneresult : results) - { - tuple = new HashMap<String, ByteIterator>(); - - Column column; - String name; - ByteIterator value; - for (ColumnOrSuperColumn onecol : oneresult.columns) - { - column = onecol.column; - name = new String(column.name.array(), column.name.position()+column.name.arrayOffset(), column.name.remaining()); - value = new ByteArrayByteIterator(column.value.array(), column.value.position()+column.value.arrayOffset(), column.value.remaining()); - - tuple.put(name, value); - - if (_debug) - { - System.out.print("(" + name + "=" + value + ")"); - } - } - - result.add(tuple); - if (_debug) - { - System.out.println(); - } - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int update(String table, String key, HashMap<String, ByteIterator> values) - { - return insert(table, key, values); - } - - /** - * 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 - */ - public int insert(String table, String key, HashMap<String, ByteIterator> values) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - if (_debug) - { - System.out.println("Inserting key: " + key); - } - - try - { - ByteBuffer wrappedKey = ByteBuffer.wrap(key.getBytes("UTF-8")); - - Column col; - ColumnOrSuperColumn column; - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) - { - col = new Column(); - col.setName(ByteBuffer.wrap(entry.getKey().getBytes("UTF-8"))); - col.setValue(ByteBuffer.wrap(entry.getValue().toArray())); - col.setTimestamp(System.currentTimeMillis()); - - column = new ColumnOrSuperColumn(); - column.setColumn(col); - - mutations.add(new Mutation().setColumn_or_supercolumn(column)); - } - - mutationMap.put(column_family, mutations); - record.put(wrappedKey, mutationMap); - - client.batch_mutate(record, ConsistencyLevel.ONE); - - mutations.clear(); - mutationMap.clear(); - record.clear(); - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return 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 - */ - public int delete(String table, String key) - { - if (!_table.equals(table)) { - try - { - client.set_keyspace(table); - _table = table; - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return Error; - } - } - - for (int i = 0; i < OperationRetries; i++) - { - try - { - client.remove(ByteBuffer.wrap(key.getBytes("UTF-8")), - new ColumnPath(column_family), - System.currentTimeMillis(), - ConsistencyLevel.ONE); - - if (_debug) - { - System.out.println("Delete key: " + key); - } - - return Ok; - } catch (Exception e) - { - errorexception = e; - } - try - { - Thread.sleep(500); - } catch (InterruptedException e) - { - } - } - errorexception.printStackTrace(); - errorexception.printStackTrace(System.out); - return Error; - } - - public static void main(String[] args) - { - CassandraClient8 cli = new CassandraClient8(); - - Properties props = new Properties(); - - props.setProperty("hosts", args[0]); - cli.setProperties(props); - - try - { - cli.init(); - } catch (Exception e) - { - e.printStackTrace(); - System.exit(0); - } - - HashMap<String, ByteIterator> vals = new HashMap<String, ByteIterator>(); - vals.put("age", new StringByteIterator("57")); - vals.put("middlename", new StringByteIterator("bradley")); - vals.put("favoritecolor", new StringByteIterator("blue")); - int res = cli.insert("usertable", "BrianFrankCooper", vals); - System.out.println("Result of insert: " + res); - - HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); - HashSet<String> fields = new HashSet<String>(); - fields.add("middlename"); - fields.add("age"); - fields.add("favoritecolor"); - res = cli.read("usertable", "BrianFrankCooper", null, result); - System.out.println("Result of read: " + res); - for (String s : result.keySet()) - { - System.out.println("[" + s + "]=[" + result.get(s) + "]"); - } - - res = cli.delete("usertable", "BrianFrankCooper"); - System.out.println("Result of delete: " + res); - } - - /* - * public static void main(String[] args) throws TException, - * InvalidRequestException, UnavailableException, - * UnsupportedEncodingException, NotFoundException { - * - * - * - * String key_user_id = "1"; - * - * - * - * - * client.insert("Keyspace1", key_user_id, new ColumnPath("Standard1", null, - * "age".getBytes("UTF-8")), "24".getBytes("UTF-8"), timestamp, - * ConsistencyLevel.ONE); - * - * - * // read single column ColumnPath path = new ColumnPath("Standard1", null, - * "name".getBytes("UTF-8")); - * - * System.out.println(client.get("Keyspace1", key_user_id, path, - * ConsistencyLevel.ONE)); - * - * - * // read entire row SlicePredicate predicate = new SlicePredicate(null, new - * SliceRange(new byte[0], new byte[0], false, 10)); - * - * ColumnParent parent = new ColumnParent("Standard1", null); - * - * List<ColumnOrSuperColumn> results = client.get_slice("Keyspace1", - * key_user_id, parent, predicate, ConsistencyLevel.ONE); - * - * for (ColumnOrSuperColumn result : results) { - * - * Column column = result.column; - * - * System.out.println(new String(column.name, "UTF-8") + " -> " + new - * String(column.value, "UTF-8")); - * - * } - * - * - * - * - * } - */ -} diff --git a/cassandra/src/main/java/com/yahoo/ycsb/db/package-info.java b/cassandra/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..007f01dc54dd9d543b5380dff68880f23b1c009b --- /dev/null +++ b/cassandra/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -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="http://cassandra.apache.org/">Cassandra</a> + * 2.1+ via CQL. + */ +package com.yahoo.ycsb.db; + diff --git a/checkstyle.xml b/checkstyle.xml index eda4a4716365eb7cd15300223261375eea4a8023..2197b022643a1112c1524a006ceea8b619e8f8c4 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -1,4 +1,21 @@ <?xml version="1.0"?> +<!-- +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. +--> + <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> @@ -98,7 +115,9 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="LineLength"/> + <module name="LineLength"> + <property name="max" value="120"/> + </module> <module name="MethodLength"/> <module name="ParameterNumber"/> @@ -161,7 +180,7 @@ <property name="basicOffset" value="2" /> <property name="caseIndent" value="0" /> </module> - <module name="TodoComment"/> + <!-- <module name="TodoComment"/> --> <module name="UpperEll"/> </module> diff --git a/core/CHANGES.md b/core/CHANGES.md index d6a53d4821e69ec0f33b19cc9efda75cb41663e3..05a4b38e13227d240bff7c647fc7a97e75fbc9cd 100644 --- a/core/CHANGES.md +++ b/core/CHANGES.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + When used as a latency under load benchmark YCSB in it's original form suffers from Coordinated Omission[1] and related measurement issue: diff --git a/core/pom.xml b/core/pom.xml index 1a44ddeb018bdb2fb0eb269e675e1685126da87e..858daa3452e8404088f410526c1f2deb96bf078b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,10 +1,27 @@ <?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>root</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> </parent> <artifactId>core</artifactId> @@ -12,10 +29,16 @@ <packaging>jar</packaging> <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> <jackson.api.version>1.9.4</jackson.api.version> </properties> <dependencies> + <dependency> + <groupId>org.apache.htrace</groupId> + <artifactId>htrace-core4</artifactId> + <version>4.1.0-incubating</version> + </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> @@ -39,6 +62,12 @@ </dependency> </dependencies> <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/core/src/main/java/com/yahoo/ycsb/BasicDB.java b/core/src/main/java/com/yahoo/ycsb/BasicDB.java index 0eff6f3808f0197439a581c36b05a384846e367e..ec12bcda230dc462c78e56ebd57c8f0ef3cf5e50 100644 --- a/core/src/main/java/com/yahoo/ycsb/BasicDB.java +++ b/core/src/main/java/com/yahoo/ycsb/BasicDB.java @@ -17,11 +17,7 @@ package com.yahoo.ycsb; -import java.util.HashMap; -import java.util.Properties; -import java.util.Set; -import java.util.Enumeration; -import java.util.Vector; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.LockSupport; @@ -84,7 +80,7 @@ public class BasicDB extends DB verbose=Boolean.parseBoolean(getProperties().getProperty(VERBOSE, VERBOSE_DEFAULT)); todelay=Integer.parseInt(getProperties().getProperty(SIMULATE_DELAY, SIMULATE_DELAY_DEFAULT)); randomizedelay=Boolean.parseBoolean(getProperties().getProperty(RANDOMIZE_DELAY, RANDOMIZE_DELAY_DEFAULT)); - if (verbose) + if (verbose) synchronized(System.out) { System.out.println("***************** properties *****************"); Properties p=getProperties(); @@ -100,6 +96,19 @@ public class BasicDB extends DB } } + static final ThreadLocal<StringBuilder> TL_STRING_BUILDER = new ThreadLocal<StringBuilder>() { + @Override + protected StringBuilder initialValue() { + return new StringBuilder(); + } + }; + + static StringBuilder getStringBuilder() { + StringBuilder sb = TL_STRING_BUILDER.get(); + sb.setLength(0); + return sb; + } + /** * Read a record from the database. Each field/value pair from the result will be stored in a HashMap. * @@ -109,29 +118,31 @@ public class BasicDB extends DB * @param result A HashMap of field/value pairs for the result * @return Zero on success, a non-zero error code on error */ - public int read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) + public Status read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) { delay(); if (verbose) { - System.out.print("READ "+table+" "+key+" [ "); + StringBuilder sb = getStringBuilder(); + sb.append("READ ").append(table).append(" ").append(key).append(" [ "); if (fields!=null) { for (String f : fields) { - System.out.print(f+" "); + sb.append(f).append(" "); } } else { - System.out.print("<all fields>"); + sb.append("<all fields>"); } - System.out.println("]"); - } + sb.append("]"); + System.out.println(sb); + } - return 0; + return Status.OK; } /** @@ -144,29 +155,31 @@ public class BasicDB extends DB * @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 */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) + public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) { delay(); if (verbose) { - System.out.print("SCAN "+table+" "+startkey+" "+recordcount+" [ "); + StringBuilder sb = getStringBuilder(); + sb.append("SCAN ").append(table).append(" ").append(startkey).append(" ").append(recordcount).append(" [ "); if (fields!=null) { for (String f : fields) { - System.out.print(f+" "); + sb.append(f).append(" "); } } else { - System.out.print("<all fields>"); + sb.append("<all fields>"); } - System.out.println("]"); - } + sb.append("]"); + System.out.println(sb); + } - return 0; + return Status.OK; } /** @@ -178,24 +191,26 @@ public class BasicDB extends DB * @param values A HashMap of field/value pairs to update in the record * @return Zero on success, a non-zero error code on error */ - public int update(String table, String key, HashMap<String,ByteIterator> values) + public Status update(String table, String key, HashMap<String,ByteIterator> values) { delay(); if (verbose) { - System.out.print("UPDATE "+table+" "+key+" [ "); + StringBuilder sb = getStringBuilder(); + sb.append("UPDATE ").append(table).append(" ").append(key).append(" [ "); if (values!=null) { - for (String k : values.keySet()) + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - System.out.print(k+"="+values.get(k)+" "); + sb.append(entry.getKey()).append("=").append(entry.getValue()).append(" "); } } - System.out.println("]"); + sb.append("]"); + System.out.println(sb); } - return 0; + return Status.OK; } /** @@ -207,25 +222,27 @@ public class BasicDB extends DB * @param values A HashMap of field/value pairs to insert in the record * @return Zero on success, a non-zero error code on error */ - public int insert(String table, String key, HashMap<String,ByteIterator> values) + public Status insert(String table, String key, HashMap<String,ByteIterator> values) { delay(); if (verbose) { - System.out.print("INSERT "+table+" "+key+" [ "); + StringBuilder sb = getStringBuilder(); + sb.append("INSERT ").append(table).append(" ").append(key).append(" [ "); if (values!=null) { - for (String k : values.keySet()) + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - System.out.print(k+"="+values.get(k)+" "); + sb.append(entry.getKey()).append("=").append(entry.getValue()).append(" "); } } - System.out.println("]"); + sb.append("]"); + System.out.println(sb); } - return 0; + return Status.OK; } @@ -236,16 +253,18 @@ public class BasicDB extends DB * @param key The record key of the record to delete. * @return Zero on success, a non-zero error code on error */ - public int delete(String table, String key) + public Status delete(String table, String key) { delay(); if (verbose) { - System.out.println("DELETE "+table+" "+key); + StringBuilder sb = getStringBuilder(); + sb.append("DELETE ").append(table).append(" ").append(key); + System.out.println(sb); } - return 0; + return Status.OK; } /** diff --git a/core/src/main/java/com/yahoo/ycsb/Client.java b/core/src/main/java/com/yahoo/ycsb/Client.java index bcf33c2e0a485c7c18488a2cf799380037d96898..de87be7c9b978a522b9ad9a6d7a8f86098cd3e4f 100644 --- a/core/src/main/java/com/yahoo/ycsb/Client.java +++ b/core/src/main/java/com/yahoo/ycsb/Client.java @@ -1,18 +1,18 @@ -/** - * Copyright (c) 2010 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. +/** + * Copyright (c) 2010 - 2016 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. */ package com.yahoo.ycsb; @@ -24,281 +24,516 @@ import java.io.IOException; import java.io.OutputStream; import java.text.DecimalFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.Properties; -import java.util.Vector; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.LockSupport; +import org.apache.htrace.core.Tracer; +import org.apache.htrace.core.TraceScope; +import org.apache.htrace.core.HTraceConfiguration; + import com.yahoo.ycsb.measurements.Measurements; import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; import com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter; -//import org.apache.log4j.BasicConfigurator; - /** * A thread to periodically show the status of the experiment, to reassure you that progress is being made. - * - * @author cooperb * + * @author cooperb */ class StatusThread extends Thread { - Vector<Thread> _threads; - String _label; - boolean _standardstatus; - - /** - * The interval for reporting status. - */ - long _sleeptimeNs; - - public StatusThread(Vector<Thread> threads, String label, boolean standardstatus, int statusIntervalSeconds) - { - _threads=threads; - _label=label; - _standardstatus=standardstatus; - _sleeptimeNs=TimeUnit.SECONDS.toNanos(statusIntervalSeconds); - } - - /** - * Run and periodically report status. - */ - public void run() - { - final long st=System.currentTimeMillis(); - final long startTimeNanos = System.nanoTime(); - long deadline = startTimeNanos + _sleeptimeNs; - long lasten=st; - long lasttotalops=0; - - boolean alldone; - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS"); - - do - { - alldone=true; - - int totalops=0; - - //terminate this thread when all the worker threads are done - for (Thread t : _threads) - { - if (t.getState()!=Thread.State.TERMINATED) - { - alldone=false; - } - - ClientThread ct=(ClientThread)t; - totalops+=ct.getOpsDone(); - } - - long en=System.currentTimeMillis(); - - long interval=en-st; - //double throughput=1000.0*((double)totalops)/((double)interval); - - double curthroughput=1000.0*(((double)(totalops-lasttotalops))/((double)(en-lasten))); - - lasttotalops=totalops; - lasten=en; - - DecimalFormat d = new DecimalFormat("#.##"); - String label = _label + format.format(new Date()); - - StringBuilder msg = new StringBuilder(label).append(" ").append(interval/1000).append(" sec: "); - msg.append(totalops).append(" operations; "); - - if (totalops != 0) { - msg.append(d.format(curthroughput)).append(" current ops/sec; "); - } - - msg.append(Measurements.getMeasurements().getSummary()); - - System.err.println(msg); - - if (_standardstatus) { - System.out.println(msg); - } - - ClientThread.sleepUntil(deadline); - deadline+=_sleeptimeNs; - } - while (!alldone); - } + /** Counts down each of the clients completing. */ + private final CountDownLatch _completeLatch; + + /** Stores the measurements for the run. */ + private final Measurements _measurements; + + /** Whether or not to track the JVM stats per run */ + private final boolean _trackJVMStats; + + /** The clients that are running. */ + private final List<ClientThread> _clients; + + private final String _label; + private final boolean _standardstatus; + + /** The interval for reporting status. */ + private long _sleeptimeNs; + + /** JVM max/mins */ + private int _maxThreads; + private int _minThreads = Integer.MAX_VALUE; + private long _maxUsedMem; + private long _minUsedMem = Long.MAX_VALUE; + private double _maxLoadAvg; + private double _minLoadAvg = Double.MAX_VALUE; + private long lastGCCount = 0; + private long lastGCTime = 0; + + /** + * Creates a new StatusThread without JVM stat tracking. + * + * @param completeLatch The latch that each client thread will {@link CountDownLatch#countDown()} as they complete. + * @param clients The clients to collect metrics from. + * @param label The label for the status. + * @param standardstatus If true the status is printed to stdout in addition to stderr. + * @param statusIntervalSeconds The number of seconds between status updates. + */ + public StatusThread(CountDownLatch completeLatch, List<ClientThread> clients, + String label, boolean standardstatus, int statusIntervalSeconds) + { + this(completeLatch, clients, label, standardstatus, statusIntervalSeconds, false); + } + + /** + * Creates a new StatusThread. + * + * @param completeLatch The latch that each client thread will {@link CountDownLatch#countDown()} as they complete. + * @param clients The clients to collect metrics from. + * @param label The label for the status. + * @param standardstatus If true the status is printed to stdout in addition to stderr. + * @param statusIntervalSeconds The number of seconds between status updates. + * @param trackJVMStats Whether or not to track JVM stats. + */ + public StatusThread(CountDownLatch completeLatch, List<ClientThread> clients, + String label, boolean standardstatus, int statusIntervalSeconds, + boolean trackJVMStats) + { + _completeLatch=completeLatch; + _clients=clients; + _label=label; + _standardstatus=standardstatus; + _sleeptimeNs=TimeUnit.SECONDS.toNanos(statusIntervalSeconds); + _measurements = Measurements.getMeasurements(); + _trackJVMStats = trackJVMStats; + } + + /** + * Run and periodically report status. + */ + @Override + public void run() + { + final long startTimeMs=System.currentTimeMillis(); + final long startTimeNanos = System.nanoTime(); + long deadline = startTimeNanos + _sleeptimeNs; + long startIntervalMs=startTimeMs; + long lastTotalOps=0; + + boolean alldone; + + do + { + long nowMs=System.currentTimeMillis(); + + lastTotalOps = computeStats(startTimeMs, startIntervalMs, nowMs, lastTotalOps); + + if (_trackJVMStats) { + measureJVM(); + } + + alldone = waitForClientsUntil(deadline); + + startIntervalMs=nowMs; + deadline+=_sleeptimeNs; + } + while (!alldone); + + if (_trackJVMStats) { + measureJVM(); + } + // Print the final stats. + computeStats(startTimeMs, startIntervalMs, System.currentTimeMillis(), lastTotalOps); + } + + /** + * Computes and prints the stats. + * + * @param startTimeMs The start time of the test. + * @param startIntervalMs The start time of this interval. + * @param endIntervalMs The end time (now) for the interval. + * @param lastTotalOps The last total operations count. + * + * @return The current operation count. + */ + private long computeStats(final long startTimeMs, long startIntervalMs, long endIntervalMs, + long lastTotalOps) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS"); + + long totalops=0; + long todoops=0; + + // Calculate the total number of operations completed. + for (ClientThread t : _clients) + { + totalops+=t.getOpsDone(); + todoops+=t.getOpsTodo(); + } + + + long interval=endIntervalMs-startTimeMs; + double throughput=1000.0*(((double)totalops)/(double)interval); + double curthroughput=1000.0*(((double)(totalops-lastTotalOps))/((double)(endIntervalMs-startIntervalMs))); + long estremaining = (long) Math.ceil(todoops / throughput); + + + DecimalFormat d = new DecimalFormat("#.##"); + String label = _label + format.format(new Date()); + + StringBuilder msg = new StringBuilder(label).append(" ").append(interval/1000).append(" sec: "); + msg.append(totalops).append(" operations; "); + + if (totalops != 0) { + msg.append(d.format(curthroughput)).append(" current ops/sec; "); + } + if (todoops != 0) { + msg.append("est completion in ").append(RemainingFormatter.format(estremaining)); + } + + msg.append(Measurements.getMeasurements().getSummary()); + + System.err.println(msg); + + if (_standardstatus) { + System.out.println(msg); + } + return totalops; + } + + /** + * Waits for all of the client to finish or the deadline to expire. + * + * @param deadline The current deadline. + * + * @return True if all of the clients completed. + */ + private boolean waitForClientsUntil(long deadline) { + boolean alldone=false; + long now=System.nanoTime(); + + while( !alldone && now < deadline ) { + try { + alldone = _completeLatch.await(deadline-now, TimeUnit.NANOSECONDS); + } + catch( InterruptedException ie) { + // If we are interrupted the thread is being asked to shutdown. + // Return true to indicate that and reset the interrupt state + // of the thread. + Thread.currentThread().interrupt(); + alldone=true; + } + now=System.nanoTime(); + } + + return alldone; + } + + /** Executes the JVM measurements. */ + private void measureJVM() { + final int threads = Utils.getActiveThreadCount(); + if (threads < _minThreads) { + _minThreads = threads; + } + if (threads > _maxThreads) { + _maxThreads = threads; + } + _measurements.measure("THREAD_COUNT", threads); + + // TODO - once measurements allow for other number types, switch to using + // the raw bytes. Otherwise we can track in MB to avoid negative values + // when faced with huge heaps. + final int usedMem = Utils.getUsedMemoryMegaBytes(); + if (usedMem < _minUsedMem) { + _minUsedMem = usedMem; + } + if (usedMem > _maxUsedMem) { + _maxUsedMem = usedMem; + } + _measurements.measure("USED_MEM_MB", usedMem); + + // Some JVMs may not implement this feature so if the value is less than + // zero, just ommit it. + final double systemLoad = Utils.getSystemLoadAverage(); + if (systemLoad >= 0) { + // TODO - store the double if measurements allows for them + _measurements.measure("SYS_LOAD_AVG", (int)systemLoad); + if (systemLoad > _maxLoadAvg) { + _maxLoadAvg = systemLoad; + } + if (systemLoad < _minLoadAvg) { + _minLoadAvg = systemLoad; + } + } + + final long gcs = Utils.getGCTotalCollectionCount(); + _measurements.measure("GCS", (int)(gcs - lastGCCount)); + final long gcTime = Utils.getGCTotalTime(); + _measurements.measure("GCS_TIME", (int)(gcTime - lastGCTime)); + lastGCCount = gcs; + lastGCTime = gcTime; + } + + /** @return The maximum threads running during the test. */ + public int getMaxThreads() { + return _maxThreads; + } + + /** @return The minimum threads running during the test. */ + public int getMinThreads() { + return _minThreads; + } + + /** @return The maximum memory used during the test. */ + public long getMaxUsedMem() { + return _maxUsedMem; + } + + /** @return The minimum memory used during the test. */ + public long getMinUsedMem() { + return _minUsedMem; + } + + /** @return The maximum load average during the test. */ + public double getMaxLoadAvg() { + return _maxLoadAvg; + } + + /** @return The minimum load average during the test. */ + public double getMinLoadAvg() { + return _minLoadAvg; + } + + /** @return Whether or not the thread is tracking JVM stats. */ + public boolean trackJVMStats() { + return _trackJVMStats; + } +} + +/** + * Turn seconds remaining into more useful units. + * i.e. if there are hours or days worth of seconds, use them. + */ +class RemainingFormatter { + public static StringBuilder format(long seconds) { + StringBuilder time = new StringBuilder(); + long days = TimeUnit.SECONDS.toDays(seconds); + if (days > 0) { + time.append(days).append(" days "); + seconds -= TimeUnit.DAYS.toSeconds(days); + } + long hours = TimeUnit.SECONDS.toHours(seconds); + if (hours > 0) { + time.append(hours).append(" hours "); + seconds -= TimeUnit.HOURS.toSeconds(hours); + } + /* Only include minute granularity if we're < 1 day. */ + if (days < 1) { + long minutes = TimeUnit.SECONDS.toMinutes(seconds); + if (minutes > 0) { + time.append(minutes).append(" minutes "); + seconds -= TimeUnit.MINUTES.toSeconds(seconds); + } + } + /* Only bother to include seconds if we're < 1 minute */ + if (time.length() == 0) { + time.append(seconds).append(" seconds "); + } + return time; + } } /** * A thread for executing transactions or data inserts to the database. - * + * * @author cooperb * */ -class ClientThread extends Thread +class ClientThread implements Runnable { - private static boolean _spinSleep; - DB _db; - boolean _dotransactions; - Workload _workload; - int _opcount; - double _targetOpsPerMs; - - int _opsdone; - int _threadid; - int _threadcount; - Object _workloadstate; - Properties _props; - long _targetOpsTickNs; - final Measurements _measurements; - - /** - * Constructor. - * - * @param db the DB implementation to use - * @param dotransactions true to do transactions, false to insert data - * @param workload the workload to use - * @param threadid the id of this thread - * @param threadcount the total number of threads - * @param props the properties defining the experiment - * @param opcount the number of operations (transactions or inserts) to do - * @param targetperthreadperms target number of operations per thread per ms - */ - public ClientThread(DB db, boolean dotransactions, Workload workload, int threadid, int threadcount, Properties props, int opcount, double targetperthreadperms) - { - //TODO: consider removing threadcount and threadid - _db=db; - _dotransactions=dotransactions; - _workload=workload; - _opcount=opcount; - _opsdone=0; - if(targetperthreadperms > 0){ - _targetOpsPerMs=targetperthreadperms; - _targetOpsTickNs=(long)(1000000/_targetOpsPerMs); - } - _threadid=threadid; - _threadcount=threadcount; - _props=props; - _measurements = Measurements.getMeasurements(); - _spinSleep = Boolean.valueOf(_props.getProperty("spin.sleep", "false")); - } - - public int getOpsDone() - { - return _opsdone; - } - - public void run() - { - try - { - _db.init(); - } - catch (DBException e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return; - } - - try - { - _workloadstate=_workload.initThread(_props,_threadid,_threadcount); - } - catch (WorkloadException e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return; - } - - //NOTE: Switching to using nanoTime and parkNanos for time management here such that the measurements - // and the client thread have the same view on time. - - //spread the thread operations out so they don't all hit the DB at the same time - // GH issue 4 - throws exception if _target>1 because random.nextInt argument must be >0 - // and the sleep() doesn't make sense for granularities < 1 ms anyway - if ((_targetOpsPerMs > 0) && (_targetOpsPerMs <= 1.0)) + /** Counts down each of the clients completing. */ + private final CountDownLatch _completeLatch; + + private static boolean _spinSleep; + DB _db; + boolean _dotransactions; + Workload _workload; + int _opcount; + double _targetOpsPerMs; + + int _opsdone; + int _threadid; + int _threadcount; + Object _workloadstate; + Properties _props; + long _targetOpsTickNs; + final Measurements _measurements; + + /** + * Constructor. + * + * @param db the DB implementation to use + * @param dotransactions true to do transactions, false to insert data + * @param workload the workload to use + * @param props the properties defining the experiment + * @param opcount the number of operations (transactions or inserts) to do + * @param targetperthreadperms target number of operations per thread per ms + * @param completeLatch The latch tracking the completion of all clients. + */ + public ClientThread(DB db, boolean dotransactions, Workload workload, Properties props, int opcount, double targetperthreadperms, CountDownLatch completeLatch) + { + _db=db; + _dotransactions=dotransactions; + _workload=workload; + _opcount=opcount; + _opsdone=0; + if(targetperthreadperms > 0){ + _targetOpsPerMs=targetperthreadperms; + _targetOpsTickNs=(long)(1000000/_targetOpsPerMs); + } + _props=props; + _measurements = Measurements.getMeasurements(); + _spinSleep = Boolean.valueOf(_props.getProperty("spin.sleep", "false")); + _completeLatch=completeLatch; + } + + public int getOpsDone() + { + return _opsdone; + } + + @Override + public void run() + { + try + { + _db.init(); + } + catch (DBException e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + return; + } + + try + { + _workloadstate=_workload.initThread(_props,_threadid,_threadcount); + } + catch (WorkloadException e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + return; + } + + //NOTE: Switching to using nanoTime and parkNanos for time management here such that the measurements + // and the client thread have the same view on time. + + //spread the thread operations out so they don't all hit the DB at the same time + // GH issue 4 - throws exception if _target>1 because random.nextInt argument must be >0 + // and the sleep() doesn't make sense for granularities < 1 ms anyway + if ((_targetOpsPerMs > 0) && (_targetOpsPerMs <= 1.0)) + { + long randomMinorDelay = Utils.random().nextInt((int) _targetOpsTickNs); + sleepUntil(System.nanoTime() + randomMinorDelay); + } + try + { + if (_dotransactions) + { + long startTimeNanos = System.nanoTime(); + + while (((_opcount == 0) || (_opsdone < _opcount)) && !_workload.isStopRequested()) { - long randomMinorDelay = Utils.random().nextInt((int) _targetOpsTickNs); - sleepUntil(System.nanoTime() + randomMinorDelay); - } - try - { - if (_dotransactions) - { - long startTimeNanos = System.nanoTime(); - - while (((_opcount == 0) || (_opsdone < _opcount)) && !_workload.isStopRequested()) - { - - if (!_workload.doTransaction(_db,_workloadstate)) - { - break; - } - - _opsdone++; - - throttleNanos(startTimeNanos); - } - } - else - { - long startTimeNanos = System.nanoTime(); - - while (((_opcount == 0) || (_opsdone < _opcount)) && !_workload.isStopRequested()) - { - - if (!_workload.doInsert(_db,_workloadstate)) - { - break; - } - - _opsdone++; - - throttleNanos(startTimeNanos); - } - } - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - System.exit(0); - } - - try - { - _measurements.setIntendedStartTimeNs(0); - _db.cleanup(); - } - catch (DBException e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - return; - } - } - - static void sleepUntil(long deadline) { - long now = System.nanoTime(); - while((now = System.nanoTime()) < deadline) { - if (!_spinSleep) { - LockSupport.parkNanos(deadline - now); - } + + if (!_workload.doTransaction(_db,_workloadstate)) + { + break; + } + + _opsdone++; + + throttleNanos(startTimeNanos); } - } - private void throttleNanos(long startTimeNanos) { - //throttle the operations - if (_targetOpsPerMs > 0) + } + else + { + long startTimeNanos = System.nanoTime(); + + while (((_opcount == 0) || (_opsdone < _opcount)) && !_workload.isStopRequested()) { - // delay until next tick - long deadline = startTimeNanos + _opsdone*_targetOpsTickNs; - sleepUntil(deadline); - _measurements.setIntendedStartTimeNs(deadline); + + if (!_workload.doInsert(_db,_workloadstate)) + { + break; + } + + _opsdone++; + + throttleNanos(startTimeNanos); } + } } - + catch (Exception e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + System.exit(0); + } + + try + { + _measurements.setIntendedStartTimeNs(0); + _db.cleanup(); + } + catch (DBException e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + return; + } + finally + { + _completeLatch.countDown(); + } + } + + static void sleepUntil(long deadline) { + long now = System.nanoTime(); + while((now = System.nanoTime()) < deadline) { + if (!_spinSleep) { + LockSupport.parkNanos(deadline - now); + } + } + } + private void throttleNanos(long startTimeNanos) { + //throttle the operations + if (_targetOpsPerMs > 0) + { + // delay until next tick + long deadline = startTimeNanos + _opsdone*_targetOpsTickNs; + sleepUntil(deadline); + _measurements.setIntendedStartTimeNs(deadline); + } + } + + /** + * the total amount of work this thread is still expected to do + */ + public int getOpsTodo() + { + int todo = _opcount - _opsdone; + return todo < 0 ? 0 : todo; + } } /** @@ -307,536 +542,646 @@ class ClientThread extends Thread public class Client { - public static final String DEFAULT_RECORD_COUNT = "0"; - - /** - * The target number of operations to perform. - */ - public static final String OPERATION_COUNT_PROPERTY="operationcount"; - - /** - * The number of records to load into the database initially. - */ - public static final String RECORD_COUNT_PROPERTY="recordcount"; - - /** - * The workload class to be loaded. - */ - public static final String WORKLOAD_PROPERTY="workload"; - - /** - * The database class to be used. - */ - public static final String DB_PROPERTY="db"; - - /** - * The exporter class to be used. The default is - * com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter. - */ - public static final String EXPORTER_PROPERTY="exporter"; - - /** - * If set to the path of a file, YCSB will write all output to this file - * instead of STDOUT. - */ - public static final String EXPORT_FILE_PROPERTY="exportfile"; - - /** - * The number of YCSB client threads to run. - */ - public static final String THREAD_COUNT_PROPERTY="threadcount"; - - /** - * Indicates how many inserts to do, if less than recordcount. Useful for partitioning - * the load among multiple servers, if the client is the bottleneck. Additionally, workloads - * should support the "insertstart" property, which tells them which record to start at. - */ - public static final String INSERT_COUNT_PROPERTY="insertcount"; - - /** - * Target number of operations per second - */ - public static final String TARGET_PROPERTY="target"; - - /** + public static final String DEFAULT_RECORD_COUNT = "0"; + + /** + * The target number of operations to perform. + */ + public static final String OPERATION_COUNT_PROPERTY="operationcount"; + + /** + * The number of records to load into the database initially. + */ + public static final String RECORD_COUNT_PROPERTY="recordcount"; + + /** + * The workload class to be loaded. + */ + public static final String WORKLOAD_PROPERTY="workload"; + + /** + * The database class to be used. + */ + public static final String DB_PROPERTY="db"; + + /** + * The exporter class to be used. The default is + * com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter. + */ + public static final String EXPORTER_PROPERTY="exporter"; + + /** + * If set to the path of a file, YCSB will write all output to this file + * instead of STDOUT. + */ + public static final String EXPORT_FILE_PROPERTY="exportfile"; + + /** + * The number of YCSB client threads to run. + */ + public static final String THREAD_COUNT_PROPERTY="threadcount"; + + /** + * Indicates how many inserts to do, if less than recordcount. Useful for partitioning + * the load among multiple servers, if the client is the bottleneck. Additionally, workloads + * should support the "insertstart" property, which tells them which record to start at. + */ + public static final String INSERT_COUNT_PROPERTY="insertcount"; + + /** + * Target number of operations per second + */ + public static final String TARGET_PROPERTY="target"; + + /** * The maximum amount of time (in seconds) for which the benchmark will be run. */ public static final String MAX_EXECUTION_TIME = "maxexecutiontime"; + /** + * Whether or not this is the transaction phase (run) or not (load). + */ + public static final String DO_TRANSACTIONS_PROPERTY = "dotransactions"; + + /** An optional thread used to track progress and measure JVM stats. */ + private static StatusThread statusthread = null; + + // HTrace integration related constants. + + /** + * All keys for configuring the tracing system start with this prefix. + */ + private static final String HTRACE_KEY_PREFIX="htrace."; + private static final String CLIENT_WORKLOAD_INIT_SPAN = "Client#workload_init"; + private static final String CLIENT_INIT_SPAN = "Client#init"; + private static final String CLIENT_WORKLOAD_SPAN = "Client#workload"; + private static final String CLIENT_CLEANUP_SPAN = "Client#cleanup"; + private static final String CLIENT_EXPORT_MEASUREMENTS_SPAN = "Client#export_measurements"; + + public static void usageMessage() + { + System.out.println("Usage: java com.yahoo.ycsb.Client [options]"); + System.out.println("Options:"); + System.out.println(" -threads n: execute using n threads (default: 1) - can also be specified as the \n" + + " \"threadcount\" property using -p"); + System.out.println(" -target n: attempt to do n operations per second (default: unlimited) - can also\n" + + " be specified as the \"target\" property using -p"); + System.out.println(" -load: run the loading phase of the workload"); + System.out.println(" -t: run the transactions phase of the workload (default)"); + System.out.println(" -db dbname: specify the name of the DB to use (default: com.yahoo.ycsb.BasicDB) - \n" + + " can also be specified as the \"db\" property using -p"); + System.out.println(" -P propertyfile: load properties from the given file. Multiple files can"); + System.out.println(" be specified, and will be processed in the order specified"); + System.out.println(" -p name=value: specify a property to be passed to the DB and workloads;"); + System.out.println(" multiple properties can be specified, and override any"); + System.out.println(" values in the propertyfile"); + System.out.println(" -s: show status during run (default: no status)"); + System.out.println(" -l label: use label for status (e.g. to label one experiment out of a whole batch)"); + System.out.println(""); + System.out.println("Required properties:"); + System.out.println(" "+WORKLOAD_PROPERTY+": the name of the workload class to use (e.g. com.yahoo.ycsb.workloads.CoreWorkload)"); + System.out.println(""); + System.out.println("To run the transaction phase from multiple servers, start a separate client on each."); + System.out.println("To run the load phase from multiple servers, start a separate client on each; additionally,"); + System.out.println("use the \"insertcount\" and \"insertstart\" properties to divide up the records to be inserted"); + } + + public static boolean checkRequiredProperties(Properties props) + { + if (props.getProperty(WORKLOAD_PROPERTY)==null) + { + System.out.println("Missing property: "+WORKLOAD_PROPERTY); + return false; + } + + return true; + } + + + /** + * Exports the measurements to either sysout or a file using the exporter + * loaded from conf. + * @throws IOException Either failed to write to output stream or failed to close it. + */ + private static void exportMeasurements(Properties props, int opcount, long runtime) + throws IOException + { + MeasurementsExporter exporter = null; + try + { + // if no destination file is provided the results will be written to stdout + OutputStream out; + String exportFile = props.getProperty(EXPORT_FILE_PROPERTY); + if (exportFile == null) + { + out = System.out; + } else + { + out = new FileOutputStream(exportFile); + } + + // if no exporter is provided the default text one will be used + String exporterStr = props.getProperty(EXPORTER_PROPERTY, "com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter"); + try + { + exporter = (MeasurementsExporter) Class.forName(exporterStr).getConstructor(OutputStream.class).newInstance(out); + } catch (Exception e) + { + System.err.println("Could not find exporter " + exporterStr + + ", will use default text reporter."); + e.printStackTrace(); + exporter = new TextMeasurementsExporter(out); + } + + exporter.write("OVERALL", "RunTime(ms)", runtime); + double throughput = 1000.0 * (opcount) / (runtime); + exporter.write("OVERALL", "Throughput(ops/sec)", throughput); + + final Map<String, Long[]> gcs = Utils.getGCStatst(); + long totalGCCount = 0; + long totalGCTime = 0; + for (final Entry<String, Long[]> entry : gcs.entrySet()) { + exporter.write("TOTAL_GCS_" + entry.getKey(), "Count", entry.getValue()[0]); + exporter.write("TOTAL_GC_TIME_" + entry.getKey(), "Time(ms)", entry.getValue()[1]); + exporter.write("TOTAL_GC_TIME_%_" + entry.getKey(), "Time(%)",((double)entry.getValue()[1] / runtime) * (double)100); + totalGCCount += entry.getValue()[0]; + totalGCTime += entry.getValue()[1]; + } + exporter.write("TOTAL_GCs", "Count", totalGCCount); + + exporter.write("TOTAL_GC_TIME", "Time(ms)", totalGCTime); + exporter.write("TOTAL_GC_TIME_%", "Time(%)", ((double)totalGCTime / runtime) * (double)100); + if (statusthread != null && statusthread.trackJVMStats()) { + exporter.write("MAX_MEM_USED", "MBs", statusthread.getMaxUsedMem()); + exporter.write("MIN_MEM_USED", "MBs", statusthread.getMinUsedMem()); + exporter.write("MAX_THREADS", "Count", statusthread.getMaxThreads()); + exporter.write("MIN_THREADS", "Count", statusthread.getMinThreads()); + exporter.write("MAX_SYS_LOAD_AVG", "Load", statusthread.getMaxLoadAvg()); + exporter.write("MIN_SYS_LOAD_AVG", "Load", statusthread.getMinLoadAvg()); + } + + Measurements.getMeasurements().exportMeasurements(exporter); + } finally + { + if (exporter != null) + { + exporter.close(); + } + } + } + + @SuppressWarnings("unchecked") + public static void main(String[] args) + { + String dbname; + Properties props=new Properties(); + Properties fileprops=new Properties(); + boolean dotransactions=true; + int threadcount=1; + int target=0; + boolean status=false; + String label=""; + + //parse arguments + int argindex=0; + + if (args.length==0) + { + usageMessage(); + System.out.println("At least one argument specifying a workload is required."); + System.exit(0); + } + + while (args[argindex].startsWith("-")) + { + if (args[argindex].compareTo("-threads")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -threads."); + System.exit(0); + } + int tcount=Integer.parseInt(args[argindex]); + props.setProperty(THREAD_COUNT_PROPERTY, String.valueOf(tcount)); + argindex++; + } + else if (args[argindex].compareTo("-target")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -target."); + System.exit(0); + } + int ttarget=Integer.parseInt(args[argindex]); + props.setProperty(TARGET_PROPERTY, String.valueOf(ttarget)); + argindex++; + } + else if (args[argindex].compareTo("-load")==0) + { + dotransactions=false; + argindex++; + } + else if (args[argindex].compareTo("-t")==0) + { + dotransactions=true; + argindex++; + } + else if (args[argindex].compareTo("-s")==0) + { + status=true; + argindex++; + } + else if (args[argindex].compareTo("-db")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -db."); + System.exit(0); + } + props.setProperty(DB_PROPERTY,args[argindex]); + argindex++; + } + else if (args[argindex].compareTo("-l")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -l."); + System.exit(0); + } + label=args[argindex]; + argindex++; + } + else if (args[argindex].compareTo("-P")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -P."); + System.exit(0); + } + String propfile=args[argindex]; + argindex++; + + Properties myfileprops=new Properties(); + try + { + myfileprops.load(new FileInputStream(propfile)); + } + catch (IOException e) + { + System.out.println("Unable to open the properties file " + propfile); + System.out.println(e.getMessage()); + System.exit(0); + } + + //Issue #5 - remove call to stringPropertyNames to make compilable under Java 1.5 + for (Enumeration e=myfileprops.propertyNames(); e.hasMoreElements(); ) + { + String prop=(String)e.nextElement(); + + fileprops.setProperty(prop,myfileprops.getProperty(prop)); + } + + } + else if (args[argindex].compareTo("-p")==0) + { + argindex++; + if (argindex>=args.length) + { + usageMessage(); + System.out.println("Missing argument value for -p"); + System.exit(0); + } + int eq=args[argindex].indexOf('='); + if (eq<0) + { + usageMessage(); + System.out.println("Argument '-p' expected to be in key=value format (e.g., -p operationcount=99999)"); + System.exit(0); + } + + String name=args[argindex].substring(0,eq); + String value=args[argindex].substring(eq+1); + props.put(name,value); + //System.out.println("["+name+"]=["+value+"]"); + argindex++; + } + else + { + usageMessage(); + System.out.println("Unknown option " + args[argindex]); + System.exit(0); + } + + if (argindex>=args.length) + { + break; + } + } + + if (argindex != args.length) + { + usageMessage(); + if (argindex < args.length) { + System.out.println("An argument value without corresponding argument specifier (e.g., -p, -s) was found. " + + "We expected an argument specifier and instead found " + args[argindex]); + } else { + System.out.println("An argument specifier without corresponding value was found at the end of the supplied command line arguments."); + } + System.exit(0); + } + + //set up logging + //BasicConfigurator.configure(); + + //overwrite file properties with properties from the command line + + //Issue #5 - remove call to stringPropertyNames to make compilable under Java 1.5 + for (Enumeration e=props.propertyNames(); e.hasMoreElements(); ) + { + String prop=(String)e.nextElement(); + + fileprops.setProperty(prop,props.getProperty(prop)); + } + + props=fileprops; + + if (!checkRequiredProperties(props)) + { + System.out.println("Failed check required properties."); + System.exit(0); + } + + props.setProperty(DO_TRANSACTIONS_PROPERTY, String.valueOf(dotransactions)); + + long maxExecutionTime = Integer.parseInt(props.getProperty(MAX_EXECUTION_TIME, "0")); + + //get number of threads, target and db + threadcount=Integer.parseInt(props.getProperty(THREAD_COUNT_PROPERTY,"1")); + dbname=props.getProperty(DB_PROPERTY,"com.yahoo.ycsb.BasicDB"); + target=Integer.parseInt(props.getProperty(TARGET_PROPERTY,"0")); + + //compute the target throughput + double targetperthreadperms=-1; + if (target>0) + { + double targetperthread=((double)target)/((double)threadcount); + targetperthreadperms=targetperthread/1000.0; + } + + final Map<String, String> filteredProperties = new HashMap<>(); + for (String key : props.stringPropertyNames()) { + if (key.startsWith(HTRACE_KEY_PREFIX)) { + filteredProperties.put(key.substring(HTRACE_KEY_PREFIX.length()), props.getProperty(key)); + } + } + final HTraceConfiguration conf = HTraceConfiguration.fromMap(filteredProperties); + + //show a warning message that creating the workload is taking a while + //but only do so if it is taking longer than 2 seconds + //(showing the message right away if the setup wasn't taking very long was confusing people) + Thread warningthread=new Thread() + { + @Override + public void run() + { + try + { + sleep(2000); + } + catch (InterruptedException e) + { + return; + } + System.err.println(" (might take a few minutes for large data sets)"); + } + }; + + + warningthread.start(); + + //set up measurements + Measurements.setProperties(props); + + //load the workload + ClassLoader classLoader = Client.class.getClassLoader(); + + try { + Properties projectProp = new Properties(); + projectProp.load(classLoader.getResourceAsStream("project.properties")); + System.err.println("YCSB Client " + projectProp.getProperty("version")); + } catch (IOException e) { + System.err.println("Unable to retrieve client version."); + } + + System.err.print("Command line:"); + for (int i=0; i<args.length; i++) + { + System.err.print(" "+args[i]); + } + System.err.println(); + System.err.println("Loading workload..."); + + Workload workload = null; + + try + { + Class workloadclass = classLoader.loadClass(props.getProperty(WORKLOAD_PROPERTY)); + + workload = (Workload)workloadclass.newInstance(); + } + catch (Exception e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + System.exit(0); + } + + final Tracer tracer = new Tracer.Builder("YCSB " + workload.getClass().getSimpleName()) + .conf(conf) + .build(); + + try + { + try (final TraceScope span = tracer.newScope(CLIENT_WORKLOAD_INIT_SPAN)) { + workload.init(props); + warningthread.interrupt(); + } + } + catch (WorkloadException e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + System.exit(0); + } + + //run the workload + + System.err.println("Starting test."); + final CountDownLatch completeLatch = new CountDownLatch(threadcount); + final List<ClientThread> clients = new ArrayList<ClientThread>(threadcount); + + boolean initFailed = false; + try (final TraceScope span = tracer.newScope(CLIENT_INIT_SPAN)) { + + int opcount; + if (dotransactions) + { + opcount=Integer.parseInt(props.getProperty(OPERATION_COUNT_PROPERTY,"0")); + } + else + { + if (props.containsKey(INSERT_COUNT_PROPERTY)) + { + opcount=Integer.parseInt(props.getProperty(INSERT_COUNT_PROPERTY,"0")); + } + else + { + opcount=Integer.parseInt(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT)); + } + } + + for (int threadid=0; threadid<threadcount; threadid++) + { + DB db = null; + try + { + db = DBFactory.newDB(dbname, props, tracer); + } + catch (UnknownDBException e) + { + System.out.println("Unknown DB " + dbname); + initFailed = true; + break; + } + + + int threadopcount = opcount / threadcount; + + // ensure correct number of operations, in case opcount is not a multiple of threadcount + if (threadid<opcount%threadcount) + { + ++threadopcount; + } + + ClientThread t=new ClientThread(db,dotransactions,workload,props,threadopcount, targetperthreadperms, completeLatch); + + clients.add(t); + } + + } + + if (initFailed) { + System.err.println("Error initializing datastore bindings."); + System.exit(0); + } + + if (status) + { + boolean standardstatus=false; + if (props.getProperty(Measurements.MEASUREMENT_TYPE_PROPERTY,"").compareTo("timeseries")==0) + { + standardstatus=true; + } + int statusIntervalSeconds = Integer.parseInt(props.getProperty("status.interval","10")); + boolean trackJVMStats = props.getProperty(Measurements.MEASUREMENT_TRACK_JVM_PROPERTY, + Measurements.MEASUREMENT_TRACK_JVM_PROPERTY_DEFAULT).equals("true"); + statusthread=new StatusThread(completeLatch,clients,label,standardstatus,statusIntervalSeconds,trackJVMStats); + statusthread.start(); + } - public static void usageMessage() - { - System.out.println("Usage: java com.yahoo.ycsb.Client [options]"); - System.out.println("Options:"); - System.out.println(" -threads n: execute using n threads (default: 1) - can also be specified as the \n" + - " \"threadcount\" property using -p"); - System.out.println(" -target n: attempt to do n operations per second (default: unlimited) - can also\n" + - " be specified as the \"target\" property using -p"); - System.out.println(" -load: run the loading phase of the workload"); - System.out.println(" -t: run the transactions phase of the workload (default)"); - System.out.println(" -db dbname: specify the name of the DB to use (default: com.yahoo.ycsb.BasicDB) - \n" + - " can also be specified as the \"db\" property using -p"); - System.out.println(" -P propertyfile: load properties from the given file. Multiple files can"); - System.out.println(" be specified, and will be processed in the order specified"); - System.out.println(" -p name=value: specify a property to be passed to the DB and workloads;"); - System.out.println(" multiple properties can be specified, and override any"); - System.out.println(" values in the propertyfile"); - System.out.println(" -s: show status during run (default: no status)"); - System.out.println(" -l label: use label for status (e.g. to label one experiment out of a whole batch)"); - System.out.println(""); - System.out.println("Required properties:"); - System.out.println(" "+WORKLOAD_PROPERTY+": the name of the workload class to use (e.g. com.yahoo.ycsb.workloads.CoreWorkload)"); - System.out.println(""); - System.out.println("To run the transaction phase from multiple servers, start a separate client on each."); - System.out.println("To run the load phase from multiple servers, start a separate client on each; additionally,"); - System.out.println("use the \"insertcount\" and \"insertstart\" properties to divide up the records to be inserted"); - } - - public static boolean checkRequiredProperties(Properties props) - { - if (props.getProperty(WORKLOAD_PROPERTY)==null) - { - System.out.println("Missing property: "+WORKLOAD_PROPERTY); - return false; - } - - return true; - } - - - /** - * Exports the measurements to either sysout or a file using the exporter - * loaded from conf. - * @throws IOException Either failed to write to output stream or failed to close it. - */ - private static void exportMeasurements(Properties props, int opcount, long runtime) - throws IOException - { - MeasurementsExporter exporter = null; - try - { - // if no destination file is provided the results will be written to stdout - OutputStream out; - String exportFile = props.getProperty(EXPORT_FILE_PROPERTY); - if (exportFile == null) - { - out = System.out; - } else - { - out = new FileOutputStream(exportFile); - } - - // if no exporter is provided the default text one will be used - String exporterStr = props.getProperty(EXPORTER_PROPERTY, "com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter"); - try - { - exporter = (MeasurementsExporter) Class.forName(exporterStr).getConstructor(OutputStream.class).newInstance(out); - } catch (Exception e) - { - System.err.println("Could not find exporter " + exporterStr - + ", will use default text reporter."); - e.printStackTrace(); - exporter = new TextMeasurementsExporter(out); - } - - exporter.write("OVERALL", "RunTime(ms)", runtime); - double throughput = 1000.0 * ((double) opcount) / ((double) runtime); - exporter.write("OVERALL", "Throughput(ops/sec)", throughput); - - Measurements.getMeasurements().exportMeasurements(exporter); - } finally - { - if (exporter != null) - { - exporter.close(); - } - } - } - - @SuppressWarnings("unchecked") - public static void main(String[] args) - { - String dbname; - Properties props=new Properties(); - Properties fileprops=new Properties(); - boolean dotransactions=true; - int threadcount=1; - int target=0; - boolean status=false; - String label=""; - - //parse arguments - int argindex=0; - - if (args.length==0) - { - usageMessage(); - System.exit(0); - } - - while (args[argindex].startsWith("-")) - { - if (args[argindex].compareTo("-threads")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - int tcount=Integer.parseInt(args[argindex]); - props.setProperty(THREAD_COUNT_PROPERTY, tcount+""); - argindex++; - } - else if (args[argindex].compareTo("-target")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - int ttarget=Integer.parseInt(args[argindex]); - props.setProperty(TARGET_PROPERTY, ttarget+""); - argindex++; - } - else if (args[argindex].compareTo("-load")==0) - { - dotransactions=false; - argindex++; - } - else if (args[argindex].compareTo("-t")==0) - { - dotransactions=true; - argindex++; - } - else if (args[argindex].compareTo("-s")==0) - { - status=true; - argindex++; - } - else if (args[argindex].compareTo("-db")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - props.setProperty(DB_PROPERTY,args[argindex]); - argindex++; - } - else if (args[argindex].compareTo("-l")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - label=args[argindex]; - argindex++; - } - else if (args[argindex].compareTo("-P")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - String propfile=args[argindex]; - argindex++; - - Properties myfileprops=new Properties(); - try - { - myfileprops.load(new FileInputStream(propfile)); - } - catch (IOException e) - { - System.out.println(e.getMessage()); - System.exit(0); - } - - //Issue #5 - remove call to stringPropertyNames to make compilable under Java 1.5 - for (Enumeration e=myfileprops.propertyNames(); e.hasMoreElements(); ) - { - String prop=(String)e.nextElement(); - - fileprops.setProperty(prop,myfileprops.getProperty(prop)); - } - - } - else if (args[argindex].compareTo("-p")==0) - { - argindex++; - if (argindex>=args.length) - { - usageMessage(); - System.exit(0); - } - int eq=args[argindex].indexOf('='); - if (eq<0) - { - usageMessage(); - System.exit(0); - } - - String name=args[argindex].substring(0,eq); - String value=args[argindex].substring(eq+1); - props.put(name,value); - //System.out.println("["+name+"]=["+value+"]"); - argindex++; - } - else - { - System.out.println("Unknown option "+args[argindex]); - usageMessage(); - System.exit(0); - } - - if (argindex>=args.length) - { - break; - } - } - - if (argindex!=args.length) - { - usageMessage(); - System.exit(0); - } - - //set up logging - //BasicConfigurator.configure(); - - //overwrite file properties with properties from the command line - - //Issue #5 - remove call to stringPropertyNames to make compilable under Java 1.5 - for (Enumeration e=props.propertyNames(); e.hasMoreElements(); ) - { - String prop=(String)e.nextElement(); - - fileprops.setProperty(prop,props.getProperty(prop)); - } - - props=fileprops; - - if (!checkRequiredProperties(props)) - { - System.exit(0); - } - - long maxExecutionTime = Integer.parseInt(props.getProperty(MAX_EXECUTION_TIME, "0")); - - //get number of threads, target and db - threadcount=Integer.parseInt(props.getProperty(THREAD_COUNT_PROPERTY,"1")); - dbname=props.getProperty(DB_PROPERTY,"com.yahoo.ycsb.BasicDB"); - target=Integer.parseInt(props.getProperty(TARGET_PROPERTY,"0")); - - //compute the target throughput - double targetperthreadperms=-1; - if (target>0) - { - double targetperthread=((double)target)/((double)threadcount); - targetperthreadperms=targetperthread/1000.0; - } - - System.out.println("YCSB Client 0.1"); - System.out.print("Command line:"); - for (int i=0; i<args.length; i++) - { - System.out.print(" "+args[i]); - } - System.out.println(); - System.err.println("Loading workload..."); - - //show a warning message that creating the workload is taking a while - //but only do so if it is taking longer than 2 seconds - //(showing the message right away if the setup wasn't taking very long was confusing people) - Thread warningthread=new Thread() - { - public void run() - { - try - { - sleep(2000); - } - catch (InterruptedException e) - { - return; - } - System.err.println(" (might take a few minutes for large data sets)"); - } - }; - - warningthread.start(); - - //set up measurements - Measurements.setProperties(props); - - //load the workload - ClassLoader classLoader = Client.class.getClassLoader(); - - Workload workload=null; - - try - { - Class workloadclass = classLoader.loadClass(props.getProperty(WORKLOAD_PROPERTY)); - - workload=(Workload)workloadclass.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - System.exit(0); - } - - try - { - workload.init(props); - } - catch (WorkloadException e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - System.exit(0); - } - - warningthread.interrupt(); - - //run the workload - - System.err.println("Starting test."); - - int opcount; - if (dotransactions) - { - opcount=Integer.parseInt(props.getProperty(OPERATION_COUNT_PROPERTY,"0")); - } - else - { - if (props.containsKey(INSERT_COUNT_PROPERTY)) - { - opcount=Integer.parseInt(props.getProperty(INSERT_COUNT_PROPERTY,"0")); - } - else - { - opcount=Integer.parseInt(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT)); - } - } - Vector<Thread> threads=new Vector<Thread>(); - - for (int threadid=0; threadid<threadcount; threadid++) - { - DB db=null; - try - { - db=DBFactory.newDB(dbname,props); - } - catch (UnknownDBException e) - { - System.out.println("Unknown DB "+dbname); - System.exit(0); - } - - - int threadopcount = opcount/threadcount; - - // ensure correct number of operations, in case opcount is not a multiple of threadcount - if (threadid<opcount%threadcount) - { - ++threadopcount; - } - - Thread t=new ClientThread(db,dotransactions,workload,threadid,threadcount,props,threadopcount, targetperthreadperms); - - threads.add(t); - //t.start(); - } - - StatusThread statusthread=null; - - if (status) - { - boolean standardstatus=false; - if (props.getProperty(Measurements.MEASUREMENT_TYPE_PROPERTY,"").compareTo("timeseries")==0) - { - standardstatus=true; - } - int statusIntervalSeconds = Integer.parseInt(props.getProperty("status.interval","10")); - statusthread=new StatusThread(threads,label,standardstatus,statusIntervalSeconds); - statusthread.start(); - } - - long st=System.currentTimeMillis(); - - for (Thread t : threads) - { - t.start(); - } - Thread terminator = null; - - if (maxExecutionTime > 0) { - terminator = new TerminatorThread(maxExecutionTime, threads, workload); - terminator.start(); + long st; + long en; + int opsDone; + + try (final TraceScope span = tracer.newScope(CLIENT_WORKLOAD_SPAN)) { + + final Map<Thread, ClientThread> threads = new HashMap<Thread, ClientThread>(threadcount); + for (ClientThread client : clients) { + threads.put(new Thread(tracer.wrap(client, "ClientThread")), client); + } + + st=System.currentTimeMillis(); + + for (Thread t : threads.keySet()) + { + t.start(); + } + + if (maxExecutionTime > 0) { + terminator = new TerminatorThread(maxExecutionTime, threads.keySet(), workload); + terminator.start(); + } + + opsDone = 0; + + for (Map.Entry<Thread, ClientThread> entry : threads.entrySet()) + { + try + { + entry.getKey().join(); + opsDone += entry.getValue().getOpsDone(); + } + catch (InterruptedException e) + { + } + } + + en=System.currentTimeMillis(); + } - - int opsDone = 0; - - for (Thread t : threads) - { - try - { - t.join(); - opsDone += ((ClientThread)t).getOpsDone(); - } - catch (InterruptedException e) - { - } - } - - long en=System.currentTimeMillis(); - - if (terminator != null && !terminator.isInterrupted()) { - terminator.interrupt(); - } - - if (status) - { - // wake up status thread if it's asleep - statusthread.interrupt(); - // at this point we assume all the monitored threads are already gone as per above join loop. - try { - statusthread.join(); - } catch (InterruptedException e) { - } - } - - try - { - workload.cleanup(); - } - catch (WorkloadException e) - { - e.printStackTrace(); - e.printStackTrace(System.out); - System.exit(0); - } - - try - { - exportMeasurements(props, opsDone, en - st); - } catch (IOException e) - { - System.err.println("Could not export measurements, error: " + e.getMessage()); - e.printStackTrace(); - System.exit(-1); - } - - System.exit(0); - } + + try + { + try (final TraceScope span = tracer.newScope(CLIENT_CLEANUP_SPAN)) { + + if (terminator != null && !terminator.isInterrupted()) { + terminator.interrupt(); + } + + if (status) + { + // wake up status thread if it's asleep + statusthread.interrupt(); + // at this point we assume all the monitored threads are already gone as per above join loop. + try { + statusthread.join(); + } catch (InterruptedException e) { + } + } + + workload.cleanup(); + } + } + catch (WorkloadException e) + { + e.printStackTrace(); + e.printStackTrace(System.out); + System.exit(0); + } + + try + { + try (final TraceScope span = tracer.newScope(CLIENT_EXPORT_MEASUREMENTS_SPAN)) { + exportMeasurements(props, opsDone, en - st); + } + } catch (IOException e) + { + System.err.println("Could not export measurements, error: " + e.getMessage()); + e.printStackTrace(); + System.exit(-1); + } + + System.exit(0); + } } diff --git a/core/src/main/java/com/yahoo/ycsb/CommandLine.java b/core/src/main/java/com/yahoo/ycsb/CommandLine.java index c3f06549900263c8012d402d639b9d7deb3fb941..80c1fc18b1df7b00807ee300fdbf4d4a3177a5ce 100644 --- a/core/src/main/java/com/yahoo/ycsb/CommandLine.java +++ b/core/src/main/java/com/yahoo/ycsb/CommandLine.java @@ -295,8 +295,8 @@ public class CommandLine } HashMap<String,ByteIterator> result=new HashMap<String,ByteIterator>(); - int ret=db.read(table,tokens[1],fields,result); - System.out.println("Return code: "+ret); + Status ret=db.read(table,tokens[1],fields,result); + System.out.println("Return code: "+ret.getName()); for (Map.Entry<String,ByteIterator> ent : result.entrySet()) { System.out.println(ent.getKey()+"="+ent.getValue()); @@ -324,10 +324,10 @@ public class CommandLine } Vector<HashMap<String,ByteIterator>> results=new Vector<HashMap<String,ByteIterator>>(); - int ret=db.scan(table,tokens[1],Integer.parseInt(tokens[2]),fields,results); - System.out.println("Return code: "+ret); + Status ret=db.scan(table,tokens[1],Integer.parseInt(tokens[2]),fields,results); + System.out.println("Result: "+ret.getName()); int record=0; - if (results.size()==0) + if (results.isEmpty()) { System.out.println("0 records"); } @@ -362,8 +362,8 @@ public class CommandLine values.put(nv[0],new StringByteIterator(nv[1])); } - int ret=db.update(table,tokens[1],values); - System.out.println("Return code: "+ret); + Status ret=db.update(table,tokens[1],values); + System.out.println("Result: "+ret.getName()); } } else if (tokens[0].compareTo("insert")==0) @@ -382,8 +382,8 @@ public class CommandLine values.put(nv[0],new StringByteIterator(nv[1])); } - int ret=db.insert(table,tokens[1],values); - System.out.println("Return code: "+ret); + Status ret=db.insert(table,tokens[1],values); + System.out.println("Result: "+ret.getName()); } } else if (tokens[0].compareTo("delete")==0) @@ -394,8 +394,8 @@ public class CommandLine } else { - int ret=db.delete(table,tokens[1]); - System.out.println("Return code: "+ret); + Status ret=db.delete(table,tokens[1]); + System.out.println("Return result: "+ret.getName()); } } else diff --git a/core/src/main/java/com/yahoo/ycsb/DB.java b/core/src/main/java/com/yahoo/ycsb/DB.java index 91a695f140623729b7a7dbd8b8ebf087ff91ba9f..f9fec3a93922c5297ae89899f1c1a2f61e3f768c 100644 --- a/core/src/main/java/com/yahoo/ycsb/DB.java +++ b/core/src/main/java/com/yahoo/ycsb/DB.java @@ -88,9 +88,9 @@ public abstract class DB * @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". + * @return The result of the operation. */ - public abstract int read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result); + public abstract Status read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result); /** * 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. @@ -100,9 +100,9 @@ public abstract class DB * @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 this class's description for a discussion of error codes. + * @return The result of the operation. */ - public abstract int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result); + public abstract Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result); /** * Update a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified @@ -111,9 +111,9 @@ public abstract class DB * @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. + * @return The result of the operation. */ - public abstract int update(String table, String key, HashMap<String,ByteIterator> values); + public abstract Status update(String table, String key, HashMap<String,ByteIterator> values); /** * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified @@ -122,16 +122,16 @@ public abstract class DB * @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 this class's description for a discussion of error codes. + * @return The result of the operation. */ - public abstract int insert(String table, String key, HashMap<String,ByteIterator> values); + public abstract Status insert(String table, String key, HashMap<String,ByteIterator> values); /** * 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 this class's description for a discussion of error codes. + * @return The result of the operation. */ - public abstract int delete(String table, String key); + public abstract Status delete(String table, String key); } diff --git a/core/src/main/java/com/yahoo/ycsb/DBFactory.java b/core/src/main/java/com/yahoo/ycsb/DBFactory.java index 18f7f5e1f1efbd1b5bd0c59f61f59452e45713c6..2096c0d139ad74729424feaff917ddd5a9226b53 100644 --- a/core/src/main/java/com/yahoo/ycsb/DBFactory.java +++ b/core/src/main/java/com/yahoo/ycsb/DBFactory.java @@ -18,6 +18,7 @@ package com.yahoo.ycsb; import java.util.Properties; +import org.apache.htrace.core.Tracer; /** * Creates a DB layer by dynamically classloading the specified DB class. @@ -25,7 +26,7 @@ import java.util.Properties; public class DBFactory { @SuppressWarnings("unchecked") - public static DB newDB(String dbname, Properties properties) throws UnknownDBException + public static DB newDB(String dbname, Properties properties, final Tracer tracer) throws UnknownDBException { ClassLoader classLoader = DBFactory.class.getClassLoader(); @@ -46,7 +47,7 @@ public class DBFactory ret.setProperties(properties); - return new DBWrapper(ret); + return new DBWrapper(ret, tracer); } } diff --git a/core/src/main/java/com/yahoo/ycsb/DBWrapper.java b/core/src/main/java/com/yahoo/ycsb/DBWrapper.java index 50b314bb75196708eca4b030e9d66d78e9954ddc..0109c519558056ab0d762b64b2350dda6fa16b7c 100644 --- a/core/src/main/java/com/yahoo/ycsb/DBWrapper.java +++ b/core/src/main/java/com/yahoo/ycsb/DBWrapper.java @@ -1,182 +1,267 @@ -/** - * Copyright (c) 2010 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. +/** + * Copyright (c) 2010 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. */ package com.yahoo.ycsb; +import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Properties; import java.util.Set; import java.util.Vector; +import org.apache.htrace.core.Tracer; +import org.apache.htrace.core.TraceScope; + import com.yahoo.ycsb.measurements.Measurements; /** * Wrapper around a "real" DB that measures latencies and counts return codes. + * Also reports latency separately between OK and failed operations. */ public class DBWrapper extends DB { - DB _db; - Measurements _measurements; - - public DBWrapper(DB db) - { - _db=db; - _measurements=Measurements.getMeasurements(); - } - - /** - * Set the properties for this DB. - */ - public void setProperties(Properties p) - { - _db.setProperties(p); - } - - /** - * Get the set of properties for this DB. - */ - public Properties getProperties() - { - return _db.getProperties(); - } - - /** - * Initialize any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - public void init() throws DBException - { - _db.init(); - } - - /** - * Cleanup any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - public void cleanup() throws DBException - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - _db.cleanup(); - long en=System.nanoTime(); - measure("CLEANUP",ist, st, en); - } - - /** - * 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 - */ - public int read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - int res=_db.read(table,key,fields,result); - long en=System.nanoTime(); - measure("READ",ist, st, en); - _measurements.reportReturnCode("READ",res); - return res; - } - - /** - * 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 - */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - int res=_db.scan(table,startkey,recordcount,fields,result); - long en=System.nanoTime(); - measure("SCAN",ist, st, en); - _measurements.reportReturnCode("SCAN",res); - return res; - } - - private void measure(String op, long intendedStartTimeNanos, long startTimeNanos, long endTimeNanos) { - _measurements.measure(op, (int)((endTimeNanos-startTimeNanos)/1000)); - _measurements.measureIntended(op, (int)((endTimeNanos-intendedStartTimeNanos)/1000)); + private final DB _db; + private final Measurements _measurements; + private final Tracer _tracer; + + private boolean reportLatencyForEachError = false; + private HashSet<String> latencyTrackedErrors = new HashSet<String>(); + + private static final String REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY = + "reportlatencyforeacherror"; + private static final String REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY_DEFAULT = + "false"; + + private static final String LATENCY_TRACKED_ERRORS_PROPERTY = + "latencytrackederrors"; + + private final String SCOPE_STRING_CLEANUP; + private final String SCOPE_STRING_DELETE; + private final String SCOPE_STRING_INIT; + private final String SCOPE_STRING_INSERT; + private final String SCOPE_STRING_READ; + private final String SCOPE_STRING_SCAN; + private final String SCOPE_STRING_UPDATE; + + public DBWrapper(final DB db, final Tracer tracer) + { + _db=db; + _measurements=Measurements.getMeasurements(); + _tracer = tracer; + final String simple = db.getClass().getSimpleName(); + SCOPE_STRING_CLEANUP = simple + "#cleanup"; + SCOPE_STRING_DELETE = simple + "#delete"; + SCOPE_STRING_INIT = simple + "#init"; + SCOPE_STRING_INSERT = simple + "#insert"; + SCOPE_STRING_READ = simple + "#read"; + SCOPE_STRING_SCAN = simple + "#scan"; + SCOPE_STRING_UPDATE = simple + "#update"; + } + + /** + * Set the properties for this DB. + */ + public void setProperties(Properties p) + { + _db.setProperties(p); + } + + /** + * Get the set of properties for this DB. + */ + public Properties getProperties() + { + return _db.getProperties(); + } + + /** + * Initialize any state for this DB. + * Called once per DB instance; there is one DB instance per client thread. + */ + public void init() throws DBException + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_INIT)) { + _db.init(); + + this.reportLatencyForEachError = Boolean.parseBoolean(getProperties(). + getProperty(REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY, + REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY_DEFAULT)); + + if (!reportLatencyForEachError) { + String latencyTrackedErrors = getProperties().getProperty( + LATENCY_TRACKED_ERRORS_PROPERTY, null); + if (latencyTrackedErrors != null) { + this.latencyTrackedErrors = new HashSet<String>(Arrays.asList( + latencyTrackedErrors.split(","))); + } + } + + System.err.println("DBWrapper: report latency for each error is " + + this.reportLatencyForEachError + " and specific error codes to track" + + " for latency are: " + this.latencyTrackedErrors.toString()); + } + } + + /** + * Cleanup any state for this DB. + * Called once per DB instance; there is one DB instance per client thread. + */ + public void cleanup() throws DBException + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_CLEANUP)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + _db.cleanup(); + long en=System.nanoTime(); + measure("CLEANUP", Status.OK, ist, st, en); + } + } + + /** + * 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 The result of the operation. + */ + public Status read(String table, String key, Set<String> fields, + HashMap<String,ByteIterator> result) + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_READ)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + Status res=_db.read(table,key,fields,result); + long en=System.nanoTime(); + measure("READ", res, ist, st, en); + _measurements.reportStatus("READ", res); + return res; + } + } + + /** + * 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 The result of the operation. + */ + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String,ByteIterator>> result) + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_SCAN)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + Status res=_db.scan(table,startkey,recordcount,fields,result); + long en=System.nanoTime(); + measure("SCAN", res, ist, st, en); + _measurements.reportStatus("SCAN", res); + return res; + } + } + + private void measure(String op, Status result, long intendedStartTimeNanos, + long startTimeNanos, long endTimeNanos) { + String measurementName = op; + if (result != Status.OK) { + if (this.reportLatencyForEachError || + this.latencyTrackedErrors.contains(result.getName())) { + measurementName = op + "-" + result.getName(); + } else { + measurementName = op + "-FAILED"; + } + } + _measurements.measure(measurementName, + (int)((endTimeNanos-startTimeNanos)/1000)); + _measurements.measureIntended(measurementName, + (int)((endTimeNanos-intendedStartTimeNanos)/1000)); + } + + /** + * 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 The result of the operation. + */ + public Status update(String table, String key, + HashMap<String,ByteIterator> values) + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_UPDATE)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + Status res=_db.update(table,key,values); + long en=System.nanoTime(); + measure("UPDATE", res, ist, st, en); + _measurements.reportStatus("UPDATE", res); + return res; + } + } + + /** + * 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 The result of the operation. + */ + public Status insert(String table, String key, + HashMap<String,ByteIterator> values) + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_INSERT)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + Status res=_db.insert(table,key,values); + long en=System.nanoTime(); + measure("INSERT", res, ist, st, en); + _measurements.reportStatus("INSERT", res); + return res; + } + } + + /** + * Delete a record from the database. + * + * @param table The name of the table + * @param key The record key of the record to delete. + * @return The result of the operation. + */ + public Status delete(String table, String key) + { + try (final TraceScope span = _tracer.newScope(SCOPE_STRING_DELETE)) { + long ist=_measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + Status res=_db.delete(table,key); + long en=System.nanoTime(); + measure("DELETE", res, ist, st, en); + _measurements.reportStatus("DELETE", res); + return res; } - - /** - * 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 - */ - public int update(String table, String key, HashMap<String,ByteIterator> values) - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - int res=_db.update(table,key,values); - long en=System.nanoTime(); - measure("UPDATE",ist, st, en); - _measurements.reportReturnCode("UPDATE",res); - return res; - } - - /** - * 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 - */ - public int insert(String table, String key, HashMap<String,ByteIterator> values) - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - int res=_db.insert(table,key,values); - long en=System.nanoTime(); - measure("INSERT",ist, st, en); - _measurements.reportReturnCode("INSERT",res); - return res; - } - - /** - * 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 - */ - public int delete(String table, String key) - { - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - int res=_db.delete(table,key); - long en=System.nanoTime(); - measure("DELETE",ist, st, en); - _measurements.reportReturnCode("DELETE",res); - return res; - } + } } diff --git a/core/src/main/java/com/yahoo/ycsb/GoodBadUglyDB.java b/core/src/main/java/com/yahoo/ycsb/GoodBadUglyDB.java index 706438eb879bf93515dd31cefa6252696481c409..e576a84268b104a12410bc80dae0a36098a6f5d5 100644 --- a/core/src/main/java/com/yahoo/ycsb/GoodBadUglyDB.java +++ b/core/src/main/java/com/yahoo/ycsb/GoodBadUglyDB.java @@ -96,9 +96,9 @@ public class GoodBadUglyDB extends DB { * @param result A HashMap of field/value pairs for the result * @return Zero on success, a non-zero error code on error */ - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { delay(); - return 0; + return Status.OK; } /** @@ -112,11 +112,11 @@ public class GoodBadUglyDB extends DB { * @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 */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, + public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { delay(); - return 0; + return Status.OK; } /** @@ -128,10 +128,10 @@ public class GoodBadUglyDB extends DB { * @param values A HashMap of field/value pairs to update in the record * @return Zero on success, a non-zero error code on error */ - public int update(String table, String key, HashMap<String, ByteIterator> values) { + public Status update(String table, String key, HashMap<String, ByteIterator> values) { delay(); - return 0; + return Status.OK; } /** @@ -143,9 +143,9 @@ public class GoodBadUglyDB extends DB { * @param values A HashMap of field/value pairs to insert in the record * @return Zero on success, a non-zero error code on error */ - public int insert(String table, String key, HashMap<String, ByteIterator> values) { + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { delay(); - return 0; + return Status.OK; } /** @@ -155,8 +155,8 @@ public class GoodBadUglyDB extends DB { * @param key The record key of the record to delete. * @return Zero on success, a non-zero error code on error */ - public int delete(String table, String key) { + public Status delete(String table, String key) { delay(); - return 0; + return Status.OK; } } diff --git a/core/src/main/java/com/yahoo/ycsb/RandomByteIterator.java b/core/src/main/java/com/yahoo/ycsb/RandomByteIterator.java index cb0977aa56c8f52f4686d84aaaa23f4f30f160c2..b080ec56a9d0ec54939273bdc60b9daab8959a59 100644 --- a/core/src/main/java/com/yahoo/ycsb/RandomByteIterator.java +++ b/core/src/main/java/com/yahoo/ycsb/RandomByteIterator.java @@ -32,14 +32,23 @@ public class RandomByteIterator extends ByteIterator { private void fillBytesImpl(byte[] buffer, int base) { int bytes = Utils.random().nextInt(); - try { - buffer[base+0] = (byte)(((bytes) & 31) + ' '); - buffer[base+1] = (byte)(((bytes >> 5) & 63) + ' '); - buffer[base+2] = (byte)(((bytes >> 10) & 95) + ' '); - buffer[base+3] = (byte)(((bytes >> 15) & 31) + ' '); - buffer[base+4] = (byte)(((bytes >> 20) & 63) + ' '); - buffer[base+5] = (byte)(((bytes >> 25) & 95) + ' '); - } catch (ArrayIndexOutOfBoundsException e) { /* ignore it */ } + + switch(buffer.length - base) { + default: + buffer[base+5] = (byte)(((bytes >> 25) & 95) + ' '); + case 5: + buffer[base+4] = (byte)(((bytes >> 20) & 63) + ' '); + case 4: + buffer[base+3] = (byte)(((bytes >> 15) & 31) + ' '); + case 3: + buffer[base+2] = (byte)(((bytes >> 10) & 95) + ' '); + case 2: + buffer[base+1] = (byte)(((bytes >> 5) & 63) + ' '); + case 1: + buffer[base+0] = (byte)(((bytes) & 31) + ' '); + case 0: + break; + } } private void fillBytes() { diff --git a/core/src/main/java/com/yahoo/ycsb/Status.java b/core/src/main/java/com/yahoo/ycsb/Status.java new file mode 100644 index 0000000000000000000000000000000000000000..5e5b3a887d3f3bb6c871c950977ab2585c3fc28f --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/Status.java @@ -0,0 +1,92 @@ +/** + * 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. + */ + +package com.yahoo.ycsb; + +/** + * The result of an operation. + */ +public class Status { + private final String name; + private final String description; + + + /** + * @param name A short name for the status. + * @param description A description of the status. + */ + public Status(String name, String description) { + super(); + this.name = name; + this.description = description; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + @Override + public String toString() { + return "Status [name=" + name + ", description=" + description + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((description == null) ? 0 : description.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Status other = (Status) obj; + if (description == null) { + if (other.description != null) + return false; + } else if (!description.equals(other.description)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + public static final Status OK = new Status("OK", "The operation completed successfully."); + public static final Status ERROR = new Status("ERROR", "The operation failed."); + public static final Status NOT_FOUND = new Status("NOT_FOUND", "The requested record was not found."); + public static final Status NOT_IMPLEMENTED = new Status("NOT_IMPLEMENTED", "The operation is not implemented for the current binding."); + public static final Status UNEXPECTED_STATE = new Status("UNEXPECTED_STATE", "The operation reported success, but the result was not as expected."); + public static final Status BAD_REQUEST = new Status("BAD_REQUEST", "The request was not valid."); + public static final Status FORBIDDEN = new Status("FORBIDDEN", "The operation is forbidden."); + public static final Status SERVICE_UNAVAILABLE = new Status("SERVICE_UNAVAILABLE", "Dependant service for the current binding is not available."); + public static final Status BATCHED_OK = new Status("BATCHED_OK", "The operation has been batched by the binding to be executed later."); +} + diff --git a/core/src/main/java/com/yahoo/ycsb/StringByteIterator.java b/core/src/main/java/com/yahoo/ycsb/StringByteIterator.java index 84465cba3ef0482bea716c3daf2cf7ca45463961..bcc602effacf0eafc0196ade64712290ea7a5e5c 100644 --- a/core/src/main/java/com/yahoo/ycsb/StringByteIterator.java +++ b/core/src/main/java/com/yahoo/ycsb/StringByteIterator.java @@ -29,7 +29,7 @@ public class StringByteIterator extends ByteIterator { * String values into ByteIterators. */ public static void putAllAsByteIterators(Map<String, ByteIterator> out, Map<String, String> in) { - for(String s: in.keySet()) { out.put(s, new StringByteIterator(in.get(s))); } + for(Map.Entry<String, String> entry : in.entrySet()) { out.put(entry.getKey(), new StringByteIterator(entry.getValue())); } } /** @@ -37,7 +37,7 @@ public class StringByteIterator extends ByteIterator { * ByteIterator values into Strings. */ public static void putAllAsStrings(Map<String, String> out, Map<String, ByteIterator> in) { - for(String s: in.keySet()) { out.put(s, in.get(s).toString()); } + for(Map.Entry<String, ByteIterator> entry : in.entrySet()) { out.put(entry.getKey(), entry.getValue().toString()); } } /** @@ -48,8 +48,8 @@ public class StringByteIterator extends ByteIterator { HashMap<String, ByteIterator> ret = new HashMap<String,ByteIterator>(); - for(String s: m.keySet()) { - ret.put(s, new StringByteIterator(m.get(s))); + for(Map.Entry<String, String> entry : m.entrySet()) { + ret.put(entry.getKey(), new StringByteIterator(entry.getValue())); } return ret; } @@ -61,8 +61,8 @@ public class StringByteIterator extends ByteIterator { public static HashMap<String, String> getStringMap(Map<String, ByteIterator> m) { HashMap<String, String> ret = new HashMap<String,String>(); - for(String s: m.keySet()) { - ret.put(s, m.get(s).toString());; + for(Map.Entry<String, ByteIterator> entry : m.entrySet()) { + ret.put(entry.getKey(), entry.getValue().toString()); } return ret; } diff --git a/core/src/main/java/com/yahoo/ycsb/TerminatorThread.java b/core/src/main/java/com/yahoo/ycsb/TerminatorThread.java index 7d985f82e1777496c5f1ebb7efc408c138bb9359..f15de5dfdaf2e4d9acb0d37d0cbf6f40e54d9be9 100644 --- a/core/src/main/java/com/yahoo/ycsb/TerminatorThread.java +++ b/core/src/main/java/com/yahoo/ycsb/TerminatorThread.java @@ -16,11 +16,11 @@ */ package com.yahoo.ycsb; -import java.util.Vector; +import java.util.Collection; /** * A thread that waits for the maximum specified time and then interrupts all the client - * threads passed as the Vector at initialization of this thread. + * threads passed at initialization of this thread. * * The maximum execution time passed is assumed to be in seconds. * @@ -29,12 +29,12 @@ import java.util.Vector; */ public class TerminatorThread extends Thread { - private Vector<Thread> threads; + private final Collection<? extends Thread> threads; private long maxExecutionTime; private Workload workload; private long waitTimeOutInMS; - public TerminatorThread(long maxExecutionTime, Vector<Thread> threads, + public TerminatorThread(long maxExecutionTime, Collection<? extends Thread> threads, Workload workload) { this.maxExecutionTime = maxExecutionTime; this.threads = threads; diff --git a/core/src/main/java/com/yahoo/ycsb/Utils.java b/core/src/main/java/com/yahoo/ycsb/Utils.java index f49bc0f5c03cd1b3cd7993d9d97ba619cc5cde37..05199fd7dd266ea09d9162df3c20369bd86f7d97 100644 --- a/core/src/main/java/com/yahoo/ycsb/Utils.java +++ b/core/src/main/java/com/yahoo/ycsb/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010 Yahoo! Inc. All rights reserved. + * Copyright (c) 2010 Yahoo! Inc., 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 @@ -17,6 +17,12 @@ package com.yahoo.ycsb; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.OperatingSystemMXBean; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Random; /** @@ -113,4 +119,155 @@ public class Utils } return Math.abs(hashval); } + + /** + * Reads a big-endian 8-byte long from an offset in the given array. + * @param bytes The array to read from. + * @return A long integer. + * @throws IndexOutOfBoundsException if the byte array is too small. + * @throws NullPointerException if the byte array is null. + */ + public static long bytesToLong(final byte[] bytes) { + return (bytes[0] & 0xFFL) << 56 + | (bytes[1] & 0xFFL) << 48 + | (bytes[2] & 0xFFL) << 40 + | (bytes[3] & 0xFFL) << 32 + | (bytes[4] & 0xFFL) << 24 + | (bytes[5] & 0xFFL) << 16 + | (bytes[6] & 0xFFL) << 8 + | (bytes[7] & 0xFFL) << 0; + } + + /** + * Writes a big-endian 8-byte long at an offset in the given array. + * @param val The value to encode. + * @throws IndexOutOfBoundsException if the byte array is too small. + */ + public static byte[] longToBytes(final long val) { + final byte[] bytes = new byte[8]; + bytes[0] = (byte) (val >>> 56); + bytes[1] = (byte) (val >>> 48); + bytes[2] = (byte) (val >>> 40); + bytes[3] = (byte) (val >>> 32); + bytes[4] = (byte) (val >>> 24); + bytes[5] = (byte) (val >>> 16); + bytes[6] = (byte) (val >>> 8); + bytes[7] = (byte) (val >>> 0); + return bytes; + } + + /** + * Parses the byte array into a double. + * The byte array must be at least 8 bytes long and have been encoded using + * {@link #doubleToBytes}. If the array is longer than 8 bytes, only the + * first 8 bytes are parsed. + * @param bytes The byte array to parse, at least 8 bytes. + * @return A double value read from the byte array. + * @throws IllegalArgumentException if the byte array is not 8 bytes wide. + */ + public static double bytesToDouble(final byte[] bytes) { + if (bytes.length < 8) { + throw new IllegalArgumentException("Byte array must be 8 bytes wide."); + } + return Double.longBitsToDouble(bytesToLong(bytes)); + } + + /** + * Encodes the double value as an 8 byte array. + * @param val The double value to encode. + * @return A byte array of length 8. + */ + public static byte[] doubleToBytes(final double val) { + return longToBytes(Double.doubleToRawLongBits(val)); + } + + /** + * Measure the estimated active thread count in the current thread group. + * Since this calls {@link Thread.activeCount} it should be called from the + * main thread or one started by the main thread. Threads included in the + * count can be in any state. + * For a more accurate count we could use {@link Thread.getAllStackTraces().size()} + * but that freezes the JVM and incurs a high overhead. + * @return An estimated thread count, good for showing the thread count + * over time. + */ + public static int getActiveThreadCount() { + return Thread.activeCount(); + } + + /** @return The currently used memory in bytes */ + public static long getUsedMemoryBytes() { + final Runtime runtime = Runtime.getRuntime(); + return runtime.totalMemory() - runtime.freeMemory(); + } + + /** @return The currently used memory in megabytes. */ + public static int getUsedMemoryMegaBytes() { + return (int)(getUsedMemoryBytes() / 1024 / 1024); + } + + /** @return The current system load average if supported by the JDK. + * If it's not supported, the value will be negative. */ + public static double getSystemLoadAverage() { + final OperatingSystemMXBean osBean = + ManagementFactory.getOperatingSystemMXBean(); + return osBean.getSystemLoadAverage(); + } + + /** @return The total number of garbage collections executed for all + * memory pools. */ + public static long getGCTotalCollectionCount() { + final List<GarbageCollectorMXBean> gcBeans = + ManagementFactory.getGarbageCollectorMXBeans(); + long count = 0; + for (final GarbageCollectorMXBean bean : gcBeans) { + if (bean.getCollectionCount() < 0) { + continue; + } + count += bean.getCollectionCount(); + } + return count; + } + + /** @return The total time, in milliseconds, spent in GC. */ + public static long getGCTotalTime() { + final List<GarbageCollectorMXBean> gcBeans = + ManagementFactory.getGarbageCollectorMXBeans(); + long time = 0; + for (final GarbageCollectorMXBean bean : gcBeans) { + if (bean.getCollectionTime() < 0) { + continue; + } + time += bean.getCollectionTime(); + } + return time; + } + + /** + * Returns a map of garbage collectors and their stats. + * The first object in the array is the total count since JVM start and the + * second is the total time (ms) since JVM start. + * If a garbage collectors does not support the collector MXBean, then it + * will not be represented in the map. + * @return A non-null map of garbage collectors and their metrics. The map + * may be empty. + */ + public static Map<String, Long[]> getGCStatst() { + final List<GarbageCollectorMXBean> gcBeans = + ManagementFactory.getGarbageCollectorMXBeans(); + final Map<String, Long[]> map = new HashMap<String, Long[]>(gcBeans.size()); + for (final GarbageCollectorMXBean bean : gcBeans) { + if (!bean.isValid() || bean.getCollectionCount() < 0 || + bean.getCollectionTime() < 0) { + continue; + } + + final Long[] measurements = new Long[] { + bean.getCollectionCount(), + bean.getCollectionTime() + }; + map.put(bean.getName().replace(" ", "_"), measurements); + } + return map; + } } diff --git a/core/src/main/java/com/yahoo/ycsb/Workload.java b/core/src/main/java/com/yahoo/ycsb/Workload.java index 6b3e8ba74142c22a003cb676189898f38f27b01c..7bebafbf3f913acea21082535cabf2c3f1a237d5 100644 --- a/core/src/main/java/com/yahoo/ycsb/Workload.java +++ b/core/src/main/java/com/yahoo/ycsb/Workload.java @@ -1,24 +1,25 @@ -/** - * Copyright (c) 2010 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. +/** + * Copyright (c) 2010 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. */ package com.yahoo.ycsb; -import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.Properties; + /** * One experiment scenario. One object of this type will @@ -27,86 +28,86 @@ import java.util.concurrent.atomic.AtomicBoolean; * load it dynamically. Any argument-based initialization should be * done by init(). * - * If you extend this class, you should support the "insertstart" property. This - * allows the load phase to proceed from multiple clients on different machines, in case + * If you extend this class, you should support the "insertstart" property. This + * allows the Client to proceed from multiple clients on different machines, in case * the client is the bottleneck. For example, if we want to load 1 million records from * 2 machines, the first machine should have insertstart=0 and the second insertstart=500000. Additionally, * the "insertcount" property, which is interpreted by Client, can be used to tell each instance of the * client how many inserts to do. In the example above, both clients should have insertcount=500000. */ -public abstract class Workload -{ - public static final String INSERT_START_PROPERTY="insertstart"; - - public static final String INSERT_START_PROPERTY_DEFAULT="0"; - - private volatile AtomicBoolean stopRequested = new AtomicBoolean(false); - - /** - * Initialize the scenario. Create any generators and other shared objects here. - * Called once, in the main client thread, before any operations are started. - */ - public void init(Properties p) throws WorkloadException - { - } +public abstract class Workload { + public static final String INSERT_START_PROPERTY = "insertstart"; + public static final String INSERT_COUNT_PROPERTY = "insertcount"; + + public static final String INSERT_START_PROPERTY_DEFAULT = "0"; + + private volatile AtomicBoolean stopRequested = new AtomicBoolean(false); + + /** + * Initialize the scenario. Create any generators and other shared objects here. + * Called once, in the main client thread, before any operations are started. + */ + public void init(Properties p) throws WorkloadException { + } - /** - * Initialize any state for a particular client thread. Since the scenario object - * will be shared among all threads, this is the place to create any state that is specific - * to one thread. To be clear, this means the returned object should be created anew on each - * call to initThread(); do not return the same object multiple times. - * The returned object will be passed to invocations of doInsert() and doTransaction() - * for this thread. There should be no side effects from this call; all state should be encapsulated - * in the returned object. If you have no state to retain for this thread, return null. (But if you have - * no state to retain for this thread, probably you don't need to override initThread().) - * - * @return false if the workload knows it is done for this thread. Client will terminate the thread. Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read traces from a file, return true when there are more to do, false when you are done. - */ - public Object initThread(Properties p, int mythreadid, int threadcount) throws WorkloadException - { - return null; - } - - /** - * Cleanup the scenario. Called once, in the main client thread, after all operations have completed. - */ - public void cleanup() throws WorkloadException - { - } - - /** - * Do one insert operation. Because it will be called concurrently from multiple client threads, this - * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - * effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be - * synchronized, since each thread has its own threadstate instance. - */ - public abstract boolean doInsert(DB db, Object threadstate); + /** + * Initialize any state for a particular client thread. Since the scenario object + * will be shared among all threads, this is the place to create any state that is specific + * to one thread. To be clear, this means the returned object should be created anew on each + * call to initThread(); do not return the same object multiple times. + * The returned object will be passed to invocations of doInsert() and doTransaction() + * for this thread. There should be no side effects from this call; all state should be encapsulated + * in the returned object. If you have no state to retain for this thread, return null. (But if you have + * no state to retain for this thread, probably you don't need to override initThread().) + * + * @return false if the workload knows it is done for this thread. Client will terminate the thread. + * Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read + * traces from a file, return true when there are more to do, false when you are done. + */ + public Object initThread(Properties p, int mythreadid, int threadcount) throws WorkloadException { + return null; + } - /** - * Do one transaction operation. Because it will be called concurrently from multiple client threads, this - * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - * effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be - * synchronized, since each thread has its own threadstate instance. - * - * @return false if the workload knows it is done for this thread. Client will terminate the thread. Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read traces from a file, return true when there are more to do, false when you are done. - */ - public abstract boolean doTransaction(DB db, Object threadstate); - - /** - * Allows scheduling a request to stop the workload. - */ - public void requestStop() { - stopRequested.set(true); - } - - /** - * Check the status of the stop request flag. - * @return true if stop was requested, false otherwise. - */ - public boolean isStopRequested() { - if (stopRequested.get() == true) return true; - else return false; - } + /** + * Cleanup the scenario. Called once, in the main client thread, after all operations have completed. + */ + public void cleanup() throws WorkloadException { + } + + /** + * Do one insert operation. Because it will be called concurrently from multiple client threads, this + * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each + * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side + * effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be + * synchronized, since each thread has its own threadstate instance. + */ + public abstract boolean doInsert(DB db, Object threadstate); + + /** + * Do one transaction operation. Because it will be called concurrently from multiple client threads, this + * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each + * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side + * effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be + * synchronized, since each thread has its own threadstate instance. + * + * @return false if the workload knows it is done for this thread. Client will terminate the thread. + * Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read + * traces from a file, return true when there are more to do, false when you are done. + */ + public abstract boolean doTransaction(DB db, Object threadstate); + + /** + * Allows scheduling a request to stop the workload. + */ + public void requestStop() { + stopRequested.set(true); + } + + /** + * Check the status of the stop request flag. + * @return true if stop was requested, false otherwise. + */ + public boolean isStopRequested() { + return stopRequested.get(); + } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/AcknowledgedCounterGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/AcknowledgedCounterGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..3015c51a08f76c05b1d747b5ba38699c63b275a0 --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/generator/AcknowledgedCounterGenerator.java @@ -0,0 +1,92 @@ +/** + * 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. + */ +package com.yahoo.ycsb.generator; + +import java.util.concurrent.locks.ReentrantLock; + +/** + * A CounterGenerator that reports generated integers via lastInt() + * only after they have been acknowledged. + */ +public class AcknowledgedCounterGenerator extends CounterGenerator +{ + /** The size of the window of pending id ack's. 2^20 = {@value} */ + static final int WINDOW_SIZE = Integer.rotateLeft(1, 20); + + /** The mask to use to turn an id into a slot in {@link #window}. */ + private static final int WINDOW_MASK = WINDOW_SIZE - 1; + + private final ReentrantLock lock; + private final boolean[] window; + private volatile int limit; + + /** + * Create a counter that starts at countstart. + */ + public AcknowledgedCounterGenerator(int countstart) + { + super(countstart); + lock = new ReentrantLock(); + window = new boolean[WINDOW_SIZE]; + limit = countstart - 1; + } + + /** + * In this generator, the highest acknowledged counter value + * (as opposed to the highest generated counter value). + */ + @Override + public Integer lastValue() + { + return limit; + } + + /** + * Make a generated counter value available via lastInt(). + */ + public void acknowledge(int value) + { + final int currentSlot = (value & WINDOW_MASK); + if (window[currentSlot] == true) { + throw new RuntimeException("Too many unacknowledged insertion keys."); + } + + window[currentSlot] = true; + + if (lock.tryLock()) { + // move a contiguous sequence from the window + // over to the "limit" variable + try { + // Only loop through the entire window at most once. + int beforeFirstSlot = (limit & WINDOW_MASK); + int index; + for (index = limit + 1; index != beforeFirstSlot; ++index) { + int slot = (index & WINDOW_MASK); + if (!window[slot]) { + break; + } + + window[slot] = false; + } + + limit = index - 1; + } finally { + lock.unlock(); + } + } + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/generator/ConstantIntegerGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/ConstantIntegerGenerator.java index 94dd3a6ae414f0ef40d20ba5f87d448a2af30a27..f3a634d6e9d099e9a4fba81036c06d3709d89bc0 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/ConstantIntegerGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/ConstantIntegerGenerator.java @@ -22,7 +22,7 @@ package com.yahoo.ycsb.generator; * @author sears * */ -public class ConstantIntegerGenerator extends IntegerGenerator { +public class ConstantIntegerGenerator extends NumberGenerator { private final int i; /** * @param i The integer that this generator will always return. @@ -32,7 +32,7 @@ public class ConstantIntegerGenerator extends IntegerGenerator { } @Override - public int nextInt() { + public Integer nextValue() { return i; } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/CounterGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/CounterGenerator.java index df37b2398c5f0f46e886d7df7367398f68d86b90..7ba7382df22e734e438e460f516dc2c74c7db8da 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/CounterGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/CounterGenerator.java @@ -22,9 +22,9 @@ import java.util.concurrent.atomic.AtomicInteger; /** * Generates a sequence of integers 0, 1, ... */ -public class CounterGenerator extends IntegerGenerator +public class CounterGenerator extends NumberGenerator { - final AtomicInteger counter; + private final AtomicInteger counter; /** * Create a counter that starts at countstart @@ -32,23 +32,18 @@ public class CounterGenerator extends IntegerGenerator public CounterGenerator(int countstart) { counter=new AtomicInteger(countstart); - setLastInt(counter.get()-1); } - /** - * If the generator returns numeric (integer) values, return the next value as an int. Default is to return -1, which - * is appropriate for generators that do not return numeric values. - */ - public int nextInt() + @Override + public Integer nextValue() { - int ret = counter.getAndIncrement(); - setLastInt(ret); - return ret; + return counter.getAndIncrement(); } + @Override - public int lastInt() + public Integer lastValue() { - return counter.get() - 1; + return counter.get() - 1; } @Override public double mean() { diff --git a/core/src/main/java/com/yahoo/ycsb/generator/DiscreteGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/DiscreteGenerator.java index c28f3ae771e1bbe667902e925bf0a16f0bdf8fe3..398c44c1e4d296b5f922d4aad2c7e31d39c9bb44 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/DiscreteGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/DiscreteGenerator.java @@ -17,42 +17,42 @@ package com.yahoo.ycsb.generator; -import java.util.Vector; -import java.util.Random; +import java.util.ArrayList; +import java.util.Collection; +import static java.util.Objects.requireNonNull; import com.yahoo.ycsb.Utils; -import com.yahoo.ycsb.WorkloadException; /** * Generates a distribution by choosing from a discrete set of values. */ -public class DiscreteGenerator extends Generator +public class DiscreteGenerator extends Generator<String> { - class Pair + private static class Pair { - public double _weight; - public String _value; + private double _weight; + private String _value; Pair(double weight, String value) { _weight=weight; - _value=value; + _value = requireNonNull(value); } } - Vector<Pair> _values; - String _lastvalue; + private final Collection<Pair> _values = new ArrayList<>(); + private String _lastvalue; public DiscreteGenerator() { - _values=new Vector<Pair>(); _lastvalue=null; } /** * Generate the next string in the distribution. */ - public String nextString() + @Override + public String nextValue() { double sum=0; @@ -65,31 +65,17 @@ public class DiscreteGenerator extends Generator for (Pair p : _values) { - if (val<p._weight/sum) + double pw = p._weight / sum; + if (val < pw) { return p._value; } - val-=p._weight/sum; + val -= pw; } - //should never get here. - System.out.println("oops. should not get here."); + throw new AssertionError("oops. should not get here."); - System.exit(0); - - return null; - } - - /** - * If the generator returns numeric (integer) values, return the next value as an int. Default is to return -1, which - * is appropriate for generators that do not return numeric values. - * - * @throws WorkloadException if this generator does not support integer values - */ - public int nextInt() throws WorkloadException - { - throw new WorkloadException("DiscreteGenerator does not support nextInt()"); } /** @@ -97,11 +83,12 @@ public class DiscreteGenerator extends Generator * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet * been called, lastString() should return something reasonable. */ - public String lastString() + @Override + public String lastValue() { if (_lastvalue==null) { - _lastvalue=nextString(); + _lastvalue=nextValue(); } return _lastvalue; } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/ExponentialGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/ExponentialGenerator.java index de1a2760c4b02b308666dbc7ceaefb9cc8805cfd..03318edc1c391019cb55beb41be0b1e3def00ae1 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/ExponentialGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/ExponentialGenerator.java @@ -17,20 +17,18 @@ package com.yahoo.ycsb.generator; -import java.util.Random; - import com.yahoo.ycsb.Utils; /** * A generator of an exponential distribution. It produces a sequence - * of time intervals (integers) according to an exponential + * of time intervals according to an exponential * distribution. Smaller intervals are more frequent than larger * ones, and there is no bound on the length of an interval. When you * construct an instance of this class, you specify a parameter gamma, * which corresponds to the rate at which events occur. * Alternatively, 1/gamma is the average length of an interval. */ -public class ExponentialGenerator extends IntegerGenerator +public class ExponentialGenerator extends NumberGenerator { // What percentage of the readings should be within the most recent exponential.frac portion of the dataset? public static final String EXPONENTIAL_PERCENTILE_PROPERTY="exponential.percentile"; @@ -43,7 +41,7 @@ public class ExponentialGenerator extends IntegerGenerator /** * The exponential constant to use. */ - double _gamma; + private double _gamma; /******************************* Constructors **************************************/ @@ -62,27 +60,16 @@ public class ExponentialGenerator extends IntegerGenerator /****************************************************************************************/ - /** - * Generate the next item. this distribution will be skewed toward lower integers; e.g. 0 will - * be the most popular, 1 the next most popular, etc. - * @param itemcount The number of items in the distribution. - * @return The next item in the sequence. - */ - @Override - public int nextInt() - { - return (int)nextLong(); - } /** - * Generate the next item as a long. - * - * @param itemcount The number of items in the distribution. - * @return The next item in the sequence. - */ - public long nextLong() + * Generate the next item as a long. This distribution will be skewed toward lower values; e.g. 0 will + * be the most popular, 1 the next most popular, etc. + * @return The next item in the sequence. + */ + @Override + public Double nextValue() { - return (long) (-Math.log(Utils.random().nextDouble()) / _gamma); + return -Math.log(Utils.random().nextDouble()) / _gamma; } @Override @@ -93,7 +80,7 @@ public class ExponentialGenerator extends IntegerGenerator ExponentialGenerator e = new ExponentialGenerator(90, 100); int j = 0; for(int i = 0; i < 1000; i++) { - if(e.nextInt() < 100) { + if(e.nextValue() < 100) { j++; } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/FileGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/FileGenerator.java index e39ffedceadf7586b70cb9c854c3d00523577f2a..ca10a1cb1bcd17dc4a2d339254850f2d59d425d3 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/FileGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/FileGenerator.java @@ -15,57 +15,48 @@ package com.yahoo.ycsb.generator; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; +import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; +import java.io.Reader; /** * A generator, whose sequence is the lines of a file. */ -public class FileGenerator extends Generator +public class FileGenerator extends Generator<String> { - String filename; - String current; - BufferedReader reader; + private final String filename; + private String current; + private BufferedReader reader; /** * Create a FileGenerator with the given file. * @param _filename The file to read lines from. */ - public FileGenerator(String _filename) + public FileGenerator(String _filename) { - try { - filename = _filename; - File file = new File(filename); - FileInputStream in = new FileInputStream(file); - reader = new BufferedReader(new InputStreamReader(in)); - } catch(IOException e) { - System.err.println("Exception: " + e); - } + filename = _filename; + reloadFile(); } /** * Return the next string of the sequence, ie the next line of the file. */ - public synchronized String nextString() + @Override + public synchronized String nextValue() { try { return current = reader.readLine(); - } catch(NullPointerException e) { - System.err.println("NullPointerException: " + filename + ':' + current); - throw e; } catch(IOException e) { - System.err.println("Exception: " + e); - return null; + throw new RuntimeException(e); } } /** * Return the previous read line. */ - public String lastString() + @Override + public String lastValue() { return current; } @@ -73,16 +64,12 @@ public class FileGenerator extends Generator /** * Reopen the file to reuse values. */ - public synchronized void reloadFile() - { - try { + public synchronized void reloadFile() { + try (Reader r = reader) { System.err.println("Reload " + filename); - reader.close(); - File file = new File(filename); - FileInputStream in = new FileInputStream(file); - reader = new BufferedReader(new InputStreamReader(in)); - } catch(IOException e) { - System.err.println("Exception: " + e); - } + reader = new BufferedReader(new FileReader(filename)); + } catch (IOException e) { + throw new RuntimeException(e); + } } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/Generator.java b/core/src/main/java/com/yahoo/ycsb/generator/Generator.java index a0d2f2e6e70a54329dc2bee6be0008958edf62fd..73e5ca1a814895d14d5d4e9acc0f1b3e6697b46f 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/Generator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/Generator.java @@ -18,20 +18,30 @@ package com.yahoo.ycsb.generator; /** - * An expression that generates a sequence of string values, following some distribution (Uniform, Zipfian, Sequential, etc.) + * An expression that generates a sequence of values, following some distribution (Uniform, Zipfian, Sequential, etc.) */ -public abstract class Generator +public abstract class Generator<V> { /** - * Generate the next string in the distribution. + * Generate the next value in the distribution. */ - public abstract String nextString(); + public abstract V nextValue(); /** - * Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - * been called, lastString() should return something reasonable. + * Return the previous value generated by the distribution; e.g., returned from the last {@link Generator#nextValue()} call. + * Calling {@link #lastValue()} should not advance the distribution or have any side effects. If {@link #nextValue()} has not yet + * been called, {@link #lastValue()} should return something reasonable. */ - public abstract String lastString(); + public abstract V lastValue(); + + public final String nextString() { + V ret = nextValue(); + return ret == null ? null : ret.toString(); + } + + public final String lastString() { + V ret = lastValue(); + return ret == null ? null : ret.toString(); + } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/HistogramGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/HistogramGenerator.java index aba42c47b0c060a92b667c7d6808f3b608c37dac..4d7d38c904d649b2690c638fcf619acfd46205fc 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/HistogramGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/HistogramGenerator.java @@ -19,10 +19,8 @@ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; -import java.util.Random; - import com.yahoo.ycsb.Utils; -import com.yahoo.ycsb.generator.IntegerGenerator; +import com.yahoo.ycsb.generator.NumberGenerator; /** * Generate integers according to a histogram distribution. The histogram @@ -38,44 +36,43 @@ import com.yahoo.ycsb.generator.IntegerGenerator; * @author snjones * */ -public class HistogramGenerator extends IntegerGenerator { +public class HistogramGenerator extends NumberGenerator { - long block_size; - long[] buckets; - long area; - long weighted_area = 0; - double mean_size = 0; + private final long block_size; + private final long[] buckets; + private long area; + private long weighted_area = 0; + private double mean_size = 0; public HistogramGenerator(String histogramfile) throws IOException { - BufferedReader in = new BufferedReader(new FileReader(histogramfile)); - String str; - String[] line; - - ArrayList<Integer> a = new ArrayList<Integer>(); - - str = in.readLine(); - if(str == null) { - throw new IOException("Empty input file!\n"); - } - line = str.split("\t"); - if(line[0].compareTo("BlockSize") != 0) { - throw new IOException("First line of histogram is not the BlockSize!\n"); - } - block_size = Integer.parseInt(line[1]); - - while((str = in.readLine()) != null){ - // [0] is the bucket, [1] is the value - line = str.split("\t"); - - a.add(Integer.parseInt(line[0]), Integer.parseInt(line[1])); - } - buckets = new long[a.size()]; - for(int i = 0; i < a.size(); i++) { - buckets[i] = a.get(i); - } - - in.close(); - init(); + try (BufferedReader in = new BufferedReader(new FileReader(histogramfile))) { + String str; + String[] line; + + ArrayList<Integer> a = new ArrayList<Integer>(); + + str = in.readLine(); + if(str == null) { + throw new IOException("Empty input file!\n"); + } + line = str.split("\t"); + if(line[0].compareTo("BlockSize") != 0) { + throw new IOException("First line of histogram is not the BlockSize!\n"); + } + block_size = Integer.parseInt(line[1]); + + while((str = in.readLine()) != null){ + // [0] is the bucket, [1] is the value + line = str.split("\t"); + + a.add(Integer.parseInt(line[0]), Integer.parseInt(line[1])); + } + buckets = new long[a.size()]; + for(int i = 0; i < a.size(); i++) { + buckets[i] = a.get(i); + } + } + init(); } public HistogramGenerator(long[] buckets, int block_size) { @@ -86,25 +83,25 @@ public class HistogramGenerator extends IntegerGenerator { private void init() { for(int i = 0; i < buckets.length; i++) { area += buckets[i]; - weighted_area = i * buckets[i]; + weighted_area += i * buckets[i]; } // calculate average file size - mean_size = ((double)block_size) * ((double)weighted_area) / (double)(area); + mean_size = ((double)block_size) * ((double)weighted_area) / (area); } @Override - public int nextInt() { + public Long nextValue() { int number = Utils.random().nextInt((int)area); int i; for(i = 0; i < (buckets.length - 1); i++){ number -= buckets[i]; if(number <= 0){ - return (int)((i+1)*block_size); + return (i+1)*block_size; } } - return (int)(i * block_size); + return i * block_size; } @Override diff --git a/core/src/main/java/com/yahoo/ycsb/generator/HotspotIntegerGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/HotspotIntegerGenerator.java index 969ae7706d781b48e50f2289db602eb666a761d9..fafe8ff4e7d090fcc13a42fd046c3181122db730 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/HotspotIntegerGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/HotspotIntegerGenerator.java @@ -31,7 +31,7 @@ import com.yahoo.ycsb.Utils; * @author sudipto * */ -public class HotspotIntegerGenerator extends IntegerGenerator { +public class HotspotIntegerGenerator extends NumberGenerator { private final int lowerBound; private final int upperBound; @@ -75,7 +75,7 @@ public class HotspotIntegerGenerator extends IntegerGenerator { } @Override - public int nextInt() { + public Integer nextValue() { int value = 0; Random random = Utils.random(); if (random.nextDouble() < hotOpnFraction) { @@ -85,7 +85,7 @@ public class HotspotIntegerGenerator extends IntegerGenerator { // Choose a value from the cold set. value = lowerBound + hotInterval + random.nextInt(coldInterval); } - setLastInt(value); + setLastValue(value); return value; } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/IncrementingPrintableStringGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/IncrementingPrintableStringGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..82406f020a1a64c37b2c2cc0891da046c52120a8 --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/generator/IncrementingPrintableStringGenerator.java @@ -0,0 +1,389 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.generator; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; + +/** + * A generator that produces strings of {@link #length} using a set of code points + * from {@link #characterSet}. Each time {@link #nextValue()} is executed, the string + * is incremented by one character. Eventually the string may rollover to the beginning + * and the user may choose to have the generator throw a NoSuchElementException at that + * point or continue incrementing. (By default the generator will continue incrementing). + * <p> + * For example, if we set a length of 2 characters and the character set includes + * [A, B] then the generator output will be: + * <ul> + * <li>AA</li> + * <li>AB</li> + * <li>BA</li> + * <li>BB</li> + * <li>AA <-- rolled over</li> + * </ul> + * <p> + * This class includes some default character sets to choose from including ASCII + * and plane 0 UTF. + */ +public class IncrementingPrintableStringGenerator extends Generator<String> { + + /** Default string length for the generator. */ + public static final int DEFAULTSTRINGLENGTH = 8; + + /** + * Set of all character types that include every symbol other than non-printable + * control characters. + */ + public static final Set<Integer> CHAR_TYPES_ALL_BUT_CONTROL; + static { + CHAR_TYPES_ALL_BUT_CONTROL = new HashSet<Integer>(24); + // numbers + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.DECIMAL_DIGIT_NUMBER); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.LETTER_NUMBER); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.OTHER_NUMBER); + + // letters + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.UPPERCASE_LETTER); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.LOWERCASE_LETTER); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.TITLECASE_LETTER); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.OTHER_LETTER); + + // marks + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.COMBINING_SPACING_MARK); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.NON_SPACING_MARK); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.ENCLOSING_MARK); + + // punctuation + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.CONNECTOR_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.DASH_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.START_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.END_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.INITIAL_QUOTE_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.FINAL_QUOTE_PUNCTUATION); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.OTHER_PUNCTUATION); + + // symbols + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.MATH_SYMBOL); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.CURRENCY_SYMBOL); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.MODIFIER_SYMBOL); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.OTHER_SYMBOL); + + // separators + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.SPACE_SEPARATOR); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.LINE_SEPARATOR); + CHAR_TYPES_ALL_BUT_CONTROL.add((int)Character.PARAGRAPH_SEPARATOR); + } + + /** + * Set of character types including only decimals, upper and lower case letters. + */ + public static final Set<Integer> CHAR_TYPES_BASIC_ALPHA; + static { + CHAR_TYPES_BASIC_ALPHA = new HashSet<Integer>(2); + CHAR_TYPES_BASIC_ALPHA.add((int)Character.UPPERCASE_LETTER); + CHAR_TYPES_BASIC_ALPHA.add((int)Character.LOWERCASE_LETTER); + } + + /** + * Set of character types including only decimals, upper and lower case letters. + */ + public static final Set<Integer> CHAR_TYPES_BASIC_ALPHANUMERICS; + static { + CHAR_TYPES_BASIC_ALPHANUMERICS = new HashSet<Integer>(3); + CHAR_TYPES_BASIC_ALPHANUMERICS.add((int)Character.DECIMAL_DIGIT_NUMBER); + CHAR_TYPES_BASIC_ALPHANUMERICS.add((int)Character.UPPERCASE_LETTER); + CHAR_TYPES_BASIC_ALPHANUMERICS.add((int)Character.LOWERCASE_LETTER); + } + + /** + * Set of character types including only decimals, letter numbers, + * other numbers, upper, lower, title case as well as letter modifiers + * and other letters. + */ + public static final Set<Integer> CHAR_TYPE_EXTENDED_ALPHANUMERICS; + static { + CHAR_TYPE_EXTENDED_ALPHANUMERICS = new HashSet<Integer>(8); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.DECIMAL_DIGIT_NUMBER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.LETTER_NUMBER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.OTHER_NUMBER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.UPPERCASE_LETTER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.LOWERCASE_LETTER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.TITLECASE_LETTER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.MODIFIER_LETTER); + CHAR_TYPE_EXTENDED_ALPHANUMERICS.add((int)Character.OTHER_LETTER); + } + + /** The character set to iterate over. */ + private final int[] characterSet; + + /** An array indices matching a position in the output string. */ + private int[] indices; + + /** The length of the output string in characters. */ + private final int length; + + /** The last value returned by the generator. Should be null if {@link #nextValue()} + * has not been called.*/ + private String lastValue; + + /** Whether or not to throw an exception when the string rolls over. */ + private boolean throwExceptionOnRollover; + + /** Whether or not the generator has rolled over. */ + private boolean hasRolledOver; + + /** + * Generates strings of 8 characters using only the upper and lower case alphabetical + * characters from the ASCII set. + */ + public IncrementingPrintableStringGenerator() { + this(DEFAULTSTRINGLENGTH, printableBasicAlphaASCIISet()); + } + + /** + * Generates strings of {@link #length} characters using only the upper and lower + * case alphabetical characters from the ASCII set. + * @param length The length of string to return from the generator. + * @throws IllegalArgumentException if the length is less than one. + */ + public IncrementingPrintableStringGenerator(final int length) { + this(length, printableBasicAlphaASCIISet()); + } + + /** + * Generates strings of {@link #length} characters using the code points in + * {@link #characterSet}. + * @param length The length of string to return from the generator. + * @param characterSet A set of code points to choose from. Code points in the + * set can be in any order, not necessarily lexical. + * @throws IllegalArgumentException if the length is less than one or the character + * set has fewer than one code points. + */ + public IncrementingPrintableStringGenerator(final int length, final int[] characterSet) { + if (length < 1) { + throw new IllegalArgumentException("Length must be greater than or equal to 1"); + } + if (characterSet == null || characterSet.length < 1) { + throw new IllegalArgumentException("Character set must have at least one character"); + } + this.length = length; + this.characterSet = characterSet; + indices = new int[length]; + } + + @Override + public String nextValue() { + if (hasRolledOver && throwExceptionOnRollover) { + throw new NoSuchElementException("The generator has rolled over to the beginning"); + } + + final StringBuilder buffer = new StringBuilder(length); + for (int i = 0; i < length; i++) { + buffer.append(Character.toChars(characterSet[indices[i]])); + } + + // increment the indices; + for (int i = length - 1; i >= 0; --i) { + if (indices[i] >= characterSet.length - 1) { + indices[i] = 0; + if (i == 0 || characterSet.length == 1 && lastValue != null) { + hasRolledOver = true; + } + } else { + ++indices[i]; + break; + } + } + + lastValue = buffer.toString(); + return lastValue; + } + + @Override + public String lastValue() { + return lastValue; + } + + /** @param exceptionOnRollover Whether or not to throw an exception on rollover. */ + public void setThrowExceptionOnRollover(final boolean exceptionOnRollover) { + this.throwExceptionOnRollover = exceptionOnRollover; + } + + /** @return Whether or not to throw an exception on rollover. */ + public boolean getThrowExceptionOnRollover() { + return throwExceptionOnRollover; + } + + /** + * Returns an array of printable code points with only the upper and lower + * case alphabetical characters from the basic ASCII set. + * @return An array of code points + */ + public static int[] printableBasicAlphaASCIISet() { + final List<Integer> validCharacters = + generatePrintableCharacterSet(0, 127, null, false, CHAR_TYPES_BASIC_ALPHA); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Returns an array of printable code points with the upper and lower case + * alphabetical characters as well as the numeric values from the basic + * ASCII set. + * @return An array of code points + */ + public static int[] printableBasicAlphaNumericASCIISet() { + final List<Integer> validCharacters = + generatePrintableCharacterSet(0, 127, null, false, CHAR_TYPES_BASIC_ALPHANUMERICS); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Returns an array of printable code points with the entire basic ASCII table, + * including spaces. Excludes new lines. + * @return An array of code points + */ + public static int[] fullPrintableBasicASCIISet() { + final List<Integer> validCharacters = + generatePrintableCharacterSet(32, 127, null, false, null); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Returns an array of printable code points with the entire basic ASCII table, + * including spaces and new lines. + * @return An array of code points + */ + public static int[] fullPrintableBasicASCIISetWithNewlines() { + final List<Integer> validCharacters =new ArrayList<Integer>(); + validCharacters.add(10); // newline + validCharacters.addAll(generatePrintableCharacterSet(32, 127, null, false, null)); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Returns an array of printable code points the first plane of Unicode characters + * including only the alpha-numeric values. + * @return An array of code points + */ + public static int[] printableAlphaNumericPlaneZeroSet() { + final List<Integer> validCharacters = + generatePrintableCharacterSet(0, 65535, null, false, CHAR_TYPES_BASIC_ALPHANUMERICS); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Returns an array of printable code points the first plane of Unicode characters + * including all printable characters. + * @return An array of code points + */ + public static int[] fullPrintablePlaneZeroSet() { + final List<Integer> validCharacters = + generatePrintableCharacterSet(0, 65535, null, false, CHAR_TYPES_ALL_BUT_CONTROL); + final int[] characterSet = new int[validCharacters.size()]; + for (int i = 0; i < validCharacters.size(); i++) { + characterSet[i] = validCharacters.get(i); + } + return characterSet; + } + + /** + * Generates a list of code points based on a range and filters. + * These can be used for generating strings with various ASCII and/or + * Unicode printable character sets for use with DBs that may have + * character limitations. + * <p> + * Note that control, surrogate, format, private use and unassigned + * code points are skipped. + * @param startCodePoint The starting code point, inclusive. + * @param lastCodePoint The final code point, inclusive. + * @param characterTypesFilter An optional set of allowable character + * types. See {@link Character} for types. + * @param isFilterAllowableList Determines whether the {@code allowableTypes} + * set is inclusive or exclusive. When true, only those code points that + * appear in the list will be included in the resulting set. Otherwise + * matching code points are excluded. + * @param allowableTypes An optional list of code points for inclusion or + * exclusion. + * @return A list of code points matching the given range and filters. The + * list may be empty but is guaranteed not to be null. + */ + public static List<Integer> generatePrintableCharacterSet( + final int startCodePoint, + final int lastCodePoint, + final Set<Integer> characterTypesFilter, + final boolean isFilterAllowableList, + final Set<Integer> allowableTypes) { + + // since we don't know the final size of the allowable character list we + // start with a list then we'll flatten it to an array. + final List<Integer> validCharacters = new ArrayList<Integer>(lastCodePoint); + + for (int codePoint = startCodePoint; codePoint <= lastCodePoint; ++codePoint) { + if (allowableTypes != null && + !allowableTypes.contains(Character.getType(codePoint))) { + continue; + } else { + // skip control points, formats, surrogates, etc + final int type = Character.getType(codePoint); + if (type == Character.CONTROL || + type == Character.SURROGATE || + type == Character.FORMAT || + type == Character.PRIVATE_USE || + type == Character.UNASSIGNED) { + continue; + } + } + + if (characterTypesFilter != null) { + // if the filter is enabled then we need to make sure the code point + // is in the allowable list if it's a whitelist or that the code point + // is NOT in the list if it's a blacklist. + if ((isFilterAllowableList && !characterTypesFilter.contains(codePoint)) || + (characterTypesFilter.contains(codePoint))) { + continue; + } + } + + validCharacters.add(codePoint); + } + return validCharacters; + } + +} diff --git a/core/src/main/java/com/yahoo/ycsb/generator/IntegerGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/NumberGenerator.java similarity index 67% rename from core/src/main/java/com/yahoo/ycsb/generator/IntegerGenerator.java rename to core/src/main/java/com/yahoo/ycsb/generator/NumberGenerator.java index 13d36cd1f1f423e7cd97b36789e2e02152d1ef09..59d89341044202b0dfa75582149f7956b3471b01 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/IntegerGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/NumberGenerator.java @@ -18,55 +18,29 @@ package com.yahoo.ycsb.generator; /** - * A generator that is capable of generating ints as well as strings + * A generator that is capable of generating numeric values * * @author cooperb * */ -public abstract class IntegerGenerator extends Generator +public abstract class NumberGenerator extends Generator<Number> { - int lastint; + private Number lastVal; /** - * Set the last value generated. IntegerGenerator subclasses must use this call - * to properly set the last string value, or the lastString() and lastInt() calls won't work. + * Set the last value generated. NumberGenerator subclasses must use this call + * to properly set the last value, or the {@link #lastValue()} calls won't work. */ - protected void setLastInt(int last) + protected void setLastValue(Number last) { - lastint=last; + lastVal=last; } + - /** - * Return the next value as an int. When overriding this method, be sure to call setLastString() properly, or the lastString() call won't work. - */ - public abstract int nextInt(); - - /** - * Generate the next string in the distribution. - */ - public String nextString() - { - return ""+nextInt(); - } - - /** - * Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - * been called, lastString() should return something reasonable. - */ @Override - public String lastString() - { - return ""+lastInt(); - } - - /** - * Return the previous int generated by the distribution. This call is unique to IntegerGenerator subclasses, and assumes - * IntegerGenerator subclasses always return ints for nextInt() (e.g. not arbitrary strings). - */ - public int lastInt() + public Number lastValue() { - return lastint; + return lastVal; } /** * Return the expected value (mean) of the values this generator will return. diff --git a/core/src/main/java/com/yahoo/ycsb/generator/ScrambledZipfianGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/ScrambledZipfianGenerator.java index 8b62c4c2bacef2c2c094c9c54b6a55e8ed8e7af9..8918c37117f618bc42009a35a83b1e0f5e57441d 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/ScrambledZipfianGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/ScrambledZipfianGenerator.java @@ -28,14 +28,14 @@ import com.yahoo.ycsb.Utils; * Unlike @ZipfianGenerator, this class scatters the "popular" items across the itemspace. Use this, instead of @ZipfianGenerator, if you * don't want the head of the distribution (the popular items) clustered together. */ -public class ScrambledZipfianGenerator extends IntegerGenerator +public class ScrambledZipfianGenerator extends NumberGenerator { public static final double ZETAN=26.46902820178302; public static final double USED_ZIPFIAN_CONSTANT=0.99; public static final long ITEM_COUNT=10000000000L; - ZipfianGenerator gen; - long _min,_max,_itemcount; + private ZipfianGenerator gen; + private final long _min,_max,_itemcount; /******************************* Constructors **************************************/ @@ -94,22 +94,15 @@ public class ScrambledZipfianGenerator extends IntegerGenerator /**************************************************************************************************/ - /** - * Return the next int in the sequence. - */ - @Override - public int nextInt() { - return (int)nextLong(); - } - /** * Return the next long in the sequence. */ - public long nextLong() + @Override + public Long nextValue() { - long ret=gen.nextLong(); + long ret=gen.nextValue(); ret=_min+Utils.FNVhash64(ret)%_itemcount; - setLastInt((int)ret); + setLastValue(ret); return ret; } @@ -123,7 +116,7 @@ public class ScrambledZipfianGenerator extends IntegerGenerator for (int i=0; i<1000000; i++) { - System.out.println(""+gen.nextInt()); + System.out.println(""+gen.nextValue()); } } @@ -132,6 +125,6 @@ public class ScrambledZipfianGenerator extends IntegerGenerator */ @Override public double mean() { - return ((double)(((long)_min) +(long)_max))/2.0; + return ((_min) +_max)/2.0; } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/SequentialGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/SequentialGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..4d53385e312a5c8ab30a3a955643deb00a4b7bbc --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/generator/SequentialGenerator.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.generator; + +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Generates a sequence of integers 0, 1, ... + */ +public class SequentialGenerator extends NumberGenerator { + final AtomicInteger counter; + int _interval, _countstart; + + /** + * Create a counter that starts at countstart. + */ + public SequentialGenerator(int countstart, int countend) { + counter = new AtomicInteger(); + setLastValue(counter.get()); + _countstart = countstart; + _interval = countend - countstart + 1; + } + + /** + * If the generator returns numeric (integer) values, return the next value as an int. + * Default is to return -1, which is appropriate for generators that do not return numeric values. + */ + public int nextInt() { + int ret = _countstart + counter.getAndIncrement() % _interval; + setLastValue(ret); + return ret; + } + + @Override + public Number nextValue() { + int ret = _countstart + counter.getAndIncrement() % _interval; + setLastValue(ret); + return ret; + } + + @Override + public Number lastValue() { + return counter.get() + 1; + } + + @Override + public double mean() { + throw new UnsupportedOperationException("Can't compute mean of non-stationary distribution!"); + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/generator/SkewedLatestGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/SkewedLatestGenerator.java index 376eb7775c6b7cf6c44549728d4a03a4d47916b6..f52f3c44cd2471476e55acb5c53bb159d949eea6 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/SkewedLatestGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/SkewedLatestGenerator.java @@ -20,27 +20,28 @@ package com.yahoo.ycsb.generator; /** * Generate a popularity distribution of items, skewed to favor recent items significantly more than older items. */ -public class SkewedLatestGenerator extends IntegerGenerator +public class SkewedLatestGenerator extends NumberGenerator { - CounterGenerator _basis; - ZipfianGenerator _zipfian; + private CounterGenerator _basis; + private final ZipfianGenerator _zipfian; public SkewedLatestGenerator(CounterGenerator basis) { _basis=basis; - _zipfian=new ZipfianGenerator(_basis.lastInt()); - nextInt(); + _zipfian=new ZipfianGenerator(_basis.lastValue()); + nextValue(); } /** * Generate the next string in the distribution, skewed Zipfian favoring the items most recently returned by the basis generator. */ - public int nextInt() + @Override + public Long nextValue() { - int max=_basis.lastInt(); - int nextint=max-_zipfian.nextInt(max); - setLastInt(nextint); - return nextint; + long max=_basis.lastValue(); + long next=max-_zipfian.nextLong(max); + setLastValue(next); + return next; } public static void main(String[] args) diff --git a/core/src/main/java/com/yahoo/ycsb/generator/UniformGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/UniformGenerator.java index 43b9d3905568dd80837adb5229749aa1879e6757..5567225c3dd830e9c7c930c39ee50f515ac079ef 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/UniformGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/UniformGenerator.java @@ -17,26 +17,27 @@ package com.yahoo.ycsb.generator; -import java.util.Vector; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; /** - * An expression that generates a random integer in the specified range + * An expression that generates a random value in the specified range */ -public class UniformGenerator extends Generator +public class UniformGenerator extends Generator<String> { - Vector<String> _values; - String _laststring; - UniformIntegerGenerator _gen; + private final List<String> _values; + private String _laststring; + private final UniformIntegerGenerator _gen; /** * Creates a generator that will return strings from the specified set uniformly randomly */ - @SuppressWarnings( "unchecked" ) - public UniformGenerator(Vector<String> values) + public UniformGenerator(Collection<String> values) { - _values=(Vector<String>)values.clone(); + _values= new ArrayList<>(values); _laststring=null; _gen=new UniformIntegerGenerator(0,values.size()-1); } @@ -44,9 +45,10 @@ public class UniformGenerator extends Generator /** * Generate the next string in the distribution. */ - public String nextString() + @Override + public String nextValue() { - _laststring=_values.elementAt(_gen.nextInt()); + _laststring = _values.get(_gen.nextValue()); return _laststring; } @@ -55,11 +57,12 @@ public class UniformGenerator extends Generator * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet * been called, lastString() should return something reasonable. */ - public String lastString() + @Override + public String lastValue() { if (_laststring==null) { - nextString(); + nextValue(); } return _laststring; } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/UniformIntegerGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/UniformIntegerGenerator.java index fa6af1316ca3d156653d9b362f1f59debd451a97..3e2c99d9044ea8ac2e2e06dbcf70afdbade5d1ae 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/UniformIntegerGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/UniformIntegerGenerator.java @@ -17,16 +17,14 @@ package com.yahoo.ycsb.generator; -import java.util.Random; - import com.yahoo.ycsb.Utils; /** * Generates integers randomly uniform from an interval. */ -public class UniformIntegerGenerator extends IntegerGenerator +public class UniformIntegerGenerator extends NumberGenerator { - int _lb,_ub,_interval; + private final int _lb,_ub,_interval; /** * Creates a generator that will return integers uniformly randomly from the interval [lb,ub] inclusive (that is, lb and ub are possible values) @@ -42,16 +40,16 @@ public class UniformIntegerGenerator extends IntegerGenerator } @Override - public int nextInt() + public Integer nextValue() { int ret=Utils.random().nextInt(_interval)+_lb; - setLastInt(ret); + setLastValue(ret); return ret; } @Override public double mean() { - return ((double)((long)(_lb + (long)_ub))) / 2.0; + return ((_lb + (long)_ub)) / 2.0; } } diff --git a/core/src/main/java/com/yahoo/ycsb/generator/UnixEpochTimestampGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/UnixEpochTimestampGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..914bb7fe4163c1f1e9c5c8de9b8841bfe59b3cd3 --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/generator/UnixEpochTimestampGenerator.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.generator; + +import java.util.concurrent.TimeUnit; + +/** + * A generator that produces Unix epoch timestamps in seconds, milli, micro or + * nanoseconds and increments the stamp a given interval each time + * {@link #nextValue()} is called. The result is emitted as a long in the same + * way calls to {@code System.currentTimeMillis()} and + * {@code System.nanoTime()} behave. + * <p> + * By default, the current system time of the host is used as the starting + * timestamp. Calling {@link #initalizeTimestamp(long)} can adjust the timestamp + * back or forward in time. For example, if a workload will generate an hour of + * data at 1 minute intervals, then to set the start timestamp an hour in the past + * from the current run, use: + * <pre>{@code + * UnixEpochTimestampGenerator generator = new UnixEpochTimestampGenerator(); + * generator.initalizeTimestamp(-60); + * }</pre> + * A constructor is also present for setting an explicit start time. + * Negative intervals are supported as well for iterating back in time. + * <p> + * WARNING: This generator is not thread safe and should not called from multiple + * threads. + */ +public class UnixEpochTimestampGenerator extends Generator<Long> { + + /** The current timestamp that will be incremented. */ + private long currentTimestamp; + + /** The last used timestamp. Should always be one interval behind current. */ + private long lastTimestamp; + + /** The interval to increment by. Multiplied by {@link #timeUnits}. */ + private long interval; + + /** The units of time the interval represents. */ + private TimeUnit timeUnits; + + /** + * Default ctor with the current system time and a 60 second interval. + */ + public UnixEpochTimestampGenerator() { + this(60, TimeUnit.SECONDS); + } + + /** + * Ctor that uses the current system time as current. + * @param interval The interval for incrementing the timestamp. + * @param timeUnits The units of time the increment represents. + */ + public UnixEpochTimestampGenerator(final long interval, final TimeUnit timeUnits) { + this.interval = interval; + this.timeUnits = timeUnits; + // move the first timestamp by 1 interval so that the first call to nextValue + // returns this timestamp + initalizeTimestamp(-1); + currentTimestamp -= getOffset(1); + lastTimestamp = currentTimestamp; + } + + /** + * Ctor for supplying a starting timestamp. + * @param interval The interval for incrementing the timestamp. + * @param timeUnits The units of time the increment represents. + * @param startTimestamp The start timestamp to use. + * NOTE that this must match the time units used for the interval. + * If the units are in nanoseconds, provide a nanosecond timestamp {@code System.nanoTime()} + * or in microseconds, {@code System.nanoTime() / 1000} + * or in millis, {@code System.currentTimeMillis()} + * or seconds and any interval above, {@code System.currentTimeMillis() / 1000} + */ + public UnixEpochTimestampGenerator(final long interval, final TimeUnit timeUnits, + final long startTimestamp) { + this.interval = interval; + this.timeUnits = timeUnits; + // move the first timestamp by 1 interval so that the first call to nextValue + // returns this timestamp + this.currentTimestamp = startTimestamp - getOffset(1); + lastTimestamp = currentTimestamp - getOffset(1); + } + + /** + * Sets the starting timestamp to the current system time plus the interval offset. + * E.g. to set the time an hour in the past, supply a value of {@code -60}. + * @param intervalOffset The interval to increment or decrement by. + */ + public void initalizeTimestamp(final long intervalOffset) { + switch (timeUnits) { + case NANOSECONDS: + currentTimestamp = System.nanoTime() + getOffset(intervalOffset); + break; + case MICROSECONDS: + currentTimestamp = (System.nanoTime() / 1000) + getOffset(intervalOffset); + break; + case MILLISECONDS: + currentTimestamp = System.currentTimeMillis() + getOffset(intervalOffset); + break; + case SECONDS: + currentTimestamp = (System.currentTimeMillis() / 1000) + + getOffset(intervalOffset); + break; + case MINUTES: + currentTimestamp = (System.currentTimeMillis() / 1000) + + getOffset(intervalOffset); + break; + case HOURS: + currentTimestamp = (System.currentTimeMillis() / 1000) + + getOffset(intervalOffset); + break; + case DAYS: + currentTimestamp = (System.currentTimeMillis() / 1000) + + getOffset(intervalOffset); + break; + default: + throw new IllegalArgumentException("Unhandled time unit type: " + timeUnits); + } + } + + @Override + public Long nextValue() { + lastTimestamp = currentTimestamp; + currentTimestamp += getOffset(1); + return currentTimestamp; + } + + /** + * Returns the proper increment offset to use given the interval and timeunits. + * @param intervalOffset The amount of offset to multiply by. + * @return An offset value to adjust the timestamp by. + */ + public long getOffset(final long intervalOffset) { + switch (timeUnits) { + case NANOSECONDS: + case MICROSECONDS: + case MILLISECONDS: + case SECONDS: + return intervalOffset * interval; + case MINUTES: + return intervalOffset * interval * (long) 60; + case HOURS: + return intervalOffset * interval * (long) (60 * 60); + case DAYS: + return intervalOffset * interval * (long) (60 * 60 * 24); + default: + throw new IllegalArgumentException("Unhandled time unit type: " + timeUnits); + } + } + + @Override + public Long lastValue() { + return lastTimestamp; + } + + /** @return The current timestamp as set by the last call to {@link #nextValue()} */ + public long currentValue() { + return currentTimestamp; + } + +} diff --git a/core/src/main/java/com/yahoo/ycsb/generator/ZipfianGenerator.java b/core/src/main/java/com/yahoo/ycsb/generator/ZipfianGenerator.java index 017fa05e5723766bc5fbd12ffd950a0eb32a09c3..3bd445f75c657067477e4d2b4428735ac33758f8 100644 --- a/core/src/main/java/com/yahoo/ycsb/generator/ZipfianGenerator.java +++ b/core/src/main/java/com/yahoo/ycsb/generator/ZipfianGenerator.java @@ -17,8 +17,6 @@ package com.yahoo.ycsb.generator; -import java.util.Random; - import com.yahoo.ycsb.Utils; /** @@ -39,34 +37,34 @@ import com.yahoo.ycsb.Utils; * * The algorithm used here is from "Quickly Generating Billion-Record Synthetic Databases", Jim Gray et al, SIGMOD 1994. */ -public class ZipfianGenerator extends IntegerGenerator +public class ZipfianGenerator extends NumberGenerator { public static final double ZIPFIAN_CONSTANT=0.99; /** * Number of items. */ - long items; + private final long items; /** * Min item to generate. */ - long base; + private final long base; /** * The zipfian constant to use. */ - double zipfianconstant; + private final double zipfianconstant; /** * Computed parameters for generating the distribution. */ - double alpha,zetan,eta,theta,zeta2theta; + private double alpha,zetan,eta,theta,zeta2theta; /** * The number of items used to compute zetan the last time. */ - long countforzeta; + private long countforzeta; /** * Flag to prevent problems. If you increase the number of items the zipfian generator is allowed to choose from, this code will incrementally compute a new zeta @@ -76,7 +74,7 @@ public class ZipfianGenerator extends IntegerGenerator * did the second thread think there were only 1000 items? maybe it read the item count before the first thread incremented it. So this flag allows you to say if you really do * want that recomputation. If true, then the code will recompute zeta if the itemcount goes down. If false, the code will assume itemcount only goes up, and never recompute. */ - boolean allowitemcountdecrease=false; + private boolean allowitemcountdecrease=false; /******************************* Constructors **************************************/ @@ -148,7 +146,7 @@ public class ZipfianGenerator extends IntegerGenerator eta=(1-Math.pow(2.0/items,1-theta))/(1-zeta2theta/zetan); //System.out.println("XXXX 3 XXXX"); - nextInt(); + nextValue(); //System.out.println("XXXX 4 XXXX"); } @@ -219,16 +217,6 @@ public class ZipfianGenerator extends IntegerGenerator /****************************************************************************************/ - /** - * Generate the next item. this distribution will be skewed toward lower integers; e.g. 0 will - * be the most popular, 1 the next most popular, etc. - * @param itemcount The number of items in the distribution. - * @return The next item in the sequence. - */ - public int nextInt(int itemcount) - { - return (int)nextLong(itemcount); - } /** * Generate the next item as a long. @@ -236,7 +224,7 @@ public class ZipfianGenerator extends IntegerGenerator * @param itemcount The number of items in the distribution. * @return The next item in the sequence. */ - public long nextLong(long itemcount) + long nextLong(long itemcount) { //from "Quickly Generating Billion-Record Synthetic Databases", Jim Gray et al, SIGMOD 1994 @@ -285,7 +273,7 @@ public class ZipfianGenerator extends IntegerGenerator } long ret=base+(long)((itemcount) * Math.pow(eta*u - eta + 1, alpha)); - setLastInt((int)ret); + setLastValue(ret); return ret; } @@ -295,17 +283,7 @@ public class ZipfianGenerator extends IntegerGenerator * popular items scattered throughout the item space, use ScrambledZipfianGenerator instead. */ @Override - public int nextInt() - { - return (int)nextLong(items); - } - - /** - * Return the next value, skewed by the Zipfian distribution. The 0th item will be the most popular, followed by the 1st, followed - * by the 2nd, etc. (Or, if min != 0, the min-th item is the most popular, the min+1th item the next most popular, etc.) If you want the - * popular items scattered throughout the item space, use ScrambledZipfianGenerator instead. - */ - public long nextLong() + public Long nextValue() { return nextLong(items); } diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/Measurements.java b/core/src/main/java/com/yahoo/ycsb/measurements/Measurements.java index 76ba40c16a5007a48b16c579ea10567c59cc2373..f47ecd52aafadbc7b585fe661ef8cbc116b5841d 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/Measurements.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/Measurements.java @@ -1,277 +1,314 @@ -/** - * Copyright (c) 2010 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. +/** + * Copyright (c) 2010 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. */ package com.yahoo.ycsb.measurements; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + import java.io.IOException; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; - /** * Collects latency measurements, and reports them when requested. - * + * * @author cooperb * */ -public class Measurements -{ - public static final String MEASUREMENT_TYPE_PROPERTY = "measurementtype"; +public class Measurements { + /** + * All supported measurement types are defined in this enum. + * + */ + public enum MeasurementType { + HISTOGRAM, + HDRHISTOGRAM, + HDRHISTOGRAM_AND_HISTOGRAM, + HDRHISTOGRAM_AND_RAW, + TIMESERIES, + RAW + } + + public static final String MEASUREMENT_TYPE_PROPERTY = "measurementtype"; + private static final String MEASUREMENT_TYPE_PROPERTY_DEFAULT = "hdrhistogram"; + + public static final String MEASUREMENT_INTERVAL = "measurement.interval"; + private static final String MEASUREMENT_INTERVAL_DEFAULT = "op"; + + public static final String MEASUREMENT_TRACK_JVM_PROPERTY = "measurement.trackjvm"; + public static final String MEASUREMENT_TRACK_JVM_PROPERTY_DEFAULT = "false"; + + static Measurements singleton=null; + static Properties measurementproperties=null; + + public static void setProperties(Properties props) + { + measurementproperties=props; + } + + /** + * Return the singleton Measurements object. + */ + public synchronized static Measurements getMeasurements() + { + if (singleton==null) + { + singleton=new Measurements(measurementproperties); + } + return singleton; + } + + final ConcurrentHashMap<String,OneMeasurement> _opToMesurementMap; + final ConcurrentHashMap<String,OneMeasurement> _opToIntendedMesurementMap; + final MeasurementType _measurementType; + final int _measurementInterval; + private Properties _props; + + /** + * Create a new object with the specified properties. + */ + public Measurements(Properties props) + { + _opToMesurementMap=new ConcurrentHashMap<String,OneMeasurement>(); + _opToIntendedMesurementMap=new ConcurrentHashMap<String,OneMeasurement>(); - private static final String MEASUREMENT_TYPE_PROPERTY_DEFAULT = "histogram"; - public static final String MEASUREMENT_INTERVAL = "measurement.interval"; - private static final String MEASUREMENT_INTERVAL_DEFAULT = "op"; + _props=props; - static Measurements singleton=null; - - static Properties measurementproperties=null; - - public static void setProperties(Properties props) - { - measurementproperties=props; - } + String mTypeString = _props.getProperty(MEASUREMENT_TYPE_PROPERTY, MEASUREMENT_TYPE_PROPERTY_DEFAULT); + if (mTypeString.equals("histogram")) + { + _measurementType = MeasurementType.HISTOGRAM; + } + else if (mTypeString.equals("hdrhistogram")) + { + _measurementType = MeasurementType.HDRHISTOGRAM; + } + else if (mTypeString.equals("hdrhistogram+histogram")) + { + _measurementType = MeasurementType.HDRHISTOGRAM_AND_HISTOGRAM; + } + else if (mTypeString.equals("hdrhistogram+raw")) + { + _measurementType = MeasurementType.HDRHISTOGRAM_AND_RAW; + } + else if (mTypeString.equals("timeseries")) + { + _measurementType = MeasurementType.TIMESERIES; + } + else if (mTypeString.equals("raw")) + { + _measurementType = MeasurementType.RAW; + } + else { + throw new IllegalArgumentException("unknown "+MEASUREMENT_TYPE_PROPERTY+"="+mTypeString); + } - /** - * Return the singleton Measurements object. - */ - public synchronized static Measurements getMeasurements() - { - if (singleton==null) - { - singleton=new Measurements(measurementproperties); - } - return singleton; - } + String mIntervalString = _props.getProperty(MEASUREMENT_INTERVAL, MEASUREMENT_INTERVAL_DEFAULT); + if (mIntervalString.equals("op")) + { + _measurementInterval = 0; + } + else if (mIntervalString.equals("intended")) + { + _measurementInterval = 1; + } + else if (mIntervalString.equals("both")) + { + _measurementInterval = 2; + } + else { + throw new IllegalArgumentException("unknown "+MEASUREMENT_INTERVAL+"="+mIntervalString); + } + } - final ConcurrentHashMap<String,OneMeasurement> _opToMesurementMap; - final ConcurrentHashMap<String,OneMeasurement> _opToIntendedMesurementMap; - final int _measurementType; - final int _measurementInterval; - private Properties _props; - - /** - * Create a new object with the specified properties. - */ - public Measurements(Properties props) - { - _opToMesurementMap=new ConcurrentHashMap<String,OneMeasurement>(); - _opToIntendedMesurementMap=new ConcurrentHashMap<String,OneMeasurement>(); - - _props=props; - - String mTypeString = _props.getProperty(MEASUREMENT_TYPE_PROPERTY, MEASUREMENT_TYPE_PROPERTY_DEFAULT); - if (mTypeString.equals("histogram")) - { - _measurementType = 0; - } - else if (mTypeString.equals("hdrhistogram")) - { - _measurementType = 1; - } - else if (mTypeString.equals("hdrhistogram+histogram")) - { - _measurementType = 2; - } - else if (mTypeString.equals("timeseries")) - { - _measurementType = 3; - } - else { - throw new IllegalArgumentException("unknown "+MEASUREMENT_TYPE_PROPERTY+"="+mTypeString); - } - - String mIntervalString = _props.getProperty(MEASUREMENT_INTERVAL, MEASUREMENT_INTERVAL_DEFAULT); - if (mIntervalString.equals("op")) - { - _measurementInterval = 0; - } - else if (mIntervalString.equals("intended")) - { - _measurementInterval = 1; - } - else if (mIntervalString.equals("both")) - { - _measurementInterval = 2; - } - else { - throw new IllegalArgumentException("unknown "+MEASUREMENT_INTERVAL+"="+mIntervalString); - } - - } - - OneMeasurement constructOneMeasurement(String name) + OneMeasurement constructOneMeasurement(String name) + { + switch (_measurementType) { - switch (_measurementType) - { - case 0: - return new OneMeasurementHistogram(name, _props); - case 1: - return new OneMeasurementHdrHistogram(name, _props); - case 2: - return new TwoInOneMeasurement(name, - new OneMeasurementHdrHistogram("Hdr"+name, _props), - new OneMeasurementHistogram("Bucket"+name, _props)); - default: - return new OneMeasurementTimeSeries(name, _props); - } + case HISTOGRAM: + return new OneMeasurementHistogram(name, _props); + case HDRHISTOGRAM: + return new OneMeasurementHdrHistogram(name, _props); + case HDRHISTOGRAM_AND_HISTOGRAM: + return new TwoInOneMeasurement(name, + new OneMeasurementHdrHistogram("Hdr"+name, _props), + new OneMeasurementHistogram("Bucket"+name, _props)); + case HDRHISTOGRAM_AND_RAW: + return new TwoInOneMeasurement(name, + new OneMeasurementHdrHistogram("Hdr"+name, _props), + new OneMeasurementRaw("Raw"+name, _props)); + case TIMESERIES: + return new OneMeasurementTimeSeries(name, _props); + case RAW: + return new OneMeasurementRaw(name, _props); + default: + throw new AssertionError("Impossible to be here. Dead code reached. Bugs?"); + } + } + + static class StartTimeHolder { + long time; + + long startTime(){ + if(time == 0) { + return System.nanoTime(); + } + else { + return time; + } } + } - static class StartTimeHolder{ - long time; - long startTime(){ - if(time == 0) { - return System.nanoTime(); - } - else { - return time; - } - } + ThreadLocal<StartTimeHolder> tlIntendedStartTime = new ThreadLocal<Measurements.StartTimeHolder>() { + protected StartTimeHolder initialValue() { + return new StartTimeHolder(); } - ThreadLocal<StartTimeHolder> tlIntendedStartTime = new ThreadLocal<Measurements.StartTimeHolder>(){ - protected StartTimeHolder initialValue() { - return new StartTimeHolder(); - }; - }; - public void setIntendedStartTimeNs(long time){ - if(_measurementInterval==0) - return; - tlIntendedStartTime.get().time=time; + }; + + public void setIntendedStartTimeNs(long time) { + if(_measurementInterval==0) + return; + tlIntendedStartTime.get().time=time; + } + + public long getIntendedtartTimeNs() { + if(_measurementInterval==0) + return 0L; + return tlIntendedStartTime.get().startTime(); + } + + /** + * Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured + * value. + */ + public void measure(String operation, int latency) + { + if(_measurementInterval==1) + return; + try + { + OneMeasurement m = getOpMeasurement(operation); + m.measure(latency); } - - public long getIntendedtartTimeNs(){ - if(_measurementInterval==0) - return 0L; - return tlIntendedStartTime.get().startTime(); + // This seems like a terribly hacky way to cover up for a bug in the measurement code + catch (java.lang.ArrayIndexOutOfBoundsException e) + { + System.out.println("ERROR: java.lang.ArrayIndexOutOfBoundsException - ignoring and continuing"); + e.printStackTrace(); + e.printStackTrace(System.out); } + } - /** - * Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured - * value. - */ - public void measure(String operation, int latency) - { - if(_measurementInterval==1) - return; - try - { - OneMeasurement m = getOpMeasurement(operation); - m.measure(latency); - } - // This seems like a terribly hacky way to cover up for a bug in the measurement code - catch (java.lang.ArrayIndexOutOfBoundsException e) - { - System.out.println("ERROR: java.lang.ArrayIndexOutOfBoundsException - ignoring and continuing"); - e.printStackTrace(); - e.printStackTrace(System.out); - } - } - /** - * Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured - * value. - */ - public void measureIntended(String operation, int latency) + /** + * Report a single value of a single metric. E.g. for read latency, operation="READ" and latency is the measured + * value. + */ + public void measureIntended(String operation, int latency) + { + if(_measurementInterval==0) + return; + try { - if(_measurementInterval==0) - return; - try - { - OneMeasurement m = getOpIntendedMeasurement(operation); - m.measure(latency); - } - // This seems like a terribly hacky way to cover up for a bug in the measurement code - catch (java.lang.ArrayIndexOutOfBoundsException e) - { - System.out.println("ERROR: java.lang.ArrayIndexOutOfBoundsException - ignoring and continuing"); - e.printStackTrace(); - e.printStackTrace(System.out); - } + OneMeasurement m = getOpIntendedMeasurement(operation); + m.measure(latency); } + // This seems like a terribly hacky way to cover up for a bug in the measurement code + catch (java.lang.ArrayIndexOutOfBoundsException e) + { + System.out.println("ERROR: java.lang.ArrayIndexOutOfBoundsException - ignoring and continuing"); + e.printStackTrace(); + e.printStackTrace(System.out); + } + } - private OneMeasurement getOpMeasurement(String operation) { - OneMeasurement m = _opToMesurementMap.get(operation); - if(m == null) - { - m = constructOneMeasurement(operation); - OneMeasurement oldM = _opToMesurementMap.putIfAbsent(operation, m); - if(oldM != null) - { - m = oldM; - } - } - return m; + private OneMeasurement getOpMeasurement(String operation) { + OneMeasurement m = _opToMesurementMap.get(operation); + if(m == null) + { + m = constructOneMeasurement(operation); + OneMeasurement oldM = _opToMesurementMap.putIfAbsent(operation, m); + if(oldM != null) + { + m = oldM; + } } - private OneMeasurement getOpIntendedMeasurement(String operation) { - OneMeasurement m = _opToIntendedMesurementMap.get(operation); - if(m == null) - { - final String name = _measurementInterval==1 ? operation : "Intended-" + operation; - m = constructOneMeasurement(name); - OneMeasurement oldM = _opToIntendedMesurementMap.putIfAbsent(operation, m); - if(oldM != null) - { - m = oldM; - } - } - return m; + return m; + } + + private OneMeasurement getOpIntendedMeasurement(String operation) { + OneMeasurement m = _opToIntendedMesurementMap.get(operation); + if(m == null) + { + final String name = _measurementInterval==1 ? operation : "Intended-" + operation; + m = constructOneMeasurement(name); + OneMeasurement oldM = _opToIntendedMesurementMap.putIfAbsent(operation, m); + if(oldM != null) + { + m = oldM; + } } - /** - * Report a return code for a single DB operation. - */ - public void reportReturnCode(String operation, int code) - { - OneMeasurement m = _measurementInterval==1 ? - getOpIntendedMeasurement(operation) : - getOpMeasurement(operation); - m.reportReturnCode(code); - } - + return m; + } + + /** + * Report a return code for a single DB operation. + */ + public void reportStatus(final String operation, final Status status) + { + OneMeasurement m = _measurementInterval==1 ? + getOpIntendedMeasurement(operation) : + getOpMeasurement(operation); + m.reportStatus(status); + } + /** * Export the current measurements to a suitable format. - * + * * @param exporter Exporter representing the type of format to write to. * @throws IOException Thrown if the export failed. */ public void exportMeasurements(MeasurementsExporter exporter) throws IOException { - for (OneMeasurement measurement : _opToMesurementMap.values()) - { - measurement.exportMeasurements(exporter); - } - for (OneMeasurement measurement : _opToIntendedMesurementMap.values()) - { - measurement.exportMeasurements(exporter); - } + for (OneMeasurement measurement : _opToMesurementMap.values()) + { + measurement.exportMeasurements(exporter); + } + for (OneMeasurement measurement : _opToIntendedMesurementMap.values()) + { + measurement.exportMeasurements(exporter); + } } - - /** - * Return a one line summary of the measurements. - */ - public synchronized String getSummary() - { - String ret=""; - for (OneMeasurement m : _opToMesurementMap.values()) - { - ret+=m.getSummary()+" "; - } - for (OneMeasurement m : _opToIntendedMesurementMap.values()) - { - ret+=m.getSummary()+" "; - } - return ret; - } + + /** + * Return a one line summary of the measurements. + */ + public synchronized String getSummary() + { + String ret=""; + for (OneMeasurement m : _opToMesurementMap.values()) + { + ret += m.getSummary()+" "; + } + for (OneMeasurement m : _opToIntendedMesurementMap.values()) + { + ret += m.getSummary()+" "; + } + return ret; + } + } diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurement.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurement.java index 90720ef490d2caeaa2c5605e686aa80083ffad20..8d4d22da2754712d95c91e352012cd3c15f0f783 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurement.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurement.java @@ -1,55 +1,81 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.measurements; - -import java.io.IOException; - -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; - -/** - * A single measured metric (such as READ LATENCY) - */ -public abstract class OneMeasurement { - - String _name; - - public String getName() { - return _name; - } - - /** - * @param _name - */ - public OneMeasurement(String _name) { - this._name = _name; - } - - public abstract void reportReturnCode(int code); - - public abstract void measure(int latency); - - public abstract String getSummary(); - - /** - * Export the current measurements to a suitable format. - * - * @param exporter Exporter representing the type of format to write to. - * @throws IOException Thrown if the export failed. - */ - public abstract void exportMeasurements(MeasurementsExporter exporter) throws IOException; -} +/** + * Copyright (c) 2010 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. + */ + +package com.yahoo.ycsb.measurements; + +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * A single measured metric (such as READ LATENCY) + */ +public abstract class OneMeasurement { + + private final String _name; + private final ConcurrentHashMap<Status, AtomicInteger> _returncodes; + + public String getName() { + return _name; + } + + /** + * @param _name + */ + public OneMeasurement(String _name) { + this._name = _name; + this._returncodes = new ConcurrentHashMap<Status, AtomicInteger>(); + } + + public abstract void measure(int latency); + + public abstract String getSummary(); + + /** + * No need for synchronization, using CHM to deal with that + */ + public void reportStatus(Status status) { + AtomicInteger counter = _returncodes.get(status); + + if (counter == null) { + AtomicInteger other = _returncodes.putIfAbsent(status, counter = new AtomicInteger()); + if (other != null) { + counter = other; + } + } + + counter.incrementAndGet(); + } + + /** + * Export the current measurements to a suitable format. + * + * @param exporter Exporter representing the type of format to write to. + * @throws IOException Thrown if the export failed. + */ + public abstract void exportMeasurements(MeasurementsExporter exporter) throws IOException; + + protected final void exportStatusCounts(MeasurementsExporter exporter) throws IOException { + for (Map.Entry<Status, AtomicInteger> entry : _returncodes.entrySet()) { + exporter.write(getName(), "Return=" + entry.getKey().getName(), entry.getValue().get()); + } + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java index fa0735f854f758b59d07c6c15de07b89ccef8cb4..a88c2b81a97f297f0e8295e7bf7cf36fcd6c6f8c 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java @@ -1,166 +1,200 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.measurements; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.text.DecimalFormat; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicInteger; - -import org.HdrHistogram.Histogram; -import org.HdrHistogram.HistogramLogWriter; -import org.HdrHistogram.Recorder; - -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; - -/** - * Take measurements and maintain a HdrHistogram of a given metric, such as READ LATENCY. - * - * @author nitsanw - * - */ -public class OneMeasurementHdrHistogram extends OneMeasurement { - // we need one log per measurement histogram - final PrintStream log; - final HistogramLogWriter histogramLogWriter; - - final Recorder histogram = new Recorder(3); - final ConcurrentHashMap<Integer, AtomicInteger> returncodes; - - Histogram totalHistogram; - - public OneMeasurementHdrHistogram(String name, Properties props) { - super(name); - returncodes = new ConcurrentHashMap<Integer, AtomicInteger>(); - boolean shouldLog = Boolean.parseBoolean(props.getProperty("hdrhistogram.fileoutput", "false")); - if (!shouldLog) { - log = null; - histogramLogWriter = null; - return; - } - try { - final String hdrOutputFilename = props.getProperty("hdrhistogram.output.path", "") +name+".hdr"; - log = new PrintStream(new FileOutputStream(hdrOutputFilename), false); - } catch (FileNotFoundException e) { - throw new RuntimeException("Failed to open hdr histogram output file",e); - } - histogramLogWriter = new HistogramLogWriter(log); - histogramLogWriter.outputComment("[Logging for: " + name + "]"); - histogramLogWriter.outputLogFormatVersion(); - histogramLogWriter.outputStartTime(System.currentTimeMillis()); - histogramLogWriter.outputLegend(); - } - - /** - * No need for synchronization, using CHM to deal with that - * - * @see com.yahoo.ycsb.OneMeasurement#reportReturnCode(int) - */ - public void reportReturnCode(int code) { - Integer Icode = code; - AtomicInteger counter = returncodes.get(Icode); - if (counter == null) { - AtomicInteger other = returncodes.putIfAbsent(Icode, counter = new AtomicInteger()); - if (other != null) { - counter = other; - } - } - - counter.incrementAndGet(); - } - - /** - * It appears latency is reported in micros. - * Using {@link Recorder} to support concurrent updates to histogram. - * - * @see com.yahoo.ycsb.OneMeasurement#measure(int) - */ - public void measure(int latencyInMicros) { - histogram.recordValue(latencyInMicros); - } - - /** - * This is called from a main thread, on orderly termination. - * - * @see com.yahoo.ycsb.measurements.OneMeasurement#exportMeasurements(com.yahoo.ycsb.measurements.exporter.MeasurementsExporter) - */ - @Override - public void exportMeasurements(MeasurementsExporter exporter) throws IOException { - // accumulate the last interval which was not caught by status thread - Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); - if(histogramLogWriter != null) { - histogramLogWriter.outputIntervalHistogram(intervalHistogram); - // we can close now - log.close(); - } - exporter.write(getName(), "Operations", totalHistogram.getTotalCount()); - exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean()); - exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue()); - exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue()); - exporter.write(getName(), "95thPercentileLatency(ms)", totalHistogram.getValueAtPercentile(90)/1000); - exporter.write(getName(), "99thPercentileLatency(ms)", totalHistogram.getValueAtPercentile(99)/1000); - - for (Map.Entry<Integer, AtomicInteger> entry : returncodes.entrySet()) { - exporter.write(getName(), "Return=" + entry.getKey(), entry.getValue().get()); - } - } - - /** - * This is called periodically from the StatusThread. There's a single StatusThread per Client process. - * We optionally serialize the interval to log on this opportunity. - * @see com.yahoo.ycsb.measurements.OneMeasurement#getSummary() - */ - @Override - public String getSummary() { - Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); - // we use the summary interval as the histogram file interval. - if(histogramLogWriter != null) { - histogramLogWriter.outputIntervalHistogram(intervalHistogram); - } - - DecimalFormat d = new DecimalFormat("#.##"); - return "[" + getName() + - ": Count=" + intervalHistogram.getTotalCount() + - ", Max=" + intervalHistogram.getMaxValue() + - ", Min=" + intervalHistogram.getMinValue() + - ", Avg=" + d.format(intervalHistogram.getMean()) + - ", 90=" + d.format(intervalHistogram.getValueAtPercentile(90)) + - ", 99=" + d.format(intervalHistogram.getValueAtPercentile(99)) + - ", 99.9=" + d.format(intervalHistogram.getValueAtPercentile(99.9)) + - ", 99.99=" + d.format(intervalHistogram.getValueAtPercentile(99.99)) +"]"; - } - - private Histogram getIntervalHistogramAndAccumulate() { - Histogram intervalHistogram = histogram.getIntervalHistogram(); - // add this to the total time histogram. - if (totalHistogram == null) { - totalHistogram = intervalHistogram; - } - else { - totalHistogram.add(intervalHistogram); - } - return intervalHistogram; - } - -} +/** + * Copyright (c) 2010 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. + */ + +package com.yahoo.ycsb.measurements; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.text.DecimalFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +import org.HdrHistogram.Histogram; +import org.HdrHistogram.HistogramLogWriter; +import org.HdrHistogram.Recorder; + +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + +/** + * Take measurements and maintain a HdrHistogram of a given metric, such as READ + * LATENCY. + * + * @author nitsanw + * + */ +public class OneMeasurementHdrHistogram extends OneMeasurement { + + // we need one log per measurement histogram + final PrintStream log; + final HistogramLogWriter histogramLogWriter; + + final Recorder histogram; + Histogram totalHistogram; + + /** + * The name of the property for deciding what percentile values to output. + */ + public static final String PERCENTILES_PROPERTY = "hdrhistogram.percentiles"; + + /** + * The default value for the hdrhistogram.percentiles property. + */ + public static final String PERCENTILES_PROPERTY_DEFAULT = "95,99"; + + List<Integer> percentiles; + + public OneMeasurementHdrHistogram(String name, Properties props) { + super(name); + percentiles = getPercentileValues(props.getProperty(PERCENTILES_PROPERTY, PERCENTILES_PROPERTY_DEFAULT)); + boolean shouldLog = Boolean.parseBoolean(props.getProperty("hdrhistogram.fileoutput", "false")); + if (!shouldLog) { + log = null; + histogramLogWriter = null; + } else { + try { + final String hdrOutputFilename = props.getProperty("hdrhistogram.output.path", "") + name + ".hdr"; + log = new PrintStream(new FileOutputStream(hdrOutputFilename), false); + } catch (FileNotFoundException e) { + throw new RuntimeException("Failed to open hdr histogram output file", e); + } + histogramLogWriter = new HistogramLogWriter(log); + histogramLogWriter.outputComment("[Logging for: " + name + "]"); + histogramLogWriter.outputLogFormatVersion(); + long now = System.currentTimeMillis(); + histogramLogWriter.outputStartTime(now); + histogramLogWriter.setBaseTime(now); + histogramLogWriter.outputLegend(); + } + histogram = new Recorder(3); + } + + /** + * It appears latency is reported in micros. + * Using {@link Recorder} to support concurrent updates to histogram. + * + * @see com.yahoo.ycsb.OneMeasurement#measure(int) + */ + public void measure(int latencyInMicros) { + histogram.recordValue(latencyInMicros); + } + + /** + * This is called from a main thread, on orderly termination. + * + * @see com.yahoo.ycsb.measurements.OneMeasurement#exportMeasurements(com.yahoo.ycsb.measurements.exporter.MeasurementsExporter) + */ + @Override + public void exportMeasurements(MeasurementsExporter exporter) throws IOException { + // accumulate the last interval which was not caught by status thread + Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); + if (histogramLogWriter != null) { + histogramLogWriter.outputIntervalHistogram(intervalHistogram); + // we can close now + log.close(); + } + exporter.write(getName(), "Operations", totalHistogram.getTotalCount()); + exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean()); + exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue()); + exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue()); + + for (Integer percentile: percentiles) { + exporter.write(getName(), ordinal(percentile) + "PercentileLatency(us)", totalHistogram.getValueAtPercentile(percentile)); + } + + exportStatusCounts(exporter); + } + + /** + * This is called periodically from the StatusThread. There's a single + * StatusThread per Client process. We optionally serialize the interval to + * log on this opportunity. + * + * @see com.yahoo.ycsb.measurements.OneMeasurement#getSummary() + */ + @Override + public String getSummary() { + Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); + // we use the summary interval as the histogram file interval. + if (histogramLogWriter != null) { + histogramLogWriter.outputIntervalHistogram(intervalHistogram); + } + + DecimalFormat d = new DecimalFormat("#.##"); + return "[" + getName() + ": Count=" + intervalHistogram.getTotalCount() + ", Max=" + + intervalHistogram.getMaxValue() + ", Min=" + intervalHistogram.getMinValue() + ", Avg=" + + d.format(intervalHistogram.getMean()) + ", 90=" + d.format(intervalHistogram.getValueAtPercentile(90)) + + ", 99=" + d.format(intervalHistogram.getValueAtPercentile(99)) + ", 99.9=" + + d.format(intervalHistogram.getValueAtPercentile(99.9)) + ", 99.99=" + + d.format(intervalHistogram.getValueAtPercentile(99.99)) + "]"; + } + + private Histogram getIntervalHistogramAndAccumulate() { + Histogram intervalHistogram = histogram.getIntervalHistogram(); + // add this to the total time histogram. + if (totalHistogram == null) { + totalHistogram = intervalHistogram; + } else { + totalHistogram.add(intervalHistogram); + } + return intervalHistogram; + } + + /** + * Helper method to parse the given percentile value string + * + * @param percentileString - comma delimited string of Integer values + * @return An Integer List of percentile values + */ + private List<Integer> getPercentileValues(String percentileString) { + List<Integer> percentileValues = new ArrayList<Integer>(); + + try { + for (String rawPercentile: percentileString.split(",")) { + percentileValues.add(Integer.parseInt(rawPercentile)); + } + } catch(Exception e) { + // If the given hdrhistogram.percentiles value is unreadable for whatever reason, + // then calculate and return the default set. + System.err.println("[WARN] Couldn't read " + PERCENTILES_PROPERTY + " value: '" + percentileString + + "', the default of '" + PERCENTILES_PROPERTY_DEFAULT + "' will be used."); + e.printStackTrace(); + return getPercentileValues(PERCENTILES_PROPERTY_DEFAULT); + } + + return percentileValues; + } + + /** + * Helper method to find the ordinal of any number. eg 1 -> 1st + * @param i + * @return ordinal string + */ + private String ordinal(int i) { + String[] suffixes = new String[] { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" }; + switch (i % 100) { + case 11: + case 12: + case 13: + return i + "th"; + default: + return i + suffixes[i % 10]; + } + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHistogram.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHistogram.java index 2cba955a2a3c926f1d7b719c26b9696562522a08..6e2ed0be5a4dcf241e913637e0f9c48e9593af8f 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHistogram.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHistogram.java @@ -1,165 +1,177 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.measurements; - -import java.io.IOException; -import java.text.DecimalFormat; -import java.util.HashMap; -import java.util.Properties; - -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; - - -/** - * Take measurements and maintain a histogram of a given metric, such as READ LATENCY. - * - * @author cooperb - * - */ -public class OneMeasurementHistogram extends OneMeasurement -{ - public static final String BUCKETS="histogram.buckets"; - public static final String BUCKETS_DEFAULT="1000"; - - int _buckets; - int[] histogram; - int histogramoverflow; - int operations; - long totallatency; - - //keep a windowed version of these stats for printing status - int windowoperations; - long windowtotallatency; - - int min; - int max; - HashMap<Integer,int[]> returncodes; - - public OneMeasurementHistogram(String name, Properties props) - { - super(name); - _buckets=Integer.parseInt(props.getProperty(BUCKETS, BUCKETS_DEFAULT)); - histogram=new int[_buckets]; - histogramoverflow=0; - operations=0; - totallatency=0; - windowoperations=0; - windowtotallatency=0; - min=-1; - max=-1; - returncodes=new HashMap<Integer,int[]>(); - } - - /* (non-Javadoc) - * @see com.yahoo.ycsb.OneMeasurement#reportReturnCode(int) - */ - public synchronized void reportReturnCode(int code) - { - Integer Icode=code; - if (!returncodes.containsKey(Icode)) - { - int[] val=new int[1]; - val[0]=0; - returncodes.put(Icode,val); - } - returncodes.get(Icode)[0]++; - } - - - /* (non-Javadoc) - * @see com.yahoo.ycsb.OneMeasurement#measure(int) - */ - public synchronized void measure(int latency) - { - if (latency/1000>=_buckets) - { - histogramoverflow++; - } - else - { - histogram[latency/1000]++; - } - operations++; - totallatency+=latency; - windowoperations++; - windowtotallatency+=latency; - - if ( (min<0) || (latency<min) ) - { - min=latency; - } - - if ( (max<0) || (latency>max) ) - { - max=latency; - } - } - - - @Override - public void exportMeasurements(MeasurementsExporter exporter) throws IOException - { - exporter.write(getName(), "Operations", operations); - exporter.write(getName(), "AverageLatency(us)", (((double)totallatency)/((double)operations))); - exporter.write(getName(), "MinLatency(us)", min); - exporter.write(getName(), "MaxLatency(us)", max); - - int opcounter=0; - boolean done95th=false; - for (int i=0; i<_buckets; i++) - { - opcounter+=histogram[i]; - if ( (!done95th) && (((double)opcounter)/((double)operations)>=0.95) ) - { - exporter.write(getName(), "95thPercentileLatency(ms)", i); - done95th=true; - } - if (((double)opcounter)/((double)operations)>=0.99) - { - exporter.write(getName(), "99thPercentileLatency(ms)", i); - break; - } - } - - for (Integer I : returncodes.keySet()) - { - int[] val=returncodes.get(I); - exporter.write(getName(), "Return="+I, val[0]); - } - - for (int i=0; i<_buckets; i++) - { - exporter.write(getName(), Integer.toString(i), histogram[i]); - } - exporter.write(getName(), ">"+_buckets, histogramoverflow); - } - - @Override - public String getSummary() { - if (windowoperations==0) - { - return ""; - } - DecimalFormat d = new DecimalFormat("#.##"); - double report=((double)windowtotallatency)/((double)windowoperations); - windowtotallatency=0; - windowoperations=0; - return "["+getName()+" AverageLatency(us)="+d.format(report)+"]"; - } - -} +/** + * Copyright (c) 2010 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. + */ + +package com.yahoo.ycsb.measurements; + +import java.io.IOException; +import java.text.DecimalFormat; +import java.util.Properties; + +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + + +/** + * Take measurements and maintain a histogram of a given metric, such as READ LATENCY. + * + * @author cooperb + * + */ +public class OneMeasurementHistogram extends OneMeasurement +{ + public static final String BUCKETS="histogram.buckets"; + public static final String BUCKETS_DEFAULT="1000"; + + + /** + * Specify the range of latencies to track in the histogram. + */ + int _buckets; + + /** + * Groups operations in discrete blocks of 1ms width. + */ + int[] histogram; + + /** + * Counts all operations outside the histogram's range. + */ + int histogramoverflow; + + /** + * The total number of reported operations. + */ + int operations; + + /** + * The sum of each latency measurement over all operations. + * Calculated in ms. + */ + long totallatency; + + /** + * The sum of each latency measurement squared over all operations. + * Used to calculate variance of latency. + * Calculated in ms. + */ + double totalsquaredlatency; + + //keep a windowed version of these stats for printing status + int windowoperations; + long windowtotallatency; + + int min; + int max; + + public OneMeasurementHistogram(String name, Properties props) + { + super(name); + _buckets=Integer.parseInt(props.getProperty(BUCKETS, BUCKETS_DEFAULT)); + histogram=new int[_buckets]; + histogramoverflow=0; + operations=0; + totallatency=0; + totalsquaredlatency=0; + windowoperations=0; + windowtotallatency=0; + min=-1; + max=-1; + } + + /* (non-Javadoc) + * @see com.yahoo.ycsb.OneMeasurement#measure(int) + */ + public synchronized void measure(int latency) + { + //latency reported in us and collected in bucket by ms. + if (latency/1000>=_buckets) + { + histogramoverflow++; + } + else + { + histogram[latency/1000]++; + } + operations++; + totallatency += latency; + totalsquaredlatency += ((double)latency) * ((double)latency); + windowoperations++; + windowtotallatency += latency; + + if ( (min<0) || (latency<min) ) + { + min=latency; + } + + if ( (max<0) || (latency>max) ) + { + max=latency; + } + } + + @Override + public void exportMeasurements(MeasurementsExporter exporter) throws IOException + { + double mean = totallatency/((double)operations); + double variance = totalsquaredlatency/((double)operations) - (mean * mean); + exporter.write(getName(), "Operations", operations); + exporter.write(getName(), "AverageLatency(us)", mean); + exporter.write(getName(), "LatencyVariance(us)", variance); + exporter.write(getName(), "MinLatency(us)", min); + exporter.write(getName(), "MaxLatency(us)", max); + + int opcounter=0; + boolean done95th=false; + for (int i=0; i<_buckets; i++) + { + opcounter+=histogram[i]; + if ( (!done95th) && (((double)opcounter)/((double)operations)>=0.95) ) + { + exporter.write(getName(), "95thPercentileLatency(us)", i*1000); + done95th=true; + } + if (((double)opcounter)/((double)operations)>=0.99) + { + exporter.write(getName(), "99thPercentileLatency(us)", i*1000); + break; + } + } + + exportStatusCounts(exporter); + + for (int i=0; i<_buckets; i++) + { + exporter.write(getName(), Integer.toString(i), histogram[i]); + } + exporter.write(getName(), ">"+_buckets, histogramoverflow); + } + + @Override + public String getSummary() { + if (windowoperations==0) + { + return ""; + } + DecimalFormat d = new DecimalFormat("#.##"); + double report=((double)windowtotallatency)/((double)windowoperations); + windowtotallatency=0; + windowoperations=0; + return "["+getName()+" AverageLatency(us)="+d.format(report)+"]"; + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementRaw.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementRaw.java new file mode 100644 index 0000000000000000000000000000000000000000..15c3f18304b5a3cd21e88b5f59afc82801da863c --- /dev/null +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementRaw.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) 2015 Google 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. + */ + +package com.yahoo.ycsb.measurements; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Properties; +import java.util.LinkedList; +import java.util.Collections; +import java.util.Comparator; +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + +/** + * Record a series of measurements as raw data points without down sampling, + * optionally write to an output file when configured. + * + * @author stfeng + * + */ +public class OneMeasurementRaw extends OneMeasurement { + /** + * One raw data point, two fields: timestamp (ms) when the datapoint is + * inserted, and the value. + */ + class RawDataPoint { + private final long timestamp; + private final int value; + + public RawDataPoint(int value) { + this.timestamp = System.currentTimeMillis(); + this.value = value; + } + + public long timeStamp() { + return timestamp; + } + + public int value() { + return value; + } + } + + class RawDataPointComparator implements Comparator<RawDataPoint> { + @Override + public int compare(RawDataPoint p1, RawDataPoint p2){ + if (p1.value() < p2.value()){ + return -1; + } else if (p1.value() == p2.value()) { + return 0; + } else { + return 1; + } + } + } + + /** + * Optionally, user can configure an output file to save the raw data points. + * Default is none, raw results will be written to stdout. + * + */ + public static final String OUTPUT_FILE_PATH = "measurement.raw.output_file"; + public static final String OUTPUT_FILE_PATH_DEFAULT = ""; + + /** + * Optionally, user can request to not output summary stats. This is useful + * if the user chains the raw measurement type behind the HdrHistogram type + * which already outputs summary stats. But even in that case, the user may + * still want this class to compute summary stats for them, especially if + * they want accurate computation of percentiles (because percentils computed + * by histogram classes are still approximations). + */ + public static final String NO_SUMMARY_STATS = "measurement.raw.no_summary"; + public static final String NO_SUMMARY_STATS_DEFAULT = "false"; + + private String outputFilePath = ""; + private final PrintStream outputStream; + + private boolean noSummaryStats = false; + + private LinkedList<RawDataPoint> measurements; + private long totalLatency = 0; + + // A window of stats to print summary for at the next getSummary() call. + // It's supposed to be a one line summary, so we will just print count and + // average. + private int windowOperations = 0; + private long windowTotalLatency = 0; + + public OneMeasurementRaw(String name, Properties props) { + super(name); + + outputFilePath = props.getProperty(OUTPUT_FILE_PATH, + OUTPUT_FILE_PATH_DEFAULT); + if (!outputFilePath.isEmpty()) { + System.out.println("Raw data measurement: will output to result file: " + + outputFilePath); + + try { + outputStream = new PrintStream( + new FileOutputStream(outputFilePath, true), + true); + } catch (FileNotFoundException e) { + throw new RuntimeException("Failed to open raw data output file", e); + } + + } else{ + System.out.println("Raw data measurement: will output to stdout."); + outputStream = System.out; + + } + + noSummaryStats = Boolean.parseBoolean(props.getProperty(NO_SUMMARY_STATS, + NO_SUMMARY_STATS_DEFAULT)); + + measurements = new LinkedList<RawDataPoint>(); + } + + @Override + public synchronized void measure(int latency) { + totalLatency += latency; + windowTotalLatency += latency; + windowOperations++; + + measurements.add(new RawDataPoint(latency)); + } + + @Override + public void exportMeasurements(MeasurementsExporter exporter) + throws IOException { + // Output raw data points first then print out a summary of percentiles to + // stdout. + + outputStream.println(getName() + + " latency raw data: op, timestamp(ms), latency(us)"); + for (RawDataPoint point : measurements) { + outputStream.println( + String.format("%s,%d,%d", getName(), point.timeStamp(), + point.value())); + } + if (outputStream != System.out) { + outputStream.close(); + } + + int totalOps = measurements.size(); + exporter.write(getName(), "Total Operations", totalOps); + if (totalOps > 0 && !noSummaryStats) { + exporter.write(getName(), + "Below is a summary of latency in microseconds:", -1); + exporter.write(getName(), "Average", + (double)totalLatency / (double)totalOps); + + Collections.sort(measurements, new RawDataPointComparator()); + + exporter.write(getName(), "Min", measurements.get(0).value()); + exporter.write( + getName(), "Max", measurements.get(totalOps - 1).value()); + exporter.write( + getName(), "p1", measurements.get((int)(totalOps*0.01)).value()); + exporter.write( + getName(), "p5", measurements.get((int)(totalOps*0.05)).value()); + exporter.write( + getName(), "p50", measurements.get((int)(totalOps*0.5)).value()); + exporter.write( + getName(), "p90", measurements.get((int)(totalOps*0.9)).value()); + exporter.write( + getName(), "p95", measurements.get((int)(totalOps*0.95)).value()); + exporter.write( + getName(), "p99", measurements.get((int)(totalOps*0.99)).value()); + exporter.write(getName(), "p99.9", + measurements.get((int)(totalOps*0.999)).value()); + exporter.write(getName(), "p99.99", + measurements.get((int)(totalOps*0.9999)).value()); + } + + exportStatusCounts(exporter); + } + + @Override + public synchronized String getSummary() { + if (windowOperations == 0) { + return ""; + } + + String toReturn = String.format("%s count: %d, average latency(us): %.2f", + getName(), windowOperations, + (double)windowTotalLatency / (double)windowOperations); + + windowTotalLatency=0; + windowOperations=0; + + return toReturn; + } +} diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.java index 25c77b76740feaed3bf134c78b249e4e9146a827..5e8dea01f8d1324c93e151d11476480d15ccefbd 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.java @@ -1,179 +1,157 @@ -/** - * Copyright (c) 2010 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. - */ - -package com.yahoo.ycsb.measurements; - -import java.io.IOException; -import java.text.DecimalFormat; -import java.util.HashMap; -import java.util.Properties; -import java.util.Vector; - -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; - -class SeriesUnit -{ - /** - * @param time - * @param average - */ - public SeriesUnit(long time, double average) { - this.time = time; - this.average = average; - } - public long time; - public double average; -} - -/** - * A time series measurement of a metric, such as READ LATENCY. - */ -public class OneMeasurementTimeSeries extends OneMeasurement -{ - /** - * Granularity for time series; measurements will be averaged in chunks of this granularity. Units are milliseconds. - */ - public static final String GRANULARITY="timeseries.granularity"; - - public static final String GRANULARITY_DEFAULT="1000"; - - int _granularity; - Vector<SeriesUnit> _measurements; - - long start=-1; - long currentunit=-1; - int count=0; - int sum=0; - int operations=0; - long totallatency=0; - - //keep a windowed version of these stats for printing status - int windowoperations=0; - long windowtotallatency=0; - - int min=-1; - int max=-1; - - private HashMap<Integer, int[]> returncodes; - - public OneMeasurementTimeSeries(String name, Properties props) - { - super(name); - _granularity=Integer.parseInt(props.getProperty(GRANULARITY,GRANULARITY_DEFAULT)); - _measurements=new Vector<SeriesUnit>(); - returncodes=new HashMap<Integer,int[]>(); - } - - void checkEndOfUnit(boolean forceend) - { - long now=System.currentTimeMillis(); - - if (start<0) - { - currentunit=0; - start=now; - } - - long unit=((now-start)/_granularity)*_granularity; - - if ( (unit>currentunit) || (forceend) ) - { - double avg=((double)sum)/((double)count); - _measurements.add(new SeriesUnit(currentunit,avg)); - - currentunit=unit; - - count=0; - sum=0; - } - } - - @Override - public void measure(int latency) - { - checkEndOfUnit(false); - - count++; - sum+=latency; - totallatency+=latency; - operations++; - windowoperations++; - windowtotallatency+=latency; - - if (latency>max) - { - max=latency; - } - - if ( (latency<min) || (min<0) ) - { - min=latency; - } - } - - - @Override - public void exportMeasurements(MeasurementsExporter exporter) throws IOException - { - checkEndOfUnit(true); - - exporter.write(getName(), "Operations", operations); - exporter.write(getName(), "AverageLatency(us)", (((double)totallatency)/((double)operations))); - exporter.write(getName(), "MinLatency(us)", min); - exporter.write(getName(), "MaxLatency(us)", max); - - //TODO: 95th and 99th percentile latency - - for (Integer I : returncodes.keySet()) - { - int[] val=returncodes.get(I); - exporter.write(getName(), "Return="+I, val[0]); - } - - for (SeriesUnit unit : _measurements) - { - exporter.write(getName(), Long.toString(unit.time), unit.average); - } - } - - @Override - public void reportReturnCode(int code) { - Integer Icode=code; - if (!returncodes.containsKey(Icode)) - { - int[] val=new int[1]; - val[0]=0; - returncodes.put(Icode,val); - } - returncodes.get(Icode)[0]++; - - } - - @Override - public String getSummary() { - if (windowoperations==0) - { - return ""; - } - DecimalFormat d = new DecimalFormat("#.##"); - double report=((double)windowtotallatency)/((double)windowoperations); - windowtotallatency=0; - windowoperations=0; - return "["+getName()+" AverageLatency(us)="+d.format(report)+"]"; - } - -} +/** + * Copyright (c) 2010 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. + */ + +package com.yahoo.ycsb.measurements; + +import java.io.IOException; +import java.util.Vector; +import java.util.Properties; +import java.text.DecimalFormat; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; + +class SeriesUnit +{ + /** + * @param time + * @param average + */ + public SeriesUnit(long time, double average) { + this.time = time; + this.average = average; + } + public long time; + public double average; +} + +/** + * A time series measurement of a metric, such as READ LATENCY. + */ +public class OneMeasurementTimeSeries extends OneMeasurement +{ + + /** + * Granularity for time series; measurements will be averaged in chunks of this granularity. Units are milliseconds. + */ + public static final String GRANULARITY="timeseries.granularity"; + public static final String GRANULARITY_DEFAULT="1000"; + + int _granularity; + Vector<SeriesUnit> _measurements; + + long start=-1; + long currentunit=-1; + int count=0; + int sum=0; + int operations=0; + long totallatency=0; + + //keep a windowed version of these stats for printing status + int windowoperations=0; + long windowtotallatency=0; + + int min=-1; + int max=-1; + + public OneMeasurementTimeSeries(String name, Properties props) + { + super(name); + _granularity=Integer.parseInt(props.getProperty(GRANULARITY,GRANULARITY_DEFAULT)); + _measurements=new Vector<SeriesUnit>(); + } + + synchronized void checkEndOfUnit(boolean forceend) + { + long now=System.currentTimeMillis(); + + if (start<0) + { + currentunit=0; + start=now; + } + + long unit=((now-start)/_granularity)*_granularity; + + if ( (unit>currentunit) || (forceend) ) + { + double avg=((double)sum)/((double)count); + _measurements.add(new SeriesUnit(currentunit,avg)); + + currentunit=unit; + + count=0; + sum=0; + } + } + + @Override + public void measure(int latency) + { + checkEndOfUnit(false); + + count++; + sum+=latency; + totallatency+=latency; + operations++; + windowoperations++; + windowtotallatency+=latency; + + if (latency>max) + { + max=latency; + } + + if ( (latency<min) || (min<0) ) + { + min=latency; + } + } + + + @Override + public void exportMeasurements(MeasurementsExporter exporter) throws IOException { + checkEndOfUnit(true); + + exporter.write(getName(), "Operations", operations); + exporter.write(getName(), "AverageLatency(us)", (((double) totallatency) / ((double) operations))); + exporter.write(getName(), "MinLatency(us)", min); + exporter.write(getName(), "MaxLatency(us)", max); + + // TODO: 95th and 99th percentile latency + + exportStatusCounts(exporter); + for (SeriesUnit unit : _measurements) { + exporter.write(getName(), Long.toString(unit.time), unit.average); + } + } + + @Override + public String getSummary() { + if (windowoperations==0) + { + return ""; + } + DecimalFormat d = new DecimalFormat("#.##"); + double report=((double)windowtotallatency)/((double)windowoperations); + windowtotallatency=0; + windowoperations=0; + return "["+getName()+" AverageLatency(us)="+d.format(report)+"]"; + } + +} diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/TwoInOneMeasurement.java b/core/src/main/java/com/yahoo/ycsb/measurements/TwoInOneMeasurement.java index c48a3f776b5fcdf75195ce8be3752d8e18ca80d9..37a385bb177c002171025a7d74e8dec743f6d99f 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/TwoInOneMeasurement.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/TwoInOneMeasurement.java @@ -1,27 +1,28 @@ -/** - * Copyright (c) 2010 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. +/** + * Copyright (c) 2010 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. */ package com.yahoo.ycsb.measurements; -import java.io.IOException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; import org.HdrHistogram.Recorder; -import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; +import java.io.IOException; /** * delegates to 2 measurement instances. @@ -29,51 +30,55 @@ import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; * */ public class TwoInOneMeasurement extends OneMeasurement { - final OneMeasurement thing1,thing2; - public TwoInOneMeasurement(String name, OneMeasurement thing1,OneMeasurement thing2) { - super(name); - this.thing1 = thing1; - this.thing2 = thing2; - } - /** - * No need for synchronization, using CHM to deal with that - * - * @see com.yahoo.ycsb.OneMeasurement#reportReturnCode(int) - */ - public void reportReturnCode(int code) { - thing1.reportReturnCode(code); - } + final OneMeasurement thing1,thing2; + public TwoInOneMeasurement(String name, OneMeasurement thing1,OneMeasurement thing2) { + super(name); + this.thing1 = thing1; + this.thing2 = thing2; + } + + /** + * No need for synchronization, using CHM to deal with that + * + * @see com.yahoo.ycsb.OneMeasurement#reportStatus(int) + */ + @Override + public void reportStatus(final Status status) { + thing1.reportStatus(status); + } + + /** + * It appears latency is reported in micros. + * Using {@link Recorder} to support concurrent updates to histogram. + * + * @see com.yahoo.ycsb.OneMeasurement#measure(int) + */ + @Override + public void measure(int latencyInMicros) { + thing1.measure(latencyInMicros); + thing2.measure(latencyInMicros); + } - /** - * It appears latency is reported in micros. - * Using {@link Recorder} to support concurrent updates to histogram. - * - * @see com.yahoo.ycsb.OneMeasurement#measure(int) - */ - public void measure(int latencyInMicros) { - thing1.measure(latencyInMicros); - thing2.measure(latencyInMicros); - } + /** + * This is called from a main thread, on orderly termination. + * + * @see com.yahoo.ycsb.measurements.OneMeasurement#exportMeasurements(com.yahoo.ycsb.measurements.exporter.MeasurementsExporter) + */ + @Override + public void exportMeasurements(MeasurementsExporter exporter) throws IOException { + thing1.exportMeasurements(exporter); + thing2.exportMeasurements(exporter); + } - /** - * This is called from a main thread, on orderly termination. - * - * @see com.yahoo.ycsb.measurements.OneMeasurement#exportMeasurements(com.yahoo.ycsb.measurements.exporter.MeasurementsExporter) - */ - @Override - public void exportMeasurements(MeasurementsExporter exporter) throws IOException { - thing1.exportMeasurements(exporter); - thing2.exportMeasurements(exporter); - } + /** + * This is called periodically from the StatusThread. There's a single StatusThread per Client process. + * We optionally serialize the interval to log on this opportunity. + * @see com.yahoo.ycsb.measurements.OneMeasurement#getSummary() + */ + @Override + public String getSummary() { + return thing1.getSummary() + "\n" + thing2.getSummary(); + } - /** - * This is called periodically from the StatusThread. There's a single StatusThread per Client process. - * We optionally serialize the interval to log on this opportunity. - * @see com.yahoo.ycsb.measurements.OneMeasurement#getSummary() - */ - @Override - public String getSummary() { - return thing1.getSummary() + "\n" + thing2.getSummary(); - } } diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/exporter/JSONArrayMeasurementsExporter.java b/core/src/main/java/com/yahoo/ycsb/measurements/exporter/JSONArrayMeasurementsExporter.java index b8466cfc0d64c588c5596086ac539165ec8dc88d..555fb2d493649cfaa5f459602a9afeb14b2e3d88 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/exporter/JSONArrayMeasurementsExporter.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/exporter/JSONArrayMeasurementsExporter.java @@ -36,7 +36,6 @@ public class JSONArrayMeasurementsExporter implements MeasurementsExporter public JSONArrayMeasurementsExporter(OutputStream os) throws IOException { - BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os)); g = factory.createJsonGenerator(bw); g.setPrettyPrinter(new DefaultPrettyPrinter()); diff --git a/core/src/main/java/com/yahoo/ycsb/workloads/ConstantOccupancyWorkload.java b/core/src/main/java/com/yahoo/ycsb/workloads/ConstantOccupancyWorkload.java index 6a5e7d025d93e21be5ebb099965437abda3c7cd8..3f367c7a624a1184ef2aaf4abc145b04e5540d20 100644 --- a/core/src/main/java/com/yahoo/ycsb/workloads/ConstantOccupancyWorkload.java +++ b/core/src/main/java/com/yahoo/ycsb/workloads/ConstantOccupancyWorkload.java @@ -20,7 +20,7 @@ import java.util.Properties; import com.yahoo.ycsb.WorkloadException; import com.yahoo.ycsb.Client; -import com.yahoo.ycsb.generator.IntegerGenerator; +import com.yahoo.ycsb.generator.NumberGenerator; /** * A disk-fragmenting workload. @@ -45,12 +45,11 @@ import com.yahoo.ycsb.generator.IntegerGenerator; * */ public class ConstantOccupancyWorkload extends CoreWorkload { - long disksize; - long storageages; - IntegerGenerator objectsizes; + private long disksize; + private long storageages; double occupancy; - long object_count; + private long object_count; public static final String STORAGE_AGE_PROPERTY = "storageages"; public static final long STORAGE_AGE_PROPERTY_DEFAULT = 10; @@ -64,26 +63,26 @@ public class ConstantOccupancyWorkload extends CoreWorkload { @Override public void init(Properties p) throws WorkloadException { - disksize = Long.parseLong( p.getProperty(DISK_SIZE_PROPERTY, DISK_SIZE_PROPERTY_DEFAULT+"")); - storageages = Long.parseLong( p.getProperty(STORAGE_AGE_PROPERTY, STORAGE_AGE_PROPERTY_DEFAULT+"")); - occupancy = Double.parseDouble(p.getProperty(OCCUPANCY_PROPERTY, OCCUPANCY_PROPERTY_DEFAULT+"")); + disksize = Long.parseLong( p.getProperty(DISK_SIZE_PROPERTY, String.valueOf(DISK_SIZE_PROPERTY_DEFAULT))); + storageages = Long.parseLong( p.getProperty(STORAGE_AGE_PROPERTY, String.valueOf(STORAGE_AGE_PROPERTY_DEFAULT))); + occupancy = Double.parseDouble(p.getProperty(OCCUPANCY_PROPERTY, String.valueOf(OCCUPANCY_PROPERTY_DEFAULT))); if(p.getProperty(Client.RECORD_COUNT_PROPERTY) != null || p.getProperty(Client.INSERT_COUNT_PROPERTY) != null || p.getProperty(Client.OPERATION_COUNT_PROPERTY) != null) { System.err.println("Warning: record, insert or operation count was set prior to initting ConstantOccupancyWorkload. Overriding old values."); } - IntegerGenerator g = CoreWorkload.getFieldLengthGenerator(p); + NumberGenerator g = CoreWorkload.getFieldLengthGenerator(p); double fieldsize = g.mean(); int fieldcount = Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT)); - object_count = (long)(occupancy * ((double)disksize / (fieldsize * (double)fieldcount))); + object_count = (long)(occupancy * (disksize / (fieldsize * fieldcount))); if(object_count == 0) { throw new IllegalStateException("Object count was zero. Perhaps disksize is too low?"); } - p.setProperty(Client.RECORD_COUNT_PROPERTY, object_count+""); - p.setProperty(Client.OPERATION_COUNT_PROPERTY, (storageages*object_count)+""); - p.setProperty(Client.INSERT_COUNT_PROPERTY, object_count+""); + p.setProperty(Client.RECORD_COUNT_PROPERTY, String.valueOf(object_count)); + p.setProperty(Client.OPERATION_COUNT_PROPERTY, String.valueOf(storageages*object_count)); + p.setProperty(Client.INSERT_COUNT_PROPERTY, String.valueOf(object_count)); super.init(p); } diff --git a/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java b/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java index b4a477b40e8371eca90a8da07b2a4b7aaae9ac59..b9ff7e734cf3b3224511de51e4f1b16253f00ff7 100644 --- a/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java +++ b/core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java @@ -1,11 +1,11 @@ /** - * Copyright (c) 2010 Yahoo! Inc. All rights reserved. - * + * Copyright (c) 2010 Yahoo! Inc., Copyright (c) 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 + * 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, @@ -20,138 +20,161 @@ package com.yahoo.ycsb.workloads; import java.util.Properties; import com.yahoo.ycsb.*; +import com.yahoo.ycsb.generator.AcknowledgedCounterGenerator; +import com.yahoo.ycsb.generator.ConstantIntegerGenerator; import com.yahoo.ycsb.generator.CounterGenerator; import com.yahoo.ycsb.generator.DiscreteGenerator; import com.yahoo.ycsb.generator.ExponentialGenerator; -import com.yahoo.ycsb.generator.Generator; -import com.yahoo.ycsb.generator.ConstantIntegerGenerator; -import com.yahoo.ycsb.generator.HotspotIntegerGenerator; import com.yahoo.ycsb.generator.HistogramGenerator; -import com.yahoo.ycsb.generator.IntegerGenerator; +import com.yahoo.ycsb.generator.HotspotIntegerGenerator; +import com.yahoo.ycsb.generator.NumberGenerator; import com.yahoo.ycsb.generator.ScrambledZipfianGenerator; +import com.yahoo.ycsb.generator.SequentialGenerator; import com.yahoo.ycsb.generator.SkewedLatestGenerator; import com.yahoo.ycsb.generator.UniformIntegerGenerator; import com.yahoo.ycsb.generator.ZipfianGenerator; import com.yahoo.ycsb.measurements.Measurements; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Vector; import java.util.List; import java.util.Map; -import java.util.ArrayList; +import java.util.Vector; + /** - * The core benchmark scenario. Represents a set of clients doing simple CRUD operations. The relative - * proportion of different kinds of operations, and other properties of the workload, are controlled - * by parameters specified at runtime. - * + * The core benchmark scenario. Represents a set of clients doing simple CRUD operations. The + * relative proportion of different kinds of operations, and other properties of the workload, + * are controlled by parameters specified at runtime. + * * Properties to control the client: * <UL> * <LI><b>fieldcount</b>: the number of fields in a record (default: 10) * <LI><b>fieldlength</b>: the size of each field (default: 100) * <LI><b>readallfields</b>: should reads read all fields (true) or just one (false) (default: true) - * <LI><b>writeallfields</b>: should updates and read/modify/writes update all fields (true) or just one (false) (default: false) + * <LI><b>writeallfields</b>: should updates and read/modify/writes update all fields (true) or just + * one (false) (default: false) * <LI><b>readproportion</b>: what proportion of operations should be reads (default: 0.95) * <LI><b>updateproportion</b>: what proportion of operations should be updates (default: 0.05) * <LI><b>insertproportion</b>: what proportion of operations should be inserts (default: 0) * <LI><b>scanproportion</b>: what proportion of operations should be scans (default: 0) - * <LI><b>readmodifywriteproportion</b>: what proportion of operations should be read a record, modify it, write it back (default: 0) - * <LI><b>requestdistribution</b>: what distribution should be used to select the records to operate on - uniform, zipfian, hotspot, or latest (default: uniform) + * <LI><b>readmodifywriteproportion</b>: what proportion of operations should be read a record, + * modify it, write it back (default: 0) + * <LI><b>requestdistribution</b>: what distribution should be used to select the records to operate + * on - uniform, zipfian, hotspot, sequential, exponential or latest (default: uniform) * <LI><b>maxscanlength</b>: for scans, what is the maximum number of records to scan (default: 1000) - * <LI><b>scanlengthdistribution</b>: for scans, what distribution should be used to choose the number of records to scan, for each scan, between 1 and maxscanlength (default: uniform) - * <LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed) - * </ul> + * <LI><b>scanlengthdistribution</b>: for scans, what distribution should be used to choose the + * number of records to scan, for each scan, between 1 and maxscanlength (default: uniform) + * <LI><b>insertstart</b>: for parallel loads and runs, defines the starting record for this + * YCSB instance (default: 0) + * <LI><b>insertcount</b>: for parallel loads and runs, defines the number of records for this + * YCSB instance (default: recordcount) + * <LI><b>zeropadding</b>: for generating a record sequence compatible with string sort order by + * 0 padding the record number. Controls the number of 0s to use for padding. (default: 1) + * For example for row 5, with zeropadding=1 you get 'user5' key and with zeropading=8 you get + * 'user00000005' key. In order to see its impact, zeropadding needs to be bigger than number of + * digits in the record number. + * <LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed + * order ("hashed") (default: hashed) + * </ul> */ -public class CoreWorkload extends Workload -{ - - /** - * The name of the database table to run queries against. - */ - public static final String TABLENAME_PROPERTY="table"; - - /** - * The default name of the database table to run queries against. - */ - public static final String TABLENAME_PROPERTY_DEFAULT="usertable"; - - public static String table; - - - /** - * The name of the property for the number of fields in a record. - */ - public static final String FIELD_COUNT_PROPERTY="fieldcount"; - - /** - * Default number of fields in a record. - */ - public static final String FIELD_COUNT_PROPERTY_DEFAULT="10"; - - int fieldcount; - - private List<String> fieldnames; - - /** - * The name of the property for the field length distribution. Options are "uniform", "zipfian" (favoring short records), "constant", and "histogram". - * - * If "uniform", "zipfian" or "constant", the maximum field length will be that specified by the fieldlength property. If "histogram", then the - * histogram will be read from the filename specified in the "fieldlengthhistogram" property. - */ - public static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY="fieldlengthdistribution"; - /** - * The default field length distribution. - */ - public static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT = "constant"; - - /** - * The name of the property for the length of a field in bytes. - */ - public static final String FIELD_LENGTH_PROPERTY="fieldlength"; - /** - * The default maximum length of a field in bytes. - */ - public static final String FIELD_LENGTH_PROPERTY_DEFAULT="100"; - - /** - * The name of a property that specifies the filename containing the field length histogram (only used if fieldlengthdistribution is "histogram"). - */ - public static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY = "fieldlengthhistogram"; - /** - * The default filename containing a field length histogram. - */ - public static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT = "hist.txt"; - - /** - * Generator object that produces field lengths. The value of this depends on the properties that start with "FIELD_LENGTH_". - */ - IntegerGenerator fieldlengthgenerator; - - /** - * The name of the property for deciding whether to read one field (false) or all fields (true) of a record. - */ - public static final String READ_ALL_FIELDS_PROPERTY="readallfields"; - - /** - * The default value for the readallfields property. - */ - public static final String READ_ALL_FIELDS_PROPERTY_DEFAULT="true"; - - boolean readallfields; - - /** - * The name of the property for deciding whether to write one field (false) or all fields (true) of a record. - */ - public static final String WRITE_ALL_FIELDS_PROPERTY="writeallfields"; - - /** - * The default value for the writeallfields property. - */ - public static final String WRITE_ALL_FIELDS_PROPERTY_DEFAULT="false"; - - boolean writeallfields; +public class CoreWorkload extends Workload { + /** + * The name of the database table to run queries against. + */ + public static final String TABLENAME_PROPERTY = "table"; + + /** + * The default name of the database table to run queries against. + */ + public static final String TABLENAME_PROPERTY_DEFAULT = "usertable"; + + public static String table; + + + /** + * The name of the property for the number of fields in a record. + */ + public static final String FIELD_COUNT_PROPERTY = "fieldcount"; + + /** + * Default number of fields in a record. + */ + public static final String FIELD_COUNT_PROPERTY_DEFAULT = "10"; + + int fieldcount; + + private List<String> fieldnames; + + /** + * The name of the property for the field length distribution. Options are "uniform", "zipfian" + * (favouring short records), "constant", and "histogram". + * + * If "uniform", "zipfian" or "constant", the maximum field length will be that specified by the + * fieldlength property. If "histogram", then the histogram will be read from the filename + * specified in the "fieldlengthhistogram" property. + */ + public static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY = "fieldlengthdistribution"; + + /** + * The default field length distribution. + */ + public static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT = "constant"; + + /** + * The name of the property for the length of a field in bytes. + */ + public static final String FIELD_LENGTH_PROPERTY = "fieldlength"; + + /** + * The default maximum length of a field in bytes. + */ + public static final String FIELD_LENGTH_PROPERTY_DEFAULT = "100"; + + /** + * The name of a property that specifies the filename containing the field length histogram (only + * used if fieldlengthdistribution is "histogram"). + */ + public static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY = "fieldlengthhistogram"; + + /** + * The default filename containing a field length histogram. + */ + public static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT = "hist.txt"; + + /** + * Generator object that produces field lengths. The value of this depends on the properties that + * start with "FIELD_LENGTH_". + */ + NumberGenerator fieldlengthgenerator; + + /** + * The name of the property for deciding whether to read one field (false) or all fields (true) of + * a record. + */ + public static final String READ_ALL_FIELDS_PROPERTY = "readallfields"; + + /** + * The default value for the readallfields property. + */ + public static final String READ_ALL_FIELDS_PROPERTY_DEFAULT = "true"; + + boolean readallfields; + + /** + * The name of the property for deciding whether to write one field (false) or all fields (true) + * of a record. + */ + public static final String WRITE_ALL_FIELDS_PROPERTY = "writeallfields"; + + /** + * The default value for the writeallfields property. + */ + public static final String WRITE_ALL_FIELDS_PROPERTY_DEFAULT = "false"; + + boolean writeallfields; /** @@ -159,7 +182,7 @@ public class CoreWorkload extends Workload * data against the formation template to ensure data integrity. */ public static final String DATA_INTEGRITY_PROPERTY = "dataintegrity"; - + /** * The default value for the dataintegrity property. */ @@ -172,346 +195,363 @@ public class CoreWorkload extends Workload private boolean dataintegrity; /** - * Response values for data integrity checks. - * Need to be multiples of 1000 to match bucket offsets of - * measurements/OneMeasurementHistogram.java. - */ - private final int DATA_INT_MATCH = 0; - private final int DATA_INT_DEVIATE = 1000; - private final int DATA_INT_UNEXPECTED_NULL = 2000; - - - /** - * The name of the property for the proportion of transactions that are reads. - */ - public static final String READ_PROPORTION_PROPERTY="readproportion"; - - /** - * The default proportion of transactions that are reads. - */ - public static final String READ_PROPORTION_PROPERTY_DEFAULT="0.95"; - - /** - * The name of the property for the proportion of transactions that are updates. - */ - public static final String UPDATE_PROPORTION_PROPERTY="updateproportion"; - - /** - * The default proportion of transactions that are updates. - */ - public static final String UPDATE_PROPORTION_PROPERTY_DEFAULT="0.05"; - - /** - * The name of the property for the proportion of transactions that are inserts. - */ - public static final String INSERT_PROPORTION_PROPERTY="insertproportion"; - - /** - * The default proportion of transactions that are inserts. - */ - public static final String INSERT_PROPORTION_PROPERTY_DEFAULT="0.0"; - - /** - * The name of the property for the proportion of transactions that are scans. - */ - public static final String SCAN_PROPORTION_PROPERTY="scanproportion"; - - /** - * The default proportion of transactions that are scans. - */ - public static final String SCAN_PROPORTION_PROPERTY_DEFAULT="0.0"; - - /** - * The name of the property for the proportion of transactions that are read-modify-write. - */ - public static final String READMODIFYWRITE_PROPORTION_PROPERTY="readmodifywriteproportion"; - - /** - * The default proportion of transactions that are scans. - */ - public static final String READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT="0.0"; - - /** - * The name of the property for the the distribution of requests across the keyspace. Options are "uniform", "zipfian" and "latest" - */ - public static final String REQUEST_DISTRIBUTION_PROPERTY="requestdistribution"; - - /** - * The default distribution of requests across the keyspace - */ - public static final String REQUEST_DISTRIBUTION_PROPERTY_DEFAULT="uniform"; - - /** - * The name of the property for the max scan length (number of records) - */ - public static final String MAX_SCAN_LENGTH_PROPERTY="maxscanlength"; - - /** - * The default max scan length. - */ - public static final String MAX_SCAN_LENGTH_PROPERTY_DEFAULT="1000"; - - /** - * The name of the property for the scan length distribution. Options are "uniform" and "zipfian" (favoring short scans) - */ - public static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY="scanlengthdistribution"; - - /** - * The default max scan length. - */ - public static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT="uniform"; - - /** - * The name of the property for the order to insert records. Options are "ordered" or "hashed" - */ - public static final String INSERT_ORDER_PROPERTY="insertorder"; - - /** - * Default insert order. - */ - public static final String INSERT_ORDER_PROPERTY_DEFAULT="hashed"; - - /** + * The name of the property for the proportion of transactions that are reads. + */ + public static final String READ_PROPORTION_PROPERTY = "readproportion"; + + /** + * The default proportion of transactions that are reads. + */ + public static final String READ_PROPORTION_PROPERTY_DEFAULT = "0.95"; + + /** + * The name of the property for the proportion of transactions that are updates. + */ + public static final String UPDATE_PROPORTION_PROPERTY = "updateproportion"; + + /** + * The default proportion of transactions that are updates. + */ + public static final String UPDATE_PROPORTION_PROPERTY_DEFAULT = "0.05"; + + /** + * The name of the property for the proportion of transactions that are inserts. + */ + public static final String INSERT_PROPORTION_PROPERTY = "insertproportion"; + + /** + * The default proportion of transactions that are inserts. + */ + public static final String INSERT_PROPORTION_PROPERTY_DEFAULT = "0.0"; + + /** + * The name of the property for the proportion of transactions that are scans. + */ + public static final String SCAN_PROPORTION_PROPERTY = "scanproportion"; + + /** + * The default proportion of transactions that are scans. + */ + public static final String SCAN_PROPORTION_PROPERTY_DEFAULT = "0.0"; + + /** + * The name of the property for the proportion of transactions that are read-modify-write. + */ + public static final String READMODIFYWRITE_PROPORTION_PROPERTY = "readmodifywriteproportion"; + + /** + * The default proportion of transactions that are scans. + */ + public static final String READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT = "0.0"; + + /** + * The name of the property for the the distribution of requests across the keyspace. Options are + * "uniform", "zipfian" and "latest" + */ + public static final String REQUEST_DISTRIBUTION_PROPERTY = "requestdistribution"; + + /** + * The default distribution of requests across the keyspace. + */ + public static final String REQUEST_DISTRIBUTION_PROPERTY_DEFAULT = "uniform"; + + /** + * The name of the property for adding zero padding to record numbers in order to match + * string sort order. Controls the number of 0s to left pad with. + */ + public static final String ZERO_PADDING_PROPERTY = "zeropadding"; + + /** + * The default zero padding value. Matches integer sort order + */ + public static final String ZERO_PADDING_PROPERTY_DEFAULT = "1"; + + + /** + * The name of the property for the max scan length (number of records). + */ + public static final String MAX_SCAN_LENGTH_PROPERTY = "maxscanlength"; + + /** + * The default max scan length. + */ + public static final String MAX_SCAN_LENGTH_PROPERTY_DEFAULT = "1000"; + + /** + * The name of the property for the scan length distribution. Options are "uniform" and "zipfian" + * (favoring short scans) + */ + public static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY = "scanlengthdistribution"; + + /** + * The default max scan length. + */ + public static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT = "uniform"; + + /** + * The name of the property for the order to insert records. Options are "ordered" or "hashed" + */ + public static final String INSERT_ORDER_PROPERTY = "insertorder"; + + /** + * Default insert order. + */ + public static final String INSERT_ORDER_PROPERTY_DEFAULT = "hashed"; + + /** * Percentage data items that constitute the hot set. */ public static final String HOTSPOT_DATA_FRACTION = "hotspotdatafraction"; - + /** * Default value of the size of the hot set. */ public static final String HOTSPOT_DATA_FRACTION_DEFAULT = "0.2"; - + /** * Percentage operations that access the hot set. */ public static final String HOTSPOT_OPN_FRACTION = "hotspotopnfraction"; - + /** * Default value of the percentage operations accessing the hot set. */ public static final String HOTSPOT_OPN_FRACTION_DEFAULT = "0.8"; - - IntegerGenerator keysequence; - - DiscreteGenerator operationchooser; - - IntegerGenerator keychooser; - - Generator fieldchooser; - - CounterGenerator transactioninsertkeysequence; - - IntegerGenerator scanlength; - - boolean orderedinserts; - - int recordcount; - - private Measurements _measurements = Measurements.getMeasurements(); - - protected static IntegerGenerator getFieldLengthGenerator(Properties p) throws WorkloadException{ - IntegerGenerator fieldlengthgenerator; - String fieldlengthdistribution = p.getProperty(FIELD_LENGTH_DISTRIBUTION_PROPERTY, FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT); - int fieldlength=Integer.parseInt(p.getProperty(FIELD_LENGTH_PROPERTY,FIELD_LENGTH_PROPERTY_DEFAULT)); - String fieldlengthhistogram = p.getProperty(FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY, FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT); - if(fieldlengthdistribution.compareTo("constant") == 0) { - fieldlengthgenerator = new ConstantIntegerGenerator(fieldlength); - } else if(fieldlengthdistribution.compareTo("uniform") == 0) { - fieldlengthgenerator = new UniformIntegerGenerator(1, fieldlength); - } else if(fieldlengthdistribution.compareTo("zipfian") == 0) { - fieldlengthgenerator = new ZipfianGenerator(1, fieldlength); - } else if(fieldlengthdistribution.compareTo("histogram") == 0) { - try { - fieldlengthgenerator = new HistogramGenerator(fieldlengthhistogram); - } catch(IOException e) { - throw new WorkloadException("Couldn't read field length histogram file: "+fieldlengthhistogram, e); - } - } else { - throw new WorkloadException("Unknown field length distribution \""+fieldlengthdistribution+"\""); - } - return fieldlengthgenerator; - } - - /** - * Initialize the scenario. - * Called once, in the main client thread, before any operations are started. - */ - public void init(Properties p) throws WorkloadException - { - table = p.getProperty(TABLENAME_PROPERTY,TABLENAME_PROPERTY_DEFAULT); - - fieldcount=Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY,FIELD_COUNT_PROPERTY_DEFAULT)); + + /** + * How many times to retry when insertion of a single item to a DB fails. + */ + public static final String INSERTION_RETRY_LIMIT = "core_workload_insertion_retry_limit"; + public static final String INSERTION_RETRY_LIMIT_DEFAULT = "0"; + + /** + * On average, how long to wait between the retries, in seconds. + */ + public static final String INSERTION_RETRY_INTERVAL = "core_workload_insertion_retry_interval"; + public static final String INSERTION_RETRY_INTERVAL_DEFAULT = "3"; + + NumberGenerator keysequence; + + DiscreteGenerator operationchooser; + + NumberGenerator keychooser; + + NumberGenerator fieldchooser; + + AcknowledgedCounterGenerator transactioninsertkeysequence; + + NumberGenerator scanlength; + + boolean orderedinserts; + + int recordcount; + int zeropadding; + + int insertionRetryLimit; + int insertionRetryInterval; + + private Measurements _measurements = Measurements.getMeasurements(); + + protected static NumberGenerator getFieldLengthGenerator(Properties p) throws WorkloadException { + NumberGenerator fieldlengthgenerator; + String fieldlengthdistribution = p.getProperty( + FIELD_LENGTH_DISTRIBUTION_PROPERTY, FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT); + int fieldlength = + Integer.parseInt(p.getProperty(FIELD_LENGTH_PROPERTY, FIELD_LENGTH_PROPERTY_DEFAULT)); + String fieldlengthhistogram = p.getProperty( + FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY, FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT); + if (fieldlengthdistribution.compareTo("constant") == 0) { + fieldlengthgenerator = new ConstantIntegerGenerator(fieldlength); + } else if (fieldlengthdistribution.compareTo("uniform") == 0) { + fieldlengthgenerator = new UniformIntegerGenerator(1, fieldlength); + } else if (fieldlengthdistribution.compareTo("zipfian") == 0) { + fieldlengthgenerator = new ZipfianGenerator(1, fieldlength); + } else if (fieldlengthdistribution.compareTo("histogram") == 0) { + try { + fieldlengthgenerator = new HistogramGenerator(fieldlengthhistogram); + } catch (IOException e) { + throw new WorkloadException( + "Couldn't read field length histogram file: " + fieldlengthhistogram, e); + } + } else { + throw new WorkloadException( + "Unknown field length distribution \"" + fieldlengthdistribution + "\""); + } + return fieldlengthgenerator; + } + + /** + * Initialize the scenario. + * Called once, in the main client thread, before any operations are started. + */ + @Override + public void init(Properties p) throws WorkloadException { + table = p.getProperty(TABLENAME_PROPERTY, TABLENAME_PROPERTY_DEFAULT); + + fieldcount = + Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT)); fieldnames = new ArrayList<String>(); for (int i = 0; i < fieldcount; i++) { - fieldnames.add("field" + i); + fieldnames.add("field" + i); + } + fieldlengthgenerator = CoreWorkload.getFieldLengthGenerator(p); + + recordcount = + Integer.parseInt(p.getProperty(Client.RECORD_COUNT_PROPERTY, Client.DEFAULT_RECORD_COUNT)); + if (recordcount == 0) { + recordcount = Integer.MAX_VALUE; } - fieldlengthgenerator = CoreWorkload.getFieldLengthGenerator(p); - - double readproportion=Double.parseDouble(p.getProperty(READ_PROPORTION_PROPERTY,READ_PROPORTION_PROPERTY_DEFAULT)); - double updateproportion=Double.parseDouble(p.getProperty(UPDATE_PROPORTION_PROPERTY,UPDATE_PROPORTION_PROPERTY_DEFAULT)); - double insertproportion=Double.parseDouble(p.getProperty(INSERT_PROPORTION_PROPERTY,INSERT_PROPORTION_PROPERTY_DEFAULT)); - double scanproportion=Double.parseDouble(p.getProperty(SCAN_PROPORTION_PROPERTY,SCAN_PROPORTION_PROPERTY_DEFAULT)); - double readmodifywriteproportion=Double.parseDouble(p.getProperty(READMODIFYWRITE_PROPORTION_PROPERTY,READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); - recordcount=Integer.parseInt(p.getProperty(Client.RECORD_COUNT_PROPERTY, Client.DEFAULT_RECORD_COUNT)); - if(recordcount == 0) - recordcount = Integer.MAX_VALUE; - String requestdistrib=p.getProperty(REQUEST_DISTRIBUTION_PROPERTY,REQUEST_DISTRIBUTION_PROPERTY_DEFAULT); - int maxscanlength=Integer.parseInt(p.getProperty(MAX_SCAN_LENGTH_PROPERTY,MAX_SCAN_LENGTH_PROPERTY_DEFAULT)); - String scanlengthdistrib=p.getProperty(SCAN_LENGTH_DISTRIBUTION_PROPERTY,SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT); - - int insertstart=Integer.parseInt(p.getProperty(INSERT_START_PROPERTY,INSERT_START_PROPERTY_DEFAULT)); - - readallfields=Boolean.parseBoolean(p.getProperty(READ_ALL_FIELDS_PROPERTY,READ_ALL_FIELDS_PROPERTY_DEFAULT)); - writeallfields=Boolean.parseBoolean(p.getProperty(WRITE_ALL_FIELDS_PROPERTY,WRITE_ALL_FIELDS_PROPERTY_DEFAULT)); - - dataintegrity = Boolean.parseBoolean(p.getProperty(DATA_INTEGRITY_PROPERTY, DATA_INTEGRITY_PROPERTY_DEFAULT)); - //Confirm that fieldlengthgenerator returns a constant if data - //integrity check requested. - if (dataintegrity && !(p.getProperty(FIELD_LENGTH_DISTRIBUTION_PROPERTY, FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT)).equals("constant")) - { + String requestdistrib = + p.getProperty(REQUEST_DISTRIBUTION_PROPERTY, REQUEST_DISTRIBUTION_PROPERTY_DEFAULT); + int maxscanlength = + Integer.parseInt(p.getProperty(MAX_SCAN_LENGTH_PROPERTY, MAX_SCAN_LENGTH_PROPERTY_DEFAULT)); + String scanlengthdistrib = + p.getProperty(SCAN_LENGTH_DISTRIBUTION_PROPERTY, SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT); + + int insertstart = + Integer.parseInt(p.getProperty(INSERT_START_PROPERTY, INSERT_START_PROPERTY_DEFAULT)); + int insertcount = + Integer.parseInt(p.getProperty(INSERT_COUNT_PROPERTY, String.valueOf(recordcount - insertstart))); + // Confirm valid values for insertstart and insertcount in relation to recordcount + if (recordcount < (insertstart + insertcount)) { + System.err.println("Invalid combination of insertstart, insertcount and recordcount."); + System.err.println("recordcount must be bigger than insertstart + insertcount."); + System.exit(-1); + } + zeropadding = + Integer.parseInt(p.getProperty(ZERO_PADDING_PROPERTY, ZERO_PADDING_PROPERTY_DEFAULT)); + + readallfields = Boolean.parseBoolean( + p.getProperty(READ_ALL_FIELDS_PROPERTY, READ_ALL_FIELDS_PROPERTY_DEFAULT)); + writeallfields = Boolean.parseBoolean( + p.getProperty(WRITE_ALL_FIELDS_PROPERTY, WRITE_ALL_FIELDS_PROPERTY_DEFAULT)); + + dataintegrity = Boolean.parseBoolean( + p.getProperty(DATA_INTEGRITY_PROPERTY, DATA_INTEGRITY_PROPERTY_DEFAULT)); + // Confirm that fieldlengthgenerator returns a constant if data + // integrity check requested. + if (dataintegrity && !(p.getProperty( + FIELD_LENGTH_DISTRIBUTION_PROPERTY, + FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT)).equals("constant")) { System.err.println("Must have constant field size to check data integrity."); System.exit(-1); } - if (p.getProperty(INSERT_ORDER_PROPERTY,INSERT_ORDER_PROPERTY_DEFAULT).compareTo("hashed")==0) - { - orderedinserts=false; - } - else if (requestdistrib.compareTo("exponential")==0) - { - double percentile = Double.parseDouble(p.getProperty(ExponentialGenerator.EXPONENTIAL_PERCENTILE_PROPERTY, - ExponentialGenerator.EXPONENTIAL_PERCENTILE_DEFAULT)); - double frac = Double.parseDouble(p.getProperty(ExponentialGenerator.EXPONENTIAL_FRAC_PROPERTY, - ExponentialGenerator.EXPONENTIAL_FRAC_DEFAULT)); - keychooser = new ExponentialGenerator(percentile, recordcount*frac); - } - else - { - orderedinserts=true; - } - - keysequence=new CounterGenerator(insertstart); - operationchooser=new DiscreteGenerator(); - if (readproportion>0) - { - operationchooser.addValue(readproportion,"READ"); - } - - if (updateproportion>0) - { - operationchooser.addValue(updateproportion,"UPDATE"); - } - - if (insertproportion>0) - { - operationchooser.addValue(insertproportion,"INSERT"); - } - - if (scanproportion>0) - { - operationchooser.addValue(scanproportion,"SCAN"); - } - - if (readmodifywriteproportion>0) - { - operationchooser.addValue(readmodifywriteproportion,"READMODIFYWRITE"); - } - - transactioninsertkeysequence=new CounterGenerator(recordcount); - if (requestdistrib.compareTo("uniform")==0) - { - keychooser=new UniformIntegerGenerator(0,recordcount-1); - } - else if (requestdistrib.compareTo("zipfian")==0) - { - //it does this by generating a random "next key" in part by taking the modulus over the number of keys - //if the number of keys changes, this would shift the modulus, and we don't want that to change which keys are popular - //so we'll actually construct the scrambled zipfian generator with a keyspace that is larger than exists at the beginning - //of the test. that is, we'll predict the number of inserts, and tell the scrambled zipfian generator the number of existing keys - //plus the number of predicted keys as the total keyspace. then, if the generator picks a key that hasn't been inserted yet, will - //just ignore it and pick another key. this way, the size of the keyspace doesn't change from the perspective of the scrambled zipfian generator - - int opcount=Integer.parseInt(p.getProperty(Client.OPERATION_COUNT_PROPERTY)); - int expectednewkeys=(int)(((double)opcount)*insertproportion*2.0); //2 is fudge factor - - keychooser=new ScrambledZipfianGenerator(recordcount+expectednewkeys); - } - else if (requestdistrib.compareTo("latest")==0) - { - keychooser=new SkewedLatestGenerator(transactioninsertkeysequence); - } - else if (requestdistrib.equals("hotspot")) - { - double hotsetfraction = Double.parseDouble(p.getProperty( - HOTSPOT_DATA_FRACTION, HOTSPOT_DATA_FRACTION_DEFAULT)); - double hotopnfraction = Double.parseDouble(p.getProperty( - HOTSPOT_OPN_FRACTION, HOTSPOT_OPN_FRACTION_DEFAULT)); - keychooser = new HotspotIntegerGenerator(0, recordcount - 1, + if (p.getProperty(INSERT_ORDER_PROPERTY, INSERT_ORDER_PROPERTY_DEFAULT).compareTo("hashed") == 0) { + orderedinserts = false; + } else if (requestdistrib.compareTo("exponential") == 0) { + double percentile = Double.parseDouble(p.getProperty( + ExponentialGenerator.EXPONENTIAL_PERCENTILE_PROPERTY, + ExponentialGenerator.EXPONENTIAL_PERCENTILE_DEFAULT)); + double frac = Double.parseDouble(p.getProperty( + ExponentialGenerator.EXPONENTIAL_FRAC_PROPERTY, + ExponentialGenerator.EXPONENTIAL_FRAC_DEFAULT)); + keychooser = new ExponentialGenerator(percentile, recordcount * frac); + } else { + orderedinserts = true; + } + + keysequence = new CounterGenerator(insertstart); + operationchooser = createOperationGenerator(p); + + transactioninsertkeysequence = new AcknowledgedCounterGenerator(recordcount); + if (requestdistrib.compareTo("uniform") == 0) { + keychooser = new UniformIntegerGenerator(insertstart, insertstart + insertcount - 1); + } else if (requestdistrib.compareTo("sequential") == 0) { + keychooser = new SequentialGenerator(insertstart, insertstart + insertcount - 1); + }else if (requestdistrib.compareTo("zipfian") == 0) { + // it does this by generating a random "next key" in part by taking the modulus over the + // number of keys. + // If the number of keys changes, this would shift the modulus, and we don't want that to + // change which keys are popular so we'll actually construct the scrambled zipfian generator + // with a keyspace that is larger than exists at the beginning of the test. that is, we'll predict + // the number of inserts, and tell the scrambled zipfian generator the number of existing keys + // plus the number of predicted keys as the total keyspace. then, if the generator picks a key + // that hasn't been inserted yet, will just ignore it and pick another key. this way, the size of + // the keyspace doesn't change from the perspective of the scrambled zipfian generator + final double insertproportion = Double.parseDouble( + p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); + int opcount = Integer.parseInt(p.getProperty(Client.OPERATION_COUNT_PROPERTY)); + int expectednewkeys = (int) ((opcount) * insertproportion * 2.0); // 2 is fudge factor + + keychooser = new ScrambledZipfianGenerator(insertstart, insertstart + insertcount + expectednewkeys); + } else if (requestdistrib.compareTo("latest") == 0) { + keychooser = new SkewedLatestGenerator(transactioninsertkeysequence); + } else if (requestdistrib.equals("hotspot")) { + double hotsetfraction = + Double.parseDouble(p.getProperty(HOTSPOT_DATA_FRACTION, HOTSPOT_DATA_FRACTION_DEFAULT)); + double hotopnfraction = + Double.parseDouble(p.getProperty(HOTSPOT_OPN_FRACTION, HOTSPOT_OPN_FRACTION_DEFAULT)); + keychooser = new HotspotIntegerGenerator(insertstart, insertstart + insertcount - 1, hotsetfraction, hotopnfraction); + } else { + throw new WorkloadException("Unknown request distribution \"" + requestdistrib + "\""); + } + + fieldchooser = new UniformIntegerGenerator(0, fieldcount - 1); + + if (scanlengthdistrib.compareTo("uniform") == 0) { + scanlength = new UniformIntegerGenerator(1, maxscanlength); + } else if (scanlengthdistrib.compareTo("zipfian") == 0) { + scanlength = new ZipfianGenerator(1, maxscanlength); + } else { + throw new WorkloadException( + "Distribution \"" + scanlengthdistrib + "\" not allowed for scan length"); + } + + insertionRetryLimit = Integer.parseInt(p.getProperty( + INSERTION_RETRY_LIMIT, INSERTION_RETRY_LIMIT_DEFAULT)); + insertionRetryInterval = Integer.parseInt(p.getProperty( + INSERTION_RETRY_INTERVAL, INSERTION_RETRY_INTERVAL_DEFAULT)); + } + + public String buildKeyName(long keynum) { + if (!orderedinserts) { + keynum = Utils.hash(keynum); } - else - { - throw new WorkloadException("Unknown request distribution \""+requestdistrib+"\""); - } - - fieldchooser=new UniformIntegerGenerator(0,fieldcount-1); - - if (scanlengthdistrib.compareTo("uniform")==0) - { - scanlength=new UniformIntegerGenerator(1,maxscanlength); - } - else if (scanlengthdistrib.compareTo("zipfian")==0) - { - scanlength=new ZipfianGenerator(1,maxscanlength); - } - else - { - throw new WorkloadException("Distribution \""+scanlengthdistrib+"\" not allowed for scan length"); - } - } - - public String buildKeyName(long keynum) { - if (!orderedinserts) - { - keynum=Utils.hash(keynum); - } - return "user"+keynum; - } - + String value = Long.toString(keynum); + int fill = zeropadding - value.length(); + String prekey = "user"; + for(int i=0; i<fill; i++) { + prekey += '0'; + } + return prekey + value; + } + /** * Builds a value for a randomly chosen field. */ private HashMap<String, ByteIterator> buildSingleValue(String key) { - HashMap<String,ByteIterator> value = new HashMap<String,ByteIterator>(); + HashMap<String, ByteIterator> value = new HashMap<String, ByteIterator>(); - String fieldkey = fieldnames.get(Integer.parseInt(fieldchooser.nextString())); + String fieldkey = fieldnames.get(fieldchooser.nextValue().intValue()); ByteIterator data; if (dataintegrity) { data = new StringByteIterator(buildDeterministicValue(key, fieldkey)); } else { - //fill with random data - data = new RandomByteIterator(fieldlengthgenerator.nextInt()); + // fill with random data + data = new RandomByteIterator(fieldlengthgenerator.nextValue().longValue()); } - value.put(fieldkey,data); + value.put(fieldkey, data); - return value; + return value; } /** * Builds values for all fields. */ - private HashMap<String, ByteIterator> buildValues(String key) { - HashMap<String,ByteIterator> values = new HashMap<String,ByteIterator>(); + private HashMap<String, ByteIterator> buildValues(String key) { + HashMap<String, ByteIterator> values = new HashMap<String, ByteIterator>(); for (String fieldkey : fieldnames) { ByteIterator data; if (dataintegrity) { data = new StringByteIterator(buildDeterministicValue(key, fieldkey)); } else { - //fill with random data - data = new RandomByteIterator(fieldlengthgenerator.nextInt()); + // fill with random data + data = new RandomByteIterator(fieldlengthgenerator.nextValue().longValue()); } - values.put(fieldkey,data); + values.put(fieldkey, data); } return values; } @@ -520,7 +560,7 @@ public class CoreWorkload extends Workload * Build a deterministic value given the key information. */ private String buildDeterministicValue(String key, String fieldkey) { - int size = fieldlengthgenerator.nextInt(); + int size = fieldlengthgenerator.nextValue().intValue(); StringBuilder sb = new StringBuilder(size); sb.append(key); sb.append(':'); @@ -534,234 +574,290 @@ public class CoreWorkload extends Workload return sb.toString(); } - /** - * Do one insert operation. Because it will be called concurrently from multiple client threads, this - * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - * effects other than DB operations. - */ - public boolean doInsert(DB db, Object threadstate) - { - int keynum=keysequence.nextInt(); - String dbkey = buildKeyName(keynum); - HashMap<String, ByteIterator> values = buildValues(dbkey); - if (db.insert(table,dbkey,values) == 0) - return true; - else - return false; - } - - /** - * Do one transaction operation. Because it will be called concurrently from multiple client threads, this - * function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - * other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - * effects other than DB operations. - */ - public boolean doTransaction(DB db, Object threadstate) - { - String op=operationchooser.nextString(); - - if (op.compareTo("READ")==0) - { - doTransactionRead(db); - } - else if (op.compareTo("UPDATE")==0) - { - doTransactionUpdate(db); - } - else if (op.compareTo("INSERT")==0) - { - doTransactionInsert(db); - } - else if (op.compareTo("SCAN")==0) - { - doTransactionScan(db); - } - else - { - doTransactionReadModifyWrite(db); - } - - return true; - } + /** + * Do one insert operation. Because it will be called concurrently from multiple client threads, + * this function must be thread safe. However, avoid synchronized, or the threads will block waiting + * for each other, and it will be difficult to reach the target throughput. Ideally, this function would + * have no side effects other than DB operations. + */ + @Override + public boolean doInsert(DB db, Object threadstate) { + int keynum = keysequence.nextValue().intValue(); + String dbkey = buildKeyName(keynum); + HashMap<String, ByteIterator> values = buildValues(dbkey); + + Status status; + int numOfRetries = 0; + do { + status = db.insert(table, dbkey, values); + if (status == Status.OK) { + break; + } + // Retry if configured. Without retrying, the load process will fail + // even if one single insertion fails. User can optionally configure + // an insertion retry limit (default is 0) to enable retry. + if (++numOfRetries <= insertionRetryLimit) { + System.err.println("Retrying insertion, retry count: " + numOfRetries); + try { + // Sleep for a random number between [0.8, 1.2)*insertionRetryInterval. + int sleepTime = (int) (1000 * insertionRetryInterval * (0.8 + 0.4 * Math.random())); + Thread.sleep(sleepTime); + } catch (InterruptedException e) { + break; + } + + } else { + System.err.println("Error inserting, not retrying any more. number of attempts: " + numOfRetries + + "Insertion Retry Limit: " + insertionRetryLimit); + break; + + } + } while (true); + + return (status == Status.OK); + } + + /** + * Do one transaction operation. Because it will be called concurrently from multiple client + * threads, this function must be thread safe. However, avoid synchronized, or the threads will block waiting + * for each other, and it will be difficult to reach the target throughput. Ideally, this function would + * have no side effects other than DB operations. + */ + @Override + public boolean doTransaction(DB db, Object threadstate) { + switch (operationchooser.nextString()) { + case "READ": + doTransactionRead(db); + break; + case "UPDATE": + doTransactionUpdate(db); + break; + case "INSERT": + doTransactionInsert(db); + break; + case "SCAN": + doTransactionScan(db); + break; + default: + doTransactionReadModifyWrite(db); + } + + return true; + } /** * Results are reported in the first three buckets of the histogram under - * the label "VERIFY". + * the label "VERIFY". * Bucket 0 means the expected data was returned. * Bucket 1 means incorrect data was returned. - * Bucket 2 means null data was returned when some data was expected. + * Bucket 2 means null data was returned when some data was expected. */ - protected void verifyRow(String key, HashMap<String,ByteIterator> cells) { - int matchType = DATA_INT_MATCH; + protected void verifyRow(String key, HashMap<String, ByteIterator> cells) { + Status verifyStatus = Status.OK; + long startTime = System.nanoTime(); if (!cells.isEmpty()) { for (Map.Entry<String, ByteIterator> entry : cells.entrySet()) { - if (!entry.getValue().toString().equals( - buildDeterministicValue(key, entry.getKey()))) { - matchType = DATA_INT_DEVIATE; + if (!entry.getValue().toString().equals(buildDeterministicValue(key, entry.getKey()))) { + verifyStatus = Status.UNEXPECTED_STATE; break; } } } else { - //This assumes that null data is never valid - matchType = DATA_INT_UNEXPECTED_NULL; + // This assumes that null data is never valid + verifyStatus = Status.ERROR; } - Measurements.getMeasurements().measure("VERIFY", matchType); + long endTime = System.nanoTime(); + _measurements.measure("VERIFY", (int) (endTime - startTime) / 1000); + _measurements.reportStatus("VERIFY", verifyStatus); } - int nextKeynum() { - int keynum; - if(keychooser instanceof ExponentialGenerator) { - do - { - keynum=transactioninsertkeysequence.lastInt() - keychooser.nextInt(); - } - while(keynum < 0); - } else { - do - { - keynum=keychooser.nextInt(); - } - while (keynum > transactioninsertkeysequence.lastInt()); - } - return keynum; + int nextKeynum() { + int keynum; + if (keychooser instanceof ExponentialGenerator) { + do { + keynum = transactioninsertkeysequence.lastValue() - keychooser.nextValue().intValue(); + } while (keynum < 0); + } else { + do { + keynum = keychooser.nextValue().intValue(); + } while (keynum > transactioninsertkeysequence.lastValue()); } + return keynum; + } - public void doTransactionRead(DB db) - { - //choose a random key - int keynum = nextKeynum(); - - String keyname = buildKeyName(keynum); - - HashSet<String> fields=null; + public void doTransactionRead(DB db) { + // choose a random key + int keynum = nextKeynum(); - if (!readallfields) - { - //read a random field - String fieldname=fieldnames.get(Integer.parseInt(fieldchooser.nextString())); + String keyname = buildKeyName(keynum); - fields=new HashSet<String>(); - fields.add(fieldname); - } + HashSet<String> fields = null; - HashMap<String,ByteIterator> cells = - new HashMap<String,ByteIterator>(); - db.read(table,keyname,fields,cells); + if (!readallfields) { + // read a random field + String fieldname = fieldnames.get(fieldchooser.nextValue().intValue()); + + fields = new HashSet<String>(); + fields.add(fieldname); + } else if (dataintegrity) { + // pass the full field list if dataintegrity is on for verification + fields = new HashSet<String>(fieldnames); + } + + HashMap<String, ByteIterator> cells = new HashMap<String, ByteIterator>(); + db.read(table, keyname, fields, cells); if (dataintegrity) { verifyRow(keyname, cells); } - } - - public void doTransactionReadModifyWrite(DB db) - { - //choose a random key - int keynum = nextKeynum(); - - String keyname = buildKeyName(keynum); - - HashSet<String> fields=null; - - if (!readallfields) - { - //read a random field - String fieldname=fieldnames.get(Integer.parseInt(fieldchooser.nextString())); - - fields=new HashSet<String>(); - fields.add(fieldname); - } - - HashMap<String,ByteIterator> values; - - if (writeallfields) - { - //new data for all the fields - values = buildValues(keyname); - } - else - { - //update a random field - values = buildSingleValue(keyname); - } - - //do the transaction - - HashMap<String,ByteIterator> cells = - new HashMap<String,ByteIterator>(); - - - long ist=_measurements.getIntendedtartTimeNs(); - long st = System.nanoTime(); - db.read(table,keyname,fields,cells); - - db.update(table,keyname,values); - - long en=System.nanoTime(); + } + + public void doTransactionReadModifyWrite(DB db) { + // choose a random key + int keynum = nextKeynum(); + + String keyname = buildKeyName(keynum); + + HashSet<String> fields = null; + + if (!readallfields) { + // read a random field + String fieldname = fieldnames.get(fieldchooser.nextValue().intValue()); + + fields = new HashSet<String>(); + fields.add(fieldname); + } + + HashMap<String, ByteIterator> values; + + if (writeallfields) { + // new data for all the fields + values = buildValues(keyname); + } else { + // update a random field + values = buildSingleValue(keyname); + } + + // do the transaction + + HashMap<String, ByteIterator> cells = new HashMap<String, ByteIterator>(); + + + long ist = _measurements.getIntendedtartTimeNs(); + long st = System.nanoTime(); + db.read(table, keyname, fields, cells); + + db.update(table, keyname, values); + + long en = System.nanoTime(); if (dataintegrity) { verifyRow(keyname, cells); } - _measurements .measure("READ-MODIFY-WRITE", (int)((en-st)/1000)); - _measurements .measureIntended("READ-MODIFY-WRITE", (int)((en-ist)/1000)); - } - - public void doTransactionScan(DB db) - { - //choose a random key - int keynum = nextKeynum(); - - String startkeyname = buildKeyName(keynum); - - //choose a random scan length - int len=scanlength.nextInt(); - - HashSet<String> fields=null; - - if (!readallfields) - { - //read a random field - String fieldname=fieldnames.get(Integer.parseInt(fieldchooser.nextString())); - - fields=new HashSet<String>(); - fields.add(fieldname); - } - - db.scan(table,startkeyname,len,fields,new Vector<HashMap<String,ByteIterator>>()); - } - - public void doTransactionUpdate(DB db) - { - //choose a random key - int keynum = nextKeynum(); - - String keyname=buildKeyName(keynum); - - HashMap<String,ByteIterator> values; - - if (writeallfields) - { - //new data for all the fields - values = buildValues(keyname); - } - else - { - //update a random field - values = buildSingleValue(keyname); - } - - db.update(table,keyname,values); - } - - public void doTransactionInsert(DB db) - { - //choose the next key - int keynum=transactioninsertkeysequence.nextInt(); - - String dbkey = buildKeyName(keynum); - - HashMap<String, ByteIterator> values = buildValues(dbkey); - db.insert(table,dbkey,values); - } + _measurements.measure("READ-MODIFY-WRITE", (int) ((en - st) / 1000)); + _measurements.measureIntended("READ-MODIFY-WRITE", (int) ((en - ist) / 1000)); + } + + public void doTransactionScan(DB db) { + // choose a random key + int keynum = nextKeynum(); + + String startkeyname = buildKeyName(keynum); + + // choose a random scan length + int len = scanlength.nextValue().intValue(); + + HashSet<String> fields = null; + + if (!readallfields) { + // read a random field + String fieldname = fieldnames.get(fieldchooser.nextValue().intValue()); + + fields = new HashSet<String>(); + fields.add(fieldname); + } + + db.scan(table, startkeyname, len, fields, new Vector<HashMap<String, ByteIterator>>()); + } + + public void doTransactionUpdate(DB db) { + // choose a random key + int keynum = nextKeynum(); + + String keyname = buildKeyName(keynum); + + HashMap<String, ByteIterator> values; + + if (writeallfields) { + // new data for all the fields + values = buildValues(keyname); + } else { + // update a random field + values = buildSingleValue(keyname); + } + + db.update(table, keyname, values); + } + + public void doTransactionInsert(DB db) { + // choose the next key + int keynum = transactioninsertkeysequence.nextValue(); + + try { + String dbkey = buildKeyName(keynum); + + HashMap<String, ByteIterator> values = buildValues(dbkey); + db.insert(table, dbkey, values); + } finally { + transactioninsertkeysequence.acknowledge(keynum); + } + } + + /** + * Creates a weighted discrete values with database operations for a workload to perform. + * Weights/proportions are read from the properties list and defaults are used + * when values are not configured. + * Current operations are "READ", "UPDATE", "INSERT", "SCAN" and "READMODIFYWRITE". + * @param p The properties list to pull weights from. + * @return A generator that can be used to determine the next operation to perform. + * @throws IllegalArgumentException if the properties object was null. + */ + public static DiscreteGenerator createOperationGenerator(final Properties p) { + if (p == null) { + throw new IllegalArgumentException("Properties object cannot be null"); + } + final double readproportion = Double.parseDouble( + p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); + final double updateproportion = Double.parseDouble( + p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); + final double insertproportion = Double.parseDouble( + p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); + final double scanproportion = Double.parseDouble( + p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); + final double readmodifywriteproportion = Double.parseDouble(p.getProperty( + READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); + + final DiscreteGenerator operationchooser = new DiscreteGenerator(); + if (readproportion > 0) { + operationchooser.addValue(readproportion, "READ"); + } + + if (updateproportion > 0) { + operationchooser.addValue(updateproportion, "UPDATE"); + } + + if (insertproportion > 0) { + operationchooser.addValue(insertproportion, "INSERT"); + } + + if (scanproportion > 0) { + operationchooser.addValue(scanproportion, "SCAN"); + } + + if (readmodifywriteproportion > 0) { + operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); + } + return operationchooser; + } } diff --git a/core/src/main/resources/project.properties b/core/src/main/resources/project.properties new file mode 100644 index 0000000000000000000000000000000000000000..defbd48204e4784090fe0e17e28fe5bc395abf47 --- /dev/null +++ b/core/src/main/resources/project.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/core/src/test/java/com/yahoo/ycsb/TestByteIterator.java b/core/src/test/java/com/yahoo/ycsb/TestByteIterator.java index b95415b09a89e15540983694a7c53ea1870116ce..7edbc947d27061f4e9be1ae4db0661bfe1224e99 100644 --- a/core/src/test/java/com/yahoo/ycsb/TestByteIterator.java +++ b/core/src/test/java/com/yahoo/ycsb/TestByteIterator.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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; import org.testng.annotations.Test; diff --git a/core/src/test/java/com/yahoo/ycsb/TestUtils.java b/core/src/test/java/com/yahoo/ycsb/TestUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..a84eca86bbde9bea4a85f87770da0b034758f8a3 --- /dev/null +++ b/core/src/test/java/com/yahoo/ycsb/TestUtils.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; + +import java.util.Arrays; + +import org.testng.annotations.Test; + +public class TestUtils { + + @Test + public void bytesToFromLong() throws Exception { + byte[] bytes = new byte[8]; + assertEquals(Utils.bytesToLong(bytes), 0L); + assertArrayEquals(Utils.longToBytes(0), bytes); + + bytes[7] = 1; + assertEquals(Utils.bytesToLong(bytes), 1L); + assertArrayEquals(Utils.longToBytes(1L), bytes); + + bytes = new byte[] { 127, -1, -1, -1, -1, -1, -1, -1 }; + assertEquals(Utils.bytesToLong(bytes), Long.MAX_VALUE); + assertArrayEquals(Utils.longToBytes(Long.MAX_VALUE), bytes); + + bytes = new byte[] { -128, 0, 0, 0, 0, 0, 0, 0 }; + assertEquals(Utils.bytesToLong(bytes), Long.MIN_VALUE); + assertArrayEquals(Utils.longToBytes(Long.MIN_VALUE), bytes); + + bytes = new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, + (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF }; + assertEquals(Utils.bytesToLong(bytes), -1L); + assertArrayEquals(Utils.longToBytes(-1L), bytes); + + // if the array is too long we just skip the remainder + bytes = new byte[] { 0, 0, 0, 0, 0, 0, 0, 1, 42, 42, 42 }; + assertEquals(Utils.bytesToLong(bytes), 1L); + } + + @Test + public void bytesToFromDouble() throws Exception { + byte[] bytes = new byte[8]; + assertEquals(Utils.bytesToDouble(bytes), 0, 0.0001); + assertArrayEquals(Utils.doubleToBytes(0), bytes); + + bytes = new byte[] { 63, -16, 0, 0, 0, 0, 0, 0 }; + assertEquals(Utils.bytesToDouble(bytes), 1, 0.0001); + assertArrayEquals(Utils.doubleToBytes(1), bytes); + + bytes = new byte[] { -65, -16, 0, 0, 0, 0, 0, 0 }; + assertEquals(Utils.bytesToDouble(bytes), -1, 0.0001); + assertArrayEquals(Utils.doubleToBytes(-1), bytes); + + bytes = new byte[] { 127, -17, -1, -1, -1, -1, -1, -1 }; + assertEquals(Utils.bytesToDouble(bytes), Double.MAX_VALUE, 0.0001); + assertArrayEquals(Utils.doubleToBytes(Double.MAX_VALUE), bytes); + + bytes = new byte[] { 0, 0, 0, 0, 0, 0, 0, 1 }; + assertEquals(Utils.bytesToDouble(bytes), Double.MIN_VALUE, 0.0001); + assertArrayEquals(Utils.doubleToBytes(Double.MIN_VALUE), bytes); + + bytes = new byte[] { 127, -8, 0, 0, 0, 0, 0, 0 }; + assertTrue(Double.isNaN(Utils.bytesToDouble(bytes))); + assertArrayEquals(Utils.doubleToBytes(Double.NaN), bytes); + + bytes = new byte[] { 63, -16, 0, 0, 0, 0, 0, 0, 42, 42, 42 }; + assertEquals(Utils.bytesToDouble(bytes), 1, 0.0001); + } + + @Test (expectedExceptions = NullPointerException.class) + public void bytesToLongNull() throws Exception { + Utils.bytesToLong(null); + } + + @Test (expectedExceptions = IndexOutOfBoundsException.class) + public void bytesToLongTooShort() throws Exception { + Utils.bytesToLong(new byte[] { 0, 0, 0, 0, 0, 0, 0 }); + } + + @Test (expectedExceptions = IllegalArgumentException.class) + public void bytesToDoubleTooShort() throws Exception { + Utils.bytesToDouble(new byte[] { 0, 0, 0, 0, 0, 0, 0 }); + } + + @Test + public void jvmUtils() throws Exception { + // This should ALWAYS return at least one thread. + assertTrue(Utils.getActiveThreadCount() > 0); + // This should always be greater than 0 or something is goofed up in the JVM. + assertTrue(Utils.getUsedMemoryBytes() > 0); + // Some operating systems may not implement this so we don't have a good + // test. Just make sure it doesn't throw an exception. + Utils.getSystemLoadAverage(); + // This will probably be zero but should never be negative. + assertTrue(Utils.getGCTotalCollectionCount() >= 0); + // Could be zero similar to GC total collection count + assertTrue(Utils.getGCTotalTime() >= 0); + // Could be empty + assertTrue(Utils.getGCStatst().size() >= 0); + } + + /** + * Since this version of TestNG doesn't appear to have an assertArrayEquals, + * this will compare the two to make sure they're the same. + * @param actual Actual array to validate + * @param expected What the array should contain + * @throws AssertionError if the test fails. + */ + public void assertArrayEquals(final byte[] actual, final byte[] expected) { + if (actual == null && expected != null) { + throw new AssertionError("Expected " + Arrays.toString(expected) + + " but found [null]"); + } + if (actual != null && expected == null) { + throw new AssertionError("Expected [null] but found " + + Arrays.toString(actual)); + } + if (actual.length != expected.length) { + throw new AssertionError("Expected length " + expected.length + + " but found " + actual.length); + } + for (int i = 0; i < expected.length; i++) { + if (actual[i] != expected[i]) { + throw new AssertionError("Expected byte [" + expected[i] + + "] at index " + i + " but found [" + actual[i] + "]"); + } + } + } +} \ No newline at end of file diff --git a/core/src/test/java/com/yahoo/ycsb/generator/AcknowledgedCounterGeneratorTest.java b/core/src/test/java/com/yahoo/ycsb/generator/AcknowledgedCounterGeneratorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..f4aa88b4f06a8c2b958e3a16bca5f2ae5f675d8f --- /dev/null +++ b/core/src/test/java/com/yahoo/ycsb/generator/AcknowledgedCounterGeneratorTest.java @@ -0,0 +1,61 @@ +/** + * 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. + */ +package com.yahoo.ycsb.generator; + +import java.util.Random; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; + +import org.testng.annotations.Test; + +/** + * Tests for the AcknowledgedCounterGenerator class. + */ +public class AcknowledgedCounterGeneratorTest { + + /** + * Test that advancing past {@link Integer#MAX_VALUE} works. + */ + @Test + public void testIncrementPastIntegerMaxValue() { + final long toTry = AcknowledgedCounterGenerator.WINDOW_SIZE * 3; + + AcknowledgedCounterGenerator generator = + new AcknowledgedCounterGenerator(Integer.MAX_VALUE - 1000); + + Random rand = new Random(System.currentTimeMillis()); + BlockingQueue<Integer> pending = new ArrayBlockingQueue<Integer>(1000); + for (long i = 0; i < toTry; ++i) { + int value = generator.nextValue(); + + while (!pending.offer(value)) { + + Integer first = pending.poll(); + + // Don't always advance by one. + if (rand.nextBoolean()) { + generator.acknowledge(first); + } else { + Integer second = pending.poll(); + pending.add(first); + generator.acknowledge(second); + } + } + } + + } +} diff --git a/core/src/test/java/com/yahoo/ycsb/generator/TestIncrementingPrintableStringGenerator.java b/core/src/test/java/com/yahoo/ycsb/generator/TestIncrementingPrintableStringGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..eea3d507861563f21ced4c7a12ff168316539159 --- /dev/null +++ b/core/src/test/java/com/yahoo/ycsb/generator/TestIncrementingPrintableStringGenerator.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.generator; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.fail; + +import java.util.NoSuchElementException; + +import org.testng.annotations.Test; + +public class TestIncrementingPrintableStringGenerator { + private final static int[] ATOC = new int[] { 65, 66, 67 }; + + @Test + public void rolloverOK() throws Exception { + final IncrementingPrintableStringGenerator gen = + new IncrementingPrintableStringGenerator(2, ATOC); + + assertNull(gen.lastValue()); + assertEquals(gen.nextValue(), "AA"); + assertEquals(gen.lastValue(), "AA"); + assertEquals(gen.nextValue(), "AB"); + assertEquals(gen.lastValue(), "AB"); + assertEquals(gen.nextValue(), "AC"); + assertEquals(gen.lastValue(), "AC"); + assertEquals(gen.nextValue(), "BA"); + assertEquals(gen.lastValue(), "BA"); + assertEquals(gen.nextValue(), "BB"); + assertEquals(gen.lastValue(), "BB"); + assertEquals(gen.nextValue(), "BC"); + assertEquals(gen.lastValue(), "BC"); + assertEquals(gen.nextValue(), "CA"); + assertEquals(gen.lastValue(), "CA"); + assertEquals(gen.nextValue(), "CB"); + assertEquals(gen.lastValue(), "CB"); + assertEquals(gen.nextValue(), "CC"); + assertEquals(gen.lastValue(), "CC"); + assertEquals(gen.nextValue(), "AA"); // <-- rollover + assertEquals(gen.lastValue(), "AA"); + } + + @Test + public void rolloverOneCharacterOK() throws Exception { + // It would be silly to create a generator with one character. + final IncrementingPrintableStringGenerator gen = + new IncrementingPrintableStringGenerator(2, new int[] { 65 }); + for (int i = 0; i < 5; i++) { + assertEquals(gen.nextValue(), "AA"); + } + } + + @Test + public void rolloverException() throws Exception { + final IncrementingPrintableStringGenerator gen = + new IncrementingPrintableStringGenerator(2, ATOC); + gen.setThrowExceptionOnRollover(true); + + int i = 0; + try { + while(i < 11) { + ++i; + gen.nextValue(); + } + fail("Expected NoSuchElementException"); + } catch (NoSuchElementException e) { + assertEquals(i, 10); + } + } + + @Test + public void rolloverOneCharacterException() throws Exception { + // It would be silly to create a generator with one character. + final IncrementingPrintableStringGenerator gen = + new IncrementingPrintableStringGenerator(2, new int[] { 65 }); + gen.setThrowExceptionOnRollover(true); + + int i = 0; + try { + while(i < 3) { + ++i; + gen.nextValue(); + } + fail("Expected NoSuchElementException"); + } catch (NoSuchElementException e) { + assertEquals(i, 2); + } + } + + @Test + public void invalidLengths() throws Exception { + try { + new IncrementingPrintableStringGenerator(0, ATOC); + fail("Expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { } + + try { + new IncrementingPrintableStringGenerator(-42, ATOC); + fail("Expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { } + } + + @Test + public void invalidCharacterSets() throws Exception { + try { + new IncrementingPrintableStringGenerator(2, null); + fail("Expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { } + + try { + new IncrementingPrintableStringGenerator(2, new int[] {}); + fail("Expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { } + } +} diff --git a/core/src/test/java/com/yahoo/ycsb/generator/TestUnixEpochTimestampGenerator.java b/core/src/test/java/com/yahoo/ycsb/generator/TestUnixEpochTimestampGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..f92ec0f6cfcece57d838e0f28873c7dc6c252216 --- /dev/null +++ b/core/src/test/java/com/yahoo/ycsb/generator/TestUnixEpochTimestampGenerator.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.generator; + +import static org.testng.Assert.assertEquals; + +import java.util.concurrent.TimeUnit; +import org.testng.annotations.Test; + +public class TestUnixEpochTimestampGenerator { + + @Test + public void defaultCtor() throws Exception { + final UnixEpochTimestampGenerator generator = + new UnixEpochTimestampGenerator(); + final long startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 60); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 120); + assertEquals((long) generator.lastValue(), startTime + 60); + assertEquals((long) generator.nextValue(), startTime + 180); + } + + @Test + public void ctorWithIntervalAndUnits() throws Exception { + final UnixEpochTimestampGenerator generator = + new UnixEpochTimestampGenerator(120, TimeUnit.SECONDS); + final long startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 120); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 240); + assertEquals((long) generator.lastValue(), startTime + 120); + } + + @Test + public void ctorWithIntervalAndUnitsAndStart() throws Exception { + final UnixEpochTimestampGenerator generator = + new UnixEpochTimestampGenerator(120, TimeUnit.SECONDS, 1072915200L); + assertEquals((long) generator.nextValue(), 1072915200L); + assertEquals((long) generator.lastValue(), 1072915200L - 120); + assertEquals((long) generator.nextValue(), 1072915200L + 120); + assertEquals((long) generator.lastValue(), 1072915200L); + } + + @Test + public void variousIntervalsAndUnits() throws Exception { + // negatives could happen, just start and roll back in time + UnixEpochTimestampGenerator generator = + new UnixEpochTimestampGenerator(-60, TimeUnit.SECONDS); + long startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime - 60); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime - 120); + assertEquals((long) generator.lastValue(), startTime - 60); + + generator = new UnixEpochTimestampGenerator(100, TimeUnit.NANOSECONDS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 100); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 200); + assertEquals((long) generator.lastValue(), startTime + 100); + + generator = new UnixEpochTimestampGenerator(100, TimeUnit.MICROSECONDS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 100); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 200); + assertEquals((long) generator.lastValue(), startTime + 100); + + generator = new UnixEpochTimestampGenerator(100, TimeUnit.MILLISECONDS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 100); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 200); + assertEquals((long) generator.lastValue(), startTime + 100); + + generator = new UnixEpochTimestampGenerator(100, TimeUnit.SECONDS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + 100); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + 200); + assertEquals((long) generator.lastValue(), startTime + 100); + + generator = new UnixEpochTimestampGenerator(1, TimeUnit.MINUTES); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + (1 * 60)); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + (2 * 60)); + assertEquals((long) generator.lastValue(), startTime + (1 * 60)); + + generator = new UnixEpochTimestampGenerator(1, TimeUnit.HOURS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + (1 * 60 * 60)); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + (2 * 60 * 60)); + assertEquals((long) generator.lastValue(), startTime + (1 * 60 * 60)); + + generator = new UnixEpochTimestampGenerator(1, TimeUnit.DAYS); + startTime = generator.currentValue(); + assertEquals((long) generator.nextValue(), startTime + (1 * 60 * 60 * 24)); + assertEquals((long) generator.lastValue(), startTime); + assertEquals((long) generator.nextValue(), startTime + (2 * 60 * 60 * 24)); + assertEquals((long) generator.lastValue(), startTime + (1 * 60 * 60 * 24)); + } + + // TODO - With PowerMockito we could UT the initializeTimestamp(long) call. + // Otherwise it would involve creating more functions and that would get ugly. +} diff --git a/core/src/test/java/com/yahoo/ycsb/generator/TestZipfianGenerator.java b/core/src/test/java/com/yahoo/ycsb/generator/TestZipfianGenerator.java index 4b7cc2a43ec606dc000684e8e0a907da0a50bb7e..77a77586d58b7021e96da4aad5c83e9b53f03e07 100644 --- a/core/src/test/java/com/yahoo/ycsb/generator/TestZipfianGenerator.java +++ b/core/src/test/java/com/yahoo/ycsb/generator/TestZipfianGenerator.java @@ -30,7 +30,7 @@ public class TestZipfianGenerator { ZipfianGenerator zipfian = new ZipfianGenerator(min, max); for (int i = 0; i < 10000; i++) { - long rnd = zipfian.nextLong(); + long rnd = zipfian.nextValue(); assertFalse(rnd < min); assertFalse(rnd > max); } diff --git a/core/src/test/java/com/yahoo/ycsb/measurements/exporter/TestMeasurementsExporter.java b/core/src/test/java/com/yahoo/ycsb/measurements/exporter/TestMeasurementsExporter.java index 2b33aec39948c022db54bfeb67c80fe0290cd3e1..4aff0941709468e4005e755f37feae5eb1489dc3 100644 --- a/core/src/test/java/com/yahoo/ycsb/measurements/exporter/TestMeasurementsExporter.java +++ b/core/src/test/java/com/yahoo/ycsb/measurements/exporter/TestMeasurementsExporter.java @@ -32,7 +32,9 @@ import static org.testng.AssertJUnit.assertTrue; public class TestMeasurementsExporter { @Test public void testJSONArrayMeasurementsExporter() throws IOException { - Measurements mm = new Measurements(new Properties()); + Properties props = new Properties(); + props.put(Measurements.MEASUREMENT_TYPE_PROPERTY, "histogram"); + Measurements mm = new Measurements(props); ByteArrayOutputStream out = new ByteArrayOutputStream(); JSONArrayMeasurementsExporter export = new JSONArrayMeasurementsExporter(out); @@ -40,7 +42,7 @@ public class TestMeasurementsExporter { long max = 100000; ZipfianGenerator zipfian = new ZipfianGenerator(min, max); for (int i = 0; i < 1000; i++) { - int rnd = zipfian.nextInt(); + int rnd = zipfian.nextValue().intValue(); mm.measure("UPDATE", rnd); } mm.exportMeasurements(export); @@ -50,7 +52,7 @@ public class TestMeasurementsExporter { JsonNode json = mapper.readTree(out.toString("UTF-8")); assertTrue(json.isArray()); assertEquals(json.get(0).get("measurement").asText(), "Operations"); - assertEquals(json.get(3).get("measurement").asText(), "MaxLatency(us)"); - assertEquals(json.get(11).get("measurement").asText(), "5"); + assertEquals(json.get(4).get("measurement").asText(), "MaxLatency(us)"); + assertEquals(json.get(11).get("measurement").asText(), "4"); } } diff --git a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClientConstants.java b/core/src/test/java/com/yahoo/ycsb/workloads/TestCoreWorkload.java similarity index 53% rename from jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClientConstants.java rename to core/src/test/java/com/yahoo/ycsb/workloads/TestCoreWorkload.java index 120cb6452758ab21f8c425fc11b4c96f1bed59ea..d52f29b248cd069596ae1dd5bf9f8473e1fcaa64 100644 --- a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClientConstants.java +++ b/core/src/test/java/com/yahoo/ycsb/workloads/TestCoreWorkload.java @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2010 Yahoo! Inc. All rights reserved. +/** + * Copyright (c) 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 @@ -12,51 +12,59 @@ * 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. + * LICENSE file. */ -package com.yahoo.ycsb.db; +package com.yahoo.ycsb.workloads; -/** - * Constants used by the JDBC client. - * - * @author sudipto - * - */ -public interface JdbcDBClientConstants { +import static org.testng.Assert.assertTrue; - /** The class to use as the jdbc driver. */ - public static final String DRIVER_CLASS = "db.driver"; - - /** The URL to connect to the database. */ - public static final String CONNECTION_URL = "db.url"; - - /** The user name to use to connect to the database. */ - public static final String CONNECTION_USER = "db.user"; - - /** The password to use for establishing the connection. */ - public static final String CONNECTION_PASSWD = "db.passwd"; +import java.util.Properties; - /** The JDBC fetch size hinted to the driver. */ - public static final String JDBC_FETCH_SIZE = "jdbc.fetchsize"; +import org.testng.annotations.Test; - /** The JDBC connection auto-commit property for the driver. */ - public static final String JDBC_AUTO_COMMIT = "jdbc.autocommit"; +import com.yahoo.ycsb.generator.DiscreteGenerator; - /** The name of the property for the number of fields in a record. */ - public static final String FIELD_COUNT_PROPERTY="fieldcount"; - - /** Default number of fields in a record. */ - public static final String FIELD_COUNT_PROPERTY_DEFAULT="10"; - - /** Representing a NULL value. */ - public static final String NULL_VALUE = "NULL"; - - /** The code to return when the call succeeds. */ - public static final int SUCCESS = 0; - - /** The primary key in the user table.*/ - public static String PRIMARY_KEY = "YCSB_KEY"; +public class TestCoreWorkload { + + @Test + public void createOperationChooser() { + final Properties p = new Properties(); + p.setProperty(CoreWorkload.READ_PROPORTION_PROPERTY, "0.20"); + p.setProperty(CoreWorkload.UPDATE_PROPORTION_PROPERTY, "0.20"); + p.setProperty(CoreWorkload.INSERT_PROPORTION_PROPERTY, "0.20"); + p.setProperty(CoreWorkload.SCAN_PROPORTION_PROPERTY, "0.20"); + p.setProperty(CoreWorkload.READMODIFYWRITE_PROPORTION_PROPERTY, "0.20"); + final DiscreteGenerator generator = CoreWorkload.createOperationGenerator(p); + final int[] counts = new int[5]; + + for (int i = 0; i < 100; ++i) { + switch (generator.nextString()) { + case "READ": + ++counts[0]; + break; + case "UPDATE": + ++counts[1]; + break; + case "INSERT": + ++counts[2]; + break; + case "SCAN": + ++counts[3]; + break; + default: + ++counts[4]; + } + } + + for (int i : counts) { + // Doesn't do a wonderful job of equal distribution, but in a hundred, if we + // don't see at least one of each operation then the generator is really broke. + assertTrue(i > 1); + } + } - /** The field name prefix in the table.*/ - public static String COLUMN_PREFIX = "FIELD"; -} + @Test (expectedExceptions = IllegalArgumentException.class) + public void createOperationChooserNullProperties() { + CoreWorkload.createOperationGenerator(null); + } +} \ No newline at end of file diff --git a/couchbase/README.md b/couchbase/README.md index d688d8c95e0a049f6179288a2c1337b44eaf14ef..a49bb60efd89cdb18e45a78959ddfa637e557c81 100644 --- a/couchbase/README.md +++ b/couchbase/README.md @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2015 - 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. +--> + # Couchbase Driver for YCSB This driver is a binding for the YCSB facilities to operate against a Couchbase Server cluster. It uses the official Couchbase Java SDK and provides a rich set of configuration options. @@ -34,6 +51,14 @@ Please see the general instructions in the `doc` folder if you are not sure how bin/ycsb run couchbase -s -P workloads/workloada -p couchbase.useJson=false ``` +## Scans in the CouchbaseClient +The scan operation in the CouchbaseClient requires a Couchbase View to be created manually. To do this: + +1. Go to the Couchbase UI, then to Views +2. Create a new development view, specify a ddoc and view name, use these in your YCSB properties. See Configuration Options below. +3. The default map code is sufficient. +4. Save, and publish this View. + ## Configuration Options Since no setup is the same and the goal of YCSB is to deliver realistic benchmarks, here are some setups that you can tune. Note that if you need more flexibility (let's say a custom transcoder), you still need to extend this driver and implement the facilities on your own. @@ -42,9 +67,11 @@ You can set the following properties (with the default settings applied): - couchbase.url=http://127.0.0.1:8091/pools => The connection URL from one server. - couchbase.bucket=default => The bucket name to use. - couchbase.password= => The password of the bucket. - - couchbase.checkFutures=true => If the futures should be inspected (makes ops sync). - couchbase.persistTo=0 => Observe Persistence ("PersistTo" constraint). - couchbase.replicateTo=0 => Observe Replication ("ReplicateTo" constraint). + - couchbase.ddoc => The ddoc name used for scanning + - couchbase.view => The view name used for scanning + - couchbase.stale => How to deal with stale values in View Query for scanning. (OK, FALSE, UPDATE_AFTER) - couchbase.json=true => Use json or java serialization as target format. diff --git a/couchbase/pom.xml b/couchbase/pom.xml index 07cb0b44ba08e19db28f44b228d24ca78527361f..159e90b20af221fa18a1bd34b62dacc1ce0f886d 100644 --- a/couchbase/pom.xml +++ b/couchbase/pom.xml @@ -1,10 +1,28 @@ <?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"> +<!-- +Copyright (c) 2015-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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> @@ -14,7 +32,7 @@ <dependencies> <dependency> - <groupId>couchbase</groupId> + <groupId>com.couchbase.client</groupId> <artifactId>couchbase-client</artifactId> <version>${couchbase.version}</version> </dependency> @@ -34,12 +52,4 @@ <artifactId>slf4j-api</artifactId> </dependency> </dependencies> - - <repositories> - <repository> - <id>couchbase</id> - <name>Couchbase Maven Repository</name> - <url>http://files.couchbase.com/maven2/</url> - </repository> - </repositories> </project> diff --git a/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java b/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java index 6b072536be1f3c375a0f2053802478045b52c216..4a829202c1d3de52fc8a015249a610fb9534ffb0 100644 --- a/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java +++ b/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2013 Yahoo! Inc. All rights reserved. + * Copyright (c) 2013 - 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 @@ -17,6 +17,7 @@ package com.yahoo.ycsb.db; +import com.couchbase.client.protocol.views.*; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonNode; @@ -25,38 +26,32 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; + import net.spy.memcached.PersistTo; import net.spy.memcached.ReplicateTo; import net.spy.memcached.internal.OperationFuture; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.StringWriter; import java.io.Writer; import java.net.URI; -import java.util.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; /** * A class that wraps the CouchbaseClient to allow it to be interfaced with YCSB. * This class extends {@link DB} and implements the database interface used by YCSB client. - * - * <p> The following options must be passed when using this database client. - * - * <ul> - * <li><b>couchbase.url=http://127.0.0.1:8091/pools</b> The connection URL from one server.</li> - * <li><b>couchbase.bucket=default</b> The bucket name to use./li> - * <li><b>couchbase.password=</b> The password of the bucket.</li> - * <li><b>couchbase.checkFutures=true</b> If the futures should be inspected (makes ops sync).</li> - * <li><b>couchbase.persistTo=0</b> Observe Persistence ("PersistTo" constraint)</li> - * <li><b>couchbase.replicateTo=0</b> Observe Replication ("ReplicateTo" constraint)</li> - * <li><b>couchbase.json=true</b> Use json or java serialization as target format.</li> - * </ul> - * - * @author Michael Nitschinger */ public class CouchbaseClient extends DB { - public static final String URL_PROPERTY = "couchbase.url"; public static final String BUCKET_PROPERTY = "couchbase.bucket"; public static final String PASSWORD_PROPERTY = "couchbase.password"; @@ -64,9 +59,13 @@ public class CouchbaseClient extends DB { public static final String PERSIST_PROPERTY = "couchbase.persistTo"; public static final String REPLICATE_PROPERTY = "couchbase.replicateTo"; public static final String JSON_PROPERTY = "couchbase.json"; + public static final String DESIGN_DOC_PROPERTY = "couchbase.ddoc"; + public static final String VIEW_PROPERTY = "couchbase.view"; + public static final String STALE_PROPERTY = "couchbase.stale"; + public static final String SCAN_PROPERTY = "scanproportion"; - public static final int OK = 0; - public static final int FAILURE = 1; + public static final String STALE_PROPERTY_DEFAULT = Stale.OK.name(); + public static final String SCAN_PROPERTY_DEFAULT = "0.0"; protected static final ObjectMapper JSON_MAPPER = new ObjectMapper(); @@ -75,6 +74,10 @@ public class CouchbaseClient extends DB { private ReplicateTo replicateTo; private boolean checkFutures; private boolean useJson; + private String designDoc; + private String viewName; + private Stale stale; + private View view; private final Logger log = LoggerFactory.getLogger(getClass()); @Override @@ -91,19 +94,30 @@ public class CouchbaseClient extends DB { persistTo = parsePersistTo(props.getProperty(PERSIST_PROPERTY, "0")); replicateTo = parseReplicateTo(props.getProperty(REPLICATE_PROPERTY, "0")); + designDoc = getProperties().getProperty(DESIGN_DOC_PROPERTY); + viewName = getProperties().getProperty(VIEW_PROPERTY); + stale = Stale.valueOf(getProperties().getProperty(STALE_PROPERTY, STALE_PROPERTY_DEFAULT).toUpperCase()); + + Double scanproportion = Double.valueOf(props.getProperty(SCAN_PROPERTY, SCAN_PROPERTY_DEFAULT)); + Properties systemProperties = System.getProperties(); systemProperties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.SLF4JLogger"); System.setProperties(systemProperties); try { - client = new com.couchbase.client.CouchbaseClient( - Arrays.asList(new URI(url)), - bucket, - password - ); + client = new com.couchbase.client.CouchbaseClient(Arrays.asList(new URI(url)), bucket, password); } catch (Exception e) { throw new DBException("Could not create CouchbaseClient object.", e); } + + if (scanproportion > 0) { + try { + view = client.getView(designDoc, viewName); + } catch (Exception e) { + throw new DBException(String.format("%s=%s and %s=%s provided, unable to connect to view.", + DESIGN_DOC_PROPERTY, designDoc, VIEW_PROPERTY, viewName), e.getCause()); + } + } } /** @@ -117,12 +131,16 @@ public class CouchbaseClient extends DB { int value = Integer.parseInt(property); switch (value) { - case 0: return ReplicateTo.ZERO; - case 1: return ReplicateTo.ONE; - case 2: return ReplicateTo.TWO; - case 3: return ReplicateTo.THREE; - default: - throw new DBException(REPLICATE_PROPERTY + " must be between 0 and 3"); + case 0: + return ReplicateTo.ZERO; + case 1: + return ReplicateTo.ONE; + case 2: + return ReplicateTo.TWO; + case 3: + return ReplicateTo.THREE; + default: + throw new DBException(REPLICATE_PROPERTY + " must be between 0 and 3"); } } @@ -137,13 +155,18 @@ public class CouchbaseClient extends DB { int value = Integer.parseInt(property); switch (value) { - case 0: return PersistTo.ZERO; - case 1: return PersistTo.ONE; - case 2: return PersistTo.TWO; - case 3: return PersistTo.THREE; - case 4: return PersistTo.FOUR; - default: - throw new DBException(PERSIST_PROPERTY + " must be between 0 and 4"); + case 0: + return PersistTo.ZERO; + case 1: + return PersistTo.ONE; + case 2: + return PersistTo.TWO; + case 3: + return PersistTo.THREE; + case 4: + return PersistTo.FOUR; + default: + throw new DBException(PERSIST_PROPERTY + " must be between 0 and 4"); } } @@ -156,85 +179,83 @@ public class CouchbaseClient extends DB { } @Override - public int read(final String table, final String key, final Set<String> fields, - final HashMap<String, ByteIterator> result) { + public Status read(final String table, final String key, final Set<String> fields, + final HashMap<String, ByteIterator> result) { String formattedKey = formatKey(table, key); try { Object loaded = client.get(formattedKey); if (loaded == null) { - return FAILURE; + return Status.ERROR; } decode(loaded, fields, result); - return OK; + return Status.OK; } catch (Exception e) { if (log.isErrorEnabled()) { log.error("Could not read value for key " + formattedKey, e); } - return FAILURE; + return Status.ERROR; } } - /** - * Scan is currently not implemented. - * - * @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 FAILURE, because not implemented yet. - */ @Override - public int scan(final String table, final String startkey, final int recordcount, - final Set<String> fields, final Vector<HashMap<String, ByteIterator>> result) { - return FAILURE; + public Status scan(final String table, final String startkey, final int recordcount, final Set<String> fields, + final Vector<HashMap<String, ByteIterator>> result) { + try { + Query query = new Query().setRangeStart(startkey) + .setLimit(recordcount) + .setIncludeDocs(true) + .setStale(stale); + ViewResponse response = client.query(view, query); + + for (ViewRow row : response) { + HashMap<String, ByteIterator> rowMap = new HashMap(); + decode(row.getDocument(), fields, rowMap); + result.add(rowMap); + } + + return Status.OK; + } catch (Exception e) { + log.error(e.getMessage()); + } + + return Status.ERROR; } @Override - public int update(final String table, final String key, final HashMap<String, ByteIterator> values) { + public Status update(final String table, final String key, final HashMap<String, ByteIterator> values) { String formattedKey = formatKey(table, key); try { - final OperationFuture<Boolean> future = client.replace( - formattedKey, - encode(values), - persistTo, - replicateTo - ); + final OperationFuture<Boolean> future = client.replace(formattedKey, encode(values), persistTo, replicateTo); return checkFutureStatus(future); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("Could not update value for key " + formattedKey, e); } - return FAILURE; + return Status.ERROR; } } @Override - public int insert(final String table, final String key, final HashMap<String, ByteIterator> values) { + public Status insert(final String table, final String key, final HashMap<String, ByteIterator> values) { String formattedKey = formatKey(table, key); try { - final OperationFuture<Boolean> future = client.add( - formattedKey, - encode(values), - persistTo, - replicateTo - ); + final OperationFuture<Boolean> future = client.add(formattedKey, encode(values), persistTo, replicateTo); return checkFutureStatus(future); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("Could not insert value for key " + formattedKey, e); } - return FAILURE; + return Status.ERROR; } } @Override - public int delete(final String table, final String key) { + public Status delete(final String table, final String key) { String formattedKey = formatKey(table, key); try { @@ -244,7 +265,7 @@ public class CouchbaseClient extends DB { if (log.isErrorEnabled()) { log.error("Could not delete value for key " + formattedKey, e); } - return FAILURE; + return Status.ERROR; } } @@ -265,11 +286,11 @@ public class CouchbaseClient extends DB { * @param future the future to potentially verify. * @return the status of the future result. */ - private int checkFutureStatus(final OperationFuture<?> future) { + private Status checkFutureStatus(final OperationFuture<?> future) { if (checkFutures) { - return future.getStatus().isSuccess() ? OK : FAILURE; + return future.getStatus().isSuccess() ? Status.OK : Status.ERROR; } else { - return OK; + return Status.OK; } } @@ -280,12 +301,11 @@ public class CouchbaseClient extends DB { * @param fields the fields to check. * @param dest the result passed back to the ycsb core. */ - private void decode(final Object source, final Set<String> fields, - final HashMap<String, ByteIterator> dest) { + private void decode(final Object source, final Set<String> fields, final HashMap<String, ByteIterator> dest) { if (useJson) { try { JsonNode json = JSON_MAPPER.readTree((String) source); - boolean checkFields = fields != null && fields.size() > 0; + boolean checkFields = fields != null && !fields.isEmpty(); for (Iterator<Map.Entry<String, JsonNode>> jsonFields = json.fields(); jsonFields.hasNext();) { Map.Entry<String, JsonNode> jsonField = jsonFields.next(); String name = jsonField.getKey(); @@ -334,6 +354,4 @@ public class CouchbaseClient extends DB { } return writer.toString(); } - - } diff --git a/couchbase/src/main/java/com/yahoo/ycsb/db/package-info.java b/couchbase/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..d1bf90412761b1742de1c35b1068e05c92460337 --- /dev/null +++ b/couchbase/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 - 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. + */ + +/** + * The YCSB binding for <a href="http://www.couchbase.com/">Couchbase</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/couchbase2/README.md b/couchbase2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7986811fbc12f139822f39835d12d672ab2ab6eb --- /dev/null +++ b/couchbase2/README.md @@ -0,0 +1,145 @@ +<!-- +Copyright (c) 2015 - 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. +--> + +# Couchbase (SDK 2.x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a Couchbase Server cluster. It uses the official +Couchbase Java SDK (version 2.x) and provides a rich set of configuration options, including support for the N1QL +query language. + +## Quickstart + +### 1. Start Couchbase Server +You need to start a single node or a cluster to point the client at. Please see [http://couchbase.com](couchbase.com) +for more details and instructions. + +### 2. Set up YCSB +You can either download the release zip and run it, or just clone from master. + +``` +git clone git://github.com/brianfrankcooper/YCSB.git +cd YCSB +mvn clean package +``` + +### 3. Run the Workload +Before you can actually run the workload, you need to "load" the data first. + +``` +bin/ycsb load couchbase2 -s -P workloads/workloada +``` + +Then, you can run the workload: + +``` +bin/ycsb run couchbase2 -s -P workloads/workloada +``` + +Please see the general instructions in the `doc` folder if you are not sure how it all works. You can apply a property +(as seen in the next section) like this: + +``` +bin/ycsb run couchbase -s -P workloads/workloada -p couchbase.epoll=true +``` + +## N1QL Index Setup +In general, every time N1QL is used (either implicitly through using `workloade` or through setting `kv=false`) some +kind of index must be present to make it work. Depending on the workload and data size, choosing the right index is +crucial at runtime in order to get the best performance. If in doubt, please ask at the +[forums](http://forums.couchbase.com) or get in touch with our team at Couchbase. + +For `workloade` and the default `readallfields=true` we recommend creating the following index, and if using Couchbase +Server 4.5 or later with the "Memory Optimized Index" setting on the bucket. + +``` +CREATE PRIMARY INDEX ON `bucketname`; +``` + +Couchbase Server prior to 4.5 may need a slightly different index to deliver the best performance. In those releases +additional covering information may be added to the index with this form. + +``` +-CREATE INDEX wle_idx ON `bucketname`(meta().id); +``` + +For other workloads, different index setups might be even more performant. + +## Performance Considerations +As it is with any benchmark, there are lot of knobs to tune in order to get great or (if you are reading +this and trying to write a competitor benchmark ;-)) bad performance. + +The first setting you should consider, if you are running on Linux 64bit is setting `-p couchbase.epoll=true`. This will +then turn on the Epoll IO mechanisms in the underlying Netty library which provides better performance since it has less +synchronization to do than the NIO default. This only works on Linux, but you are benchmarking on the OS you are +deploying to, right? + +The second option, `boost`, sounds more magic than it actually is. By default this benchmark trades CPU for throughput, +but this can be disabled by setting `-p couchbase.boost=0`. This defaults to 3, and 3 is the number of event loops run +in the IO layer. 3 is a reasonable default but you should set it to the number of **physical** cores you have available +on the machine if you only plan to run one YCSB instance. Make sure (using profiling) to max out your cores, but don't +overdo it. + +## Sync vs Async +By default, since YCSB is sync the code will always wait for the operation to complete. In some cases it can be useful +to just "drive load" and disable the waiting. Note that when the "-p couchbase.syncMutationResponse=false" option is +used, the measured results by YCSB can basically be thrown away. Still helpful sometimes during load phases to speed +them up :) + +## Debugging Latency +The Couchbase Java SDK has the ability to collect and dump different kinds of metrics which allow you to analyze +performance during benchmarking and production. By default this option is disabled in the benchmark, but by setting +`couchbase.networkMetricsInterval` and/or `couchbase.runtimeMetricsInterval` to something greater than 0 it will +output the information as JSON into the configured logger. The number provides is the interval in seconds. If you are +unsure what interval to pick, start with 10 or 30 seconds, depending on your runtime length. + +This is how such logs look like: + +``` +INFO: {"heap.used":{"init":268435456,"used":36500912,"committed":232259584,"max":3817865216},"gc.ps marksweep.collectionTime":0,"gc.ps scavenge.collectionTime":54,"gc.ps scavenge.collectionCount":17,"thread.count":26,"offHeap.used":{"init":2555904,"used":30865944,"committed":31719424,"max":-1},"gc.ps marksweep.collectionCount":0,"heap.pendingFinalize":0,"thread.peakCount":26,"event":{"name":"RuntimeMetrics","type":"METRIC"},"thread.startedCount":28} +INFO: {"localhost/127.0.0.1:11210":{"BINARY":{"ReplaceRequest":{"SUCCESS":{"metrics":{"percentiles":{"50.0":102,"90.0":136,"95.0":155,"99.0":244,"99.9":428},"min":55,"max":1564,"count":35787,"timeUnit":"MICROSECONDS"}}},"GetRequest":{"SUCCESS":{"metrics":{"percentiles":{"50.0":74,"90.0":98,"95.0":110,"99.0":158,"99.9":358},"min":34,"max":2310,"count":35604,"timeUnit":"MICROSECONDS"}}},"GetBucketConfigRequest":{"SUCCESS":{"metrics":{"percentiles":{"50.0":462,"90.0":462,"95.0":462,"99.0":462,"99.9":462},"min":460,"max":462,"count":1,"timeUnit":"MICROSECONDS"}}}}},"event":{"name":"NetworkLatencyMetrics","type":"METRIC"}} +``` + +It is recommended to either feed it into a program which can analyze and visualize JSON or just dump it into a JSON +pretty printer and look at it manually. Since the output can be changed (only by changing the code at the moment), you +can even configure to put those messages into another couchbase bucket and then analyze it through N1QL! You can learn +more about this in general [in the official docs](http://developer.couchbase.com/documentation/server/4.0/sdks/java-2.2/event-bus-metrics.html). + + +## Configuration Options +Since no setup is the same and the goal of YCSB is to deliver realistic benchmarks, here are some setups that you can +tune. Note that if you need more flexibility (let's say a custom transcoder), you still need to extend this driver and +implement the facilities on your own. + +You can set the following properties (with the default settings applied): + + - couchbase.host=127.0.0.1: The hostname from one server. + - couchbase.bucket=default: The bucket name to use. + - couchbase.password=: The password of the bucket. + - couchbase.syncMutationResponse=true: If mutations should wait for the response to complete. + - couchbase.persistTo=0: Persistence durability requirement + - couchbase.replicateTo=0: Replication durability requirement + - couchbase.upsert=false: Use upsert instead of insert or replace. + - couchbase.adhoc=false: If set to true, prepared statements are not used. + - couchbase.kv=true: If set to false, mutation operations will also be performed through N1QL. + - couchbase.maxParallelism=1: The server parallelism for all n1ql queries. + - couchbase.kvEndpoints=1: The number of KV sockets to open per server. + - couchbase.queryEndpoints=5: The number of N1QL Query sockets to open per server. + - couchbase.epoll=false: If Epoll instead of NIO should be used (only available for linux. + - couchbase.boost=3: If > 0 trades CPU for higher throughput. N is the number of event loops, ideally + set to the number of physical cores. Setting higher than that will likely degrade performance. + - couchbase.networkMetricsInterval=0: The interval in seconds when latency metrics will be logged. + - couchbase.runtimeMetricsInterval=0: The interval in seconds when runtime metrics will be logged. + - couchbase.documentExpiry=0: Document Expiry is the amount of time(second) until a document expires in Couchbase. \ No newline at end of file diff --git a/couchbase2/pom.xml b/couchbase2/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..86dde28ed546c5a145966e56f92fc170fd4791a9 --- /dev/null +++ b/couchbase2/pom.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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. +--> + +<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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>couchbase2-binding</artifactId> + <name>Couchbase Java SDK 2.x Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.couchbase.client</groupId> + <artifactId>java-client</artifactId> + <version>${couchbase2.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/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java new file mode 100644 index 0000000000000000000000000000000000000000..7acd9bbbca12b6837445fb424e39492d50da404e --- /dev/null +++ b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java @@ -0,0 +1,940 @@ +/** + * Copyright (c) 2016 Yahoo! Inc. All rights reserved. + * <p> + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.couchbase2; + +import com.couchbase.client.core.env.DefaultCoreEnvironment; +import com.couchbase.client.core.env.resources.IoPoolShutdownHook; +import com.couchbase.client.core.logging.CouchbaseLogger; +import com.couchbase.client.core.logging.CouchbaseLoggerFactory; +import com.couchbase.client.core.metrics.DefaultLatencyMetricsCollectorConfig; +import com.couchbase.client.core.metrics.DefaultMetricsCollectorConfig; +import com.couchbase.client.core.metrics.LatencyMetricsCollectorConfig; +import com.couchbase.client.core.metrics.MetricsCollectorConfig; +import com.couchbase.client.deps.com.fasterxml.jackson.core.JsonFactory; +import com.couchbase.client.deps.com.fasterxml.jackson.core.JsonGenerator; +import com.couchbase.client.deps.com.fasterxml.jackson.databind.JsonNode; +import com.couchbase.client.deps.com.fasterxml.jackson.databind.node.ObjectNode; +import com.couchbase.client.deps.io.netty.channel.DefaultSelectStrategyFactory; +import com.couchbase.client.deps.io.netty.channel.EventLoopGroup; +import com.couchbase.client.deps.io.netty.channel.SelectStrategy; +import com.couchbase.client.deps.io.netty.channel.SelectStrategyFactory; +import com.couchbase.client.deps.io.netty.channel.epoll.EpollEventLoopGroup; +import com.couchbase.client.deps.io.netty.channel.nio.NioEventLoopGroup; +import com.couchbase.client.deps.io.netty.util.IntSupplier; +import com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory; +import com.couchbase.client.java.Bucket; +import com.couchbase.client.java.Cluster; +import com.couchbase.client.java.CouchbaseCluster; +import com.couchbase.client.java.PersistTo; +import com.couchbase.client.java.ReplicateTo; +import com.couchbase.client.java.document.Document; +import com.couchbase.client.java.document.RawJsonDocument; +import com.couchbase.client.java.document.json.JsonArray; +import com.couchbase.client.java.document.json.JsonObject; +import com.couchbase.client.java.env.CouchbaseEnvironment; +import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; +import com.couchbase.client.java.error.TemporaryFailureException; +import com.couchbase.client.java.query.*; +import com.couchbase.client.java.transcoder.JacksonTransformers; +import com.couchbase.client.java.util.Blocking; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; +import rx.Observable; +import rx.Subscriber; +import rx.functions.Action1; +import rx.functions.Func1; + +import java.io.StringWriter; +import java.io.Writer; +import java.nio.channels.spi.SelectorProvider; +import java.util.*; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; + +/** + * A class that wraps the 2.x Couchbase SDK to be used with YCSB. + * + * <p> The following options can be passed when using this database client to override the defaults. + * + * <ul> + * <li><b>couchbase.host=127.0.0.1</b> The hostname from one server.</li> + * <li><b>couchbase.bucket=default</b> The bucket name to use.</li> + * <li><b>couchbase.password=</b> The password of the bucket.</li> + * <li><b>couchbase.syncMutationResponse=true</b> If mutations should wait for the response to complete.</li> + * <li><b>couchbase.persistTo=0</b> Persistence durability requirement</li> + * <li><b>couchbase.replicateTo=0</b> Replication durability requirement</li> + * <li><b>couchbase.upsert=false</b> Use upsert instead of insert or replace.</li> + * <li><b>couchbase.adhoc=false</b> If set to true, prepared statements are not used.</li> + * <li><b>couchbase.kv=true</b> If set to false, mutation operations will also be performed through N1QL.</li> + * <li><b>couchbase.maxParallelism=1</b> The server parallelism for all n1ql queries.</li> + * <li><b>couchbase.kvEndpoints=1</b> The number of KV sockets to open per server.</li> + * <li><b>couchbase.queryEndpoints=5</b> The number of N1QL Query sockets to open per server.</li> + * <li><b>couchbase.epoll=false</b> If Epoll instead of NIO should be used (only available for linux.</li> + * <li><b>couchbase.boost=3</b> If > 0 trades CPU for higher throughput. N is the number of event loops, ideally + * set to the number of physical cores. Setting higher than that will likely degrade performance.</li> + * <li><b>couchbase.networkMetricsInterval=0</b> The interval in seconds when latency metrics will be logged.</li> + * <li><b>couchbase.runtimeMetricsInterval=0</b> The interval in seconds when runtime metrics will be logged.</li> + * <li><b>couchbase.documentExpiry=0</b> Document Expiry is the amount of time until a document expires in + * Couchbase.</li> + * </ul> + */ +public class Couchbase2Client extends DB { + + static { + // No need to send the full encoded_plan for this benchmark workload, less network overhead! + System.setProperty("com.couchbase.query.encodedPlanEnabled", "false"); + } + + private static final String SEPARATOR = ":"; + private static final CouchbaseLogger LOGGER = CouchbaseLoggerFactory.getInstance(Couchbase2Client.class); + private static final Object INIT_COORDINATOR = new Object(); + + private static volatile CouchbaseEnvironment env = null; + + private Cluster cluster; + private Bucket bucket; + private String bucketName; + private boolean upsert; + private PersistTo persistTo; + private ReplicateTo replicateTo; + private boolean syncMutResponse; + private boolean epoll; + private long kvTimeout; + private boolean adhoc; + private boolean kv; + private int maxParallelism; + private String host; + private int kvEndpoints; + private int queryEndpoints; + private int boost; + private int networkMetricsInterval; + private int runtimeMetricsInterval; + private String scanAllQuery; + private int documentExpiry; + + @Override + public void init() throws DBException { + Properties props = getProperties(); + + host = props.getProperty("couchbase.host", "127.0.0.1"); + bucketName = props.getProperty("couchbase.bucket", "default"); + String bucketPassword = props.getProperty("couchbase.password", ""); + + upsert = props.getProperty("couchbase.upsert", "false").equals("true"); + persistTo = parsePersistTo(props.getProperty("couchbase.persistTo", "0")); + replicateTo = parseReplicateTo(props.getProperty("couchbase.replicateTo", "0")); + syncMutResponse = props.getProperty("couchbase.syncMutationResponse", "true").equals("true"); + adhoc = props.getProperty("couchbase.adhoc", "false").equals("true"); + kv = props.getProperty("couchbase.kv", "true").equals("true"); + maxParallelism = Integer.parseInt(props.getProperty("couchbase.maxParallelism", "1")); + kvEndpoints = Integer.parseInt(props.getProperty("couchbase.kvEndpoints", "1")); + queryEndpoints = Integer.parseInt(props.getProperty("couchbase.queryEndpoints", "1")); + epoll = props.getProperty("couchbase.epoll", "false").equals("true"); + boost = Integer.parseInt(props.getProperty("couchbase.boost", "3")); + networkMetricsInterval = Integer.parseInt(props.getProperty("couchbase.networkMetricsInterval", "0")); + runtimeMetricsInterval = Integer.parseInt(props.getProperty("couchbase.runtimeMetricsInterval", "0")); + documentExpiry = Integer.parseInt(props.getProperty("couchbase.documentExpiry", "0")); + scanAllQuery = "SELECT RAW meta().id FROM `" + bucketName + + "` WHERE meta().id >= '$1' ORDER BY meta().id LIMIT $2"; + + try { + synchronized (INIT_COORDINATOR) { + if (env == null) { + + LatencyMetricsCollectorConfig latencyConfig = networkMetricsInterval <= 0 + ? DefaultLatencyMetricsCollectorConfig.disabled() + : DefaultLatencyMetricsCollectorConfig + .builder() + .emitFrequency(networkMetricsInterval) + .emitFrequencyUnit(TimeUnit.SECONDS) + .build(); + + MetricsCollectorConfig runtimeConfig = runtimeMetricsInterval <= 0 + ? DefaultMetricsCollectorConfig.disabled() + : DefaultMetricsCollectorConfig.create(runtimeMetricsInterval, TimeUnit.SECONDS); + + DefaultCouchbaseEnvironment.Builder builder = DefaultCouchbaseEnvironment + .builder() + .queryEndpoints(queryEndpoints) + .callbacksOnIoPool(true) + .runtimeMetricsCollectorConfig(runtimeConfig) + .networkLatencyMetricsCollectorConfig(latencyConfig) + .socketConnectTimeout(10000) // 10 secs socket connect timeout + .connectTimeout(30000) // 30 secs overall bucket open timeout + .kvTimeout(10000) // 10 instead of 2.5s for KV ops + .kvEndpoints(kvEndpoints); + + // Tune boosting and epoll based on settings + SelectStrategyFactory factory = boost > 0 ? + new BackoffSelectStrategyFactory() : DefaultSelectStrategyFactory.INSTANCE; + + int poolSize = boost > 0 ? boost : Integer.parseInt( + System.getProperty("com.couchbase.ioPoolSize", Integer.toString(DefaultCoreEnvironment.IO_POOL_SIZE)) + ); + ThreadFactory threadFactory = new DefaultThreadFactory("cb-io", true); + + EventLoopGroup group = epoll ? new EpollEventLoopGroup(poolSize, threadFactory, factory) + : new NioEventLoopGroup(poolSize, threadFactory, SelectorProvider.provider(), factory); + builder.ioPool(group, new IoPoolShutdownHook(group)); + + env = builder.build(); + logParams(); + } + } + + cluster = CouchbaseCluster.create(env, host); + bucket = cluster.openBucket(bucketName, bucketPassword); + kvTimeout = env.kvTimeout(); + } catch (Exception ex) { + throw new DBException("Could not connect to Couchbase Bucket.", ex); + } + + if (!kv && !syncMutResponse) { + throw new DBException("Not waiting for N1QL responses on mutations not yet implemented."); + } + } + + /** + * Helper method to log the CLI params so that on the command line debugging is easier. + */ + private void logParams() { + StringBuilder sb = new StringBuilder(); + + sb.append("host=").append(host); + sb.append(", bucket=").append(bucketName); + sb.append(", upsert=").append(upsert); + sb.append(", persistTo=").append(persistTo); + sb.append(", replicateTo=").append(replicateTo); + sb.append(", syncMutResponse=").append(syncMutResponse); + sb.append(", adhoc=").append(adhoc); + sb.append(", kv=").append(kv); + sb.append(", maxParallelism=").append(maxParallelism); + sb.append(", queryEndpoints=").append(queryEndpoints); + sb.append(", kvEndpoints=").append(kvEndpoints); + sb.append(", queryEndpoints=").append(queryEndpoints); + sb.append(", epoll=").append(epoll); + sb.append(", boost=").append(boost); + sb.append(", networkMetricsInterval=").append(networkMetricsInterval); + sb.append(", runtimeMetricsInterval=").append(runtimeMetricsInterval); + + LOGGER.info("===> Using Params: " + sb.toString()); + } + + @Override + public Status read(final String table, final String key, Set<String> fields, + final HashMap<String, ByteIterator> result) { + try { + String docId = formatId(table, key); + if (kv) { + return readKv(docId, fields, result); + } else { + return readN1ql(docId, fields, result); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #read(String, String, Set, HashMap)} operation via Key/Value ("get"). + * + * @param docId the document ID + * @param fields the fields to be loaded + * @param result the result map where the doc needs to be converted into + * @return The result of the operation. + */ + private Status readKv(final String docId, final Set<String> fields, final HashMap<String, ByteIterator> result) + throws Exception { + RawJsonDocument loaded = bucket.get(docId, RawJsonDocument.class); + if (loaded == null) { + return Status.NOT_FOUND; + } + decode(loaded.content(), fields, result); + return Status.OK; + } + + /** + * Performs the {@link #read(String, String, Set, HashMap)} operation via N1QL ("SELECT"). + * + * If this option should be used, the "-p couchbase.kv=false" property must be set. + * + * @param docId the document ID + * @param fields the fields to be loaded + * @param result the result map where the doc needs to be converted into + * @return The result of the operation. + */ + private Status readN1ql(final String docId, Set<String> fields, final HashMap<String, ByteIterator> result) + throws Exception { + String readQuery = "SELECT " + joinFields(fields) + " FROM `" + bucketName + "` USE KEYS [$1]"; + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + readQuery, + JsonArray.from(docId), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new DBException("Error while parsing N1QL Result. Query: " + readQuery + + ", Errors: " + queryResult.errors()); + } + + N1qlQueryRow row; + try { + row = queryResult.rows().next(); + } catch (NoSuchElementException ex) { + return Status.NOT_FOUND; + } + + JsonObject content = row.value(); + if (fields == null) { + content = content.getObject(bucketName); // n1ql result set scoped under *.bucketName + fields = content.getNames(); + } + + for (String field : fields) { + Object value = content.get(field); + result.put(field, new StringByteIterator(value != null ? value.toString() : "")); + } + + return Status.OK; + } + + @Override + public Status update(final String table, final String key, final HashMap<String, ByteIterator> values) { + if (upsert) { + return upsert(table, key, values); + } + + try { + String docId = formatId(table, key); + if (kv) { + return updateKv(docId, values); + } else { + return updateN1ql(docId, values); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #update(String, String, HashMap)} operation via Key/Value ("replace"). + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status updateKv(final String docId, final HashMap<String, ByteIterator> values) { + waitForMutationResponse(bucket.async().replace( + RawJsonDocument.create(docId, documentExpiry, encode(values)), + persistTo, + replicateTo + )); + return Status.OK; + } + + /** + * Performs the {@link #update(String, String, HashMap)} operation via N1QL ("UPDATE"). + * + * If this option should be used, the "-p couchbase.kv=false" property must be set. + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status updateN1ql(final String docId, final HashMap<String, ByteIterator> values) + throws Exception { + String fields = encodeN1qlFields(values); + String updateQuery = "UPDATE `" + bucketName + "` USE KEYS [$1] SET " + fields; + + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + updateQuery, + JsonArray.from(docId), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new DBException("Error while parsing N1QL Result. Query: " + updateQuery + + ", Errors: " + queryResult.errors()); + } + return Status.OK; + } + + @Override + public Status insert(final String table, final String key, final HashMap<String, ByteIterator> values) { + if (upsert) { + return upsert(table, key, values); + } + + try { + String docId = formatId(table, key); + if (kv) { + return insertKv(docId, values); + } else { + return insertN1ql(docId, values); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #insert(String, String, HashMap)} operation via Key/Value ("INSERT"). + * + * Note that during the "load" phase it makes sense to retry TMPFAILS (so that even if the server is + * overloaded temporarily the ops will succeed eventually). The current code will retry TMPFAILs + * for maximum of one minute and then bubble up the error. + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status insertKv(final String docId, final HashMap<String, ByteIterator> values) { + int tries = 60; // roughly 60 seconds with the 1 second sleep, not 100% accurate. + + for(int i = 0; i < tries; i++) { + try { + waitForMutationResponse(bucket.async().insert( + RawJsonDocument.create(docId, documentExpiry, encode(values)), + persistTo, + replicateTo + )); + return Status.OK; + } catch (TemporaryFailureException ex) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException("Interrupted while sleeping on TMPFAIL backoff.", ex); + } + } + } + + throw new RuntimeException("Still receiving TMPFAIL from the server after trying " + tries + " times. " + + "Check your server."); + } + + /** + * Performs the {@link #insert(String, String, HashMap)} operation via N1QL ("INSERT"). + * + * If this option should be used, the "-p couchbase.kv=false" property must be set. + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status insertN1ql(final String docId, final HashMap<String, ByteIterator> values) + throws Exception { + String insertQuery = "INSERT INTO `" + bucketName + "`(KEY,VALUE) VALUES ($1,$2)"; + + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + insertQuery, + JsonArray.from(docId, valuesToJsonObject(values)), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new DBException("Error while parsing N1QL Result. Query: " + insertQuery + + ", Errors: " + queryResult.errors()); + } + return Status.OK; + } + + /** + * Performs an upsert instead of insert or update using either Key/Value or N1QL. + * + * If this option should be used, the "-p couchbase.upsert=true" property must be set. + * + * @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 The result of the operation. + */ + private Status upsert(final String table, final String key, final HashMap<String, ByteIterator> values) { + try { + String docId = formatId(table, key); + if (kv) { + return upsertKv(docId, values); + } else { + return upsertN1ql(docId, values); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #upsert(String, String, HashMap)} operation via Key/Value ("upsert"). + * + * If this option should be used, the "-p couchbase.upsert=true" property must be set. + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status upsertKv(final String docId, final HashMap<String, ByteIterator> values) { + waitForMutationResponse(bucket.async().upsert( + RawJsonDocument.create(docId, documentExpiry, encode(values)), + persistTo, + replicateTo + )); + return Status.OK; + } + + /** + * Performs the {@link #upsert(String, String, HashMap)} operation via N1QL ("UPSERT"). + * + * If this option should be used, the "-p couchbase.upsert=true -p couchbase.kv=false" properties must be set. + * + * @param docId the document ID + * @param values the values to update the document with. + * @return The result of the operation. + */ + private Status upsertN1ql(final String docId, final HashMap<String, ByteIterator> values) + throws Exception { + String upsertQuery = "UPSERT INTO `" + bucketName + "`(KEY,VALUE) VALUES ($1,$2)"; + + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + upsertQuery, + JsonArray.from(docId, valuesToJsonObject(values)), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new DBException("Error while parsing N1QL Result. Query: " + upsertQuery + + ", Errors: " + queryResult.errors()); + } + return Status.OK; + } + + @Override + public Status delete(final String table, final String key) { + try { + String docId = formatId(table, key); + if (kv) { + return deleteKv(docId); + } else { + return deleteN1ql(docId); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #delete(String, String)} (String, String)} operation via Key/Value ("remove"). + * + * @param docId the document ID. + * @return The result of the operation. + */ + private Status deleteKv(final String docId) { + waitForMutationResponse(bucket.async().remove( + docId, + persistTo, + replicateTo + )); + return Status.OK; + } + + /** + * Performs the {@link #delete(String, String)} (String, String)} operation via N1QL ("DELETE"). + * + * If this option should be used, the "-p couchbase.kv=false" property must be set. + * + * @param docId the document ID. + * @return The result of the operation. + */ + private Status deleteN1ql(final String docId) throws Exception { + String deleteQuery = "DELETE FROM `" + bucketName + "` USE KEYS [$1]"; + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + deleteQuery, + JsonArray.from(docId), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new DBException("Error while parsing N1QL Result. Query: " + deleteQuery + + ", Errors: " + queryResult.errors()); + } + return Status.OK; + } + + @Override + public Status scan(final String table, final String startkey, final int recordcount, final Set<String> fields, + final Vector<HashMap<String, ByteIterator>> result) { + try { + if (fields == null || fields.isEmpty()) { + return scanAllFields(table, startkey, recordcount, result); + } else { + return scanSpecificFields(table, startkey, recordcount, fields, result); + } + } catch (Exception ex) { + ex.printStackTrace(); + return Status.ERROR; + } + } + + /** + * Performs the {@link #scan(String, String, int, Set, Vector)} operation, optimized for all fields. + * + * Since the full document bodies need to be loaded anyways, it makes sense to just grab the document IDs + * from N1QL and then perform the bulk loading via KV for better performance. This is a usual pattern with + * Couchbase and shows the benefits of using both N1QL and KV together. + * + * @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 result A Vector of HashMaps, where each HashMap is a set field/value pairs for one record + * @return The result of the operation. + */ + private Status scanAllFields(final String table, final String startkey, final int recordcount, + final Vector<HashMap<String, ByteIterator>> result) { + final List<HashMap<String, ByteIterator>> data = new ArrayList<HashMap<String, ByteIterator>>(recordcount); + bucket.async() + .query(N1qlQuery.parameterized( + scanAllQuery, + JsonArray.from(formatId(table, startkey), recordcount), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )) + .doOnNext(new Action1<AsyncN1qlQueryResult>() { + @Override + public void call(AsyncN1qlQueryResult result) { + if (!result.parseSuccess()) { + throw new RuntimeException("Error while parsing N1QL Result. Query: " + scanAllQuery + + ", Errors: " + result.errors()); + } + } + }) + .flatMap(new Func1<AsyncN1qlQueryResult, Observable<AsyncN1qlQueryRow>>() { + @Override + public Observable<AsyncN1qlQueryRow> call(AsyncN1qlQueryResult result) { + return result.rows(); + } + }) + .flatMap(new Func1<AsyncN1qlQueryRow, Observable<RawJsonDocument>>() { + @Override + public Observable<RawJsonDocument> call(AsyncN1qlQueryRow row) { + String id = new String(row.byteValue()).trim(); + return bucket.async().get(id.substring(1, id.length()-1), RawJsonDocument.class); + } + }) + .map(new Func1<RawJsonDocument, HashMap<String, ByteIterator>>() { + @Override + public HashMap<String, ByteIterator> call(RawJsonDocument document) { + HashMap<String, ByteIterator> tuple = new HashMap<String, ByteIterator>(); + decode(document.content(), null, tuple); + return tuple; + } + }) + .toBlocking() + .forEach(new Action1<HashMap<String, ByteIterator>>() { + @Override + public void call(HashMap<String, ByteIterator> tuple) { + data.add(tuple); + } + }); + + result.addAll(data); + return Status.OK; + } + + /** + * Performs the {@link #scan(String, String, int, Set, Vector)} operation N1Ql only for a subset of the fields. + * + * @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 The result of the operation. + */ + private Status scanSpecificFields(final String table, final String startkey, final int recordcount, + final Set<String> fields, final Vector<HashMap<String, ByteIterator>> result) { + String scanSpecQuery = "SELECT " + joinFields(fields) + " FROM `" + bucketName + + "` WHERE meta().id >= '$1' LIMIT $2"; + N1qlQueryResult queryResult = bucket.query(N1qlQuery.parameterized( + scanSpecQuery, + JsonArray.from(formatId(table, startkey), recordcount), + N1qlParams.build().adhoc(adhoc).maxParallelism(maxParallelism) + )); + + if (!queryResult.parseSuccess() || !queryResult.finalSuccess()) { + throw new RuntimeException("Error while parsing N1QL Result. Query: " + scanSpecQuery + + ", Errors: " + queryResult.errors()); + } + + boolean allFields = fields == null || fields.isEmpty(); + result.ensureCapacity(recordcount); + + for (N1qlQueryRow row : queryResult) { + JsonObject value = row.value(); + if (fields == null) { + value = value.getObject(bucketName); + } + Set<String> f = allFields ? value.getNames() : fields; + HashMap<String, ByteIterator> tuple = new HashMap<String, ByteIterator>(f.size()); + for (String field : f) { + tuple.put(field, new StringByteIterator(value.getString(field))); + } + result.add(tuple); + } + return Status.OK; + } + + /** + * Helper method to block on the response, depending on the property set. + * + * By default, since YCSB is sync the code will always wait for the operation to complete. In some + * cases it can be useful to just "drive load" and disable the waiting. Note that when the + * "-p couchbase.syncMutationResponse=false" option is used, the measured results by YCSB can basically + * be thrown away. Still helpful sometimes during load phases to speed them up :) + * + * @param input the async input observable. + */ + private void waitForMutationResponse(final Observable<? extends Document<?>> input) { + if (!syncMutResponse) { + input.subscribe(new Subscriber<Document<?>>() { + @Override + public void onCompleted() { + } + + @Override + public void onError(Throwable e) { + } + + @Override + public void onNext(Document<?> document) { + } + }); + } else { + Blocking.blockForSingle(input, kvTimeout, TimeUnit.MILLISECONDS); + } + } + + /** + * Helper method to turn the values into a String, used with {@link #upsertN1ql(String, HashMap)}. + * + * @param values the values to encode. + * @return the encoded string. + */ + private static String encodeN1qlFields(final HashMap<String, ByteIterator> values) { + if (values.isEmpty()) { + return ""; + } + + StringBuilder sb = new StringBuilder(); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + String raw = entry.getValue().toString(); + String escaped = raw.replace("\"", "\\\"").replace("\'", "\\\'"); + sb.append(entry.getKey()).append("=\"").append(escaped).append("\" "); + } + String toReturn = sb.toString(); + return toReturn.substring(0, toReturn.length() - 1); + } + + /** + * Helper method to turn the map of values into a {@link JsonObject} for further use. + * + * @param values the values to transform. + * @return the created json object. + */ + private static JsonObject valuesToJsonObject(final HashMap<String, ByteIterator> values) { + JsonObject result = JsonObject.create(); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + result.put(entry.getKey(), entry.getValue().toString()); + } + return result; + } + + /** + * Helper method to join the set of fields into a String suitable for N1QL. + * + * @param fields the fields to join. + * @return the joined fields as a String. + */ + private static String joinFields(final Set<String> fields) { + if (fields == null || fields.isEmpty()) { + return "*"; + } + StringBuilder builder = new StringBuilder(); + for (String f : fields) { + builder.append("`").append(f).append("`").append(","); + } + String toReturn = builder.toString(); + return toReturn.substring(0, toReturn.length() - 1); + } + + /** + * Helper method to turn the prefix and key into a proper document ID. + * + * @param prefix the prefix (table). + * @param key the key itself. + * @return a document ID that can be used with Couchbase. + */ + private static String formatId(final String prefix, final String key) { + return prefix + SEPARATOR + key; + } + + /** + * Helper method to parse the "ReplicateTo" property on startup. + * + * @param property the proeprty to parse. + * @return the parsed setting. + */ + private static ReplicateTo parseReplicateTo(final String property) throws DBException { + int value = Integer.parseInt(property); + + switch (value) { + case 0: + return ReplicateTo.NONE; + case 1: + return ReplicateTo.ONE; + case 2: + return ReplicateTo.TWO; + case 3: + return ReplicateTo.THREE; + default: + throw new DBException("\"couchbase.replicateTo\" must be between 0 and 3"); + } + } + + /** + * Helper method to parse the "PersistTo" property on startup. + * + * @param property the proeprty to parse. + * @return the parsed setting. + */ + private static PersistTo parsePersistTo(final String property) throws DBException { + int value = Integer.parseInt(property); + + switch (value) { + case 0: + return PersistTo.NONE; + case 1: + return PersistTo.ONE; + case 2: + return PersistTo.TWO; + case 3: + return PersistTo.THREE; + case 4: + return PersistTo.FOUR; + default: + throw new DBException("\"couchbase.persistTo\" must be between 0 and 4"); + } + } + + /** + * Decode the String from server and pass it into the decoded destination. + * + * @param source the loaded object. + * @param fields the fields to check. + * @param dest the result passed back to YCSB. + */ + private void decode(final String source, final Set<String> fields, + final HashMap<String, ByteIterator> dest) { + try { + JsonNode json = JacksonTransformers.MAPPER.readTree(source); + boolean checkFields = fields != null && !fields.isEmpty(); + for (Iterator<Map.Entry<String, JsonNode>> jsonFields = json.fields(); jsonFields.hasNext();) { + Map.Entry<String, JsonNode> jsonField = jsonFields.next(); + String name = jsonField.getKey(); + if (checkFields && !fields.contains(name)) { + continue; + } + JsonNode jsonValue = jsonField.getValue(); + if (jsonValue != null && !jsonValue.isNull()) { + dest.put(name, new StringByteIterator(jsonValue.asText())); + } + } + } catch (Exception e) { + throw new RuntimeException("Could not decode JSON"); + } + } + + /** + * Encode the source into a String for storage. + * + * @param source the source value. + * @return the encoded string. + */ + private String encode(final HashMap<String, ByteIterator> source) { + HashMap<String, String> stringMap = StringByteIterator.getStringMap(source); + ObjectNode node = JacksonTransformers.MAPPER.createObjectNode(); + for (Map.Entry<String, String> pair : stringMap.entrySet()) { + node.put(pair.getKey(), pair.getValue()); + } + JsonFactory jsonFactory = new JsonFactory(); + Writer writer = new StringWriter(); + try { + JsonGenerator jsonGenerator = jsonFactory.createGenerator(writer); + JacksonTransformers.MAPPER.writeTree(jsonGenerator, node); + } catch (Exception e) { + throw new RuntimeException("Could not encode JSON value"); + } + return writer.toString(); + } +} + +/** + * Factory for the {@link BackoffSelectStrategy} to be used with boosting. + */ +class BackoffSelectStrategyFactory implements SelectStrategyFactory { + @Override + public SelectStrategy newSelectStrategy() { + return new BackoffSelectStrategy(); + } +} + +/** + * Custom IO select strategy which trades CPU for throughput, used with the boost setting. + */ +class BackoffSelectStrategy implements SelectStrategy { + + private int counter = 0; + + @Override + public int calculateStrategy(final IntSupplier supplier, final boolean hasTasks) throws Exception { + int selectNowResult = supplier.get(); + if (hasTasks || selectNowResult != 0) { + counter = 0; + return selectNowResult; + } + counter++; + + if (counter > 2000) { + LockSupport.parkNanos(1); + } else if (counter > 3000) { + Thread.yield(); + } else if (counter > 4000) { + LockSupport.parkNanos(1000); + } else if (counter > 5000) { + // defer to blocking select + counter = 0; + return SelectStrategy.SELECT; + } + + return SelectStrategy.CONTINUE; + } +} diff --git a/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/package-info.java b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..0eb3b3992b30adf338223870471a1e75ed82ab3b --- /dev/null +++ b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 - 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. + */ + +/** + * The YCSB binding for <a href="http://www.couchbase.com/">Couchbase</a>, new driver. + */ +package com.yahoo.ycsb.db.couchbase2; + diff --git a/distribution/pom.xml b/distribution/pom.xml index 09ceb97797769ad1607747c1ba93cf452c5a3ad5..d8af2145d87c60011fdf13e698dc92a1d2ee3eee 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -1,10 +1,27 @@ +<!-- +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>root</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> </parent> <artifactId>ycsb</artifactId> @@ -32,6 +49,16 @@ <artifactId>aerospike-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>arangodb-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>asynchbase-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>cassandra-binding</artifactId> @@ -42,6 +69,11 @@ <artifactId>couchbase-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>couchbase2-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>dynamodb-binding</artifactId> @@ -54,12 +86,32 @@ </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> - <artifactId>gemfire-binding</artifactId> + <artifactId>geode-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>googledatastore-binding</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> - <artifactId>hbase-binding</artifactId> + <artifactId>googlebigtable-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>hbase094-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>hbase098-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>hbase10-binding</artifactId> <version>${project.version}</version> </dependency> <dependency> @@ -77,21 +129,56 @@ <artifactId>jdbc-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>kudu-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>memcached-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>mongodb-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>nosqldb-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>orientdb-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>rados-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>redis-binding</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>riak-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>s3-binding</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>solr-binding</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>tarantool-binding</artifactId> @@ -116,6 +203,7 @@ <descriptor>src/main/assembly/distribution.xml</descriptor> </descriptors> <appendAssemblyId>false</appendAssemblyId> + <tarLongFileMode>posix</tarLongFileMode> </configuration> <executions> <execution> diff --git a/distribution/src/main/assembly/distribution.xml b/distribution/src/main/assembly/distribution.xml index 75eb009700b68a1b3376aceaa18f9618846c08c6..487e1e2ddab3c1ba7c96c004e409ee8ae7244ee9 100644 --- a/distribution/src/main/assembly/distribution.xml +++ b/distribution/src/main/assembly/distribution.xml @@ -1,3 +1,20 @@ +<!-- +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. +--> + <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>package</id> @@ -21,7 +38,7 @@ <outputDirectory>bin</outputDirectory> <fileMode>0755</fileMode> <includes> - <include>ycsb</include> + <include>ycsb*</include> </includes> </fileSet> <fileSet> diff --git a/doc/coreproperties.html b/doc/coreproperties.html index 81b2ede066e7e4f2fef6fa080b0e4f2db0fad6e1..a03e967357a30b70d2416613168648a05dedd241 100644 --- a/doc/coreproperties.html +++ b/doc/coreproperties.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - Core workload package properties</TITLE> </HEAD> diff --git a/doc/coreworkloads.html b/doc/coreworkloads.html index d039ac86fb1b477e9828544efd360842830d5a6f..e6f195a867816706b484ba4d1499b4f3de56a2ad 100644 --- a/doc/coreworkloads.html +++ b/doc/coreworkloads.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - Core workloads</TITLE> </HEAD> diff --git a/doc/dblayer.html b/doc/dblayer.html index 35cdfdbf299ab479b9ac8a4c55e0b6263fd374fb..e75b68149e66d4aeaa4779c66ee41831d335c7cc 100644 --- a/doc/dblayer.html +++ b/doc/dblayer.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - DB Interface Layer</TITLE> </HEAD> diff --git a/doc/index.html b/doc/index.html index 0aeb3eef1483cbfd6214896cfcd6cafa140a91b4..6e2a20dbb2a6fdb9a446942935c31b6eb6e6f1f9 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,4 +1,21 @@ <html> +<!-- +Copyright (c) 2010 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. +--> + <head> <title>YCSB - Yahoo! Cloud Serving Benchmark</title> </head> diff --git a/doc/javadoc/allclasses-frame.html b/doc/javadoc/allclasses-frame.html deleted file mode 100644 index 082b089272b0f7b5af864828df968b1f64e50096..0000000000000000000000000000000000000000 --- a/doc/javadoc/allclasses-frame.html +++ /dev/null @@ -1,89 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -All Classes -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameHeadingFont"> -<B>All Classes</B></FONT> -<BR> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb" target="classFrame">BasicDB</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient5</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient6</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient7</A> -<BR> -<A HREF="com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb" target="classFrame">Client</A> -<BR> -<A HREF="com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb" target="classFrame">CommandLine</A> -<BR> -<A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads" target="classFrame">CoreWorkload</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">CounterGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb" target="classFrame">DB</A> -<BR> -<A HREF="com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb" target="classFrame">DBException</A> -<BR> -<A HREF="com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb" target="classFrame">DBFactory</A> -<BR> -<A HREF="com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb" target="classFrame">DBWrapper</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">DiscreteGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">Generator</A> -<BR> -<A HREF="com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db" target="classFrame">HBaseClient</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">IntegerGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements" target="classFrame">Measurements</A> -<BR> -<A HREF="com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db" target="classFrame">MongoDbClient</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements" target="classFrame">OneMeasurement</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements" target="classFrame">OneMeasurementHistogram</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements" target="classFrame">OneMeasurementTimeSeries</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">ScrambledZipfianGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">SkewedLatestGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">UniformGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">UniformIntegerGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb" target="classFrame">UnknownDBException</A> -<BR> -<A HREF="com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb" target="classFrame">Utils</A> -<BR> -<A HREF="com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb" target="classFrame">Workload</A> -<BR> -<A HREF="com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb" target="classFrame">WorkloadException</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator" target="classFrame">ZipfianGenerator</A> -<BR> -</FONT></TD> -</TR> -</TABLE> - -</BODY> -</HTML> diff --git a/doc/javadoc/allclasses-noframe.html b/doc/javadoc/allclasses-noframe.html deleted file mode 100644 index 3946613595a18929ad0590cc857c7c295e5fb5b9..0000000000000000000000000000000000000000 --- a/doc/javadoc/allclasses-noframe.html +++ /dev/null @@ -1,89 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -All Classes -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameHeadingFont"> -<B>All Classes</B></FONT> -<BR> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<BR> -<A HREF="com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<BR> -<A HREF="com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<BR> -<A HREF="com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<BR> -<A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator">CounterGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<BR> -<A HREF="com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A> -<BR> -<A HREF="com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb">DBFactory</A> -<BR> -<A HREF="com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator">Generator</A> -<BR> -<A HREF="com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<BR> -<A HREF="com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<BR> -<A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator">SkewedLatestGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator">UniformGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator">UniformIntegerGenerator</A> -<BR> -<A HREF="com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A> -<BR> -<A HREF="com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<BR> -<A HREF="com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<BR> -<A HREF="com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A> -<BR> -<A HREF="com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<BR> -</FONT></TD> -</TR> -</TABLE> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/BasicDB.html b/doc/javadoc/com/yahoo/ycsb/BasicDB.html deleted file mode 100644 index 2d27db6ff1e704b4989112408c689b630b256b8f..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/BasicDB.html +++ /dev/null @@ -1,511 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -BasicDB -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="BasicDB"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/BasicDB.html" target="_top"><B>FRAMES</B></A> - <A HREF="BasicDB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class BasicDB</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.BasicDB</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>BasicDB</B><DT>extends <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -Basic DB that just prints out the requested operations, instead of doing them against a database. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY">SIMULATE_DELAY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY_DEFAULT">SIMULATE_DELAY_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#VERBOSE">VERBOSE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#VERBOSE_DEFAULT">VERBOSE_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#BasicDB()">BasicDB</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.DB"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A>, <A HREF="../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A>, <A HREF="../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="VERBOSE"><!-- --></A><H3> -VERBOSE</H3> -<PRE> -public static final java.lang.String <B>VERBOSE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.BasicDB.VERBOSE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="VERBOSE_DEFAULT"><!-- --></A><H3> -VERBOSE_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>VERBOSE_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.BasicDB.VERBOSE_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SIMULATE_DELAY"><!-- --></A><H3> -SIMULATE_DELAY</H3> -<PRE> -public static final java.lang.String <B>SIMULATE_DELAY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.BasicDB.SIMULATE_DELAY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SIMULATE_DELAY_DEFAULT"><!-- --></A><H3> -SIMULATE_DELAY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>SIMULATE_DELAY_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.BasicDB.SIMULATE_DELAY_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="BasicDB()"><!-- --></A><H3> -BasicDB</H3> -<PRE> -public <B>BasicDB</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>()</PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/BasicDB.html" target="_top"><B>FRAMES</B></A> - <A HREF="BasicDB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/Client.html b/doc/javadoc/com/yahoo/ycsb/Client.html deleted file mode 100644 index 4855a52c66a37afa64c7d5c7480af26efd1c1b35..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/Client.html +++ /dev/null @@ -1,386 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -Client -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Client"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Client.html" target="_top"><B>FRAMES</B></A> - <A HREF="Client.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class Client</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.Client</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>Client</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -Main class for executing YCSB. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#INSERT_COUNT_PROPERTY">INSERT_COUNT_PROPERTY</A></B></CODE> - -<BR> - Indicates how many inserts to do, if less than recordcount.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#OPERATION_COUNT_PROPERTY">OPERATION_COUNT_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#RECORD_COUNT_PROPERTY">RECORD_COUNT_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#WORKLOAD_PROPERTY">WORKLOAD_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#Client()">Client</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#checkRequiredProperties(java.util.Properties)">checkRequiredProperties</A></B>(java.util.Properties props)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Client.html#usageMessage()">usageMessage</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="OPERATION_COUNT_PROPERTY"><!-- --></A><H3> -OPERATION_COUNT_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>OPERATION_COUNT_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Client.OPERATION_COUNT_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="RECORD_COUNT_PROPERTY"><!-- --></A><H3> -RECORD_COUNT_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>RECORD_COUNT_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Client.RECORD_COUNT_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="WORKLOAD_PROPERTY"><!-- --></A><H3> -WORKLOAD_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>WORKLOAD_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Client.WORKLOAD_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_COUNT_PROPERTY"><!-- --></A><H3> -INSERT_COUNT_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>INSERT_COUNT_PROPERTY</B></PRE> -<DL> -<DD>Indicates how many inserts to do, if less than recordcount. Useful for partitioning - the load among multiple servers, if the client is the bottleneck. Additionally, workloads - should support the "insertstart" property, which tells them which record to start at. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Client.INSERT_COUNT_PROPERTY">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Client()"><!-- --></A><H3> -Client</H3> -<PRE> -public <B>Client</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="usageMessage()"><!-- --></A><H3> -usageMessage</H3> -<PRE> -public static void <B>usageMessage</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="checkRequiredProperties(java.util.Properties)"><!-- --></A><H3> -checkRequiredProperties</H3> -<PRE> -public static boolean <B>checkRequiredProperties</B>(java.util.Properties props)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Client.html" target="_top"><B>FRAMES</B></A> - <A HREF="Client.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/CounterGenerator.html b/doc/javadoc/com/yahoo/ycsb/CounterGenerator.html deleted file mode 100644 index d3d1f681e23e0a70e5404aec45a54a49b1fe7f40..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/CounterGenerator.html +++ /dev/null @@ -1,270 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -CounterGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.CounterGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="CounterGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/CounterGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="CounterGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class CounterGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.IntegerGenerator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.CounterGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>CounterGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></DL> -</PRE> - -<P> -Generates a sequence of integers 0, 1, ... -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/CounterGenerator.html#CounterGenerator(int)">CounterGenerator</A></B>(int countstart)</CODE> - -<BR> - Create a counter that starts at countstart</TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/CounterGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - If the generator returns numeric (integer) values, return the next value as an int.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.IntegerGenerator"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="CounterGenerator(int)"><!-- --></A><H3> -CounterGenerator</H3> -<PRE> -public <B>CounterGenerator</B>(int countstart)</PRE> -<DL> -<DD>Create a counter that starts at countstart -<P> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>()</PRE> -<DL> -<DD>If the generator returns numeric (integer) values, return the next value as an int. Default is to return -1, which - is appropriate for generators that do not return numeric values. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/CounterGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="CounterGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/DB.html b/doc/javadoc/com/yahoo/ycsb/DB.html deleted file mode 100644 index 199b464fc75b792c8c996382e419ca7ddd135b35..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/DB.html +++ /dev/null @@ -1,482 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -DB -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="DB"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DB.html" target="_top"><B>FRAMES</B></A> - <A HREF="DB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class DB</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.DB</B> -</PRE> -<DL> -<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A>, <A HREF="../../../com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A>, <A HREF="../../../com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A>, <A HREF="../../../com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A>, <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A>, <A HREF="../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A>, <A HREF="../../../com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A></DD> -</DL> -<HR> -<DL> -<DT><PRE>public abstract class <B>DB</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -A layer for accessing a database to be benchmarked. Each thread in the client - will be given its own instance of whatever DB class is to be used in the test. - This class should be constructed using a no-argument constructor, so we can - load it dynamically. Any argument-based initialization should be - done by init(). - - Note that YCSB does not make any use of the return codes returned by this class. - Instead, it keeps a count of the return values and presents them to the user. - - The semantics of methods such as insert, update and delete vary from database - to database. In particular, operations may or may not be durable once these - methods commit, and some systems may return 'success' regardless of whether - or not a tuple with a matching key existed before the call. Rather than dictate - the exact semantics of these methods, we recommend you either implement them - to match the database's default semantics, or the semantics of your - target application. For the sake of comparison between experiments we also - recommend you explain the semantics you chose when presenting performance results. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#DB()">DB</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.util.Properties</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A></B>()</CODE> - -<BR> - Get the set of properties for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></B>(java.util.Properties p)</CODE> - -<BR> - Set the properties for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="DB()"><!-- --></A><H3> -DB</H3> -<PRE> -public <B>DB</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="setProperties(java.util.Properties)"><!-- --></A><H3> -setProperties</H3> -<PRE> -public void <B>setProperties</B>(java.util.Properties p)</PRE> -<DL> -<DD>Set the properties for this DB. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getProperties()"><!-- --></A><H3> -getProperties</H3> -<PRE> -public java.util.Properties <B>getProperties</B>()</PRE> -<DL> -<DD>Get the set of properties for this DB. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public abstract int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error or "not found".</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public abstract int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public abstract int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public abstract int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public abstract int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DB.html" target="_top"><B>FRAMES</B></A> - <A HREF="DB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/DBException.html b/doc/javadoc/com/yahoo/ycsb/DBException.html deleted file mode 100644 index 72e533856ab42b4047553d3bdca26a15588ef329..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/DBException.html +++ /dev/null @@ -1,286 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -DBException -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="DBException"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBException.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class DBException</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Throwable - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Exception - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.DBException</B> -</PRE> -<DL> -<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> -</DL> -<HR> -<DL> -<DT><PRE>public class <B>DBException</B><DT>extends java.lang.Exception</DL> -</PRE> - -<P> -Something bad happened while interacting with the database. -<P> - -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#com.yahoo.ycsb.DBException">Serialized Form</A></DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBException.html#DBException()">DBException</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBException.html#DBException(java.lang.String)">DBException</A></B>(java.lang.String message)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBException.html#DBException(java.lang.String, java.lang.Throwable)">DBException</A></B>(java.lang.String message, - java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBException.html#DBException(java.lang.Throwable)">DBException</A></B>(java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Throwable</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="DBException(java.lang.String)"><!-- --></A><H3> -DBException</H3> -<PRE> -public <B>DBException</B>(java.lang.String message)</PRE> -<DL> -</DL> -<HR> - -<A NAME="DBException()"><!-- --></A><H3> -DBException</H3> -<PRE> -public <B>DBException</B>()</PRE> -<DL> -</DL> -<HR> - -<A NAME="DBException(java.lang.String, java.lang.Throwable)"><!-- --></A><H3> -DBException</H3> -<PRE> -public <B>DBException</B>(java.lang.String message, - java.lang.Throwable cause)</PRE> -<DL> -</DL> -<HR> - -<A NAME="DBException(java.lang.Throwable)"><!-- --></A><H3> -DBException</H3> -<PRE> -public <B>DBException</B>(java.lang.Throwable cause)</PRE> -<DL> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBException.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/DBFactory.html b/doc/javadoc/com/yahoo/ycsb/DBFactory.html deleted file mode 100644 index 6c54102f13970f5b725e7f6c35e26e8f1778d573..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/DBFactory.html +++ /dev/null @@ -1,259 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -DBFactory -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="DBFactory"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBFactory.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBFactory.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class DBFactory</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.DBFactory</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>DBFactory</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -Creates a DB layer by dynamically classloading the specified DB class. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBFactory.html#DBFactory()">DBFactory</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBFactory.html#newDB(java.lang.String, java.util.Properties)">newDB</A></B>(java.lang.String dbname, - java.util.Properties properties)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="DBFactory()"><!-- --></A><H3> -DBFactory</H3> -<PRE> -public <B>DBFactory</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="newDB(java.lang.String, java.util.Properties)"><!-- --></A><H3> -newDB</H3> -<PRE> -public static <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> <B>newDB</B>(java.lang.String dbname, - java.util.Properties properties) - throws <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A></PRE> -<DL> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A></CODE></DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBFactory.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBFactory.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/DBWrapper.html b/doc/javadoc/com/yahoo/ycsb/DBWrapper.html deleted file mode 100644 index 168c837d9961ec598720b527a5c020913f14edcb..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/DBWrapper.html +++ /dev/null @@ -1,491 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -DBWrapper -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="DBWrapper"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBWrapper.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBWrapper.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class DBWrapper</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.DBWrapper</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>DBWrapper</B><DT>extends <A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -Wrapper around a "real" DB that measures latencies and counts return codes. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#DBWrapper(com.yahoo.ycsb.DB)">DBWrapper</A></B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.util.Properties</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#getProperties()">getProperties</A></B>()</CODE> - -<BR> - Get the set of properties for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#setProperties(java.util.Properties)">setProperties</A></B>(java.util.Properties p)</CODE> - -<BR> - Set the properties for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="DBWrapper(com.yahoo.ycsb.DB)"><!-- --></A><H3> -DBWrapper</H3> -<PRE> -public <B>DBWrapper</B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="setProperties(java.util.Properties)"><!-- --></A><H3> -setProperties</H3> -<PRE> -public void <B>setProperties</B>(java.util.Properties p)</PRE> -<DL> -<DD>Set the properties for this DB. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getProperties()"><!-- --></A><H3> -getProperties</H3> -<PRE> -public java.util.Properties <B>getProperties</B>()</PRE> -<DL> -<DD>Get the set of properties for this DB. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DBWrapper.html" target="_top"><B>FRAMES</B></A> - <A HREF="DBWrapper.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/DiscreteGenerator.html b/doc/javadoc/com/yahoo/ycsb/DiscreteGenerator.html deleted file mode 100644 index 5cd28b8eecee22ae2ae264cb59c4cdf01c884452..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/DiscreteGenerator.html +++ /dev/null @@ -1,329 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -DiscreteGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.DiscreteGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="DiscreteGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DiscreteGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="DiscreteGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class DiscreteGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.DiscreteGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>DiscreteGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></DL> -</PRE> - -<P> -Generates a distribution by choosing from a discrete set of values. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html#DiscreteGenerator()">DiscreteGenerator</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html#addValue(double, java.lang.String)">addValue</A></B>(double weight, - java.lang.String value)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html#lastString()">lastString</A></B>()</CODE> - -<BR> - Return the previous string generated by the distribution; e.g., returned from the last nextString() call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - If the generator returns numeric (integer) values, return the next value as an int.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html#nextString()">nextString</A></B>()</CODE> - -<BR> - Generate the next string in the distribution.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="DiscreteGenerator()"><!-- --></A><H3> -DiscreteGenerator</H3> -<PRE> -public <B>DiscreteGenerator</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextString()"><!-- --></A><H3> -nextString</H3> -<PRE> -public java.lang.String <B>nextString</B>()</PRE> -<DL> -<DD>Generate the next string in the distribution. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#nextString()">nextString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>() - throws <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></PRE> -<DL> -<DD>If the generator returns numeric (integer) values, return the next value as an int. Default is to return -1, which - is appropriate for generators that do not return numeric values. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></CODE> - if this generator does not support integer values</DL> -</DD> -</DL> -<HR> - -<A NAME="lastString()"><!-- --></A><H3> -lastString</H3> -<PRE> -public java.lang.String <B>lastString</B>()</PRE> -<DL> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - been called, lastString() should return something reasonable. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#lastString()">lastString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="addValue(double, java.lang.String)"><!-- --></A><H3> -addValue</H3> -<PRE> -public void <B>addValue</B>(double weight, - java.lang.String value)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/DiscreteGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="DiscreteGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/FindGoodAB.html b/doc/javadoc/com/yahoo/ycsb/FindGoodAB.html deleted file mode 100644 index d9fc418f0b22f78added7242356be4943ddb1638..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/FindGoodAB.html +++ /dev/null @@ -1,360 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Tue Apr 20 15:39:16 PDT 2010 --> -<TITLE> -FindGoodAB -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.FindGoodAB class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="FindGoodAB"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/FindGoodAB.html" target="_top"><B>FRAMES</B></A> - <A HREF="FindGoodAB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class FindGoodAB</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.FindGoodAB</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>FindGoodAB</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#a">a</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#b">b</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#FindGoodAB()">FindGoodAB</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#hash(int, int)">hash</A></B>(int val, - int itemcount)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#scramble(int)">scramble</A></B>(int val)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodAB.html#testVector(int)">testVector</A></B>(int itemcount)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="a"><!-- --></A><H3> -a</H3> -<PRE> -public static int <B>a</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="b"><!-- --></A><H3> -b</H3> -<PRE> -public static int <B>b</B></PRE> -<DL> -<DL> -</DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="FindGoodAB()"><!-- --></A><H3> -FindGoodAB</H3> -<PRE> -public <B>FindGoodAB</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="scramble(int)"><!-- --></A><H3> -scramble</H3> -<PRE> -public static int <B>scramble</B>(int val)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="hash(int, int)"><!-- --></A><H3> -hash</H3> -<PRE> -public static int <B>hash</B>(int val, - int itemcount)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="testVector(int)"><!-- --></A><H3> -testVector</H3> -<PRE> -public static int <B>testVector</B>(int itemcount)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/FindGoodAB.html" target="_top"><B>FRAMES</B></A> - <A HREF="FindGoodAB.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/FindGoodScrambleVector.html b/doc/javadoc/com/yahoo/ycsb/FindGoodScrambleVector.html deleted file mode 100644 index 0157c76c97e2c95758af465398aeb516b0255322..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/FindGoodScrambleVector.html +++ /dev/null @@ -1,306 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Tue Apr 20 15:39:16 PDT 2010 --> -<TITLE> -FindGoodScrambleVector -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.FindGoodScrambleVector class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="FindGoodScrambleVector"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/FindGoodAB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/FindGoodScrambleVector.html" target="_top"><B>FRAMES</B></A> - <A HREF="FindGoodScrambleVector.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class FindGoodScrambleVector</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.FindGoodScrambleVector</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>FindGoodScrambleVector</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html#FindGoodScrambleVector()">FindGoodScrambleVector</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html#hash(int, int)">hash</A></B>(int val, - int itemcount)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html#scramble(int)">scramble</A></B>(int val)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int[]</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/FindGoodScrambleVector.html#scrambleArray()">scrambleArray</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="FindGoodScrambleVector()"><!-- --></A><H3> -FindGoodScrambleVector</H3> -<PRE> -public <B>FindGoodScrambleVector</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="scrambleArray()"><!-- --></A><H3> -scrambleArray</H3> -<PRE> -public static int[] <B>scrambleArray</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="scramble(int)"><!-- --></A><H3> -scramble</H3> -<PRE> -public static int <B>scramble</B>(int val)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="hash(int, int)"><!-- --></A><H3> -hash</H3> -<PRE> -public static int <B>hash</B>(int val, - int itemcount)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>args</CODE> - </DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/FindGoodAB.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/FindGoodScrambleVector.html" target="_top"><B>FRAMES</B></A> - <A HREF="FindGoodScrambleVector.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/Generator.html b/doc/javadoc/com/yahoo/ycsb/Generator.html deleted file mode 100644 index cf8462d02cf91e48e07c155fedfbacdea172dc6b..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/Generator.html +++ /dev/null @@ -1,279 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -Generator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.Generator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="Generator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Generator.html" target="_top"><B>FRAMES</B></A> - <A HREF="Generator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class Generator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.Generator</B> -</PRE> -<DL> -<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html" title="class in com.yahoo.ycsb">DiscreteGenerator</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A>, <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb">UniformGenerator</A></DD> -</DL> -<HR> -<DL> -<DT><PRE>public abstract class <B>Generator</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -An expression that generates a sequence of string values, following some distribution (Uniform, Zipfian, Sequential, etc.) -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Generator.html#Generator()">Generator</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Generator.html#lastString()">lastString</A></B>()</CODE> - -<BR> - Return the previous string generated by the distribution; e.g., returned from the last nextString() call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Generator.html#nextString()">nextString</A></B>()</CODE> - -<BR> - Generate the next string in the distribution.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Generator()"><!-- --></A><H3> -Generator</H3> -<PRE> -public <B>Generator</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextString()"><!-- --></A><H3> -nextString</H3> -<PRE> -public abstract java.lang.String <B>nextString</B>()</PRE> -<DL> -<DD>Generate the next string in the distribution. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="lastString()"><!-- --></A><H3> -lastString</H3> -<PRE> -public abstract java.lang.String <B>lastString</B>()</PRE> -<DL> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - been called, lastString() should return something reasonable. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DiscreteGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Generator.html" target="_top"><B>FRAMES</B></A> - <A HREF="Generator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/IntegerGenerator.html b/doc/javadoc/com/yahoo/ycsb/IntegerGenerator.html deleted file mode 100644 index c8b29b9bd3b6faacc3d864fbce568ded8cc23b2b..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/IntegerGenerator.html +++ /dev/null @@ -1,355 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -IntegerGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.IntegerGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="IntegerGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/IntegerGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="IntegerGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class IntegerGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.IntegerGenerator</B> -</PRE> -<DL> -<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/yahoo/ycsb/CounterGenerator.html" title="class in com.yahoo.ycsb">CounterGenerator</A>, <A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb">ScrambledZipfianGenerator</A>, <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb">SkewedLatestGenerator</A>, <A HREF="../../../com/yahoo/ycsb/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb">UniformIntegerGenerator</A>, <A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html" title="class in com.yahoo.ycsb">ZipfianGenerator</A></DD> -</DL> -<HR> -<DL> -<DT><PRE>public abstract class <B>IntegerGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></DL> -</PRE> - -<P> -A generator that is capable of generating ints as well as strings -<P> - -<P> -<DL> -<DT><B>Author:</B></DT> - <DD>cooperb</DD> -</DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#IntegerGenerator()">IntegerGenerator</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A></B>()</CODE> - -<BR> - Return the previous int generated by the distribution.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A></B>()</CODE> - -<BR> - Return the previous string generated by the distribution; e.g., returned from the last nextString() call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - Return the next value as an int.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A></B>()</CODE> - -<BR> - Generate the next string in the distribution.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></B>(int last)</CODE> - -<BR> - Set the last value generated.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="IntegerGenerator()"><!-- --></A><H3> -IntegerGenerator</H3> -<PRE> -public <B>IntegerGenerator</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="setLastInt(int)"><!-- --></A><H3> -setLastInt</H3> -<PRE> -public void <B>setLastInt</B>(int last)</PRE> -<DL> -<DD>Set the last value generated. IntegerGenerator subclasses must use this call - to properly set the last string value, or the lastString() and lastInt() calls won't work. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public abstract int <B>nextInt</B>()</PRE> -<DL> -<DD>Return the next value as an int. When overriding this method, be sure to call setLastString() properly, or the lastString() call won't work. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="nextString()"><!-- --></A><H3> -nextString</H3> -<PRE> -public java.lang.String <B>nextString</B>()</PRE> -<DL> -<DD>Generate the next string in the distribution. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#nextString()">nextString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="lastString()"><!-- --></A><H3> -lastString</H3> -<PRE> -public java.lang.String <B>lastString</B>()</PRE> -<DL> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - been called, lastString() should return something reasonable. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#lastString()">lastString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="lastInt()"><!-- --></A><H3> -lastInt</H3> -<PRE> -public int <B>lastInt</B>()</PRE> -<DL> -<DD>Return the previous int generated by the distribution. This call is unique to IntegerGenerator subclasses, and assumes - IntegerGenerator subclasses always return ints for nextInt() (e.g. not arbitrary strings). -<P> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/IntegerGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="IntegerGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/Measurements.html b/doc/javadoc/com/yahoo/ycsb/Measurements.html deleted file mode 100644 index 9b1725fd352933ebdc95ca361d48e87af85b50ea..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/Measurements.html +++ /dev/null @@ -1,354 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -Measurements -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.Measurements class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="Measurements"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Measurements.html" target="_top"><B>FRAMES</B></A> - <A HREF="Measurements.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class Measurements</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.Measurements</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>Measurements</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -Collects latency measurements, and reports them when requested. -<P> - -<P> -<DL> -<DT><B>Author:</B></DT> - <DD>cooperb</DD> -</DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#Measurements(java.util.Properties)">Measurements</A></B>(java.util.Properties props)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb">Measurements</A></CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#getMeasurements()">getMeasurements</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#getSummary()">getSummary</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#measure(java.lang.String, int)">measure</A></B>(java.lang.String operation, - int latency)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#printReport(java.io.PrintStream)">printReport</A></B>(java.io.PrintStream out)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#reportReturnCode(java.lang.String, int)">reportReturnCode</A></B>(java.lang.String operation, - int code)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Measurements.html#setProperties(java.util.Properties)">setProperties</A></B>(java.util.Properties props)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Measurements(java.util.Properties)"><!-- --></A><H3> -Measurements</H3> -<PRE> -public <B>Measurements</B>(java.util.Properties props)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="setProperties(java.util.Properties)"><!-- --></A><H3> -setProperties</H3> -<PRE> -public static void <B>setProperties</B>(java.util.Properties props)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getMeasurements()"><!-- --></A><H3> -getMeasurements</H3> -<PRE> -public static <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb">Measurements</A> <B>getMeasurements</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="measure(java.lang.String, int)"><!-- --></A><H3> -measure</H3> -<PRE> -public void <B>measure</B>(java.lang.String operation, - int latency)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="reportReturnCode(java.lang.String, int)"><!-- --></A><H3> -reportReturnCode</H3> -<PRE> -public void <B>reportReturnCode</B>(java.lang.String operation, - int code)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="printReport(java.io.PrintStream)"><!-- --></A><H3> -printReport</H3> -<PRE> -public void <B>printReport</B>(java.io.PrintStream out)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getSummary()"><!-- --></A><H3> -getSummary</H3> -<PRE> -public java.lang.String <B>getSummary</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Measurements.html" target="_top"><B>FRAMES</B></A> - <A HREF="Measurements.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/OneMeasurement.html b/doc/javadoc/com/yahoo/ycsb/OneMeasurement.html deleted file mode 100644 index cc3b9c0d3670e1d3278b0eb6e4ee3507ff6859c6..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/OneMeasurement.html +++ /dev/null @@ -1,332 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -OneMeasurement -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.OneMeasurement class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="OneMeasurement"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurement.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurement.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class OneMeasurement</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.OneMeasurement</B> -</PRE> -<DL> -<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb">OneMeasurementHistogram</A>, <A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb">OneMeasurementTimeSeries</A></DD> -</DL> -<HR> -<DL> -<DT><PRE>public abstract class <B>OneMeasurement</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -A single measured metric (e.g. READ LATENCY) -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#OneMeasurement(java.lang.String)">OneMeasurement</A></B>(java.lang.String _name)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getName()">getName</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getSummary()">getSummary</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#measure(int)">measure</A></B>(int latency)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#printReport(java.io.PrintStream)">printReport</A></B>(java.io.PrintStream out)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#reportReturnCode(int)">reportReturnCode</A></B>(int code)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="OneMeasurement(java.lang.String)"><!-- --></A><H3> -OneMeasurement</H3> -<PRE> -public <B>OneMeasurement</B>(java.lang.String _name)</PRE> -<DL> -<DL> -<DT><B>Parameters:</B><DD><CODE>_name</CODE> - </DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="getName()"><!-- --></A><H3> -getName</H3> -<PRE> -public java.lang.String <B>getName</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="reportReturnCode(int)"><!-- --></A><H3> -reportReturnCode</H3> -<PRE> -public abstract void <B>reportReturnCode</B>(int code)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="measure(int)"><!-- --></A><H3> -measure</H3> -<PRE> -public abstract void <B>measure</B>(int latency)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="printReport(java.io.PrintStream)"><!-- --></A><H3> -printReport</H3> -<PRE> -public abstract void <B>printReport</B>(java.io.PrintStream out)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getSummary()"><!-- --></A><H3> -getSummary</H3> -<PRE> -public abstract java.lang.String <B>getSummary</B>()</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Measurements.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurement.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurement.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/OneMeasurementHistogram.html b/doc/javadoc/com/yahoo/ycsb/OneMeasurementHistogram.html deleted file mode 100644 index 739a868cac860ecdc93313adc4601d43cd739dd5..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/OneMeasurementHistogram.html +++ /dev/null @@ -1,390 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -OneMeasurementHistogram -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.OneMeasurementHistogram class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="OneMeasurementHistogram"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurementHistogram.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurementHistogram.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class OneMeasurementHistogram</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.OneMeasurement</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.OneMeasurementHistogram</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>OneMeasurementHistogram</B><DT>extends <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></DL> -</PRE> - -<P> -Take measurements and maintain a histogram of a given metric, such as READ LATENCY. -<P> - -<P> -<DL> -<DT><B>Author:</B></DT> - <DD>cooperb</DD> -</DL> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#BUCKETS">BUCKETS</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#BUCKETS_DEFAULT">BUCKETS_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#OneMeasurementHistogram(java.lang.String, java.util.Properties)">OneMeasurementHistogram</A></B>(java.lang.String name, - java.util.Properties props)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#getSummary()">getSummary</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#measure(int)">measure</A></B>(int latency)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#printReport(java.io.PrintStream)">printReport</A></B>(java.io.PrintStream out)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html#reportReturnCode(int)">reportReturnCode</A></B>(int code)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.OneMeasurement"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getName()">getName</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="BUCKETS"><!-- --></A><H3> -BUCKETS</H3> -<PRE> -public static final java.lang.String <B>BUCKETS</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.OneMeasurementHistogram.BUCKETS">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="BUCKETS_DEFAULT"><!-- --></A><H3> -BUCKETS_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>BUCKETS_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.OneMeasurementHistogram.BUCKETS_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="OneMeasurementHistogram(java.lang.String, java.util.Properties)"><!-- --></A><H3> -OneMeasurementHistogram</H3> -<PRE> -public <B>OneMeasurementHistogram</B>(java.lang.String name, - java.util.Properties props)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="reportReturnCode(int)"><!-- --></A><H3> -reportReturnCode</H3> -<PRE> -public void <B>reportReturnCode</B>(int code)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#reportReturnCode(int)">reportReturnCode</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="measure(int)"><!-- --></A><H3> -measure</H3> -<PRE> -public void <B>measure</B>(int latency)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#measure(int)">measure</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="printReport(java.io.PrintStream)"><!-- --></A><H3> -printReport</H3> -<PRE> -public void <B>printReport</B>(java.io.PrintStream out)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#printReport(java.io.PrintStream)">printReport</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getSummary()"><!-- --></A><H3> -getSummary</H3> -<PRE> -public java.lang.String <B>getSummary</B>()</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getSummary()">getSummary</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurementHistogram.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurementHistogram.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/OneMeasurementTimeSeries.html b/doc/javadoc/com/yahoo/ycsb/OneMeasurementTimeSeries.html deleted file mode 100644 index cef9fa8c959820774a4dbc05828b7268e999aff3..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/OneMeasurementTimeSeries.html +++ /dev/null @@ -1,388 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -OneMeasurementTimeSeries -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.OneMeasurementTimeSeries class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="OneMeasurementTimeSeries"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurementTimeSeries.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurementTimeSeries.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class OneMeasurementTimeSeries</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.OneMeasurement</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.OneMeasurementTimeSeries</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>OneMeasurementTimeSeries</B><DT>extends <A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></DL> -</PRE> - -<P> -A time series measurement of a metric, such as READ LATENCY. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#GRANULARITY">GRANULARITY</A></B></CODE> - -<BR> - Granularity for time series; measurements will be averaged in chunks of this granularity.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#GRANULARITY_DEFAULT">GRANULARITY_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#OneMeasurementTimeSeries(java.lang.String, java.util.Properties)">OneMeasurementTimeSeries</A></B>(java.lang.String name, - java.util.Properties props)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#getSummary()">getSummary</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#measure(int)">measure</A></B>(int latency)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#printReport(java.io.PrintStream)">printReport</A></B>(java.io.PrintStream out)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html#reportReturnCode(int)">reportReturnCode</A></B>(int code)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.OneMeasurement"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getName()">getName</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="GRANULARITY"><!-- --></A><H3> -GRANULARITY</H3> -<PRE> -public static final java.lang.String <B>GRANULARITY</B></PRE> -<DL> -<DD>Granularity for time series; measurements will be averaged in chunks of this granularity. Units are milliseconds. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.OneMeasurementTimeSeries.GRANULARITY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="GRANULARITY_DEFAULT"><!-- --></A><H3> -GRANULARITY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>GRANULARITY_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.OneMeasurementTimeSeries.GRANULARITY_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="OneMeasurementTimeSeries(java.lang.String, java.util.Properties)"><!-- --></A><H3> -OneMeasurementTimeSeries</H3> -<PRE> -public <B>OneMeasurementTimeSeries</B>(java.lang.String name, - java.util.Properties props)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="measure(int)"><!-- --></A><H3> -measure</H3> -<PRE> -public void <B>measure</B>(int latency)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#measure(int)">measure</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="printReport(java.io.PrintStream)"><!-- --></A><H3> -printReport</H3> -<PRE> -public void <B>printReport</B>(java.io.PrintStream out)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#printReport(java.io.PrintStream)">printReport</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="reportReturnCode(int)"><!-- --></A><H3> -reportReturnCode</H3> -<PRE> -public void <B>reportReturnCode</B>(int code)</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#reportReturnCode(int)">reportReturnCode</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="getSummary()"><!-- --></A><H3> -getSummary</H3> -<PRE> -public java.lang.String <B>getSummary</B>()</PRE> -<DL> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html#getSummary()">getSummary</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/OneMeasurement.html" title="class in com.yahoo.ycsb">OneMeasurement</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/OneMeasurementTimeSeries.html" target="_top"><B>FRAMES</B></A> - <A HREF="OneMeasurementTimeSeries.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/ScrambledZipfianGenerator.html b/doc/javadoc/com/yahoo/ycsb/ScrambledZipfianGenerator.html deleted file mode 100644 index 612ca61c68d07e3071b64f0696d056954a1b87b6..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/ScrambledZipfianGenerator.html +++ /dev/null @@ -1,391 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -ScrambledZipfianGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.ScrambledZipfianGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="ScrambledZipfianGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/ScrambledZipfianGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="ScrambledZipfianGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class ScrambledZipfianGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.IntegerGenerator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.ScrambledZipfianGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>ScrambledZipfianGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></DL> -</PRE> - -<P> -A generator of a zipfian distribution. It produces a sequence of items, such that some items are more popular than others, according - to a zipfian distribution. When you construct an instance of this class, you specify the number of items in the set to draw from, either - by specifying an itemcount (so that the sequence is of items from 0 to itemcount-1) or by specifying a min and a max (so that the sequence is of - items from min to max inclusive). After you construct the instance, you can change the number of items by calling nextInt(itemcount) or nextLong(itemcount). - - Unlike @ZipfianGenerator, this class scatters the "popular" items across the itemspace. Use this, instead of @ZipfianGenerator, if you - don't want the head of the distribution (the popular items) clustered together. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#ITEM_COUNT">ITEM_COUNT</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static double</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#ZETAN">ZETAN</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#ScrambledZipfianGenerator(long)">ScrambledZipfianGenerator</A></B>(long _items)</CODE> - -<BR> - Create a zipfian generator for the specified number of items.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#ScrambledZipfianGenerator(long, long)">ScrambledZipfianGenerator</A></B>(long _min, - long _max)</CODE> - -<BR> - Create a zipfian generator for items between min and max.</TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - Return the next int in the sequence.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html#nextLong()">nextLong</A></B>()</CODE> - -<BR> - Return the next long in the sequence.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.IntegerGenerator"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ZETAN"><!-- --></A><H3> -ZETAN</H3> -<PRE> -public static final double <B>ZETAN</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.ScrambledZipfianGenerator.ZETAN">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ITEM_COUNT"><!-- --></A><H3> -ITEM_COUNT</H3> -<PRE> -public static final long <B>ITEM_COUNT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.ScrambledZipfianGenerator.ITEM_COUNT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ScrambledZipfianGenerator(long)"><!-- --></A><H3> -ScrambledZipfianGenerator</H3> -<PRE> -public <B>ScrambledZipfianGenerator</B>(long _items)</PRE> -<DL> -<DD>Create a zipfian generator for the specified number of items. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>_items</CODE> - The number of items in the distribution.</DL> -</DL> -<HR> - -<A NAME="ScrambledZipfianGenerator(long, long)"><!-- --></A><H3> -ScrambledZipfianGenerator</H3> -<PRE> -public <B>ScrambledZipfianGenerator</B>(long _min, - long _max)</PRE> -<DL> -<DD>Create a zipfian generator for items between min and max. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>_min</CODE> - The smallest integer to generate in the sequence.<DD><CODE>_max</CODE> - The largest integer to generate in the sequence.</DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>()</PRE> -<DL> -<DD>Return the next int in the sequence. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="nextLong()"><!-- --></A><H3> -nextLong</H3> -<PRE> -public long <B>nextLong</B>()</PRE> -<DL> -<DD>Return the next long in the sequence. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/ScrambledZipfianGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="ScrambledZipfianGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/SkewedLatestGenerator.html b/doc/javadoc/com/yahoo/ycsb/SkewedLatestGenerator.html deleted file mode 100644 index 546e80384ce74e5280b9d4bb99b267db0826edb8..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/SkewedLatestGenerator.html +++ /dev/null @@ -1,286 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -SkewedLatestGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.SkewedLatestGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="SkewedLatestGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/SkewedLatestGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="SkewedLatestGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class SkewedLatestGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.IntegerGenerator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.SkewedLatestGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>SkewedLatestGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></DL> -</PRE> - -<P> -Generate a popularity distribution of items, skewed to favor recent items significantly more than older items. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html#SkewedLatestGenerator(com.yahoo.ycsb.CounterGenerator)">SkewedLatestGenerator</A></B>(<A HREF="../../../com/yahoo/ycsb/CounterGenerator.html" title="class in com.yahoo.ycsb">CounterGenerator</A> basis)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - Generate the next string in the distribution, skewed Zipfian favoring the items most recently returned by the basis generator.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.IntegerGenerator"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="SkewedLatestGenerator(com.yahoo.ycsb.CounterGenerator)"><!-- --></A><H3> -SkewedLatestGenerator</H3> -<PRE> -public <B>SkewedLatestGenerator</B>(<A HREF="../../../com/yahoo/ycsb/CounterGenerator.html" title="class in com.yahoo.ycsb">CounterGenerator</A> basis)</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>()</PRE> -<DL> -<DD>Generate the next string in the distribution, skewed Zipfian favoring the items most recently returned by the basis generator. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/SkewedLatestGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="SkewedLatestGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/TestCollisions.html b/doc/javadoc/com/yahoo/ycsb/TestCollisions.html deleted file mode 100644 index 8356a28a6d172c472fdcf23a18816ae833870c99..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/TestCollisions.html +++ /dev/null @@ -1,360 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Tue Apr 20 15:39:17 PDT 2010 --> -<TITLE> -TestCollisions -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.TestCollisions class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="TestCollisions"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestCollisions.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestCollisions.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class TestCollisions</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.TestCollisions</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>TestCollisions</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#a">a</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#b">b</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#TestCollisions()">TestCollisions</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#hash(int, int)">hash</A></B>(int val, - int itemcount)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#scramble(int)">scramble</A></B>(int val)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestCollisions.html#testVector(int)">testVector</A></B>(int itemcount)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="a"><!-- --></A><H3> -a</H3> -<PRE> -public static int <B>a</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="b"><!-- --></A><H3> -b</H3> -<PRE> -public static int <B>b</B></PRE> -<DL> -<DL> -</DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="TestCollisions()"><!-- --></A><H3> -TestCollisions</H3> -<PRE> -public <B>TestCollisions</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="scramble(int)"><!-- --></A><H3> -scramble</H3> -<PRE> -public static int <B>scramble</B>(int val)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="hash(int, int)"><!-- --></A><H3> -hash</H3> -<PRE> -public static int <B>hash</B>(int val, - int itemcount)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="testVector(int)"><!-- --></A><H3> -testVector</H3> -<PRE> -public static int <B>testVector</B>(int itemcount)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestCollisions.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestCollisions.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/TestExpandedZipfian.html b/doc/javadoc/com/yahoo/ycsb/TestExpandedZipfian.html deleted file mode 100644 index 847a71c7052eb565647f9cd09b8422f8595c1ea4..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/TestExpandedZipfian.html +++ /dev/null @@ -1,247 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Tue Apr 20 15:39:17 PDT 2010 --> -<TITLE> -TestExpandedZipfian -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.TestExpandedZipfian class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="TestExpandedZipfian"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/TestCollisions.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/TestZipfian.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestExpandedZipfian.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestExpandedZipfian.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class TestExpandedZipfian</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.TestExpandedZipfian</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>TestExpandedZipfian</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html#TestExpandedZipfian()">TestExpandedZipfian</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="TestExpandedZipfian()"><!-- --></A><H3> -TestExpandedZipfian</H3> -<PRE> -public <B>TestExpandedZipfian</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/TestCollisions.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/TestZipfian.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestExpandedZipfian.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestExpandedZipfian.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/TestZipfian.html b/doc/javadoc/com/yahoo/ycsb/TestZipfian.html deleted file mode 100644 index d0ea7113100917f062dbe2bc1de8d6054ad00859..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/TestZipfian.html +++ /dev/null @@ -1,247 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Tue Apr 20 15:39:17 PDT 2010 --> -<TITLE> -TestZipfian -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.TestZipfian class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="TestZipfian"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestZipfian.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestZipfian.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class TestZipfian</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.TestZipfian</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>TestZipfian</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestZipfian.html#TestZipfian()">TestZipfian</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/TestZipfian.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="TestZipfian()"><!-- --></A><H3> -TestZipfian</H3> -<PRE> -public <B>TestZipfian</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/TestExpandedZipfian.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/TestZipfian.html" target="_top"><B>FRAMES</B></A> - <A HREF="TestZipfian.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/UniformGenerator.html b/doc/javadoc/com/yahoo/ycsb/UniformGenerator.html deleted file mode 100644 index 89e7fdc8d5f9ef4ed6c70773e110a3acac2432c8..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/UniformGenerator.html +++ /dev/null @@ -1,285 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -UniformGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.UniformGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="UniformGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UniformGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="UniformGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class UniformGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.UniformGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>UniformGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></DL> -</PRE> - -<P> -An expression that generates a random integer in the specified range -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UniformGenerator.html#UniformGenerator(java.util.Vector)">UniformGenerator</A></B>(java.util.Vector<java.lang.String> values)</CODE> - -<BR> - Creates a generator that will return strings from the specified set uniformly randomly</TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UniformGenerator.html#lastString()">lastString</A></B>()</CODE> - -<BR> - Return the previous string generated by the distribution; e.g., returned from the last nextString() call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UniformGenerator.html#nextString()">nextString</A></B>()</CODE> - -<BR> - Generate the next string in the distribution.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="UniformGenerator(java.util.Vector)"><!-- --></A><H3> -UniformGenerator</H3> -<PRE> -public <B>UniformGenerator</B>(java.util.Vector<java.lang.String> values)</PRE> -<DL> -<DD>Creates a generator that will return strings from the specified set uniformly randomly -<P> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextString()"><!-- --></A><H3> -nextString</H3> -<PRE> -public java.lang.String <B>nextString</B>()</PRE> -<DL> -<DD>Generate the next string in the distribution. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#nextString()">nextString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="lastString()"><!-- --></A><H3> -lastString</H3> -<PRE> -public java.lang.String <B>lastString</B>()</PRE> -<DL> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. - Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet - been called, lastString() should return something reasonable. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/Generator.html#lastString()">lastString</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">Generator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UniformGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="UniformGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/UniformIntegerGenerator.html b/doc/javadoc/com/yahoo/ycsb/UniformIntegerGenerator.html deleted file mode 100644 index 910e825fee942bc7ca05555cf3d8df6a53c96a10..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/UniformIntegerGenerator.html +++ /dev/null @@ -1,274 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -UniformIntegerGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.UniformIntegerGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="UniformIntegerGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UniformIntegerGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="UniformIntegerGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class UniformIntegerGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.IntegerGenerator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.UniformIntegerGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>UniformIntegerGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></DL> -</PRE> - -<P> -Generates integers randomly uniform from an interval. -<P> - -<P> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UniformIntegerGenerator.html#UniformIntegerGenerator(int, int)">UniformIntegerGenerator</A></B>(int lb, - int ub)</CODE> - -<BR> - Creates a generator that will return integers uniformly randomly from the interval [lb,ub] inclusive (that is, lb and ub are possible values)</TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UniformIntegerGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - Return the next value as an int.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.IntegerGenerator"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="UniformIntegerGenerator(int, int)"><!-- --></A><H3> -UniformIntegerGenerator</H3> -<PRE> -public <B>UniformIntegerGenerator</B>(int lb, - int ub)</PRE> -<DL> -<DD>Creates a generator that will return integers uniformly randomly from the interval [lb,ub] inclusive (that is, lb and ub are possible values) -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>lb</CODE> - the lower bound (inclusive) of generated values<DD><CODE>ub</CODE> - the upper bound (inclusive) of generated values</DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>()</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">IntegerGenerator</A></CODE></B></DD> -<DD>Return the next value as an int. When overriding this method, be sure to call setLastString() properly, or the lastString() call won't work. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/UniformGenerator.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UniformIntegerGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="UniformIntegerGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/UnknownDBException.html b/doc/javadoc/com/yahoo/ycsb/UnknownDBException.html deleted file mode 100644 index 3869cac1c31d871d4cf9eeb13b758f771df5f49e..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/UnknownDBException.html +++ /dev/null @@ -1,286 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -UnknownDBException -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="UnknownDBException"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UnknownDBException.html" target="_top"><B>FRAMES</B></A> - <A HREF="UnknownDBException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class UnknownDBException</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Throwable - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Exception - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.UnknownDBException</B> -</PRE> -<DL> -<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> -</DL> -<HR> -<DL> -<DT><PRE>public class <B>UnknownDBException</B><DT>extends java.lang.Exception</DL> -</PRE> - -<P> -Could not create the specified DB. -<P> - -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#com.yahoo.ycsb.UnknownDBException">Serialized Form</A></DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html#UnknownDBException()">UnknownDBException</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.String)">UnknownDBException</A></B>(java.lang.String message)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.String, java.lang.Throwable)">UnknownDBException</A></B>(java.lang.String message, - java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.Throwable)">UnknownDBException</A></B>(java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Throwable</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="UnknownDBException(java.lang.String)"><!-- --></A><H3> -UnknownDBException</H3> -<PRE> -public <B>UnknownDBException</B>(java.lang.String message)</PRE> -<DL> -</DL> -<HR> - -<A NAME="UnknownDBException()"><!-- --></A><H3> -UnknownDBException</H3> -<PRE> -public <B>UnknownDBException</B>()</PRE> -<DL> -</DL> -<HR> - -<A NAME="UnknownDBException(java.lang.String, java.lang.Throwable)"><!-- --></A><H3> -UnknownDBException</H3> -<PRE> -public <B>UnknownDBException</B>(java.lang.String message, - java.lang.Throwable cause)</PRE> -<DL> -</DL> -<HR> - -<A NAME="UnknownDBException(java.lang.Throwable)"><!-- --></A><H3> -UnknownDBException</H3> -<PRE> -public <B>UnknownDBException</B>(java.lang.Throwable cause)</PRE> -<DL> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/UnknownDBException.html" target="_top"><B>FRAMES</B></A> - <A HREF="UnknownDBException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/Utils.html b/doc/javadoc/com/yahoo/ycsb/Utils.html deleted file mode 100644 index 42d5689864da6d9c27fcee15ac45ba0202543777..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/Utils.html +++ /dev/null @@ -1,411 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -Utils -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Utils"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Utils.html" target="_top"><B>FRAMES</B></A> - <A HREF="Utils.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class Utils</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.Utils</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>Utils</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -Utility functions. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNV_offset_basis_32">FNV_offset_basis_32</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNV_offset_basis_64">FNV_offset_basis_64</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNV_prime_32">FNV_prime_32</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNV_prime_64">FNV_prime_64</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#Utils()">Utils</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#ASCIIString(int)">ASCIIString</A></B>(int length)</CODE> - -<BR> - Generate a random ASCII string of a given length.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNVhash32(int)">FNVhash32</A></B>(int val)</CODE> - -<BR> - 32 bit FNV hash.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#FNVhash64(long)">FNVhash64</A></B>(long val)</CODE> - -<BR> - 64 bit FNV hash.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Utils.html#hash(int)">hash</A></B>(int val)</CODE> - -<BR> - Hash an integer value.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="FNV_offset_basis_32"><!-- --></A><H3> -FNV_offset_basis_32</H3> -<PRE> -public static final int <B>FNV_offset_basis_32</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Utils.FNV_offset_basis_32">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FNV_prime_32"><!-- --></A><H3> -FNV_prime_32</H3> -<PRE> -public static final int <B>FNV_prime_32</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Utils.FNV_prime_32">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FNV_offset_basis_64"><!-- --></A><H3> -FNV_offset_basis_64</H3> -<PRE> -public static final long <B>FNV_offset_basis_64</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Utils.FNV_offset_basis_64">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FNV_prime_64"><!-- --></A><H3> -FNV_prime_64</H3> -<PRE> -public static final long <B>FNV_prime_64</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Utils.FNV_prime_64">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Utils()"><!-- --></A><H3> -Utils</H3> -<PRE> -public <B>Utils</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ASCIIString(int)"><!-- --></A><H3> -ASCIIString</H3> -<PRE> -public static java.lang.String <B>ASCIIString</B>(int length)</PRE> -<DL> -<DD>Generate a random ASCII string of a given length. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="hash(int)"><!-- --></A><H3> -hash</H3> -<PRE> -public static int <B>hash</B>(int val)</PRE> -<DL> -<DD>Hash an integer value. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="FNVhash32(int)"><!-- --></A><H3> -FNVhash32</H3> -<PRE> -public static int <B>FNVhash32</B>(int val)</PRE> -<DL> -<DD>32 bit FNV hash. Produces more "random" hashes than (say) String.hashCode(). -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>val</CODE> - The value to hash. -<DT><B>Returns:</B><DD>The hash value</DL> -</DD> -</DL> -<HR> - -<A NAME="FNVhash64(long)"><!-- --></A><H3> -FNVhash64</H3> -<PRE> -public static long <B>FNVhash64</B>(long val)</PRE> -<DL> -<DD>64 bit FNV hash. Produces more "random" hashes than (say) String.hashCode(). -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>val</CODE> - The value to hash. -<DT><B>Returns:</B><DD>The hash value</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Utils.html" target="_top"><B>FRAMES</B></A> - <A HREF="Utils.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/Workload.html b/doc/javadoc/com/yahoo/ycsb/Workload.html deleted file mode 100644 index 86547bc4351085dedb934be0d813ee5dd7f7ca8f..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/Workload.html +++ /dev/null @@ -1,443 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -Workload -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Workload"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Workload.html" target="_top"><B>FRAMES</B></A> - <A HREF="Workload.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class Workload</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.Workload</B> -</PRE> -<DL> -<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A></DD> -</DL> -<HR> -<DL> -<DT><PRE>public abstract class <B>Workload</B><DT>extends java.lang.Object</DL> -</PRE> - -<P> -One experiment scenario. One object of this type will - be instantiated and shared among all client threads. This class - should be constructed using a no-argument constructor, so we can - load it dynamically. Any argument-based initialization should be - done by init(). - - If you extend this class, you should support the "insertstart" property. This - allows the load phase to proceed from multiple clients on different machines, in case - the client is the bottleneck. For example, if we want to load 1 million records from - 2 machines, the first machine should have insertstart=0 and the second insertstart=500000. Additionally, - the "insertcount" property, which is interpreted by Client, can be used to tell each instance of the - client how many inserts to do. In the example above, both clients should have insertcount=500000. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY">INSERT_START_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY_DEFAULT">INSERT_START_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#Workload()">Workload</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup the scenario.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#doInsert(com.yahoo.ycsb.DB, java.lang.Object)">doInsert</A></B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</CODE> - -<BR> - Do one insert operation.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>abstract boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#doTransaction(com.yahoo.ycsb.DB, java.lang.Object)">doTransaction</A></B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</CODE> - -<BR> - Do one transaction operation.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#init(java.util.Properties)">init</A></B>(java.util.Properties p)</CODE> - -<BR> - Initialize the scenario.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.Object</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/Workload.html#initThread(java.util.Properties, int, int)">initThread</A></B>(java.util.Properties p, - int mythreadid, - int threadcount)</CODE> - -<BR> - Initialize any state for a particular client thread.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="INSERT_START_PROPERTY"><!-- --></A><H3> -INSERT_START_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>INSERT_START_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Workload.INSERT_START_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_START_PROPERTY_DEFAULT"><!-- --></A><H3> -INSERT_START_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>INSERT_START_PROPERTY_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.Workload.INSERT_START_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Workload()"><!-- --></A><H3> -Workload</H3> -<PRE> -public <B>Workload</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init(java.util.Properties)"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>(java.util.Properties p) - throws <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></PRE> -<DL> -<DD>Initialize the scenario. Create any generators and other shared objects here. - Called once, in the main client thread, before any operations are started. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="initThread(java.util.Properties, int, int)"><!-- --></A><H3> -initThread</H3> -<PRE> -public java.lang.Object <B>initThread</B>(java.util.Properties p, - int mythreadid, - int threadcount) - throws <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></PRE> -<DL> -<DD>Initialize any state for a particular client thread. Since the scenario object - will be shared among all threads, this is the place to create any state that is specific - to one thread. To be clear, this means the returned object should be created anew on each - call to initThread(); do not return the same object multiple times. - The returned object will be passed to invocations of doInsert() and doTransaction() - for this thread. There should be no side effects from this call; all state should be encapsulated - in the returned object. If you have no state to retain for this thread, return null. (But if you have - no state to retain for this thread, probably you don't need to override initThread().) -<P> -<DD><DL> - -<DT><B>Returns:</B><DD>false if the workload knows it is done for this thread. Client will terminate the thread. Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read traces from a file, return true when there are more to do, false when you are done. -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></PRE> -<DL> -<DD>Cleanup the scenario. Called once, in the main client thread, after all operations have completed. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="doInsert(com.yahoo.ycsb.DB, java.lang.Object)"><!-- --></A><H3> -doInsert</H3> -<PRE> -public abstract boolean <B>doInsert</B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</PRE> -<DL> -<DD>Do one insert operation. Because it will be called concurrently from multiple client threads, this - function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be - synchronized, since each thread has its own threadstate instance. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransaction(com.yahoo.ycsb.DB, java.lang.Object)"><!-- --></A><H3> -doTransaction</H3> -<PRE> -public abstract boolean <B>doTransaction</B>(<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</PRE> -<DL> -<DD>Do one transaction operation. Because it will be called concurrently from multiple client threads, this - function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - effects other than DB operations and mutations on threadstate. Mutations to threadstate do not need to be - synchronized, since each thread has its own threadstate instance. -<P> -<DD><DL> - -<DT><B>Returns:</B><DD>false if the workload knows it is done for this thread. Client will terminate the thread. Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read traces from a file, return true when there are more to do, false when you are done.</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/Workload.html" target="_top"><B>FRAMES</B></A> - <A HREF="Workload.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/WorkloadException.html b/doc/javadoc/com/yahoo/ycsb/WorkloadException.html deleted file mode 100644 index 95b75dc5f80c4e2dda0adb01b636ce401de52123..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/WorkloadException.html +++ /dev/null @@ -1,286 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:52 PDT 2010 --> -<TITLE> -WorkloadException -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="WorkloadException"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/WorkloadException.html" target="_top"><B>FRAMES</B></A> - <A HREF="WorkloadException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class WorkloadException</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Throwable - <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">java.lang.Exception - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.WorkloadException</B> -</PRE> -<DL> -<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> -</DL> -<HR> -<DL> -<DT><PRE>public class <B>WorkloadException</B><DT>extends java.lang.Exception</DL> -</PRE> - -<P> -The workload tried to do something bad. -<P> - -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#com.yahoo.ycsb.WorkloadException">Serialized Form</A></DL> -<HR> - -<P> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/WorkloadException.html#WorkloadException()">WorkloadException</A></B>()</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.String)">WorkloadException</A></B>(java.lang.String message)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.String, java.lang.Throwable)">WorkloadException</A></B>(java.lang.String message, - java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.Throwable)">WorkloadException</A></B>(java.lang.Throwable cause)</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Throwable</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="WorkloadException(java.lang.String)"><!-- --></A><H3> -WorkloadException</H3> -<PRE> -public <B>WorkloadException</B>(java.lang.String message)</PRE> -<DL> -</DL> -<HR> - -<A NAME="WorkloadException()"><!-- --></A><H3> -WorkloadException</H3> -<PRE> -public <B>WorkloadException</B>()</PRE> -<DL> -</DL> -<HR> - -<A NAME="WorkloadException(java.lang.String, java.lang.Throwable)"><!-- --></A><H3> -WorkloadException</H3> -<PRE> -public <B>WorkloadException</B>(java.lang.String message, - java.lang.Throwable cause)</PRE> -<DL> -</DL> -<HR> - -<A NAME="WorkloadException(java.lang.Throwable)"><!-- --></A><H3> -WorkloadException</H3> -<PRE> -public <B>WorkloadException</B>(java.lang.Throwable cause)</PRE> -<DL> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/WorkloadException.html" target="_top"><B>FRAMES</B></A> - <A HREF="WorkloadException.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/ZipfianGenerator.html b/doc/javadoc/com/yahoo/ycsb/ZipfianGenerator.html deleted file mode 100644 index b1672c86815d0459a66d9ff02dd5a726668a1248..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/ZipfianGenerator.html +++ /dev/null @@ -1,495 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Fri Apr 23 10:24:25 PDT 2010 --> -<TITLE> -ZipfianGenerator -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.ZipfianGenerator class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="ZipfianGenerator"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/ZipfianGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="ZipfianGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb</FONT> -<BR> -Class ZipfianGenerator</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/Generator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Generator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.IntegerGenerator</A> - <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.ZipfianGenerator</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>ZipfianGenerator</B><DT>extends <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></DL> -</PRE> - -<P> -A generator of a zipfian distribution. It produces a sequence of items, such that some items are more popular than others, according - to a zipfian distribution. When you construct an instance of this class, you specify the number of items in the set to draw from, either - by specifying an itemcount (so that the sequence is of items from 0 to itemcount-1) or by specifying a min and a max (so that the sequence is of - items from min to max inclusive). After you construct the instance, you can change the number of items by calling nextInt(itemcount) or nextLong(itemcount). - - Note that the popular items will be clustered together, e.g. item 0 is the most popular, item 1 the second most popular, and so on (or min is the most - popular, min+1 the next most popular, etc.) If you don't want this clustering, and instead want the popular items scattered throughout the - item space, then use ScrambledZipfianGenerator instead. - - Be aware: initializing this generator may take a long time if there are lots of items to choose from (e.g. over a minute - for 100 million objects). This is because certain mathematical values need to be computed to properly generate a zipfian skew, and one of those - values (zeta) is a sum sequence from 1 to n, where n is the itemcount. Note that if you increase the number of items in the set, we can compute - a new zeta incrementally, so it should be fast unless you have added millions of items. However, if you decrease the number of items, we recompute - zeta from scratch, so this can take a long time. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static double</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZIPFIAN_CONSTANT">ZIPFIAN_CONSTANT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZipfianGenerator(long)">ZipfianGenerator</A></B>(long _items)</CODE> - -<BR> - Create a zipfian generator for the specified number of items.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZipfianGenerator(long, double)">ZipfianGenerator</A></B>(long _items, - double _zipfianconstant)</CODE> - -<BR> - Create a zipfian generator for the specified number of items using the specified zipfian constant.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZipfianGenerator(long, long)">ZipfianGenerator</A></B>(long _min, - long _max)</CODE> - -<BR> - Create a zipfian generator for items between min and max.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZipfianGenerator(long, long, double)">ZipfianGenerator</A></B>(long min, - long max, - double _zipfianconstant)</CODE> - -<BR> - Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#ZipfianGenerator(long, long, double, double)">ZipfianGenerator</A></B>(long min, - long max, - double _zipfianconstant, - double _zetan)</CODE> - -<BR> - Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant, using the precomputed value of zeta.</TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#nextInt()">nextInt</A></B>()</CODE> - -<BR> - Return the next value, skewed by the Zipfian distribution.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#nextInt(int)">nextInt</A></B>(int itemcount)</CODE> - -<BR> - Generate the next item.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#nextLong()">nextLong</A></B>()</CODE> - -<BR> - Return the next value, skewed by the Zipfian distribution.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../com/yahoo/ycsb/ZipfianGenerator.html#nextLong(long)">nextLong</A></B>(long itemcount)</CODE> - -<BR> - Generate the next item as a long.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.IntegerGenerator"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastInt()">lastInt</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#lastString()">lastString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextString()">nextString</A>, <A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#setLastInt(int)">setLastInt</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ZIPFIAN_CONSTANT"><!-- --></A><H3> -ZIPFIAN_CONSTANT</H3> -<PRE> -public static final double <B>ZIPFIAN_CONSTANT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.yahoo.ycsb.ZipfianGenerator.ZIPFIAN_CONSTANT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ZipfianGenerator(long)"><!-- --></A><H3> -ZipfianGenerator</H3> -<PRE> -public <B>ZipfianGenerator</B>(long _items)</PRE> -<DL> -<DD>Create a zipfian generator for the specified number of items. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>_items</CODE> - The number of items in the distribution.</DL> -</DL> -<HR> - -<A NAME="ZipfianGenerator(long, long)"><!-- --></A><H3> -ZipfianGenerator</H3> -<PRE> -public <B>ZipfianGenerator</B>(long _min, - long _max)</PRE> -<DL> -<DD>Create a zipfian generator for items between min and max. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>_min</CODE> - The smallest integer to generate in the sequence.<DD><CODE>_max</CODE> - The largest integer to generate in the sequence.</DL> -</DL> -<HR> - -<A NAME="ZipfianGenerator(long, double)"><!-- --></A><H3> -ZipfianGenerator</H3> -<PRE> -public <B>ZipfianGenerator</B>(long _items, - double _zipfianconstant)</PRE> -<DL> -<DD>Create a zipfian generator for the specified number of items using the specified zipfian constant. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>_items</CODE> - The number of items in the distribution.<DD><CODE>_zipfianconstant</CODE> - The zipfian constant to use.</DL> -</DL> -<HR> - -<A NAME="ZipfianGenerator(long, long, double)"><!-- --></A><H3> -ZipfianGenerator</H3> -<PRE> -public <B>ZipfianGenerator</B>(long min, - long max, - double _zipfianconstant)</PRE> -<DL> -<DD>Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>min</CODE> - The smallest integer to generate in the sequence.<DD><CODE>max</CODE> - The largest integer to generate in the sequence.<DD><CODE>_zipfianconstant</CODE> - The zipfian constant to use.</DL> -</DL> -<HR> - -<A NAME="ZipfianGenerator(long, long, double, double)"><!-- --></A><H3> -ZipfianGenerator</H3> -<PRE> -public <B>ZipfianGenerator</B>(long min, - long max, - double _zipfianconstant, - double _zetan)</PRE> -<DL> -<DD>Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant, using the precomputed value of zeta. -<P> -<DL> -<DT><B>Parameters:</B><DD><CODE>min</CODE> - The smallest integer to generate in the sequence.<DD><CODE>max</CODE> - The largest integer to generate in the sequence.<DD><CODE>_zipfianconstant</CODE> - The zipfian constant to use.<DD><CODE>_zetan</CODE> - The precomputed zeta constant.</DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="nextInt(int)"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>(int itemcount)</PRE> -<DL> -<DD>Generate the next item. this distribution will be skewed toward lower integers; e.g. 0 will - be the most popular, 1 the next most popular, etc. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>itemcount</CODE> - The number of items in the distribution. -<DT><B>Returns:</B><DD>The next item in the sequence.</DL> -</DD> -</DL> -<HR> - -<A NAME="nextLong(long)"><!-- --></A><H3> -nextLong</H3> -<PRE> -public long <B>nextLong</B>(long itemcount)</PRE> -<DL> -<DD>Generate the next item as a long. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>itemcount</CODE> - The number of items in the distribution. -<DT><B>Returns:</B><DD>The next item in the sequence.</DL> -</DD> -</DL> -<HR> - -<A NAME="nextInt()"><!-- --></A><H3> -nextInt</H3> -<PRE> -public int <B>nextInt</B>()</PRE> -<DL> -<DD>Return the next value, skewed by the Zipfian distribution. The 0th item will be the most popular, followed by the 1st, followed - by the 2nd, etc. (Or, if min != 0, the min-th item is the most popular, the min+1th item the next most popular, etc.) If you want the - popular items scattered throughout the item space, use ScrambledZipfianGenerator instead. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html#nextInt()">nextInt</A></CODE> in class <CODE><A HREF="../../../com/yahoo/ycsb/IntegerGenerator.html" title="class in com.yahoo.ycsb">IntegerGenerator</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="nextLong()"><!-- --></A><H3> -nextLong</H3> -<PRE> -public long <B>nextLong</B>()</PRE> -<DL> -<DD>Return the next value, skewed by the Zipfian distribution. The 0th item will be the most popular, followed by the 1st, followed - by the 2nd, etc. (Or, if min != 0, the min-th item is the most popular, the min+1th item the next most popular, etc.) If you want the - popular items scattered throughout the item space, use ScrambledZipfianGenerator instead. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/ZipfianGenerator.html" target="_top"><B>FRAMES</B></A> - <A HREF="ZipfianGenerator.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/CassandraClient.html b/doc/javadoc/com/yahoo/ycsb/db/CassandraClient.html deleted file mode 100644 index 6b6b21bd56c0ef2866eabcf2c9d0d3f6e3cfceca..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/CassandraClient.html +++ /dev/null @@ -1,630 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.5.0_22) on Mon Apr 19 13:46:54 PDT 2010 --> -<TITLE> -CassandraClient -</TITLE> - -<META NAME="keywords" CONTENT="com.yahoo.ycsb.db.CassandraClient class"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - parent.document.title="CassandraClient"; -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/CassandraClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="CassandraClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb.db</FONT> -<BR> -Class CassandraClient</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.db.CassandraClient</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>CassandraClient</B><DT>extends <A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -XXXX if we do replication, fix the consistency levels -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#CONNECTION_RETRY_PROPERTY">CONNECTION_RETRY_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#CONNECTION_RETRY_PROPERTY_DEFAULT">CONNECTION_RETRY_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#ConnectionRetries">ConnectionRetries</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#Error">Error</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#Ok">Ok</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#OPERATION_RETRY_PROPERTY">OPERATION_RETRY_PROPERTY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#OPERATION_RETRY_PROPERTY_DEFAULT">OPERATION_RETRY_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#OperationRetries">OperationRetries</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#CassandraClient()">CassandraClient</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.DB"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A>, <A HREF="../../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="Ok"><!-- --></A><H3> -Ok</H3> -<PRE> -public static final int <B>Ok</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.Ok">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="Error"><!-- --></A><H3> -Error</H3> -<PRE> -public static final int <B>Error</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.Error">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ConnectionRetries"><!-- --></A><H3> -ConnectionRetries</H3> -<PRE> -public int <B>ConnectionRetries</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="OperationRetries"><!-- --></A><H3> -OperationRetries</H3> -<PRE> -public int <B>OperationRetries</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="CONNECTION_RETRY_PROPERTY"><!-- --></A><H3> -CONNECTION_RETRY_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>CONNECTION_RETRY_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.CONNECTION_RETRY_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="CONNECTION_RETRY_PROPERTY_DEFAULT"><!-- --></A><H3> -CONNECTION_RETRY_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>CONNECTION_RETRY_PROPERTY_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.CONNECTION_RETRY_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="OPERATION_RETRY_PROPERTY"><!-- --></A><H3> -OPERATION_RETRY_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>OPERATION_RETRY_PROPERTY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.OPERATION_RETRY_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="OPERATION_RETRY_PROPERTY_DEFAULT"><!-- --></A><H3> -OPERATION_RETRY_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>OPERATION_RETRY_PROPERTY_DEFAULT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.CassandraClient.OPERATION_RETRY_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="CassandraClient()"><!-- --></A><H3> -CassandraClient</H3> -<PRE> -public <B>CassandraClient</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - <A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/CassandraClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="CassandraClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/HBaseClient.html b/doc/javadoc/com/yahoo/ycsb/db/HBaseClient.html deleted file mode 100644 index 3b20459188c843245b42683fe6e9ffc76249c549..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/HBaseClient.html +++ /dev/null @@ -1,691 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -HBaseClient -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="HBaseClient"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - <A HREF="../../../../com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/HBaseClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="HBaseClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb.db</FONT> -<BR> -Class HBaseClient</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.db.HBaseClient</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>HBaseClient</B><DT>extends <A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -HBase client for YCSB framework -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#_columnFamily">_columnFamily</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> byte[]</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#_columnFamilyBytes">_columnFamilyBytes</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#_debug">_debug</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> HTable</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#_hTable">_hTable</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#_table">_table</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#HttpError">HttpError</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#NoMatchingRecord">NoMatchingRecord</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#Ok">Ok</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#ServerError">ServerError</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.Object</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#tableLock">tableLock</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#HBaseClient()">HBaseClient</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#getHTable(java.lang.String)">getHTable</A></B>(java.lang.String table)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.DB"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A>, <A HREF="../../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="_debug"><!-- --></A><H3> -_debug</H3> -<PRE> -public boolean <B>_debug</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="_table"><!-- --></A><H3> -_table</H3> -<PRE> -public java.lang.String <B>_table</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="_hTable"><!-- --></A><H3> -_hTable</H3> -<PRE> -public HTable <B>_hTable</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="_columnFamily"><!-- --></A><H3> -_columnFamily</H3> -<PRE> -public java.lang.String <B>_columnFamily</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="_columnFamilyBytes"><!-- --></A><H3> -_columnFamilyBytes</H3> -<PRE> -public byte[] <B>_columnFamilyBytes</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="Ok"><!-- --></A><H3> -Ok</H3> -<PRE> -public static final int <B>Ok</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.HBaseClient.Ok">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ServerError"><!-- --></A><H3> -ServerError</H3> -<PRE> -public static final int <B>ServerError</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.HBaseClient.ServerError">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HttpError"><!-- --></A><H3> -HttpError</H3> -<PRE> -public static final int <B>HttpError</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.HBaseClient.HttpError">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="NoMatchingRecord"><!-- --></A><H3> -NoMatchingRecord</H3> -<PRE> -public static final int <B>NoMatchingRecord</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.HBaseClient.NoMatchingRecord">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="tableLock"><!-- --></A><H3> -tableLock</H3> -<PRE> -public static java.lang.Object <B>tableLock</B></PRE> -<DL> -<DL> -</DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="HBaseClient()"><!-- --></A><H3> -HBaseClient</H3> -<PRE> -public <B>HBaseClient</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="getHTable(java.lang.String)"><!-- --></A><H3> -getHTable</H3> -<PRE> -public void <B>getHTable</B>(java.lang.String table) - throws java.io.IOException</PRE> -<DL> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE>java.io.IOException</CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - <A HREF="../../../../com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/HBaseClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="HBaseClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/ShardClient.html b/doc/javadoc/com/yahoo/ycsb/db/ShardClient.html deleted file mode 100644 index fa266e3a0706f8a5d89871951a5f7c84993eb1f7..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/ShardClient.html +++ /dev/null @@ -1,757 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Fri Jan 22 13:42:46 PST 2010 --> -<TITLE> -ShardClient -</TITLE> - -<META NAME="date" CONTENT="2010-01-22"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="ShardClient"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - <A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/ShardClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="ShardClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb.db</FONT> -<BR> -Class ShardClient</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.db.ShardClient</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>ShardClient</B><DT>extends <A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -A client for the simple sharded MySQL called shardserver. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#_debug">_debug</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#_donothing">_donothing</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#HttpError">HttpError</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#NoMatchingRecord">NoMatchingRecord</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#NoMatchingRecordString">NoMatchingRecordString</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#Ok">Ok</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#ServerError">ServerError</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#TotalGetOps">TotalGetOps</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#TotalGetTime">TotalGetTime</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#TotalPostOps">TotalPostOps</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> long</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#TotalPostTime">TotalPostTime</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#UrlPrefix">UrlPrefix</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#ShardClient()">ShardClient</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.util.Vector<char[]></CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#doGet(java.lang.String)">doGet</A></B>(java.lang.String url)</CODE> - -<BR> - Do a GET HTTP call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#doPost(java.lang.String, java.lang.String)">doPost</A></B>(java.lang.String url, - java.lang.String postbody)</CODE> - -<BR> - Do a POST HTTP call.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> - -<BR> - Simple test.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.DB"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A>, <A HREF="../../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="UrlPrefix"><!-- --></A><H3> -UrlPrefix</H3> -<PRE> -public static final java.lang.String <B>UrlPrefix</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.UrlPrefix">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="NoMatchingRecordString"><!-- --></A><H3> -NoMatchingRecordString</H3> -<PRE> -public static final java.lang.String <B>NoMatchingRecordString</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.NoMatchingRecordString">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="Ok"><!-- --></A><H3> -Ok</H3> -<PRE> -public static final int <B>Ok</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.Ok">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ServerError"><!-- --></A><H3> -ServerError</H3> -<PRE> -public static final int <B>ServerError</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.ServerError">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HttpError"><!-- --></A><H3> -HttpError</H3> -<PRE> -public static final int <B>HttpError</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.HttpError">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="NoMatchingRecord"><!-- --></A><H3> -NoMatchingRecord</H3> -<PRE> -public static final int <B>NoMatchingRecord</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.ShardClient.NoMatchingRecord">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="_debug"><!-- --></A><H3> -_debug</H3> -<PRE> -public boolean <B>_debug</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="_donothing"><!-- --></A><H3> -_donothing</H3> -<PRE> -public boolean <B>_donothing</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="TotalGetTime"><!-- --></A><H3> -TotalGetTime</H3> -<PRE> -public long <B>TotalGetTime</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="TotalGetOps"><!-- --></A><H3> -TotalGetOps</H3> -<PRE> -public long <B>TotalGetOps</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="TotalPostTime"><!-- --></A><H3> -TotalPostTime</H3> -<PRE> -public long <B>TotalPostTime</B></PRE> -<DL> -<DL> -</DL> -</DL> -<HR> - -<A NAME="TotalPostOps"><!-- --></A><H3> -TotalPostOps</H3> -<PRE> -public long <B>TotalPostOps</B></PRE> -<DL> -<DL> -</DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="ShardClient()"><!-- --></A><H3> -ShardClient</H3> -<PRE> -public <B>ShardClient</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. - Called once per DB instance; there is one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="doGet(java.lang.String)"><!-- --></A><H3> -doGet</H3> -<PRE> -public java.util.Vector<char[]> <B>doGet</B>(java.lang.String url) - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Do a GET HTTP call. Returns the results in a Vector of char[] blocks. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="doPost(java.lang.String, java.lang.String)"><!-- --></A><H3> -doPost</H3> -<PRE> -public java.lang.String <B>doPost</B>(java.lang.String url, - java.lang.String postbody) - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Do a POST HTTP call. Returns the result as a String. -<P> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="main(java.lang.String[])"><!-- --></A><H3> -main</H3> -<PRE> -public static void <B>main</B>(java.lang.String[] args)</PRE> -<DL> -<DD>Simple test. -<P> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - <A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html" title="class in com.yahoo.ycsb.db"><B>NEXT CLASS</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/ShardClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="ShardClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/SherpaClient.html b/doc/javadoc/com/yahoo/ycsb/db/SherpaClient.html deleted file mode 100644 index ebbbe26e6c46b3e6e1b07a78b2f471f1e40a46fa..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/SherpaClient.html +++ /dev/null @@ -1,1280 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Fri Jan 22 13:42:46 PST 2010 --> -<TITLE> -SherpaClient -</TITLE> - -<META NAME="date" CONTENT="2010-01-22"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="SherpaClient"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/SherpaClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="SherpaClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb.db</FONT> -<BR> -Class SherpaClient</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DB</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.db.SherpaClient</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>SherpaClient</B><DT>extends <A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></DL> -</PRE> - -<P> -This is a Java Sherpa client to be used for the Benchmark app. Since Sherpa - is a RESful service, this class will make use of Apache's HttpClient 4.x to - make the web service calls. -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#ADDITIONAL_FIELD">ADDITIONAL_FIELD</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#CODE">CODE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#CONTINUATION">CONTINUATION</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#DELETE">DELETE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#END_HASH_KEY">END_HASH_KEY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#END_HASH_KEY_VALUE">END_HASH_KEY_VALUE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#FIELDS">FIELDS</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#FIRST_FIELD">FIRST_FIELD</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#GET">GET</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#HASH_SCAN">HASH_SCAN</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#HOSTS">HOSTS</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#HTTP">HTTP</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#HTTP_ERROR">HTTP_ERROR</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#JSON_ERROR">JSON_ERROR</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#NAMESPACE">NAMESPACE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#OK">OK</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#ORDERED_SCAN">ORDERED_SCAN</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#PREDICATE">PREDICATE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#RECORD_LIMIT">RECORD_LIMIT</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#RECORDS">RECORDS</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#SCAN_COMPLETED">SCAN_COMPLETED</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#SCANTYPE">SCANTYPE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#SET">SET</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#START_HASH_KEY">START_HASH_KEY</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#START_HASH_KEY_HEADER">START_HASH_KEY_HEADER</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#START_HASH_KEY_VALUE">START_HASH_KEY_VALUE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#START_KEY_ADDITIONAL">START_KEY_ADDITIONAL</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#START_KEY_FIRST">START_KEY_FIRST</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#STATUS">STATUS</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#URI_PATH">URI_PATH</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#UTF8">UTF8</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#VALUE">VALUE</A></B></CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>protected static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#YDHT">YDHT</A></B></CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#SherpaClient()">SherpaClient</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#cleanup()">cleanup</A></B>()</CODE> - -<BR> - Cleanup any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#createRecordBody(java.util.HashMap)">createRecordBody</A></B>(java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Method to create the Sherpa JSON record body from an input HashMap of - key/values.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#delete(java.lang.String, java.lang.String)">delete</A></B>(java.lang.String table, - java.lang.String key)</CODE> - -<BR> - Delete a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#encodeFields(java.util.Set)">encodeFields</A></B>(java.util.Set<java.lang.String> fields)</CODE> - -<BR> - Method to encode a set of fields to retrieve from a Sherpa Get or Scan - request.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#encodeString(java.lang.String)">encodeString</A></B>(java.lang.String key)</CODE> - -<BR> - Method to encode a String to UTF8.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#getHashKey(java.lang.String)">getHashKey</A></B>(java.lang.String key)</CODE> - -<BR> - Method to return the hex string representation of a 32-bit unsigned key - value used for doing Sherpa scans.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#getResponseCode(JSONObject)">getResponseCode</A></B>(JSONObject jsonObject)</CODE> - -<BR> - Helper method to retrieve the response status code from a JSON Response - to determine if it was successful or not.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#init()">init</A></B>()</CODE> - -<BR> - Initialize any state for this DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Insert a record in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#populateHashScanRecords(JSONObject, java.util.Vector)">populateHashScanRecords</A></B>(JSONObject curResult, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Method to parse and store a JSON response from a hash scan request.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#populateOrderedScanRecords(JSONObject, java.util.Vector)">populateOrderedScanRecords</A></B>(JSONObject curResult, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Method to parse and store a JSON response from an ordered scan request.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#populateReadRecord(JSONObject, java.util.HashMap)">populateReadRecord</A></B>(JSONObject response, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Method to parse and store a JSON response from reading a single Sherpa - record into the corresponding HashMap key/value pairs.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</CODE> - -<BR> - Read a record from the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</CODE> - -<BR> - Perform a range scan for a set of records in the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> int</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/db/SherpaClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</CODE> - -<BR> - Update a record in the database.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.DB"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#getProperties()">getProperties</A>, <A HREF="../../../../com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)">setProperties</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="GET"><!-- --></A><H3> -GET</H3> -<PRE> -protected static final java.lang.String <B>GET</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.GET">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SET"><!-- --></A><H3> -SET</H3> -<PRE> -protected static final java.lang.String <B>SET</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.SET">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="DELETE"><!-- --></A><H3> -DELETE</H3> -<PRE> -protected static final java.lang.String <B>DELETE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.DELETE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HASH_SCAN"><!-- --></A><H3> -HASH_SCAN</H3> -<PRE> -protected static final java.lang.String <B>HASH_SCAN</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.HASH_SCAN">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ORDERED_SCAN"><!-- --></A><H3> -ORDERED_SCAN</H3> -<PRE> -protected static final java.lang.String <B>ORDERED_SCAN</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.ORDERED_SCAN">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIRST_FIELD"><!-- --></A><H3> -FIRST_FIELD</H3> -<PRE> -protected static final java.lang.String <B>FIRST_FIELD</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.FIRST_FIELD">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="ADDITIONAL_FIELD"><!-- --></A><H3> -ADDITIONAL_FIELD</H3> -<PRE> -protected static final java.lang.String <B>ADDITIONAL_FIELD</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.ADDITIONAL_FIELD">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="START_KEY_FIRST"><!-- --></A><H3> -START_KEY_FIRST</H3> -<PRE> -protected static final java.lang.String <B>START_KEY_FIRST</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.START_KEY_FIRST">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="START_KEY_ADDITIONAL"><!-- --></A><H3> -START_KEY_ADDITIONAL</H3> -<PRE> -protected static final java.lang.String <B>START_KEY_ADDITIONAL</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.START_KEY_ADDITIONAL">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="UTF8"><!-- --></A><H3> -UTF8</H3> -<PRE> -protected static final java.lang.String <B>UTF8</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.UTF8">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="START_HASH_KEY_HEADER"><!-- --></A><H3> -START_HASH_KEY_HEADER</H3> -<PRE> -protected static final java.lang.String <B>START_HASH_KEY_HEADER</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.START_HASH_KEY_HEADER">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="CONTINUATION"><!-- --></A><H3> -CONTINUATION</H3> -<PRE> -protected static final java.lang.String <B>CONTINUATION</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.CONTINUATION">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="START_HASH_KEY"><!-- --></A><H3> -START_HASH_KEY</H3> -<PRE> -protected static final java.lang.String <B>START_HASH_KEY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.START_HASH_KEY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="END_HASH_KEY"><!-- --></A><H3> -END_HASH_KEY</H3> -<PRE> -protected static final java.lang.String <B>END_HASH_KEY</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.END_HASH_KEY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="START_HASH_KEY_VALUE"><!-- --></A><H3> -START_HASH_KEY_VALUE</H3> -<PRE> -protected static final java.lang.String <B>START_HASH_KEY_VALUE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.START_HASH_KEY_VALUE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="END_HASH_KEY_VALUE"><!-- --></A><H3> -END_HASH_KEY_VALUE</H3> -<PRE> -protected static final java.lang.String <B>END_HASH_KEY_VALUE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.END_HASH_KEY_VALUE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="RECORD_LIMIT"><!-- --></A><H3> -RECORD_LIMIT</H3> -<PRE> -protected static final java.lang.String <B>RECORD_LIMIT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.RECORD_LIMIT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="PREDICATE"><!-- --></A><H3> -PREDICATE</H3> -<PRE> -protected static final java.lang.String <B>PREDICATE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.PREDICATE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCAN_COMPLETED"><!-- --></A><H3> -SCAN_COMPLETED</H3> -<PRE> -protected static final java.lang.String <B>SCAN_COMPLETED</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.SCAN_COMPLETED">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="RECORDS"><!-- --></A><H3> -RECORDS</H3> -<PRE> -protected static final java.lang.String <B>RECORDS</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.RECORDS">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="URI_PATH"><!-- --></A><H3> -URI_PATH</H3> -<PRE> -protected static final java.lang.String <B>URI_PATH</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.URI_PATH">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="YDHT"><!-- --></A><H3> -YDHT</H3> -<PRE> -protected static final java.lang.String <B>YDHT</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.YDHT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="STATUS"><!-- --></A><H3> -STATUS</H3> -<PRE> -protected static final java.lang.String <B>STATUS</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.STATUS">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="CODE"><!-- --></A><H3> -CODE</H3> -<PRE> -protected static final java.lang.String <B>CODE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.CODE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIELDS"><!-- --></A><H3> -FIELDS</H3> -<PRE> -protected static final java.lang.String <B>FIELDS</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.FIELDS">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="VALUE"><!-- --></A><H3> -VALUE</H3> -<PRE> -protected static final java.lang.String <B>VALUE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.VALUE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="OK"><!-- --></A><H3> -OK</H3> -<PRE> -protected static final int <B>OK</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.OK">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="JSON_ERROR"><!-- --></A><H3> -JSON_ERROR</H3> -<PRE> -protected static final int <B>JSON_ERROR</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.JSON_ERROR">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HTTP_ERROR"><!-- --></A><H3> -HTTP_ERROR</H3> -<PRE> -protected static final int <B>HTTP_ERROR</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.HTTP_ERROR">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HOSTS"><!-- --></A><H3> -HOSTS</H3> -<PRE> -protected static final java.lang.String <B>HOSTS</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.HOSTS">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="HTTP"><!-- --></A><H3> -HTTP</H3> -<PRE> -protected static final java.lang.String <B>HTTP</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.HTTP">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="NAMESPACE"><!-- --></A><H3> -NAMESPACE</H3> -<PRE> -protected static final java.lang.String <B>NAMESPACE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.NAMESPACE">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCANTYPE"><!-- --></A><H3> -SCANTYPE</H3> -<PRE> -protected static final java.lang.String <B>SCANTYPE</B></PRE> -<DL> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.db.SherpaClient.SCANTYPE">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="SherpaClient()"><!-- --></A><H3> -SherpaClient</H3> -<PRE> -public <B>SherpaClient</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init()"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Initialize any state for this DB. Called once per DB instance; there is - one DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#init()">init</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="cleanup()"><!-- --></A><H3> -cleanup</H3> -<PRE> -public void <B>cleanup</B>() - throws <A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></PRE> -<DL> -<DD>Cleanup any state for this DB. Called once per DB instance; there is one - DB instance per client thread. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#cleanup()">cleanup</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="encodeString(java.lang.String)"><!-- --></A><H3> -encodeString</H3> -<PRE> -public static java.lang.String <B>encodeString</B>(java.lang.String key)</PRE> -<DL> -<DD>Method to encode a String to UTF8. All Sherpa table/record/field and - record body data must be UTF8 since access is done via HTTP REST calls. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>key</CODE> - Key string we want to encode to UTF8 -<DT><B>Returns:</B><DD>UTF8 encoding of the input string</DL> -</DD> -</DL> -<HR> - -<A NAME="encodeFields(java.util.Set)"><!-- --></A><H3> -encodeFields</H3> -<PRE> -public static java.lang.String <B>encodeFields</B>(java.util.Set<java.lang.String> fields)</PRE> -<DL> -<DD>Method to encode a set of fields to retrieve from a Sherpa Get or Scan - request. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>fields</CODE> - Set of String fields to retrieve from a Sherpa Get or Scan - request -<DT><B>Returns:</B><DD>String encoding of the set of fields to retrieve from a Sherpa - request. This has the format of ?field=<field1>&field=<field2>...</DL> -</DD> -</DL> -<HR> - -<A NAME="getHashKey(java.lang.String)"><!-- --></A><H3> -getHashKey</H3> -<PRE> -public static java.lang.String <B>getHashKey</B>(java.lang.String key)</PRE> -<DL> -<DD>Method to return the hex string representation of a 32-bit unsigned key - value used for doing Sherpa scans. This needs to match how Sherpa in the - backend is hashing the keys to determine which tablet it is stored in. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>key</CODE> - Key string to be hashed -<DT><B>Returns:</B><DD>String hex representation of the hashing of the input key</DL> -</DD> -</DL> -<HR> - -<A NAME="getResponseCode(JSONObject)"><!-- --></A><H3> -getResponseCode</H3> -<PRE> -public static int <B>getResponseCode</B>(JSONObject jsonObject)</PRE> -<DL> -<DD>Helper method to retrieve the response status code from a JSON Response - to determine if it was successful or not. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>jsonObject</CODE> - JSONObject response from Sherpa -<DT><B>Returns:</B><DD>int Response status code indicating if the request was successful - or not</DL> -</DD> -</DL> -<HR> - -<A NAME="createRecordBody(java.util.HashMap)"><!-- --></A><H3> -createRecordBody</H3> -<PRE> -public static java.lang.String <B>createRecordBody</B>(java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD>Method to create the Sherpa JSON record body from an input HashMap of - key/values. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>values</CODE> - HashMap of key/values to be stored in a Sherpa record -<DT><B>Returns:</B><DD>Sherpa JSON record representation of the input key/values HashMap</DL> -</DD> -</DL> -<HR> - -<A NAME="populateReadRecord(JSONObject, java.util.HashMap)"><!-- --></A><H3> -populateReadRecord</H3> -<PRE> -public static void <B>populateReadRecord</B>(JSONObject response, - java.util.HashMap<java.lang.String,java.lang.String> result) - throws JSONException</PRE> -<DL> -<DD>Method to parse and store a JSON response from reading a single Sherpa - record into the corresponding HashMap key/value pairs. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>response</CODE> - JSONObject response from reading a single Sherpa record<DD><CODE>result</CODE> - HashMap key/value pairs for the record's field/values -<DT><B>Throws:</B> -<DD><CODE>JSONException</CODE> - If there is an error parsing the JSON response</DL> -</DD> -</DL> -<HR> - -<A NAME="populateHashScanRecords(JSONObject, java.util.Vector)"><!-- --></A><H3> -populateHashScanRecords</H3> -<PRE> -public static void <B>populateHashScanRecords</B>(JSONObject curResult, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result) - throws JSONException</PRE> -<DL> -<DD>Method to parse and store a JSON response from a hash scan request. This - consists of multiple records each of which will be stored in the input - result Vector as a HashMap of key/value pairs. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>curResult</CODE> - JSONObject response from a Sherpa hash scan request<DD><CODE>result</CODE> - Vector of Sherpa records each stored as a HashMap of - key/values for the record's field/values -<DT><B>Throws:</B> -<DD><CODE>JSONException</CODE> - If there is an error parsing the JSON response</DL> -</DD> -</DL> -<HR> - -<A NAME="populateOrderedScanRecords(JSONObject, java.util.Vector)"><!-- --></A><H3> -populateOrderedScanRecords</H3> -<PRE> -public static void <B>populateOrderedScanRecords</B>(JSONObject curResult, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result) - throws JSONException</PRE> -<DL> -<DD>Method to parse and store a JSON response from an ordered scan request. - This consists of multiple records each of which will be stored in the - input result Vector as a HashMap of key/value pairs. -<P> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>curResult</CODE> - JSONObject response from a Sherpa ordered scan request<DD><CODE>result</CODE> - Vector of Sherpa records each stored as a HashMap of - key/values for the record's field/values -<DT><B>Throws:</B> -<DD><CODE>JSONException</CODE> - If there is an error parsing the JSON response</DL> -</DD> -</DL> -<HR> - -<A NAME="delete(java.lang.String, java.lang.String)"><!-- --></A><H3> -delete</H3> -<PRE> -public int <B>delete</B>(java.lang.String table, - java.lang.String key)</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">DB</A></CODE></B></DD> -<DD>Delete a record from the database. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)">delete</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to delete. -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="insert(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -insert</H3> -<PRE> -public int <B>insert</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">DB</A></CODE></B></DD> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)">insert</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><!-- --></A><H3> -read</H3> -<PRE> -public int <B>read</B>(java.lang.String table, - java.lang.String key, - java.util.Set<java.lang.String> fields, - java.util.HashMap<java.lang.String,java.lang.String> result)</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">DB</A></CODE></B></DD> -<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)">read</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><!-- --></A><H3> -scan</H3> -<PRE> -public int <B>scan</B>(java.lang.String table, - java.lang.String startkey, - int recordcount, - java.util.Set<java.lang.String> fields, - java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">DB</A></CODE></B></DD> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)">scan</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<HR> - -<A NAME="update(java.lang.String, java.lang.String, java.util.HashMap)"><!-- --></A><H3> -update</H3> -<PRE> -public int <B>update</B>(java.lang.String table, - java.lang.String key, - java.util.HashMap<java.lang.String,java.lang.String> values)</PRE> -<DL> -<DD><B>Description copied from class: <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">DB</A></CODE></B></DD> -<DD>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. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)">update</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></CODE></DL> -</DD> -<DD><DL> -<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record -<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/db/ShardClient.html" title="class in com.yahoo.ycsb.db"><B>PREV CLASS</B></A> - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/SherpaClient.html" target="_top"><B>FRAMES</B></A> - <A HREF="SherpaClient.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/package-frame.html b/doc/javadoc/com/yahoo/ycsb/db/package-frame.html deleted file mode 100644 index d6d9b3e3557828338669fad1646b6a6075c253f4..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/package-frame.html +++ /dev/null @@ -1,40 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.db -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameTitleFont"> -<A HREF="../../../../com/yahoo/ycsb/db/package-summary.html" target="classFrame">com.yahoo.ycsb.db</A></FONT> -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> -Classes</FONT> -<FONT CLASS="FrameItemFont"> -<BR> -<A HREF="CassandraClient5.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient5</A> -<BR> -<A HREF="CassandraClient6.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient6</A> -<BR> -<A HREF="CassandraClient7.html" title="class in com.yahoo.ycsb.db" target="classFrame">CassandraClient7</A> -<BR> -<A HREF="HBaseClient.html" title="class in com.yahoo.ycsb.db" target="classFrame">HBaseClient</A> -<BR> -<A HREF="MongoDbClient.html" title="class in com.yahoo.ycsb.db" target="classFrame">MongoDbClient</A></FONT></TD> -</TR> -</TABLE> - - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/package-summary.html b/doc/javadoc/com/yahoo/ycsb/db/package-summary.html deleted file mode 100644 index 5138c2f9b5fc0a93d825ba64ffad3fb6617a1ce4..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/package-summary.html +++ /dev/null @@ -1,171 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.db -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb.db"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/package-summary.html"><B>PREV PACKAGE</B></A> - <A HREF="../../../../com/yahoo/ycsb/generator/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<H2> -Package com.yahoo.ycsb.db -</H2> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A></B></TD> -<TD>Cassandra 0.5 client for YCSB framework</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A></B></TD> -<TD>Cassandra 0.6 client for YCSB framework</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A></B></TD> -<TD>Cassandra 0.7 client for YCSB framework</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A></B></TD> -<TD>HBase client for YCSB framework</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A></B></TD> -<TD>MongoDB client for YCSB framework.</TD> -</TR> -</TABLE> - - -<P> -<DL> -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/package-summary.html"><B>PREV PACKAGE</B></A> - <A HREF="../../../../com/yahoo/ycsb/generator/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/db/package-tree.html b/doc/javadoc/com/yahoo/ycsb/db/package-tree.html deleted file mode 100644 index a20a816aa2b54532aef03ba22f727cf38df79b3e..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/db/package-tree.html +++ /dev/null @@ -1,153 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.db Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb.db Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/package-tree.html"><B>PREV</B></A> - <A HREF="../../../../com/yahoo/ycsb/generator/package-tree.html"><B>NEXT</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For Package com.yahoo.ycsb.db -</H2> -</CENTER> -<DL> -<DT><B>Package Hierarchies:</B><DD><A HREF="../../../../overview-tree.html">All Packages</A></DL> -<HR> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.Object<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>DB</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="../../../../com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient5</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="../../../../com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient6</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="../../../../com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient7</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="../../../../com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>HBaseClient</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="../../../../com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db"><B>MongoDbClient</B></A></UL> -</UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/package-tree.html"><B>PREV</B></A> - <A HREF="../../../../com/yahoo/ycsb/generator/package-tree.html"><B>NEXT</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/db/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/package-frame.html b/doc/javadoc/com/yahoo/ycsb/package-frame.html deleted file mode 100644 index 9281ed9b5b73f164158d2b5f44b3ce076abdf378..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/package-frame.html +++ /dev/null @@ -1,61 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameTitleFont"> -<A HREF="../../../com/yahoo/ycsb/package-summary.html" target="classFrame">com.yahoo.ycsb</A></FONT> -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> -Classes</FONT> -<FONT CLASS="FrameItemFont"> -<BR> -<A HREF="BasicDB.html" title="class in com.yahoo.ycsb" target="classFrame">BasicDB</A> -<BR> -<A HREF="Client.html" title="class in com.yahoo.ycsb" target="classFrame">Client</A> -<BR> -<A HREF="CommandLine.html" title="class in com.yahoo.ycsb" target="classFrame">CommandLine</A> -<BR> -<A HREF="DB.html" title="class in com.yahoo.ycsb" target="classFrame">DB</A> -<BR> -<A HREF="DBFactory.html" title="class in com.yahoo.ycsb" target="classFrame">DBFactory</A> -<BR> -<A HREF="DBWrapper.html" title="class in com.yahoo.ycsb" target="classFrame">DBWrapper</A> -<BR> -<A HREF="Utils.html" title="class in com.yahoo.ycsb" target="classFrame">Utils</A> -<BR> -<A HREF="Workload.html" title="class in com.yahoo.ycsb" target="classFrame">Workload</A></FONT></TD> -</TR> -</TABLE> - - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> -Exceptions</FONT> -<FONT CLASS="FrameItemFont"> -<BR> -<A HREF="DBException.html" title="class in com.yahoo.ycsb" target="classFrame">DBException</A> -<BR> -<A HREF="UnknownDBException.html" title="class in com.yahoo.ycsb" target="classFrame">UnknownDBException</A> -<BR> -<A HREF="WorkloadException.html" title="class in com.yahoo.ycsb" target="classFrame">WorkloadException</A></FONT></TD> -</TR> -</TABLE> - - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/package-summary.html b/doc/javadoc/com/yahoo/ycsb/package-summary.html deleted file mode 100644 index 82439c75b558e6a319b4d2b2d72f921d2afd1136..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/package-summary.html +++ /dev/null @@ -1,205 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV PACKAGE - <A HREF="../../../com/yahoo/ycsb/db/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<H2> -Package com.yahoo.ycsb -</H2> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A></B></TD> -<TD>Basic DB that just prints out the requested operations, instead of doing them against a database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A></B></TD> -<TD>Main class for executing YCSB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A></B></TD> -<TD>A simple command line client to a database, using the appropriate com.yahoo.ycsb.DB implementation.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A></B></TD> -<TD>A layer for accessing a database to be benchmarked.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb">DBFactory</A></B></TD> -<TD>Creates a DB layer by dynamically classloading the specified DB class.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A></B></TD> -<TD>Wrapper around a "real" DB that measures latencies and counts return codes.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A></B></TD> -<TD>Utility functions.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></B></TD> -<TD>One experiment scenario.</TD> -</TR> -</TABLE> - - -<P> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Exception Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A></B></TD> -<TD>Something bad happened while interacting with the database.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A></B></TD> -<TD>Could not create the specified DB.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></B></TD> -<TD>The workload tried to do something bad.</TD> -</TR> -</TABLE> - - -<P> -<DL> -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV PACKAGE - <A HREF="../../../com/yahoo/ycsb/db/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/package-tree.html b/doc/javadoc/com/yahoo/ycsb/package-tree.html deleted file mode 100644 index d62eac88c33bdc719b9011638d5a9aa8f380f42c..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/package-tree.html +++ /dev/null @@ -1,158 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - <A HREF="../../../com/yahoo/ycsb/db/package-tree.html"><B>NEXT</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For Package com.yahoo.ycsb -</H2> -</CENTER> -<DL> -<DT><B>Package Hierarchies:</B><DD><A HREF="../../../overview-tree.html">All Packages</A></DL> -<HR> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.Object<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>Client</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>CommandLine</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>DB</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb"><B>BasicDB</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>DBWrapper</B></A></UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>DBFactory</B></A><LI TYPE="circle">java.lang.Throwable (implements java.io.Serializable) -<UL> -<LI TYPE="circle">java.lang.Exception<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>DBException</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>UnknownDBException</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>WorkloadException</B></A></UL> -</UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>Utils</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>Workload</B></A></UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - <A HREF="../../../com/yahoo/ycsb/db/package-tree.html"><B>NEXT</B></A></FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../index.html?com/yahoo/ycsb/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/workloads/CoreWorkload.html b/doc/javadoc/com/yahoo/ycsb/workloads/CoreWorkload.html deleted file mode 100644 index 8c1f332fde5cce7b0f6089ad3deddb8e1a2cfd95..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/workloads/CoreWorkload.html +++ /dev/null @@ -1,972 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -CoreWorkload -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="CoreWorkload"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/CoreWorkload.html" target="_top"><B>FRAMES</B></A> - <A HREF="CoreWorkload.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<!-- ======== START OF CLASS DATA ======== --> -<H2> -<FONT SIZE="-1"> -com.yahoo.ycsb.workloads</FONT> -<BR> -Class CoreWorkload</H2> -<PRE> -java.lang.Object - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.Workload</A> - <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.yahoo.ycsb.workloads.CoreWorkload</B> -</PRE> -<HR> -<DL> -<DT><PRE>public class <B>CoreWorkload</B><DT>extends <A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></DL> -</PRE> - -<P> -The core benchmark scenario. Represents a set of clients doing simple CRUD operations. The relative - proportion of different kinds of operations, and other properties of the workload, are controlled - by parameters specified at runtime. - - Properties to control the client: - <UL> - <LI><b>fieldcount</b>: the number of fields in a record (default: 10) - <LI><b>fieldlength</b>: the size of each field (default: 100) - <LI><b>readallfields</b>: should reads read all fields (true) or just one (false) (default: true) - <LI><b>readproportion</b>: what proportion of operations should be reads (default: 0.95) - <LI><b>updateproportion</b>: what proportion of operations should be updates (default: 0.05) - <LI><b>insertproportion</b>: what proportion of operations should be inserts (default: 0) - <LI><b>scanproportion</b>: what proportion of operations should be scans (default: 0) - <LI><b>readmodifywriteproportion</b>: what proportion of operations should be read a record, modify it, write it back (default: 0) - <LI><b>requestdistribution</b>: what distribution should be used to select the records to operate on - uniform, zipfian or latest (default: uniform) - <LI><b>maxscanlength</b>: for scans, what is the maximum number of records to scan (default: 1000) - <LI><b>scanlengthdistribution</b>: for scans, what distribution should be used to choose the number of records to scan, for each scan, between 1 and maxscanlength (default: uniform) - <LI><b>insertorder</b>: should records be inserted in order by key ("ordered"), or in hashed order ("hashed") (default: hashed) - </ul> -<P> - -<P> -<HR> - -<P> -<!-- =========== FIELD SUMMARY =========== --> - -<A NAME="field_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Field Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY">FIELD_COUNT_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the number of fields in a record.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY_DEFAULT">FIELD_COUNT_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - Default number of fields in a record.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY">FIELD_LENGTH_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the length of a field in bytes.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY_DEFAULT">FIELD_LENGTH_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default length of a field in bytes.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY">INSERT_ORDER_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the order to insert records.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY_DEFAULT">INSERT_ORDER_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - Default insert order.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY">INSERT_PROPORTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the proportion of transactions that are inserts.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY_DEFAULT">INSERT_PROPORTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default proportion of transactions that are inserts.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY">MAX_SCAN_LENGTH_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the max scan length (number of records)</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY_DEFAULT">MAX_SCAN_LENGTH_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default max scan length.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY">READ_ALL_FIELDS_PROPERTY</A></B></CODE> - -<BR> - The name of the property for deciding whether to read one field (false) or all fields (true) of a record.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY_DEFAULT">READ_ALL_FIELDS_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default value for the readallfields property.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY">READ_PROPORTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the proportion of transactions that are reads.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY_DEFAULT">READ_PROPORTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default proportion of transactions that are reads.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY">READMODIFYWRITE_PROPORTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the proportion of transactions that are read-modify-write.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT">READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default proportion of transactions that are scans.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY">REQUEST_DISTRIBUTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the the distribution of requests across the keyspace.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY_DEFAULT">REQUEST_DISTRIBUTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default distribution of requests across the keyspace</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY">SCAN_LENGTH_DISTRIBUTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the scan length distribution.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT">SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default max scan length.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY">SCAN_PROPORTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the proportion of transactions that are scans.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY_DEFAULT">SCAN_PROPORTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default proportion of transactions that are scans.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#TABLENAME">TABLENAME</A></B></CODE> - -<BR> - The name of the database table to run queries against.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY">UPDATE_PROPORTION_PROPERTY</A></B></CODE> - -<BR> - The name of the property for the proportion of transactions that are updates.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE>static java.lang.String</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY_DEFAULT">UPDATE_PROPORTION_PROPERTY_DEFAULT</A></B></CODE> - -<BR> - The default proportion of transactions that are updates.</TD> -</TR> -</TABLE> - <A NAME="fields_inherited_from_class_com.yahoo.ycsb.Workload"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Fields inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY">INSERT_START_PROPERTY</A>, <A HREF="../../../../com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY_DEFAULT">INSERT_START_PROPERTY_DEFAULT</A></CODE></TD> -</TR> -</TABLE> - -<!-- ======== CONSTRUCTOR SUMMARY ======== --> - -<A NAME="constructor_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Constructor Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#CoreWorkload()">CoreWorkload</A></B>()</CODE> - -<BR> - </TD> -</TR> -</TABLE> - -<!-- ========== METHOD SUMMARY =========== --> - -<A NAME="method_summary"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Method Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doInsert(com.yahoo.ycsb.DB, java.lang.Object)">doInsert</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</CODE> - -<BR> - Do one insert operation.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> boolean</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransaction(com.yahoo.ycsb.DB, java.lang.Object)">doTransaction</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</CODE> - -<BR> - Do one transaction operation.</TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionInsert(com.yahoo.ycsb.DB)">doTransactionInsert</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionRead(com.yahoo.ycsb.DB)">doTransactionRead</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionReadModifyWrite(com.yahoo.ycsb.DB)">doTransactionReadModifyWrite</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionScan(com.yahoo.ycsb.DB)">doTransactionScan</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionUpdate(com.yahoo.ycsb.DB)">doTransactionUpdate</A></B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</CODE> - -<BR> - </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> -<CODE> void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html#init(java.util.Properties)">init</A></B>(java.util.Properties p)</CODE> - -<BR> - Initialize the scenario.</TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_com.yahoo.ycsb.Workload"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html#cleanup()">cleanup</A>, <A HREF="../../../../com/yahoo/ycsb/Workload.html#initThread(java.util.Properties, int, int)">initThread</A></CODE></TD> -</TR> -</TABLE> - <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> -</TR> -</TABLE> - -<P> - -<!-- ============ FIELD DETAIL =========== --> - -<A NAME="field_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Field Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="TABLENAME"><!-- --></A><H3> -TABLENAME</H3> -<PRE> -public static final java.lang.String <B>TABLENAME</B></PRE> -<DL> -<DD>The name of the database table to run queries against. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.TABLENAME">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIELD_COUNT_PROPERTY"><!-- --></A><H3> -FIELD_COUNT_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>FIELD_COUNT_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the number of fields in a record. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.FIELD_COUNT_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIELD_COUNT_PROPERTY_DEFAULT"><!-- --></A><H3> -FIELD_COUNT_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>FIELD_COUNT_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>Default number of fields in a record. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIELD_LENGTH_PROPERTY"><!-- --></A><H3> -FIELD_LENGTH_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>FIELD_LENGTH_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the length of a field in bytes. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.FIELD_LENGTH_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="FIELD_LENGTH_PROPERTY_DEFAULT"><!-- --></A><H3> -FIELD_LENGTH_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>FIELD_LENGTH_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default length of a field in bytes. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.FIELD_LENGTH_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READ_ALL_FIELDS_PROPERTY"><!-- --></A><H3> -READ_ALL_FIELDS_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>READ_ALL_FIELDS_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for deciding whether to read one field (false) or all fields (true) of a record. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READ_ALL_FIELDS_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READ_ALL_FIELDS_PROPERTY_DEFAULT"><!-- --></A><H3> -READ_ALL_FIELDS_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>READ_ALL_FIELDS_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default value for the readallfields property. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READ_ALL_FIELDS_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READ_PROPORTION_PROPERTY"><!-- --></A><H3> -READ_PROPORTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>READ_PROPORTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the proportion of transactions that are reads. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READ_PROPORTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READ_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><H3> -READ_PROPORTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>READ_PROPORTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default proportion of transactions that are reads. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READ_PROPORTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="UPDATE_PROPORTION_PROPERTY"><!-- --></A><H3> -UPDATE_PROPORTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>UPDATE_PROPORTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the proportion of transactions that are updates. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.UPDATE_PROPORTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="UPDATE_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><H3> -UPDATE_PROPORTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>UPDATE_PROPORTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default proportion of transactions that are updates. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.UPDATE_PROPORTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_PROPORTION_PROPERTY"><!-- --></A><H3> -INSERT_PROPORTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>INSERT_PROPORTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the proportion of transactions that are inserts. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.INSERT_PROPORTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><H3> -INSERT_PROPORTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>INSERT_PROPORTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default proportion of transactions that are inserts. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.INSERT_PROPORTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCAN_PROPORTION_PROPERTY"><!-- --></A><H3> -SCAN_PROPORTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>SCAN_PROPORTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the proportion of transactions that are scans. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.SCAN_PROPORTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCAN_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><H3> -SCAN_PROPORTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>SCAN_PROPORTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default proportion of transactions that are scans. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.SCAN_PROPORTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READMODIFYWRITE_PROPORTION_PROPERTY"><!-- --></A><H3> -READMODIFYWRITE_PROPORTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>READMODIFYWRITE_PROPORTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the proportion of transactions that are read-modify-write. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READMODIFYWRITE_PROPORTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><H3> -READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default proportion of transactions that are scans. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="REQUEST_DISTRIBUTION_PROPERTY"><!-- --></A><H3> -REQUEST_DISTRIBUTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>REQUEST_DISTRIBUTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the the distribution of requests across the keyspace. Options are "uniform", "zipfian" and "latest" -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.REQUEST_DISTRIBUTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="REQUEST_DISTRIBUTION_PROPERTY_DEFAULT"><!-- --></A><H3> -REQUEST_DISTRIBUTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>REQUEST_DISTRIBUTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default distribution of requests across the keyspace -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.REQUEST_DISTRIBUTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="MAX_SCAN_LENGTH_PROPERTY"><!-- --></A><H3> -MAX_SCAN_LENGTH_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>MAX_SCAN_LENGTH_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the max scan length (number of records) -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.MAX_SCAN_LENGTH_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="MAX_SCAN_LENGTH_PROPERTY_DEFAULT"><!-- --></A><H3> -MAX_SCAN_LENGTH_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>MAX_SCAN_LENGTH_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default max scan length. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.MAX_SCAN_LENGTH_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCAN_LENGTH_DISTRIBUTION_PROPERTY"><!-- --></A><H3> -SCAN_LENGTH_DISTRIBUTION_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>SCAN_LENGTH_DISTRIBUTION_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the scan length distribution. Options are "uniform" and "zipfian" (favoring short scans) -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.SCAN_LENGTH_DISTRIBUTION_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT"><!-- --></A><H3> -SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>The default max scan length. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_ORDER_PROPERTY"><!-- --></A><H3> -INSERT_ORDER_PROPERTY</H3> -<PRE> -public static final java.lang.String <B>INSERT_ORDER_PROPERTY</B></PRE> -<DL> -<DD>The name of the property for the order to insert records. Options are "ordered" or "hashed" -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.INSERT_ORDER_PROPERTY">Constant Field Values</A></DL> -</DL> -<HR> - -<A NAME="INSERT_ORDER_PROPERTY_DEFAULT"><!-- --></A><H3> -INSERT_ORDER_PROPERTY_DEFAULT</H3> -<PRE> -public static final java.lang.String <B>INSERT_ORDER_PROPERTY_DEFAULT</B></PRE> -<DL> -<DD>Default insert order. -<P> -<DL> -<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#com.yahoo.ycsb.workloads.CoreWorkload.INSERT_ORDER_PROPERTY_DEFAULT">Constant Field Values</A></DL> -</DL> - -<!-- ========= CONSTRUCTOR DETAIL ======== --> - -<A NAME="constructor_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Constructor Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="CoreWorkload()"><!-- --></A><H3> -CoreWorkload</H3> -<PRE> -public <B>CoreWorkload</B>()</PRE> -<DL> -</DL> - -<!-- ============ METHOD DETAIL ========== --> - -<A NAME="method_detail"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> -<B>Method Detail</B></FONT></TH> -</TR> -</TABLE> - -<A NAME="init(java.util.Properties)"><!-- --></A><H3> -init</H3> -<PRE> -public void <B>init</B>(java.util.Properties p) - throws <A HREF="../../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></PRE> -<DL> -<DD>Initialize the scenario. - Called once, in the main client thread, before any operations are started. -<P> -<DD><DL> -<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html#init(java.util.Properties)">init</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Throws:</B> -<DD><CODE><A HREF="../../../../com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A></CODE></DL> -</DD> -</DL> -<HR> - -<A NAME="doInsert(com.yahoo.ycsb.DB, java.lang.Object)"><!-- --></A><H3> -doInsert</H3> -<PRE> -public boolean <B>doInsert</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</PRE> -<DL> -<DD>Do one insert operation. Because it will be called concurrently from multiple client threads, this - function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - effects other than DB operations. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html#doInsert(com.yahoo.ycsb.DB, java.lang.Object)">doInsert</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></CODE></DL> -</DD> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransaction(com.yahoo.ycsb.DB, java.lang.Object)"><!-- --></A><H3> -doTransaction</H3> -<PRE> -public boolean <B>doTransaction</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db, - java.lang.Object threadstate)</PRE> -<DL> -<DD>Do one transaction operation. Because it will be called concurrently from multiple client threads, this - function must be thread safe. However, avoid synchronized, or the threads will block waiting for each - other, and it will be difficult to reach the target throughput. Ideally, this function would have no side - effects other than DB operations. -<P> -<DD><DL> -<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html#doTransaction(com.yahoo.ycsb.DB, java.lang.Object)">doTransaction</A></CODE> in class <CODE><A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></CODE></DL> -</DD> -<DD><DL> - -<DT><B>Returns:</B><DD>false if the workload knows it is done for this thread. Client will terminate the thread. Return true otherwise. Return true for workloads that rely on operationcount. For workloads that read traces from a file, return true when there are more to do, false when you are done.</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransactionRead(com.yahoo.ycsb.DB)"><!-- --></A><H3> -doTransactionRead</H3> -<PRE> -public void <B>doTransactionRead</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransactionReadModifyWrite(com.yahoo.ycsb.DB)"><!-- --></A><H3> -doTransactionReadModifyWrite</H3> -<PRE> -public void <B>doTransactionReadModifyWrite</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransactionScan(com.yahoo.ycsb.DB)"><!-- --></A><H3> -doTransactionScan</H3> -<PRE> -public void <B>doTransactionScan</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransactionUpdate(com.yahoo.ycsb.DB)"><!-- --></A><H3> -doTransactionUpdate</H3> -<PRE> -public void <B>doTransactionUpdate</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<HR> - -<A NAME="doTransactionInsert(com.yahoo.ycsb.DB)"><!-- --></A><H3> -doTransactionInsert</H3> -<PRE> -public void <B>doTransactionInsert</B>(<A HREF="../../../../com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> db)</PRE> -<DL> -<DD><DL> -</DL> -</DD> -</DL> -<!-- ========= END OF CLASS DATA ========= --> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS - NEXT CLASS</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/CoreWorkload.html" target="_top"><B>FRAMES</B></A> - <A HREF="CoreWorkload.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -<TR> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> - SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> -<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> -DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/workloads/package-frame.html b/doc/javadoc/com/yahoo/ycsb/workloads/package-frame.html deleted file mode 100644 index 8194082faddfd5613f2138c774f3fd875ba7f339..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/workloads/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.workloads -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> -<FONT size="+1" CLASS="FrameTitleFont"> -<A HREF="../../../../com/yahoo/ycsb/workloads/package-summary.html" target="classFrame">com.yahoo.ycsb.workloads</A></FONT> -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> -Classes</FONT> -<FONT CLASS="FrameItemFont"> -<BR> -<A HREF="CoreWorkload.html" title="class in com.yahoo.ycsb.workloads" target="classFrame">CoreWorkload</A></FONT></TD> -</TR> -</TABLE> - - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/workloads/package-summary.html b/doc/javadoc/com/yahoo/ycsb/workloads/package-summary.html deleted file mode 100644 index 798dd239ec6e5aa12528d703b5c6da5e7f290ebf..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/workloads/package-summary.html +++ /dev/null @@ -1,155 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.workloads -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb.workloads"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/measurements/package-summary.html"><B>PREV PACKAGE</B></A> - NEXT PACKAGE</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<H2> -Package com.yahoo.ycsb.workloads -</H2> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class Summary</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="15%"><B><A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A></B></TD> -<TD>The core benchmark scenario.</TD> -</TR> -</TABLE> - - -<P> -<DL> -</DL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/measurements/package-summary.html"><B>PREV PACKAGE</B></A> - NEXT PACKAGE</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/package-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/com/yahoo/ycsb/workloads/package-tree.html b/doc/javadoc/com/yahoo/ycsb/workloads/package-tree.html deleted file mode 100644 index d3abb3e6e59b4c2833cb43b72e5d9613cba0b367..0000000000000000000000000000000000000000 --- a/doc/javadoc/com/yahoo/ycsb/workloads/package-tree.html +++ /dev/null @@ -1,153 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -com.yahoo.ycsb.workloads Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="com.yahoo.ycsb.workloads Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/measurements/package-tree.html"><B>PREV</B></A> - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For Package com.yahoo.ycsb.workloads -</H2> -</CENTER> -<DL> -<DT><B>Package Hierarchies:</B><DD><A HREF="../../../../overview-tree.html">All Packages</A></DL> -<HR> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.Object<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="../../../../com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>Workload</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.workloads.<A HREF="../../../../com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads"><B>CoreWorkload</B></A></UL> -</UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../com/yahoo/ycsb/measurements/package-tree.html"><B>PREV</B></A> - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="../../../../index.html?com/yahoo/ycsb/workloads/package-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/constant-values.html b/doc/javadoc/constant-values.html deleted file mode 100644 index b0ae776a778905b947e134a22b22a52a8863d84f..0000000000000000000000000000000000000000 --- a/doc/javadoc/constant-values.html +++ /dev/null @@ -1,736 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Constant Field Values -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Constant Field Values"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> - <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H1> -Constant Field Values</H1> -</CENTER> -<HR SIZE="4" NOSHADE> -<B>Contents</B><UL> -<LI><A HREF="#com.yahoo">com.yahoo.*</A> -</UL> - -<A NAME="com.yahoo"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left"><FONT SIZE="+2"> -com.yahoo.*</FONT></TH> -</TR> -</TABLE> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.BasicDB.SIMULATE_DELAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY">SIMULATE_DELAY</A></CODE></TD> -<TD ALIGN="right"><CODE>"basicdb.simulatedelay"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.BasicDB.SIMULATE_DELAY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY_DEFAULT">SIMULATE_DELAY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.BasicDB.VERBOSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/BasicDB.html#VERBOSE">VERBOSE</A></CODE></TD> -<TD ALIGN="right"><CODE>"basicdb.verbose"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.BasicDB.VERBOSE_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/BasicDB.html#VERBOSE_DEFAULT">VERBOSE_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"true"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Client.INSERT_COUNT_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Client.html#INSERT_COUNT_PROPERTY">INSERT_COUNT_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"insertcount"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Client.OPERATION_COUNT_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Client.html#OPERATION_COUNT_PROPERTY">OPERATION_COUNT_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"operationcount"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Client.RECORD_COUNT_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Client.html#RECORD_COUNT_PROPERTY">RECORD_COUNT_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"recordcount"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Client.WORKLOAD_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Client.html#WORKLOAD_PROPERTY">WORKLOAD_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"workload"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.CommandLine.DEFAULT_DB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/CommandLine.html#DEFAULT_DB">DEFAULT_DB</A></CODE></TD> -<TD ALIGN="right"><CODE>"com.yahoo.ycsb.BasicDB"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Utils.FNV_offset_basis_32"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Utils.html#FNV_offset_basis_32">FNV_offset_basis_32</A></CODE></TD> -<TD ALIGN="right"><CODE>-2128831035</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Utils.FNV_offset_basis_64"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final long</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Utils.html#FNV_offset_basis_64">FNV_offset_basis_64</A></CODE></TD> -<TD ALIGN="right"><CODE>-3750763034362895579L</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Utils.FNV_prime_32"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Utils.html#FNV_prime_32">FNV_prime_32</A></CODE></TD> -<TD ALIGN="right"><CODE>16777619</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Utils.FNV_prime_64"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final long</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Utils.html#FNV_prime_64">FNV_prime_64</A></CODE></TD> -<TD ALIGN="right"><CODE>1099511628211L</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Workload.INSERT_START_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY">INSERT_START_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"insertstart"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.Workload.INSERT_START_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY_DEFAULT">INSERT_START_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.CONNECTION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#CONNECTION_RETRY_PROPERTY">CONNECTION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.connectionretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.CONNECTION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#CONNECTION_RETRY_PROPERTY_DEFAULT">CONNECTION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.Error"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#Error">Error</A></CODE></TD> -<TD ALIGN="right"><CODE>-1</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.Ok"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#Ok">Ok</A></CODE></TD> -<TD ALIGN="right"><CODE>0</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.OPERATION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#OPERATION_RETRY_PROPERTY">OPERATION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.operationretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient5.OPERATION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient5.html#OPERATION_RETRY_PROPERTY_DEFAULT">OPERATION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.CONNECTION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#CONNECTION_RETRY_PROPERTY">CONNECTION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.connectionretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.CONNECTION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#CONNECTION_RETRY_PROPERTY_DEFAULT">CONNECTION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.Error"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#Error">Error</A></CODE></TD> -<TD ALIGN="right"><CODE>-1</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.Ok"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#Ok">Ok</A></CODE></TD> -<TD ALIGN="right"><CODE>0</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.OPERATION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#OPERATION_RETRY_PROPERTY">OPERATION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.operationretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient6.OPERATION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient6.html#OPERATION_RETRY_PROPERTY_DEFAULT">OPERATION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.CONNECTION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#CONNECTION_RETRY_PROPERTY">CONNECTION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.connectionretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.CONNECTION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#CONNECTION_RETRY_PROPERTY_DEFAULT">CONNECTION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.Error"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#Error">Error</A></CODE></TD> -<TD ALIGN="right"><CODE>-1</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.Ok"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#Ok">Ok</A></CODE></TD> -<TD ALIGN="right"><CODE>0</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.OPERATION_RETRY_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#OPERATION_RETRY_PROPERTY">OPERATION_RETRY_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"cassandra.operationretries"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.CassandraClient7.OPERATION_RETRY_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/CassandraClient7.html#OPERATION_RETRY_PROPERTY_DEFAULT">OPERATION_RETRY_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"300"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.HBaseClient.HttpError"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/HBaseClient.html#HttpError">HttpError</A></CODE></TD> -<TD ALIGN="right"><CODE>-2</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.HBaseClient.NoMatchingRecord"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/HBaseClient.html#NoMatchingRecord">NoMatchingRecord</A></CODE></TD> -<TD ALIGN="right"><CODE>-3</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.HBaseClient.Ok"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/HBaseClient.html#Ok">Ok</A></CODE></TD> -<TD ALIGN="right"><CODE>0</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.db.HBaseClient.ServerError"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final int</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/db/HBaseClient.html#ServerError">ServerError</A></CODE></TD> -<TD ALIGN="right"><CODE>-1</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.generator.ScrambledZipfianGenerator.ITEM_COUNT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final long</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ITEM_COUNT">ITEM_COUNT</A></CODE></TD> -<TD ALIGN="right"><CODE>10000000000L</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.generator.ScrambledZipfianGenerator.ZETAN"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final double</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ZETAN">ZETAN</A></CODE></TD> -<TD ALIGN="right"><CODE>52.93805640344461</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.generator.ZipfianGenerator.ZIPFIAN_CONSTANT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final double</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/generator/ZipfianGenerator.html#ZIPFIAN_CONSTANT">ZIPFIAN_CONSTANT</A></CODE></TD> -<TD ALIGN="right"><CODE>0.99</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.measurements.OneMeasurementHistogram.BUCKETS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#BUCKETS">BUCKETS</A></CODE></TD> -<TD ALIGN="right"><CODE>"histogram.buckets"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.measurements.OneMeasurementHistogram.BUCKETS_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#BUCKETS_DEFAULT">BUCKETS_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"1000"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.measurements.OneMeasurementTimeSeries.GRANULARITY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#GRANULARITY">GRANULARITY</A></CODE></TD> -<TD ALIGN="right"><CODE>"timeseries.granularity"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.measurements.OneMeasurementTimeSeries.GRANULARITY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#GRANULARITY_DEFAULT">GRANULARITY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"1000"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> - -<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="3">com.yahoo.ycsb.workloads.<A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.FIELD_COUNT_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY">FIELD_COUNT_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"fieldcount"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY_DEFAULT">FIELD_COUNT_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"10"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.FIELD_LENGTH_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY">FIELD_LENGTH_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"fieldlength"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.FIELD_LENGTH_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY_DEFAULT">FIELD_LENGTH_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"100"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.INSERT_ORDER_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY">INSERT_ORDER_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"insertorder"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.INSERT_ORDER_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY_DEFAULT">INSERT_ORDER_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"hashed"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.INSERT_PROPORTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY">INSERT_PROPORTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"insertproportion"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.INSERT_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY_DEFAULT">INSERT_PROPORTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0.0"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.MAX_SCAN_LENGTH_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY">MAX_SCAN_LENGTH_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"maxscanlength"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.MAX_SCAN_LENGTH_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY_DEFAULT">MAX_SCAN_LENGTH_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"1000"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READ_ALL_FIELDS_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY">READ_ALL_FIELDS_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"readallfields"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READ_ALL_FIELDS_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY_DEFAULT">READ_ALL_FIELDS_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"true"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READ_PROPORTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY">READ_PROPORTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"readproportion"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READ_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY_DEFAULT">READ_PROPORTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0.95"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READMODIFYWRITE_PROPORTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY">READMODIFYWRITE_PROPORTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"readmodifywriteproportion"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT">READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0.0"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.REQUEST_DISTRIBUTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY">REQUEST_DISTRIBUTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"requestdistribution"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.REQUEST_DISTRIBUTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY_DEFAULT">REQUEST_DISTRIBUTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"uniform"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.SCAN_LENGTH_DISTRIBUTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY">SCAN_LENGTH_DISTRIBUTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"scanlengthdistribution"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT">SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"uniform"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.SCAN_PROPORTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY">SCAN_PROPORTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"scanproportion"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.SCAN_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY_DEFAULT">SCAN_PROPORTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0.0"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.TABLENAME"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#TABLENAME">TABLENAME</A></CODE></TD> -<TD ALIGN="right"><CODE>"usertable"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.UPDATE_PROPORTION_PROPERTY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY">UPDATE_PROPORTION_PROPERTY</A></CODE></TD> -<TD ALIGN="right"><CODE>"updateproportion"</CODE></TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<A NAME="com.yahoo.ycsb.workloads.CoreWorkload.UPDATE_PROPORTION_PROPERTY_DEFAULT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> -<CODE>public static final java.lang.String</CODE></FONT></TD> -<TD ALIGN="left"><CODE><A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY_DEFAULT">UPDATE_PROPORTION_PROPERTY_DEFAULT</A></CODE></TD> -<TD ALIGN="right"><CODE>"0.05"</CODE></TD> -</TR> -</FONT></TD> -</TR> -</TABLE> - -<P> - -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> - <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/deprecated-list.html b/doc/javadoc/deprecated-list.html deleted file mode 100644 index 4a9740047521fc68dd0368cd88627c75b78e9acb..0000000000000000000000000000000000000000 --- a/doc/javadoc/deprecated-list.html +++ /dev/null @@ -1,144 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Deprecated List -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Deprecated List"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> - <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -<B>Deprecated API</B></H2> -</CENTER> -<HR SIZE="4" NOSHADE> -<B>Contents</B><UL> -</UL> - -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> - <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/help-doc.html b/doc/javadoc/help-doc.html deleted file mode 100644 index 7bdabfd901f49d3722d5ad5c9ce35c9121b99a6e..0000000000000000000000000000000000000000 --- a/doc/javadoc/help-doc.html +++ /dev/null @@ -1,217 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -API Help -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="API Help"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> - <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H1> -How This API Document Is Organized</H1> -</CENTER> -This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> -Overview</H3> -<BLOCKQUOTE> - -<P> -The <A HREF="overview-summary.html">Overview</A> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</BLOCKQUOTE> -<H3> -Package</H3> -<BLOCKQUOTE> - -<P> -Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> -<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL> -</BLOCKQUOTE> -<H3> -Class/Interface</H3> -<BLOCKQUOTE> - -<P> -Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> -<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description -<P> -<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary -<P> -<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> -Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> -</BLOCKQUOTE> -<H3> -Annotation Type</H3> -<BLOCKQUOTE> - -<P> -Each annotation type has its own separate page with the following sections:<UL> -<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL> -</BLOCKQUOTE> -</BLOCKQUOTE> -<H3> -Enum</H3> -<BLOCKQUOTE> - -<P> -Each enum has its own separate page with the following sections:<UL> -<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL> -</BLOCKQUOTE> -<H3> -Tree (Class Hierarchy)</H3> -<BLOCKQUOTE> -There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> -<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> -</BLOCKQUOTE> -<H3> -Deprecated API</H3> -<BLOCKQUOTE> -The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> -<H3> -Index</H3> -<BLOCKQUOTE> -The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> -<H3> -Prev/Next</H3> -These links take you to the next or previous class, interface, package, or related page.<H3> -Frames/No Frames</H3> -These links show and hide the HTML frames. All pages are available with or without frames. -<P> -<H3> -Serialized Form</H3> -Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -<P> -<H3> -Constant Field Values</H3> -The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values. -<P> -<FONT SIZE="-1"> -<EM> -This help file applies to API documentation generated using the standard doclet.</EM> -</FONT> -<BR> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> - <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/index-all.html b/doc/javadoc/index-all.html deleted file mode 100644 index f922cd04d5b779171b4caf06a316ee5aa64777e7..0000000000000000000000000000000000000000 --- a/doc/javadoc/index-all.html +++ /dev/null @@ -1,1013 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Index -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Index"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="./allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <A HREF="#_U_">U</A> <A HREF="#_V_">V</A> <A HREF="#_W_">W</A> <A HREF="#_Z_">Z</A> <A HREF="#___">_</A> <HR> -<A NAME="_A_"><!-- --></A><H2> -<B>A</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html#addValue(double, java.lang.String)"><B>addValue(double, String)</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#ASCIIString(int)"><B>ASCIIString(int)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD>Generate a random ASCII string of a given length. -</DL> -<HR> -<A NAME="_B_"><!-- --></A><H2> -<B>B</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb"><B>BasicDB</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Basic DB that just prints out the requested operations, instead of doing them against a database.<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#BasicDB()"><B>BasicDB()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#BUCKETS"><B>BUCKETS</B></A> - -Static variable in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#BUCKETS_DEFAULT"><B>BUCKETS_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -</DL> -<HR> -<A NAME="_C_"><!-- --></A><H2> -<B>C</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient5</B></A> - Class in <A HREF="./com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A><DD>Cassandra 0.5 client for YCSB framework<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#CassandraClient5()"><B>CassandraClient5()</B></A> - -Constructor for class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient6</B></A> - Class in <A HREF="./com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A><DD>Cassandra 0.6 client for YCSB framework<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#CassandraClient6()"><B>CassandraClient6()</B></A> - -Constructor for class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient7</B></A> - Class in <A HREF="./com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A><DD>Cassandra 0.7 client for YCSB framework<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#CassandraClient7()"><B>CassandraClient7()</B></A> - -Constructor for class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Client.html#checkRequiredProperties(java.util.Properties)"><B>checkRequiredProperties(Properties)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/DB.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Cleanup any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/Workload.html#cleanup()"><B>cleanup()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD>Cleanup the scenario. -<DT><A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>Client</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Main class for executing YCSB.<DT><A HREF="./com/yahoo/ycsb/Client.html#Client()"><B>Client()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/package-summary.html"><B>com.yahoo.ycsb</B></A> - package com.yahoo.ycsb<DD> <DT><A HREF="./com/yahoo/ycsb/db/package-summary.html"><B>com.yahoo.ycsb.db</B></A> - package com.yahoo.ycsb.db<DD> <DT><A HREF="./com/yahoo/ycsb/generator/package-summary.html"><B>com.yahoo.ycsb.generator</B></A> - package com.yahoo.ycsb.generator<DD> <DT><A HREF="./com/yahoo/ycsb/measurements/package-summary.html"><B>com.yahoo.ycsb.measurements</B></A> - package com.yahoo.ycsb.measurements<DD> <DT><A HREF="./com/yahoo/ycsb/workloads/package-summary.html"><B>com.yahoo.ycsb.workloads</B></A> - package com.yahoo.ycsb.workloads<DD> <DT><A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>CommandLine</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>A simple command line client to a database, using the appropriate com.yahoo.ycsb.DB implementation.<DT><A HREF="./com/yahoo/ycsb/CommandLine.html#CommandLine()"><B>CommandLine()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#CONNECTION_RETRY_PROPERTY"><B>CONNECTION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#CONNECTION_RETRY_PROPERTY"><B>CONNECTION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#CONNECTION_RETRY_PROPERTY"><B>CONNECTION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#CONNECTION_RETRY_PROPERTY_DEFAULT"><B>CONNECTION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#CONNECTION_RETRY_PROPERTY_DEFAULT"><B>CONNECTION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#CONNECTION_RETRY_PROPERTY_DEFAULT"><B>CONNECTION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#ConnectionRetries"><B>ConnectionRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#ConnectionRetries"><B>ConnectionRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#ConnectionRetries"><B>ConnectionRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads"><B>CoreWorkload</B></A> - Class in <A HREF="./com/yahoo/ycsb/workloads/package-summary.html">com.yahoo.ycsb.workloads</A><DD>The core benchmark scenario.<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#CoreWorkload()"><B>CoreWorkload()</B></A> - -Constructor for class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator"><B>CounterGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>Generates a sequence of integers 0, 1, ...<DT><A HREF="./com/yahoo/ycsb/generator/CounterGenerator.html#CounterGenerator(int)"><B>CounterGenerator(int)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator">CounterGenerator</A> -<DD>Create a counter that starts at countstart -</DL> -<HR> -<A NAME="_D_"><!-- --></A><H2> -<B>D</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>DB</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>A layer for accessing a database to be benchmarked.<DT><A HREF="./com/yahoo/ycsb/DB.html#DB()"><B>DB()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>DBException</B></A> - Exception in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Something bad happened while interacting with the database.<DT><A HREF="./com/yahoo/ycsb/DBException.html#DBException(java.lang.String)"><B>DBException(String)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBException.html#DBException()"><B>DBException()</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBException.html#DBException(java.lang.String, java.lang.Throwable)"><B>DBException(String, Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBException.html#DBException(java.lang.Throwable)"><B>DBException(Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">DBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>DBFactory</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Creates a DB layer by dynamically classloading the specified DB class.<DT><A HREF="./com/yahoo/ycsb/DBFactory.html#DBFactory()"><B>DBFactory()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb">DBFactory</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>DBWrapper</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Wrapper around a "real" DB that measures latencies and counts return codes.<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#DBWrapper(com.yahoo.ycsb.DB)"><B>DBWrapper(DB)</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/CommandLine.html#DEFAULT_DB"><B>DEFAULT_DB</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/DB.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#delete(java.lang.String, java.lang.String)"><B>delete(String, String)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Delete a record from the database. -<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator"><B>DiscreteGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>Generates a distribution by choosing from a discrete set of values.<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html#DiscreteGenerator()"><B>DiscreteGenerator()</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Workload.html#doInsert(com.yahoo.ycsb.DB, java.lang.Object)"><B>doInsert(DB, Object)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD>Do one insert operation. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doInsert(com.yahoo.ycsb.DB, java.lang.Object)"><B>doInsert(DB, Object)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>Do one insert operation. -<DT><A HREF="./com/yahoo/ycsb/Workload.html#doTransaction(com.yahoo.ycsb.DB, java.lang.Object)"><B>doTransaction(DB, Object)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD>Do one transaction operation. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransaction(com.yahoo.ycsb.DB, java.lang.Object)"><B>doTransaction(DB, Object)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>Do one transaction operation. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionInsert(com.yahoo.ycsb.DB)"><B>doTransactionInsert(DB)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionRead(com.yahoo.ycsb.DB)"><B>doTransactionRead(DB)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionReadModifyWrite(com.yahoo.ycsb.DB)"><B>doTransactionReadModifyWrite(DB)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionScan(com.yahoo.ycsb.DB)"><B>doTransactionScan(DB)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#doTransactionUpdate(com.yahoo.ycsb.DB)"><B>doTransactionUpdate(DB)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD> -</DL> -<HR> -<A NAME="_E_"><!-- --></A><H2> -<B>E</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#Error"><B>Error</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#Error"><B>Error</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#Error"><B>Error</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -</DL> -<HR> -<A NAME="_F_"><!-- --></A><H2> -<B>F</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY"><B>FIELD_COUNT_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the number of fields in a record. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_COUNT_PROPERTY_DEFAULT"><B>FIELD_COUNT_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>Default number of fields in a record. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY"><B>FIELD_LENGTH_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the length of a field in bytes. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#FIELD_LENGTH_PROPERTY_DEFAULT"><B>FIELD_LENGTH_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default length of a field in bytes. -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNV_offset_basis_32"><B>FNV_offset_basis_32</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNV_offset_basis_64"><B>FNV_offset_basis_64</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNV_prime_32"><B>FNV_prime_32</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNV_prime_64"><B>FNV_prime_64</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNVhash32(int)"><B>FNVhash32(int)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD>32 bit FNV hash. -<DT><A HREF="./com/yahoo/ycsb/Utils.html#FNVhash64(long)"><B>FNVhash64(long)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD>64 bit FNV hash. -</DL> -<HR> -<A NAME="_G_"><!-- --></A><H2> -<B>G</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator"><B>Generator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>An expression that generates a sequence of string values, following some distribution (Uniform, Zipfian, Sequential, etc.)<DT><A HREF="./com/yahoo/ycsb/generator/Generator.html#Generator()"><B>Generator()</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator">Generator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#getHTable(java.lang.String)"><B>getHTable(String)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#getMeasurements()"><B>getMeasurements()</B></A> - -Static method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Return the singleton Measurements object. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#getName()"><B>getName()</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DB.html#getProperties()"><B>getProperties()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Get the set of properties for this DB. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#getProperties()"><B>getProperties()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Get the set of properties for this DB. -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#getSummary()"><B>getSummary()</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Return a one line summary of the measurements. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#getSummary()"><B>getSummary()</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#getSummary()"><B>getSummary()</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#getSummary()"><B>getSummary()</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#GRANULARITY"><B>GRANULARITY</B></A> - -Static variable in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD>Granularity for time series; measurements will be averaged in chunks of this granularity. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#GRANULARITY_DEFAULT"><B>GRANULARITY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -</DL> -<HR> -<A NAME="_H_"><!-- --></A><H2> -<B>H</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/Utils.html#hash(int)"><B>hash(int)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD>Hash an integer value. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>HBaseClient</B></A> - Class in <A HREF="./com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A><DD>HBase client for YCSB framework<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#HBaseClient()"><B>HBaseClient()</B></A> - -Constructor for class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/CommandLine.html#help()"><B>help()</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#HttpError"><B>HttpError</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -</DL> -<HR> -<A NAME="_I_"><!-- --></A><H2> -<B>I</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/DB.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#init()"><B>init()</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Initialize any state for this DB. -<DT><A HREF="./com/yahoo/ycsb/Workload.html#init(java.util.Properties)"><B>init(Properties)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD>Initialize the scenario. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#init(java.util.Properties)"><B>init(Properties)</B></A> - -Method in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>Initialize the scenario. -<DT><A HREF="./com/yahoo/ycsb/Workload.html#initThread(java.util.Properties, int, int)"><B>initThread(Properties, int, int)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD>Initialize any state for a particular client thread. -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/DB.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#insert(java.lang.String, java.lang.String, java.util.HashMap)"><B>insert(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Insert a record in the database. -<DT><A HREF="./com/yahoo/ycsb/Client.html#INSERT_COUNT_PROPERTY"><B>INSERT_COUNT_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD>Indicates how many inserts to do, if less than recordcount. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY"><B>INSERT_ORDER_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the order to insert records. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_ORDER_PROPERTY_DEFAULT"><B>INSERT_ORDER_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>Default insert order. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY"><B>INSERT_PROPORTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the proportion of transactions that are inserts. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#INSERT_PROPORTION_PROPERTY_DEFAULT"><B>INSERT_PROPORTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default proportion of transactions that are inserts. -<DT><A HREF="./com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY"><B>INSERT_START_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Workload.html#INSERT_START_PROPERTY_DEFAULT"><B>INSERT_START_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator"><B>IntegerGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>A generator that is capable of generating ints as well as strings<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#IntegerGenerator()"><B>IntegerGenerator()</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ITEM_COUNT"><B>ITEM_COUNT</B></A> - -Static variable in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD> -</DL> -<HR> -<A NAME="_L_"><!-- --></A><H2> -<B>L</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#lastInt()"><B>lastInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD>Return the previous int generated by the distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html#lastString()"><B>lastString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. -<DT><A HREF="./com/yahoo/ycsb/generator/Generator.html#lastString()"><B>lastString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator">Generator</A> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#lastString()"><B>lastString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. -<DT><A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html#lastString()"><B>lastString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator">UniformGenerator</A> -<DD>Return the previous string generated by the distribution; e.g., returned from the last nextString() call. -</DL> -<HR> -<A NAME="_M_"><!-- --></A><H2> -<B>M</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/Client.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/CommandLine.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator">SkewedLatestGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY"><B>MAX_SCAN_LENGTH_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the max scan length (number of records) -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#MAX_SCAN_LENGTH_PROPERTY_DEFAULT"><B>MAX_SCAN_LENGTH_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default max scan length. -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#measure(java.lang.String, int)"><B>measure(String, int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Report a single value of a single metric. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#measure(int)"><B>measure(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#measure(int)"><B>measure(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#measure(int)"><B>measure(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements"><B>Measurements</B></A> - Class in <A HREF="./com/yahoo/ycsb/measurements/package-summary.html">com.yahoo.ycsb.measurements</A><DD>Collects latency measurements, and reports them when requested.<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#Measurements(java.util.Properties)"><B>Measurements(Properties)</B></A> - -Constructor for class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Create a new object with the specified properties. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db"><B>MongoDbClient</B></A> - Class in <A HREF="./com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A><DD>MongoDB client for YCSB framework.<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#MongoDbClient()"><B>MongoDbClient()</B></A> - -Constructor for class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -</DL> -<HR> -<A NAME="_N_"><!-- --></A><H2> -<B>N</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/DBFactory.html#newDB(java.lang.String, java.util.Properties)"><B>newDB(String, Properties)</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb">DBFactory</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/CounterGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator">CounterGenerator</A> -<DD>If the generator returns numeric (integer) values, return the next value as an int. -<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<DD>If the generator returns numeric (integer) values, return the next value as an int. -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD>Return the next value as an int. -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD>Return the next int in the sequence. -<DT><A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator">SkewedLatestGenerator</A> -<DD>Generate the next string in the distribution, skewed Zipfian favoring the items most recently returned by the basis generator. -<DT><A HREF="./com/yahoo/ycsb/generator/UniformIntegerGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator">UniformIntegerGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#nextInt(int)"><B>nextInt(int)</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Generate the next item. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#nextInt()"><B>nextInt()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Return the next value, skewed by the Zipfian distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#nextLong()"><B>nextLong()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD>Return the next long in the sequence. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#nextLong(long)"><B>nextLong(long)</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Generate the next item as a long. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#nextLong()"><B>nextLong()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Return the next value, skewed by the Zipfian distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html#nextString()"><B>nextString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator">DiscreteGenerator</A> -<DD>Generate the next string in the distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/Generator.html#nextString()"><B>nextString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator">Generator</A> -<DD>Generate the next string in the distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#nextString()"><B>nextString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD>Generate the next string in the distribution. -<DT><A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html#nextString()"><B>nextString()</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator">UniformGenerator</A> -<DD>Generate the next string in the distribution. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#NoMatchingRecord"><B>NoMatchingRecord</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -</DL> -<HR> -<A NAME="_O_"><!-- --></A><H2> -<B>O</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#Ok"><B>Ok</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#Ok"><B>Ok</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#Ok"><B>Ok</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#Ok"><B>Ok</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurement</B></A> - Class in <A HREF="./com/yahoo/ycsb/measurements/package-summary.html">com.yahoo.ycsb.measurements</A><DD>A single measured metric (such as READ LATENCY)<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#OneMeasurement(java.lang.String)"><B>OneMeasurement(String)</B></A> - -Constructor for class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurementHistogram</B></A> - Class in <A HREF="./com/yahoo/ycsb/measurements/package-summary.html">com.yahoo.ycsb.measurements</A><DD>Take measurements and maintain a histogram of a given metric, such as READ LATENCY.<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#OneMeasurementHistogram(java.lang.String, java.util.Properties)"><B>OneMeasurementHistogram(String, Properties)</B></A> - -Constructor for class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurementTimeSeries</B></A> - Class in <A HREF="./com/yahoo/ycsb/measurements/package-summary.html">com.yahoo.ycsb.measurements</A><DD>A time series measurement of a metric, such as READ LATENCY.<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#OneMeasurementTimeSeries(java.lang.String, java.util.Properties)"><B>OneMeasurementTimeSeries(String, Properties)</B></A> - -Constructor for class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Client.html#OPERATION_COUNT_PROPERTY"><B>OPERATION_COUNT_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#OPERATION_RETRY_PROPERTY"><B>OPERATION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#OPERATION_RETRY_PROPERTY"><B>OPERATION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#OPERATION_RETRY_PROPERTY"><B>OPERATION_RETRY_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#OPERATION_RETRY_PROPERTY_DEFAULT"><B>OPERATION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#OPERATION_RETRY_PROPERTY_DEFAULT"><B>OPERATION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#OPERATION_RETRY_PROPERTY_DEFAULT"><B>OPERATION_RETRY_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#OperationRetries"><B>OperationRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#OperationRetries"><B>OperationRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#OperationRetries"><B>OperationRetries</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD> -</DL> -<HR> -<A NAME="_P_"><!-- --></A><H2> -<B>P</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#printReport(java.io.PrintStream)"><B>printReport(PrintStream)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Print the full report to the listed PrintStream. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#printReport(java.io.PrintStream)"><B>printReport(PrintStream)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#printReport(java.io.PrintStream)"><B>printReport(PrintStream)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#printReport(java.io.PrintStream)"><B>printReport(PrintStream)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -</DL> -<HR> -<A NAME="_R_"><!-- --></A><H2> -<B>R</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DB.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#read(java.lang.String, java.lang.String, java.util.Set, java.util.HashMap)"><B>read(String, String, Set<String>, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Read a record from the database. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY"><B>READ_ALL_FIELDS_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for deciding whether to read one field (false) or all fields (true) of a record. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READ_ALL_FIELDS_PROPERTY_DEFAULT"><B>READ_ALL_FIELDS_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default value for the readallfields property. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY"><B>READ_PROPORTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the proportion of transactions that are reads. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READ_PROPORTION_PROPERTY_DEFAULT"><B>READ_PROPORTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default proportion of transactions that are reads. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY"><B>READMODIFYWRITE_PROPORTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the proportion of transactions that are read-modify-write. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT"><B>READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default proportion of transactions that are scans. -<DT><A HREF="./com/yahoo/ycsb/Client.html#RECORD_COUNT_PROPERTY"><B>RECORD_COUNT_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#reportReturnCode(java.lang.String, int)"><B>reportReturnCode(String, int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD>Report a return code for a single DB operaiton. -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html#reportReturnCode(int)"><B>reportReturnCode(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements">OneMeasurement</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html#reportReturnCode(int)"><B>reportReturnCode(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementHistogram</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html#reportReturnCode(int)"><B>reportReturnCode(int)</B></A> - -Method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements">OneMeasurementTimeSeries</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY"><B>REQUEST_DISTRIBUTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the the distribution of requests across the keyspace. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#REQUEST_DISTRIBUTION_PROPERTY_DEFAULT"><B>REQUEST_DISTRIBUTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default distribution of requests across the keyspace -</DL> -<HR> -<A NAME="_S_"><!-- --></A><H2> -<B>S</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DB.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#scan(java.lang.String, java.lang.String, int, java.util.Set, java.util.Vector)"><B>scan(String, String, int, Set<String>, Vector<HashMap<String, String>>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Perform a range scan for a set of records in the database. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY"><B>SCAN_LENGTH_DISTRIBUTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the scan length distribution. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT"><B>SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default max scan length. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY"><B>SCAN_PROPORTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the proportion of transactions that are scans. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#SCAN_PROPORTION_PROPERTY_DEFAULT"><B>SCAN_PROPORTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default proportion of transactions that are scans. -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator"><B>ScrambledZipfianGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>A generator of a zipfian distribution.<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ScrambledZipfianGenerator(long)"><B>ScrambledZipfianGenerator(long)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD>Create a zipfian generator for the specified number of items. -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ScrambledZipfianGenerator(long, long)"><B>ScrambledZipfianGenerator(long, long)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD>Create a zipfian generator for items between min and max. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#ServerError"><B>ServerError</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html#setLastInt(int)"><B>setLastInt(int)</B></A> - -Method in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator">IntegerGenerator</A> -<DD>Set the last value generated. -<DT><A HREF="./com/yahoo/ycsb/DB.html#setProperties(java.util.Properties)"><B>setProperties(Properties)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Set the properties for this DB. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#setProperties(java.util.Properties)"><B>setProperties(Properties)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Set the properties for this DB. -<DT><A HREF="./com/yahoo/ycsb/measurements/Measurements.html#setProperties(java.util.Properties)"><B>setProperties(Properties)</B></A> - -Static method in class com.yahoo.ycsb.measurements.<A HREF="./com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements">Measurements</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY"><B>SIMULATE_DELAY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#SIMULATE_DELAY_DEFAULT"><B>SIMULATE_DELAY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator"><B>SkewedLatestGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>Generate a popularity distribution of items, skewed to favor recent items significantly more than older items.<DT><A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html#SkewedLatestGenerator(com.yahoo.ycsb.generator.CounterGenerator)"><B>SkewedLatestGenerator(CounterGenerator)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator">SkewedLatestGenerator</A> -<DD> -</DL> -<HR> -<A NAME="_T_"><!-- --></A><H2> -<B>T</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#tableLock"><B>tableLock</B></A> - -Static variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#TABLENAME"><B>TABLENAME</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the database table to run queries against. -</DL> -<HR> -<A NAME="_U_"><!-- --></A><H2> -<B>U</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator"><B>UniformGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>An expression that generates a random integer in the specified range<DT><A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html#UniformGenerator(java.util.Vector)"><B>UniformGenerator(Vector<String>)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator">UniformGenerator</A> -<DD>Creates a generator that will return strings from the specified set uniformly randomly -<DT><A HREF="./com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator"><B>UniformIntegerGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>Generates integers randomly uniform from an interval.<DT><A HREF="./com/yahoo/ycsb/generator/UniformIntegerGenerator.html#UniformIntegerGenerator(int, int)"><B>UniformIntegerGenerator(int, int)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator">UniformIntegerGenerator</A> -<DD>Creates a generator that will return integers uniformly randomly from the interval [lb,ub] inclusive (that is, lb and ub are possible values) -<DT><A HREF="./com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>UnknownDBException</B></A> - Exception in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Could not create the specified DB.<DT><A HREF="./com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.String)"><B>UnknownDBException(String)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/UnknownDBException.html#UnknownDBException()"><B>UnknownDBException()</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.String, java.lang.Throwable)"><B>UnknownDBException(String, Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/UnknownDBException.html#UnknownDBException(java.lang.Throwable)"><B>UnknownDBException(Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">UnknownDBException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient5.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db">CassandraClient5</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient6.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db">CassandraClient6</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/CassandraClient7.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db">CassandraClient7</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/db/MongoDbClient.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db">MongoDbClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/DB.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb">DB</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/DBWrapper.html#update(java.lang.String, java.lang.String, java.util.HashMap)"><B>update(String, String, HashMap<String, String>)</B></A> - -Method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb">DBWrapper</A> -<DD>Update a record in the database. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY"><B>UPDATE_PROPORTION_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The name of the property for the proportion of transactions that are updates. -<DT><A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html#UPDATE_PROPORTION_PROPERTY_DEFAULT"><B>UPDATE_PROPORTION_PROPERTY_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.workloads.<A HREF="./com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads">CoreWorkload</A> -<DD>The default proportion of transactions that are updates. -<DT><A HREF="./com/yahoo/ycsb/Client.html#usageMessage()"><B>usageMessage()</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/CommandLine.html#usageMessage()"><B>usageMessage()</B></A> - -Static method in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb">CommandLine</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>Utils</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>Utility functions.<DT><A HREF="./com/yahoo/ycsb/Utils.html#Utils()"><B>Utils()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb">Utils</A> -<DD> -</DL> -<HR> -<A NAME="_V_"><!-- --></A><H2> -<B>V</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#VERBOSE"><B>VERBOSE</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/BasicDB.html#VERBOSE_DEFAULT"><B>VERBOSE_DEFAULT</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb">BasicDB</A> -<DD> -</DL> -<HR> -<A NAME="_W_"><!-- --></A><H2> -<B>W</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>Workload</B></A> - Class in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>One experiment scenario.<DT><A HREF="./com/yahoo/ycsb/Workload.html#Workload()"><B>Workload()</B></A> - -Constructor for class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb">Workload</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/Client.html#WORKLOAD_PROPERTY"><B>WORKLOAD_PROPERTY</B></A> - -Static variable in class com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb">Client</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>WorkloadException</B></A> - Exception in <A HREF="./com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A><DD>The workload tried to do something bad.<DT><A HREF="./com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.String)"><B>WorkloadException(String)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/WorkloadException.html#WorkloadException()"><B>WorkloadException()</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.String, java.lang.Throwable)"><B>WorkloadException(String, Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/WorkloadException.html#WorkloadException(java.lang.Throwable)"><B>WorkloadException(Throwable)</B></A> - -Constructor for exception com.yahoo.ycsb.<A HREF="./com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">WorkloadException</A> -<DD> -</DL> -<HR> -<A NAME="_Z_"><!-- --></A><H2> -<B>Z</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html#ZETAN"><B>ZETAN</B></A> - -Static variable in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ScrambledZipfianGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZIPFIAN_CONSTANT"><B>ZIPFIAN_CONSTANT</B></A> - -Static variable in class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator"><B>ZipfianGenerator</B></A> - Class in <A HREF="./com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A><DD>A generator of a zipfian distribution.<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZipfianGenerator(long)"><B>ZipfianGenerator(long)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Create a zipfian generator for the specified number of items. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZipfianGenerator(long, long)"><B>ZipfianGenerator(long, long)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Create a zipfian generator for items between min and max. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZipfianGenerator(long, double)"><B>ZipfianGenerator(long, double)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Create a zipfian generator for the specified number of items using the specified zipfian constant. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZipfianGenerator(long, long, double)"><B>ZipfianGenerator(long, long, double)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant. -<DT><A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html#ZipfianGenerator(long, long, double, double)"><B>ZipfianGenerator(long, long, double, double)</B></A> - -Constructor for class com.yahoo.ycsb.generator.<A HREF="./com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator">ZipfianGenerator</A> -<DD>Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant, using the precomputed value of zeta. -</DL> -<HR> -<A NAME="___"><!-- --></A><H2> -<B>_</B></H2> -<DL> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#_columnFamily"><B>_columnFamily</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#_columnFamilyBytes"><B>_columnFamilyBytes</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#_debug"><B>_debug</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#_hTable"><B>_hTable</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -<DT><A HREF="./com/yahoo/ycsb/db/HBaseClient.html#_table"><B>_table</B></A> - -Variable in class com.yahoo.ycsb.db.<A HREF="./com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db">HBaseClient</A> -<DD> -</DL> -<HR> -<A HREF="#_A_">A</A> <A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <A HREF="#_U_">U</A> <A HREF="#_V_">V</A> <A HREF="#_W_">W</A> <A HREF="#_Z_">Z</A> <A HREF="#___">_</A> - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> - <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="./allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/index.html b/doc/javadoc/index.html deleted file mode 100644 index 4d37a41ff3cd576020c519172f3b337f60c4b4d4..0000000000000000000000000000000000000000 --- a/doc/javadoc/index.html +++ /dev/null @@ -1,39 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc on Wed May 12 14:51:53 PDT 2010--> -<TITLE> -Generated Documentation (Untitled) -</TITLE> -<SCRIPT type="text/javascript"> - targetPage = "" + window.location.search; - if (targetPage != "" && targetPage != "undefined") - targetPage = targetPage.substring(1); - if (targetPage.indexOf(":") != -1) - targetPage = "undefined"; - function loadFrames() { - if (targetPage != "" && targetPage != "undefined") - top.classFrame.location = top.targetPage; - } -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> -</HEAD> -<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> -<FRAMESET rows="30%,70%" title="" onLoad="top.loadFrames()"> -<FRAME src="overview-frame.html" name="packageListFrame" title="All Packages"> -<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> -</FRAMESET> -<FRAME src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> -<NOFRAMES> -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to<A HREF="overview-summary.html">Non-frame version.</A> -</NOFRAMES> -</FRAMESET> -</HTML> diff --git a/doc/javadoc/overview-frame.html b/doc/javadoc/overview-frame.html deleted file mode 100644 index 4fb6a8e96220f86bb62584473f8f08b77a1fd6d4..0000000000000000000000000000000000000000 --- a/doc/javadoc/overview-frame.html +++ /dev/null @@ -1,50 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Overview List -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - - -</HEAD> - -<BODY BGCOLOR="white"> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TH ALIGN="left" NOWRAP><FONT size="+1" CLASS="FrameTitleFont"> -<B></B></FONT></TH> -</TR> -</TABLE> - -<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> -<TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT> -<P> -<FONT size="+1" CLASS="FrameHeadingFont"> -Packages</FONT> -<BR> -<FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/package-frame.html" target="packageFrame">com.yahoo.ycsb</A></FONT> -<BR> -<FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/db/package-frame.html" target="packageFrame">com.yahoo.ycsb.db</A></FONT> -<BR> -<FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/generator/package-frame.html" target="packageFrame">com.yahoo.ycsb.generator</A></FONT> -<BR> -<FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/measurements/package-frame.html" target="packageFrame">com.yahoo.ycsb.measurements</A></FONT> -<BR> -<FONT CLASS="FrameItemFont"><A HREF="com/yahoo/ycsb/workloads/package-frame.html" target="packageFrame">com.yahoo.ycsb.workloads</A></FONT> -<BR> -</TD> -</TR> -</TABLE> - -<P> - -</BODY> -</HTML> diff --git a/doc/javadoc/overview-summary.html b/doc/javadoc/overview-summary.html deleted file mode 100644 index b73bd3b31eb24d0bb13ec1e369175d5241abfab2..0000000000000000000000000000000000000000 --- a/doc/javadoc/overview-summary.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Overview -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Overview"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Packages</B></FONT></TH> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="20%"><B><A HREF="com/yahoo/ycsb/package-summary.html">com.yahoo.ycsb</A></B></TD> -<TD> </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="20%"><B><A HREF="com/yahoo/ycsb/db/package-summary.html">com.yahoo.ycsb.db</A></B></TD> -<TD> </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="20%"><B><A HREF="com/yahoo/ycsb/generator/package-summary.html">com.yahoo.ycsb.generator</A></B></TD> -<TD> </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="20%"><B><A HREF="com/yahoo/ycsb/measurements/package-summary.html">com.yahoo.ycsb.measurements</A></B></TD> -<TD> </TD> -</TR> -<TR BGCOLOR="white" CLASS="TableRowColor"> -<TD WIDTH="20%"><B><A HREF="com/yahoo/ycsb/workloads/package-summary.html">com.yahoo.ycsb.workloads</A></B></TD> -<TD> </TD> -</TR> -</TABLE> - -<P> - <HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/overview-tree.html b/doc/javadoc/overview-tree.html deleted file mode 100644 index 2012c90fc5f53fc8ff5c5eeac46aeaf636e406af..0000000000000000000000000000000000000000 --- a/doc/javadoc/overview-tree.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Class Hierarchy -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Class Hierarchy"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H2> -Hierarchy For All Packages</H2> -</CENTER> -<DL> -<DT><B>Package Hierarchies:</B><DD><A HREF="com/yahoo/ycsb/package-tree.html">com.yahoo.ycsb</A>, <A HREF="com/yahoo/ycsb/db/package-tree.html">com.yahoo.ycsb.db</A>, <A HREF="com/yahoo/ycsb/generator/package-tree.html">com.yahoo.ycsb.generator</A>, <A HREF="com/yahoo/ycsb/measurements/package-tree.html">com.yahoo.ycsb.measurements</A>, <A HREF="com/yahoo/ycsb/workloads/package-tree.html">com.yahoo.ycsb.workloads</A></DL> -<HR> -<H2> -Class Hierarchy -</H2> -<UL> -<LI TYPE="circle">java.lang.Object<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Client.html" title="class in com.yahoo.ycsb"><B>Client</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/CommandLine.html" title="class in com.yahoo.ycsb"><B>CommandLine</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/DB.html" title="class in com.yahoo.ycsb"><B>DB</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/BasicDB.html" title="class in com.yahoo.ycsb"><B>BasicDB</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient5.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient5</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient6.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient6</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/CassandraClient7.html" title="class in com.yahoo.ycsb.db"><B>CassandraClient7</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/DBWrapper.html" title="class in com.yahoo.ycsb"><B>DBWrapper</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/HBaseClient.html" title="class in com.yahoo.ycsb.db"><B>HBaseClient</B></A><LI TYPE="circle">com.yahoo.ycsb.db.<A HREF="com/yahoo/ycsb/db/MongoDbClient.html" title="class in com.yahoo.ycsb.db"><B>MongoDbClient</B></A></UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/DBFactory.html" title="class in com.yahoo.ycsb"><B>DBFactory</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/Generator.html" title="class in com.yahoo.ycsb.generator"><B>Generator</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/DiscreteGenerator.html" title="class in com.yahoo.ycsb.generator"><B>DiscreteGenerator</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/IntegerGenerator.html" title="class in com.yahoo.ycsb.generator"><B>IntegerGenerator</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/CounterGenerator.html" title="class in com.yahoo.ycsb.generator"><B>CounterGenerator</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/ScrambledZipfianGenerator.html" title="class in com.yahoo.ycsb.generator"><B>ScrambledZipfianGenerator</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/SkewedLatestGenerator.html" title="class in com.yahoo.ycsb.generator"><B>SkewedLatestGenerator</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/UniformIntegerGenerator.html" title="class in com.yahoo.ycsb.generator"><B>UniformIntegerGenerator</B></A><LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/ZipfianGenerator.html" title="class in com.yahoo.ycsb.generator"><B>ZipfianGenerator</B></A></UL> -<LI TYPE="circle">com.yahoo.ycsb.generator.<A HREF="com/yahoo/ycsb/generator/UniformGenerator.html" title="class in com.yahoo.ycsb.generator"><B>UniformGenerator</B></A></UL> -<LI TYPE="circle">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/Measurements.html" title="class in com.yahoo.ycsb.measurements"><B>Measurements</B></A><LI TYPE="circle">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/OneMeasurement.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurement</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/OneMeasurementHistogram.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurementHistogram</B></A><LI TYPE="circle">com.yahoo.ycsb.measurements.<A HREF="com/yahoo/ycsb/measurements/OneMeasurementTimeSeries.html" title="class in com.yahoo.ycsb.measurements"><B>OneMeasurementTimeSeries</B></A></UL> -<LI TYPE="circle">java.lang.Throwable (implements java.io.Serializable) -<UL> -<LI TYPE="circle">java.lang.Exception<UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb"><B>DBException</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb"><B>UnknownDBException</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb"><B>WorkloadException</B></A></UL> -</UL> -<LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Utils.html" title="class in com.yahoo.ycsb"><B>Utils</B></A><LI TYPE="circle">com.yahoo.ycsb.<A HREF="com/yahoo/ycsb/Workload.html" title="class in com.yahoo.ycsb"><B>Workload</B></A><UL> -<LI TYPE="circle">com.yahoo.ycsb.workloads.<A HREF="com/yahoo/ycsb/workloads/CoreWorkload.html" title="class in com.yahoo.ycsb.workloads"><B>CoreWorkload</B></A></UL> -</UL> -</UL> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> - <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/package-list b/doc/javadoc/package-list deleted file mode 100644 index 13443e193bc6a707ba38f222a7fe03cb8b0e608c..0000000000000000000000000000000000000000 --- a/doc/javadoc/package-list +++ /dev/null @@ -1,5 +0,0 @@ -com.yahoo.ycsb -com.yahoo.ycsb.db -com.yahoo.ycsb.generator -com.yahoo.ycsb.measurements -com.yahoo.ycsb.workloads diff --git a/doc/javadoc/resources/inherit.gif b/doc/javadoc/resources/inherit.gif deleted file mode 100644 index c814867a13deb0ca7ea2156c6ca1d5a03372af7e..0000000000000000000000000000000000000000 Binary files a/doc/javadoc/resources/inherit.gif and /dev/null differ diff --git a/doc/javadoc/serialized-form.html b/doc/javadoc/serialized-form.html deleted file mode 100644 index 3cff57be04d9176e044c773021b087804b4525d7..0000000000000000000000000000000000000000 --- a/doc/javadoc/serialized-form.html +++ /dev/null @@ -1,192 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<!--NewPage--> -<HTML> -<HEAD> -<!-- Generated by javadoc (build 1.6.0_03) on Wed May 12 14:51:53 PDT 2010 --> -<TITLE> -Serialized Form -</TITLE> - -<META NAME="date" CONTENT="2010-05-12"> - -<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> - -<SCRIPT type="text/javascript"> -function windowTitle() -{ - if (location.href.indexOf('is-external=true') == -1) { - parent.document.title="Serialized Form"; - } -} -</SCRIPT> -<NOSCRIPT> -</NOSCRIPT> - -</HEAD> - -<BODY BGCOLOR="white" onload="windowTitle();"> -<HR> - - -<!-- ========= START OF TOP NAVBAR ======= --> -<A NAME="navbar_top"><!-- --></A> -<A HREF="#skip-navbar_top" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_top_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> - <A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_top"></A> -<!-- ========= END OF TOP NAVBAR ========= --> - -<HR> -<CENTER> -<H1> -Serialized Form</H1> -</CENTER> -<HR SIZE="4" NOSHADE> - -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="center"><FONT SIZE="+2"> -<B>Package</B> <B>com.yahoo.ycsb</B></FONT></TH> -</TR> -</TABLE> - -<P> -<A NAME="com.yahoo.ycsb.DBException"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class <A HREF="com/yahoo/ycsb/DBException.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.DBException</A> extends java.lang.Exception implements Serializable</B></FONT></TH> -</TR> -</TABLE> - -<P> -<B>serialVersionUID: </B>6646883591588721475L - -<P> - -<P> -<A NAME="com.yahoo.ycsb.UnknownDBException"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class <A HREF="com/yahoo/ycsb/UnknownDBException.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.UnknownDBException</A> extends java.lang.Exception implements Serializable</B></FONT></TH> -</TR> -</TABLE> - -<P> -<B>serialVersionUID: </B>459099842269616836L - -<P> - -<P> -<A NAME="com.yahoo.ycsb.WorkloadException"><!-- --></A> -<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> -<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> -<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> -<B>Class <A HREF="com/yahoo/ycsb/WorkloadException.html" title="class in com.yahoo.ycsb">com.yahoo.ycsb.WorkloadException</A> extends java.lang.Exception implements Serializable</B></FONT></TH> -</TR> -</TABLE> - -<P> -<B>serialVersionUID: </B>8844396756042772132L - -<P> - -<P> -<HR> - - -<!-- ======= START OF BOTTOM NAVBAR ====== --> -<A NAME="navbar_bottom"><!-- --></A> -<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> -<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> -<TR> -<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> -<A NAME="navbar_bottom_firstrow"><!-- --></A> -<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> - <TR ALIGN="center" VALIGN="top"> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> - <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> - </TR> -</TABLE> -</TD> -<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> -</EM> -</TD> -</TR> - -<TR> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV - NEXT</FONT></TD> -<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - <A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> - <A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> - <SCRIPT type="text/javascript"> - <!-- - if(window==top) { - document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); - } - //--> -</SCRIPT> -<NOSCRIPT> - <A HREF="allclasses-noframe.html"><B>All Classes</B></A> -</NOSCRIPT> - - -</FONT></TD> -</TR> -</TABLE> -<A NAME="skip-navbar_bottom"></A> -<!-- ======== END OF BOTTOM NAVBAR ======= --> - -<HR> - -</BODY> -</HTML> diff --git a/doc/javadoc/stylesheet.css b/doc/javadoc/stylesheet.css deleted file mode 100644 index 6ea9e5161615fcf6cdb0d194d913139c26fa417a..0000000000000000000000000000000000000000 --- a/doc/javadoc/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF; color:#000000 } - -/* Headings */ -h1 { font-size: 145% } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ -.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ -.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} - diff --git a/doc/parallelclients.html b/doc/parallelclients.html index 4735bb5ba399d993e9afd2a2b3be2d4df1ca362e..3de79caca3a115eb8a2847cfb7496b5e1594644b 100644 --- a/doc/parallelclients.html +++ b/doc/parallelclients.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - Parallel clients</TITLE> </HEAD> diff --git a/doc/tipsfaq.html b/doc/tipsfaq.html index 27f4a5e9ea5f330e8349cf40349cdbeb1e56fbbd..3bd5a590356046ff2f53cf73327a9dcd24baccc1 100644 --- a/doc/tipsfaq.html +++ b/doc/tipsfaq.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - Tips and FAQ</TITLE> </HEAD> diff --git a/doc/workload.html b/doc/workload.html index 305d0204fcfa960f5020e4beddbf89476f7f0e78..02c41e92222e9f569d6fe201ae7cd7df0e99620c 100644 --- a/doc/workload.html +++ b/doc/workload.html @@ -1,4 +1,21 @@ <HTML> +<!-- +Copyright (c) 2010 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. +--> + <HEAD> <TITLE>YCSB - Implementing new workloads</TITLE> </HEAD> diff --git a/dynamodb/README b/dynamodb/README.md similarity index 59% rename from dynamodb/README rename to dynamodb/README.md index 42f84e7228c72ea625372f24b0078c1e41fa5dd9..61455ed919c6a7e9c98f8abcfe6cb035877e4b09 100644 --- a/dynamodb/README +++ b/dynamodb/README.md @@ -1,22 +1,44 @@ -CONFIGURE +<!-- +Copyright (c) 2010 Yahoo! Inc., 2012 - 2015 YCSB contributors. +All rights reserved. -YCSB_HOME - YCSB home directory -DYNAMODB_HOME - Amazon DynamoDB package files +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. +--> + +# DynamoDB Binding + +http://aws.amazon.com/documentation/dynamodb/ + +## Configure + + YCSB_HOME - YCSB home directory + DYNAMODB_HOME - Amazon DynamoDB package files Please refer to https://github.com/brianfrankcooper/YCSB/wiki/Using-the-Database-Libraries for more information on setup. -BENCHMARK +# Benchmark -$YCSB_HOME/bin/ycsb load dynamodb -P workloads/workloada -P dynamodb.properties -$YCSB_HOME/bin/ycsb run dynamodb -P workloads/workloada -P dynamodb.properties + $YCSB_HOME/bin/ycsb load dynamodb -P workloads/workloada -P dynamodb.properties + $YCSB_HOME/bin/ycsb run dynamodb -P workloads/workloada -P dynamodb.properties -PROPERTIES +# Properties -$DYNAMODB_HOME/conf/dynamodb.properties -$DYNAMODB_HOME/conf/AWSCredentials.properties + $DYNAMODB_HOME/conf/dynamodb.properties + $DYNAMODB_HOME/conf/AWSCredentials.properties -FAQs +# FAQs * Why is the recommended workload distribution set to 'uniform'? This is to conform with the best practices for using DynamoDB - uniform, evenly distributed workload is the recommended pattern for scaling and @@ -27,12 +49,12 @@ http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/BestPract * How does workload size affect provisioned throughput? The default payload size requires double the provisioned throughput to execute -the workload. This translates to double the provisioned throughput cost for testing. -The default item size in YCSB are 1000 bytes plus metadata overhead, which makes the -item exceed 1024 bytes. DynamoDB charges one capacity unit per 1024 bytes for read -or writes. An item that is greater than 1024 bytes but less than or equal to 2048 bytes -would cost 2 capacity units. With the change in payload size, each request would cost -1 capacity unit as opposed to 2, saving the cost of running the benchmark. +the workload. This translates to double the provisioned throughput cost for testing. +The default item size in YCSB are 1000 bytes plus metadata overhead, which makes the +item exceed 1024 bytes. DynamoDB charges one capacity unit per 1024 bytes for read +or writes. An item that is greater than 1024 bytes but less than or equal to 2048 bytes +would cost 2 capacity units. With the change in payload size, each request would cost +1 capacity unit as opposed to 2, saving the cost of running the benchmark. For more information refer to http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/WorkingWithDDTables.html @@ -43,7 +65,7 @@ than zero, either increase the DynamoDB table provisioned throughput or reduce YCSB throughput by reducing YCSB target throughput, adjusting the number of YCSB client threads, or combination of both. -For more information please refer to +For more information please refer to https://github.com/brianfrankcooper/YCSB/blob/master/doc/tipsfaq.html When requests are throttled, latency measurements by YCSB can increase. diff --git a/dynamodb/conf/AWSCredentials.properties b/dynamodb/conf/AWSCredentials.properties index dab032a1088f54478cb32fe2b5b772dbabbc7421..e337b391f0c9548ffdc75d564a5a77eb79f419aa 100644 --- a/dynamodb/conf/AWSCredentials.properties +++ b/dynamodb/conf/AWSCredentials.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # Fill in your AWS Access Key ID and Secret Access Key # http://aws.amazon.com/security-credentials #accessKey = diff --git a/dynamodb/conf/dynamodb.properties b/dynamodb/conf/dynamodb.properties index a510e4c9df53df68ff5c4393c142017d5cbb1f1d..691e20e80c60281b433d21334832478df05037dd 100644 --- a/dynamodb/conf/dynamodb.properties +++ b/dynamodb/conf/dynamodb.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # # Sample property file for Amazon DynamoDB database client @@ -9,8 +24,50 @@ # Primarykey of table 'usertable' #dynamodb.primaryKey = <firstname> +# If you set dynamodb.primaryKeyType to HASH_AND_RANGE, you must specify the +# hash key name of your primary key here. (see documentation below for details) +#dynamodb.hashKeyName = <hashid> + ## Optional parameters +# The property "primaryKeyType" below specifies the type of primary key +# you have setup for the test table. There are two choices: +# - HASH (default) +# - HASH_AND_RANGE +# +# When testing the DB in HASH mode (which is the default), your table's +# primary key must be of the "HASH" key type, and the name of the primary key +# is specified via the dynamodb.primaryKey property. In this mode, all +# keys from YCSB are hashed across multiple hash partitions and +# performance of individual operations are good. However, query across +# multiple items is eventually consistent in this mode and relies on the +# global secondary index. +# +# +# When testing the DB in HASH_AND_RANGE mode, your table's primary key must be +# of the "HASH_AND_RANGE" key type. You need to specify the name of the +# hash key via the "dynamodb.hashKeyName" property and you also need to +# specify the name of the range key via the "dynamodb.primaryKey" property. +# In this mode, keys supplied by YCSB will be used as the range part of +# the primary key and the hash part of the primary key will have a fixed value. +# Optionally you can designate the value used in the hash part of the primary +# key via the dynamodb.hashKeyValue. +# +# The purpose of the HASH_AND_RANGE mode is to benchmark the performance +# characteristics of a single logical hash partition. This is useful because +# so far the only practical way to do strongly consistent query is to do it +# in a single hash partition (Whole table scan can be consistent but it becomes +# less practical when the table is really large). Therefore, for users who +# really want to have strongly consistent query, it's important for them to +# know the performance capabilities of a single logical hash partition so +# they can plan their application accordingly. + +#dynamodb.primaryKeyType = HASH + +#Optionally you can specify a value for the hash part of the primary key +#when testing in HASH_AND_RANG mode. +#dynamodb.hashKeyValue = <some value of your choice> + # Endpoint to connect to.For best latency, it is recommended # to choose the endpoint which is closer to the client. # Default is us-east-1 diff --git a/dynamodb/pom.xml b/dynamodb/pom.xml index 49514fe100f2f44d97b86ecc206c65e48275b032..6ed245ae0eca3ed37db2e09d12aeb34dd3f46104 100644 --- a/dynamodb/pom.xml +++ b/dynamodb/pom.xml @@ -1,21 +1,42 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> <artifactId>dynamodb-binding</artifactId> <name>DynamoDB DB Binding</name> + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + <dependencies> <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk</artifactId> - <version>1.3.14</version> + <version>1.10.48</version> </dependency> <dependency> <groupId>log4j</groupId> @@ -29,4 +50,28 @@ <scope>provided</scope> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + <configuration> + <consoleOutput>true</consoleOutput> + <configLocation>../checkstyle.xml</configLocation> + <failOnViolation>true</failOnViolation> + <failsOnError>true</failsOnError> + </configuration> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/dynamodb/src/main/java/com/yahoo/ycsb/db/DynamoDBClient.java b/dynamodb/src/main/java/com/yahoo/ycsb/db/DynamoDBClient.java index 56808b8ccfa07d8a8070e10acd4bf75cd62aec94..c643768ba5f882dc63452128053a26e501627dac 100644 --- a/dynamodb/src/main/java/com/yahoo/ycsb/db/DynamoDBClient.java +++ b/dynamodb/src/main/java/com/yahoo/ycsb/db/DynamoDBClient.java @@ -1,6 +1,6 @@ /* - * Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2015-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. @@ -16,285 +16,326 @@ package com.yahoo.ycsb.db; -import java.io.FileInputStream; +import com.amazonaws.AmazonClientException; +import com.amazonaws.AmazonServiceException; +import com.amazonaws.ClientConfiguration; +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.PropertiesCredentials; +import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; +import com.amazonaws.services.dynamodbv2.model.*; +import com.yahoo.ycsb.*; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import java.util.Properties; import java.util.Set; import java.util.Vector; -import java.io.File; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; - -import com.amazonaws.auth.AWSCredentials; -import com.amazonaws.auth.PropertiesCredentials; -import com.amazonaws.ClientConfiguration; -import com.amazonaws.services.dynamodb.AmazonDynamoDBClient; -import com.amazonaws.AmazonClientException; -import com.amazonaws.AmazonServiceException; -import com.amazonaws.services.dynamodb.model.AttributeValue; -import com.amazonaws.services.dynamodb.model.AttributeValueUpdate; -import com.amazonaws.services.dynamodb.model.DeleteItemRequest; -import com.amazonaws.services.dynamodb.model.DeleteItemResult; -import com.amazonaws.services.dynamodb.model.GetItemRequest; -import com.amazonaws.services.dynamodb.model.GetItemResult; -import com.amazonaws.services.dynamodb.model.Key; -import com.amazonaws.services.dynamodb.model.PutItemRequest; -import com.amazonaws.services.dynamodb.model.PutItemResult; -import com.amazonaws.services.dynamodb.model.ScanRequest; -import com.amazonaws.services.dynamodb.model.ScanResult; -import com.amazonaws.services.dynamodb.model.UpdateItemRequest; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.StringByteIterator; /** - * DynamoDB v1.3.14 client for YCSB + * DynamoDB v1.10.48 client for YCSB. */ public class DynamoDBClient extends DB { - private static final int OK = 0; - private static final int SERVER_ERROR = 1; - private static final int CLIENT_ERROR = 2; - private AmazonDynamoDBClient dynamoDB; - private String primaryKeyName; - private boolean debug = false; - private boolean consistentRead = false; - private String endpoint = "http://dynamodb.us-east-1.amazonaws.com"; - private int maxConnects = 50; - private static Logger logger = Logger.getLogger(DynamoDBClient.class); - public DynamoDBClient() {} - - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - */ - public void init() throws DBException { - // initialize DynamoDb driver & table. - String debug = getProperties().getProperty("dynamodb.debug",null); - - if (null != debug && "true".equalsIgnoreCase(debug)) { - logger.setLevel(Level.DEBUG); - } - - String endpoint = getProperties().getProperty("dynamodb.endpoint",null); - String credentialsFile = getProperties().getProperty("dynamodb.awsCredentialsFile",null); - String primaryKey = getProperties().getProperty("dynamodb.primaryKey",null); - String consistentReads = getProperties().getProperty("dynamodb.consistentReads",null); - String connectMax = getProperties().getProperty("dynamodb.connectMax",null); - - if (null != connectMax) { - this.maxConnects = Integer.parseInt(connectMax); - } - - if (null != consistentReads && "true".equalsIgnoreCase(consistentReads)) { - this.consistentRead = true; - } - - if (null != endpoint) { - this.endpoint = endpoint; - } - - if (null == primaryKey || primaryKey.length() < 1) { - String errMsg = "Missing primary key attribute name, cannot continue"; - logger.error(errMsg); - } - - try { - AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile)); - ClientConfiguration cconfig = new ClientConfiguration(); - cconfig.setMaxConnections(maxConnects); - dynamoDB = new AmazonDynamoDBClient(credentials,cconfig); - dynamoDB.setEndpoint(this.endpoint); - primaryKeyName = primaryKey; - logger.info("dynamodb connection created with " + this.endpoint); - } catch (Exception e1) { - String errMsg = "DynamoDBClient.init(): Could not initialize DynamoDB client: " + e1.getMessage(); - logger.error(errMsg); - } + /** + * Defines the primary key type used in this particular DB instance. + * <p> + * By default, the primary key type is "HASH". Optionally, the user can + * choose to use hash_and_range key type. See documentation in the + * DynamoDB.Properties file for more details. + */ + private enum PrimaryKeyType { + HASH, + HASH_AND_RANGE + } + + private AmazonDynamoDBClient dynamoDB; + private String primaryKeyName; + private PrimaryKeyType primaryKeyType = PrimaryKeyType.HASH; + + // If the user choose to use HASH_AND_RANGE as primary key type, then + // the following two variables become relevant. See documentation in the + // DynamoDB.Properties file for more details. + private String hashKeyValue; + private String hashKeyName; + + private boolean consistentRead = false; + private String endpoint = "http://dynamodb.us-east-1.amazonaws.com"; + private int maxConnects = 50; + private static final Logger LOGGER = Logger.getLogger(DynamoDBClient.class); + private static final Status CLIENT_ERROR = new Status("CLIENT_ERROR", "An error occurred on the client."); + private static final String DEFAULT_HASH_KEY_VALUE = "YCSB_0"; + + @Override + public void init() throws DBException { + String debug = getProperties().getProperty("dynamodb.debug", null); + + if (null != debug && "true".equalsIgnoreCase(debug)) { + LOGGER.setLevel(Level.DEBUG); } - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - - logger.debug("readkey: " + key + " from table: " + table); - GetItemRequest req = new GetItemRequest(table, createPrimaryKey(key)); - req.setAttributesToGet(fields); - req.setConsistentRead(consistentRead); - GetItemResult res = null; - - try { - res = dynamoDB.getItem(req); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - return CLIENT_ERROR; - } - - if (null != res.getItem()) - { - result.putAll(extractResult(res.getItem())); - logger.debug("Result: " + res.toString()); - } - return OK; + String configuredEndpoint = getProperties().getProperty("dynamodb.endpoint", null); + String credentialsFile = getProperties().getProperty("dynamodb.awsCredentialsFile", null); + String primaryKey = getProperties().getProperty("dynamodb.primaryKey", null); + String primaryKeyTypeString = getProperties().getProperty("dynamodb.primaryKeyType", null); + String consistentReads = getProperties().getProperty("dynamodb.consistentReads", null); + String connectMax = getProperties().getProperty("dynamodb.connectMax", null); + + if (null != connectMax) { + this.maxConnects = Integer.parseInt(connectMax); } - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - logger.debug("scan " + recordcount + " records from key: " + startkey + " on table: " + table); - /* - * on DynamoDB's scan, startkey is *exclusive* so we need to - * getItem(startKey) and then use scan for the res - */ - GetItemRequest greq = new GetItemRequest(table, createPrimaryKey(startkey)); - greq.setAttributesToGet(fields); - - GetItemResult gres = null; - - try { - gres = dynamoDB.getItem(greq); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - return CLIENT_ERROR; - } - - if (null != gres.getItem()) { - result.add(extractResult(gres.getItem())); - } - - int count = 1; // startKey is done, rest to go. - - Key startKey = createPrimaryKey(startkey); - ScanRequest req = new ScanRequest(table); - req.setAttributesToGet(fields); - while (count < recordcount) { - req.setExclusiveStartKey(startKey); - req.setLimit(recordcount - count); - ScanResult res = null; - try { - res = dynamoDB.scan(req); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - ex.printStackTrace(); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - ex.printStackTrace(); - return CLIENT_ERROR; - } - - count += res.getCount(); - for (Map<String, AttributeValue> items : res.getItems()) { - result.add(extractResult(items)); - } - startKey = res.getLastEvaluatedKey(); - - } - - return OK; + if (null != consistentReads && "true".equalsIgnoreCase(consistentReads)) { + this.consistentRead = true; } - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - logger.debug("updatekey: " + key + " from table: " + table); - - Map<String, AttributeValueUpdate> attributes = new HashMap<String, AttributeValueUpdate>( - values.size()); - for (Entry<String, ByteIterator> val : values.entrySet()) { - AttributeValue v = new AttributeValue(val.getValue().toString()); - attributes.put(val.getKey(), new AttributeValueUpdate() - .withValue(v).withAction("PUT")); - } - - UpdateItemRequest req = new UpdateItemRequest(table, createPrimaryKey(key), attributes); - - try { - dynamoDB.updateItem(req); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - return CLIENT_ERROR; - } - return OK; + if (null != configuredEndpoint) { + this.endpoint = configuredEndpoint; } - @Override - public int insert(String table, String key,HashMap<String, ByteIterator> values) { - logger.debug("insertkey: " + primaryKeyName + "-" + key + " from table: " + table); - Map<String, AttributeValue> attributes = createAttributes(values); - // adding primary key - attributes.put(primaryKeyName, new AttributeValue(key)); - - PutItemRequest putItemRequest = new PutItemRequest(table, attributes); - PutItemResult res = null; - try { - res = dynamoDB.putItem(putItemRequest); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - return CLIENT_ERROR; - } - return OK; + if (null == primaryKey || primaryKey.length() < 1) { + throw new DBException("Missing primary key attribute name, cannot continue"); } - @Override - public int delete(String table, String key) { - logger.debug("deletekey: " + key + " from table: " + table); - DeleteItemRequest req = new DeleteItemRequest(table, createPrimaryKey(key)); - DeleteItemResult res = null; - - try { - res = dynamoDB.deleteItem(req); - }catch (AmazonServiceException ex) { - logger.error(ex.getMessage()); - return SERVER_ERROR; - }catch (AmazonClientException ex){ - logger.error(ex.getMessage()); - return CLIENT_ERROR; - } - return OK; + if (null != primaryKeyTypeString) { + try { + this.primaryKeyType = PrimaryKeyType.valueOf(primaryKeyTypeString.trim().toUpperCase()); + } catch (IllegalArgumentException e) { + throw new DBException("Invalid primary key mode specified: " + primaryKeyTypeString + + ". Expecting HASH or HASH_AND_RANGE."); + } } - private static Map<String, AttributeValue> createAttributes( - HashMap<String, ByteIterator> values) { - Map<String, AttributeValue> attributes = new HashMap<String, AttributeValue>( - values.size() + 1); //leave space for the PrimaryKey - for (Entry<String, ByteIterator> val : values.entrySet()) { - attributes.put(val.getKey(), new AttributeValue(val.getValue() - .toString())); - } - return attributes; + if (this.primaryKeyType == PrimaryKeyType.HASH_AND_RANGE) { + // When the primary key type is HASH_AND_RANGE, keys used by YCSB + // are range keys so we can benchmark performance of individual hash + // partitions. In this case, the user must specify the hash key's name + // and optionally can designate a value for the hash key. + + String configuredHashKeyName = getProperties().getProperty("dynamodb.hashKeyName", null); + if (null == configuredHashKeyName || configuredHashKeyName.isEmpty()) { + throw new DBException("Must specify a non-empty hash key name when the primary key type is HASH_AND_RANGE."); + } + this.hashKeyName = configuredHashKeyName; + this.hashKeyValue = getProperties().getProperty("dynamodb.hashKeyValue", DEFAULT_HASH_KEY_VALUE); } - private HashMap<String, ByteIterator> extractResult(Map<String, AttributeValue> item) { - if(null == item) - return null; - HashMap<String, ByteIterator> rItems = new HashMap<String, ByteIterator>(item.size()); + try { + AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile)); + ClientConfiguration cconfig = new ClientConfiguration(); + cconfig.setMaxConnections(maxConnects); + dynamoDB = new AmazonDynamoDBClient(credentials, cconfig); + dynamoDB.setEndpoint(this.endpoint); + primaryKeyName = primaryKey; + LOGGER.info("dynamodb connection created with " + this.endpoint); + } catch (Exception e1) { + LOGGER.error("DynamoDBClient.init(): Could not initialize DynamoDB client.", e1); + } + } - for (Entry<String, AttributeValue> attr : item.entrySet()) { - logger.debug(String.format("Result- key: %s, value: %s", attr.getKey(), attr.getValue()) ); - rItems.put(attr.getKey(), new StringByteIterator(attr.getValue().getS())); - } - return rItems; + @Override + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("readkey: " + key + " from table: " + table); } - private static Key createPrimaryKey(String key) { - Key k = new Key().withHashKeyElement(new AttributeValue().withS(key)); - return k; + GetItemRequest req = new GetItemRequest(table, createPrimaryKey(key)); + req.setAttributesToGet(fields); + req.setConsistentRead(consistentRead); + GetItemResult res; + + try { + res = dynamoDB.getItem(req); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + + if (null != res.getItem()) { + result.putAll(extractResult(res.getItem())); + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("Result: " + res.toString()); + } + } + return Status.OK; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("scan " + recordcount + " records from key: " + startkey + " on table: " + table); + } + + /* + * on DynamoDB's scan, startkey is *exclusive* so we need to + * getItem(startKey) and then use scan for the res + */ + GetItemRequest greq = new GetItemRequest(table, createPrimaryKey(startkey)); + greq.setAttributesToGet(fields); + + GetItemResult gres; + + try { + gres = dynamoDB.getItem(greq); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + + if (null != gres.getItem()) { + result.add(extractResult(gres.getItem())); + } + + int count = 1; // startKey is done, rest to go. + + Map<String, AttributeValue> startKey = createPrimaryKey(startkey); + ScanRequest req = new ScanRequest(table); + req.setAttributesToGet(fields); + while (count < recordcount) { + req.setExclusiveStartKey(startKey); + req.setLimit(recordcount - count); + ScanResult res; + try { + res = dynamoDB.scan(req); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + + count += res.getCount(); + for (Map<String, AttributeValue> items : res.getItems()) { + result.add(extractResult(items)); + } + startKey = res.getLastEvaluatedKey(); + + } + + return Status.OK; + } + + @Override + public Status update(String table, String key, HashMap<String, ByteIterator> values) { + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("updatekey: " + key + " from table: " + table); + } + + Map<String, AttributeValueUpdate> attributes = new HashMap<>(values.size()); + for (Entry<String, ByteIterator> val : values.entrySet()) { + AttributeValue v = new AttributeValue(val.getValue().toString()); + attributes.put(val.getKey(), new AttributeValueUpdate().withValue(v).withAction("PUT")); + } + + UpdateItemRequest req = new UpdateItemRequest(table, createPrimaryKey(key), attributes); + + try { + dynamoDB.updateItem(req); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + return Status.OK; + } + + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("insertkey: " + primaryKeyName + "-" + key + " from table: " + table); + } + + Map<String, AttributeValue> attributes = createAttributes(values); + // adding primary key + attributes.put(primaryKeyName, new AttributeValue(key)); + if (primaryKeyType == PrimaryKeyType.HASH_AND_RANGE) { + // If the primary key type is HASH_AND_RANGE, then what has been put + // into the attributes map above is the range key part of the primary + // key, we still need to put in the hash key part here. + attributes.put(hashKeyName, new AttributeValue(hashKeyValue)); + } + + PutItemRequest putItemRequest = new PutItemRequest(table, attributes); + try { + dynamoDB.putItem(putItemRequest); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + return Status.OK; + } + + @Override + public Status delete(String table, String key) { + if(LOGGER.isDebugEnabled()) { + LOGGER.debug("deletekey: " + key + " from table: " + table); + } + + DeleteItemRequest req = new DeleteItemRequest(table, createPrimaryKey(key)); + + try { + dynamoDB.deleteItem(req); + } catch (AmazonServiceException ex) { + LOGGER.error(ex); + return Status.ERROR; + } catch (AmazonClientException ex) { + LOGGER.error(ex); + return CLIENT_ERROR; + } + return Status.OK; + } + + private static Map<String, AttributeValue> createAttributes(HashMap<String, ByteIterator> values) { + //leave space for the PrimaryKey + Map<String, AttributeValue> attributes = new HashMap<>(values.size() + 1); + for (Entry<String, ByteIterator> val : values.entrySet()) { + attributes.put(val.getKey(), new AttributeValue(val.getValue().toString())); + } + return attributes; + } + + private HashMap<String, ByteIterator> extractResult(Map<String, AttributeValue> item) { + if (null == item) { + return null; + } + HashMap<String, ByteIterator> rItems = new HashMap<>(item.size()); + + for (Entry<String, AttributeValue> attr : item.entrySet()) { + if(LOGGER.isDebugEnabled()) { + LOGGER.debug(String.format("Result- key: %s, value: %s", attr.getKey(), attr.getValue())); + } + rItems.put(attr.getKey(), new StringByteIterator(attr.getValue().getS())); + } + return rItems; + } + + private Map<String, AttributeValue> createPrimaryKey(String key) { + Map<String, AttributeValue> k = new HashMap<>(); + if (primaryKeyType == PrimaryKeyType.HASH) { + k.put(primaryKeyName, new AttributeValue().withS(key)); + } else if (primaryKeyType == PrimaryKeyType.HASH_AND_RANGE) { + k.put(hashKeyName, new AttributeValue().withS(hashKeyValue)); + k.put(primaryKeyName, new AttributeValue().withS(key)); + } else { + throw new RuntimeException("Assertion Error: impossible primary key type"); } + return k; + } } diff --git a/dynamodb/src/main/java/com/yahoo/ycsb/db/package-info.java b/dynamodb/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..ad3cbaa7a510ea741072861a168ba92c36bd5781 --- /dev/null +++ b/dynamodb/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2015-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. + */ + +/** + * The YCSB binding for <a href="https://aws.amazon.com/dynamodb/">DynamoDB</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/dynamodb/src/main/resources/log4j.properties b/dynamodb/src/main/resources/log4j.properties index 8b4120f4ad5e8a9297e060319d335428320b8764..a9f3d668b91255d1bb4abe5d37e1f10994eaa5f1 100644 --- a/dynamodb/src/main/resources/log4j.properties +++ b/dynamodb/src/main/resources/log4j.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + #define the console appender log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 047a9ea3f27817737128f764a4726358e94fd101..0e863c891628153b98ab2844d0a4320a10cfc075 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -1,6 +1,23 @@ +<!-- +Copyright (c) 2012 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 ElasticSearch running locally. +This section describes how to run YCSB on Elasticsearch running locally. ### 1. Set Up YCSB @@ -14,52 +31,64 @@ Clone the YCSB git repository and compile: Now you are ready to run! First, load the data: - ./bin/ycsb load elasticsearch -s -P workloads/workloada + ./bin/ycsb load elasticsearch -s -P workloads/workloada -p path.home=<path> Then, run the workload: - ./bin/ycsb run elasticsearch -s -P workloads/workloada + ./bin/ycsb run elasticsearch -s -P workloads/workloada -p path.home=<path> + +Note that the `<path>` specified in each execution should be the same. + +The Elasticsearch binding has two modes of operation, embedded mode and remote +mode. In embedded mode, the client creates an embedded instance of +Elasticsearch that uses the specified `<path>` to persist data between +executions. + +In remote mode, the client will hit a standalone instance of Elasticsearch. To +use remote mode, add the flags `-p es.remote=true` and specify a hosts list via +`-p es.hosts.list=<hostname1:port1>,...,<hostnamen:portn>`. -For further configuration see below: + ./bin/ycsb run elasticsearch -s -P workloads/workloada -p es.remote=true \ + -p es.hosts.list=<hostname1:port1>,...,<hostnamen:portn>` + +Note that `es.hosts.list` defaults to `localhost:9300`. For further +configuration see below: ### Defaults Configuration -The default setting for the ElasticSearch node that is created is as follows: +The default setting for the Elasticsearch node that is created is as follows: cluster.name=es.ycsb.cluster - node.local=true - path.data=$TEMP_DIR/esdata - discovery.zen.ping.multicast.enabled=false - index.mapping._id.indexed=true - index.gateway.type=none - gateway.type=none - index.number_of_shards=1 - index.number_of_replicas=0 es.index.key=es.ycsb + es.number_of_shards=1 + es.number_of_replicas=0 + es.remote=false + es.newdb=false + es.hosts.list=localhost:9300 (only applies if es.remote=true) ### Custom Configuration -If you wish to customize the settings used to create the ElasticSerach node -you can created a new property file that contains your desired ElasticSearch +If you wish to customize the settings used to create the Elasticsearch node +you can created a new property file that contains your desired Elasticsearch node settings and pass it in via the parameter to 'bin/ycsb' script. Note that the default properties will be kept if you don't explicitly overwrite them. Assuming that we have a properties file named "myproperties.data" that contains -custom ElasticSearch node configuration you can execute the following to -pass it into the ElasticSearch client: +custom Elasticsearch node configuration you can execute the following to +pass it into the Elasticsearch client: ./bin/ycsb run elasticsearch -P workloads/workloada -P myproperties.data -s +If you wish to change the default index name you can set the following property: -If you wish to use a in-memory store type rather than the default disk store add -the following properties to your custom properties file. For a large number of -insert operations insure that you have sufficient memory on your test system -otherwise you will run out of memory. + es.index.key=my_index_key - index.store.type=memory - index.store.fs.memory.enabled=true - cache.memory.small_buffer_size=4mb - cache.memory.large_cache_size=1024mb +If you wish to run against a remote cluster you can set the following property: -If you wish to change the default index name you can set the following property: + es.remote=true - es.index.key=my_index_key +By default this will use localhost:9300 as a seed node to discover the cluster. +You can also specify + + es.hosts.list=(\w+:\d+)+ + +(a comma-separated list of host/port pairs) to change this. diff --git a/elasticsearch/pom.xml b/elasticsearch/pom.xml index ef6bd9c3bc9794000c5a60d0c29c14baca8bad57..5e7c4057957c1736016641f0b29a88a5430140d2 100644 --- a/elasticsearch/pom.xml +++ b/elasticsearch/pom.xml @@ -1,27 +1,44 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> <artifactId>elasticsearch-binding</artifactId> - <name>ElasticSearch Binding</name> + <name>Elasticsearch Binding</name> <packaging>jar</packaging> <properties> - <elasticsearch-version>0.19.8</elasticsearch-version> + <elasticsearch-version>2.4.0</elasticsearch-version> </properties> - <repositories> - <repository> - <id>sonatype-nexus-snapshots</id> - <name>Sonatype releases</name> - <url>https://oss.sonatype.org/content/repositories/releases</url> - </repository> - </repositories> <dependencies> + <dependency> + <!-- jna is supported in ES and will be used when provided + otherwise a fallback is used --> + <groupId>net.java.dev.jna</groupId> + <artifactId>jna</artifactId> + <version>4.1.0</version> + </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> <artifactId>core</artifactId> @@ -34,9 +51,9 @@ <version>${elasticsearch-version}</version> </dependency> <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>6.1.1</version> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> <scope>test</scope> </dependency> </dependencies> diff --git a/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticSearchClient.java b/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticSearchClient.java deleted file mode 100644 index 30349bb30d91962cd1e6dc0feeccdbdf500eba0b..0000000000000000000000000000000000000000 --- a/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticSearchClient.java +++ /dev/null @@ -1,296 +0,0 @@ -package com.yahoo.ycsb.db; - -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.StringByteIterator; -import java.util.HashMap; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.client.Requests; -import static org.elasticsearch.common.settings.ImmutableSettings.*; - -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.ImmutableSettings.Builder; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.*; -import static org.elasticsearch.index.query.FilterBuilders.*; -import static org.elasticsearch.index.query.QueryBuilders.*; -import org.elasticsearch.index.query.RangeFilterBuilder; -import org.elasticsearch.node.Node; -import static org.elasticsearch.node.NodeBuilder.*; -import org.elasticsearch.search.SearchHit; - -/** - * ElasticSearch client for YCSB framework. - * - * <p>Default properties to set:</p> <ul> <li>es.cluster.name = es.ycsb.cluster - * <li>es.client = true <li>es.index.key = es.ycsb</ul> - * - * @author Sharmarke Aden - * - */ -public class ElasticSearchClient extends DB { - - public static final String DEFAULT_CLUSTER_NAME = "es.ycsb.cluster"; - public static final String DEFAULT_INDEX_KEY = "es.ycsb"; - public static final String DEFAULT_REMOTE_HOST = "localhost:9300"; - private Node node; - private Client client; - private String indexKey; - - private Boolean remoteMode; - - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - */ - @Override - public void init() throws DBException { - // initialize OrientDB driver - Properties props = getProperties(); - this.indexKey = props.getProperty("es.index.key", DEFAULT_INDEX_KEY); - String clusterName = props.getProperty("cluster.name", DEFAULT_CLUSTER_NAME); - //Check if transport client needs to be used (To connect to multiple elasticsearch nodes) - remoteMode = Boolean.parseBoolean(props.getProperty("elasticsearch.remote", "false")); - Boolean newdb = Boolean.parseBoolean(props.getProperty("elasticsearch.newdb", "false")); - Builder settings = settingsBuilder() - .put("node.local", "true") - .put("path.data", System.getProperty("java.io.tmpdir") + "/esdata") - .put("discovery.zen.ping.multicast.enabled", "false") - .put("index.mapping._id.indexed", "true") - .put("index.gateway.type", "none") - .put("gateway.type", "none") - .put("index.number_of_shards", "1") - .put("index.number_of_replicas", "0"); - - - //if properties file contains elasticsearch user defined properties - //add it to the settings file (will overwrite the defaults). - settings.put(props); - System.out.println("ElasticSearch starting node = " + settings.get("cluster.name")); - System.out.println("ElasticSearch node data path = " + settings.get("path.data")); - System.out.println("ElasticSearch Remote Mode = " +remoteMode); - //Remote mode support for connecting to remote elasticsearch cluster - if(remoteMode) { - settings.put("client.transport.sniff", true) - .put("client.transport.ignore_cluster_name", false) - .put("client.transport.ping_timeout", "30s") - .put("client.transport.nodes_sampler_interval", "30s"); - //Default it to localhost:9300 - String nodeList[] = props.getProperty("elasticsearch.hosts.list", DEFAULT_REMOTE_HOST).split(","); - System.out.println("ElasticSearch Remote Hosts = " +props.getProperty("elasticsearch.hosts.list", DEFAULT_REMOTE_HOST)); - TransportClient tClient = new TransportClient(settings); - for(String h : nodeList) { - String node[] = h.split(":"); - tClient.addTransportAddress(new InetSocketTransportAddress(node[0], Integer.parseInt(node[1]))); - } - client = tClient; - } else { //Start node only if transport client mode is disabled - node = nodeBuilder().clusterName(clusterName).settings(settings).node(); - node.start(); - client = node.client(); - } - - - if (newdb) { - client.admin().indices().prepareDelete(indexKey).execute().actionGet(); - client.admin().indices().prepareCreate(indexKey).execute().actionGet(); - } else { - boolean exists = client.admin().indices().exists(Requests.indicesExistsRequest(indexKey)).actionGet().isExists(); - if (!exists) { - client.admin().indices().prepareCreate(indexKey).execute().actionGet(); - } - } - } - - @Override - public void cleanup() throws DBException { - if(!remoteMode) { - if (!node.isClosed()) { - client.close(); - node.stop(); - node.close(); - } - } else { - client.close(); - } - } - - /** - * 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 this class's - * description for a discussion of error codes. - */ - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - try { - final XContentBuilder doc = jsonBuilder().startObject(); - - for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { - doc.field(entry.getKey(), entry.getValue()); - } - - doc.endObject(); - - client.prepareIndex(indexKey, table, key) - .setSource(doc) - .execute() - .actionGet(); - - return 0; - } catch (Exception e) { - e.printStackTrace(); - } - return 1; - } - - /** - * 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 this class's - * description for a discussion of error codes. - */ - @Override - public int delete(String table, String key) { - try { - client.prepareDelete(indexKey, table, key) - .execute() - .actionGet(); - return 0; - } catch (Exception e) { - e.printStackTrace(); - } - return 1; - } - - /** - * 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". - */ - @Override - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { - try { - final GetResponse response = client.prepareGet(indexKey, table, key) - .execute() - .actionGet(); - - if (response.isExists()) { - if (fields != null) { - for (String field : fields) { - result.put(field, new StringByteIterator((String) response.getSource().get(field))); - } - } else { - for (String field : response.getSource().keySet()) { - result.put(field, new StringByteIterator((String) response.getSource().get(field))); - } - } - return 0; - } - } catch (Exception e) { - e.printStackTrace(); - } - return 1; - } - - /** - * 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 int update(String table, String key, HashMap<String, ByteIterator> values) { - try { - final GetResponse response = client.prepareGet(indexKey, table, key) - .execute() - .actionGet(); - - if (response.isExists()) { - for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { - response.getSource().put(entry.getKey(), entry.getValue()); - } - - client.prepareIndex(indexKey, table, key) - .setSource(response.getSource()) - .execute() - .actionGet(); - - return 0; - } - - } catch (Exception e) { - e.printStackTrace(); - } - return 1; - } - - /** - * 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 this class's - * description for a discussion of error codes. - */ - @Override - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - try { - final RangeFilterBuilder filter = rangeFilter("_id").gte(startkey); - final SearchResponse response = client.prepareSearch(indexKey) - .setTypes(table) - .setQuery(matchAllQuery()) - .setFilter(filter) - .setSize(recordcount) - .execute() - .actionGet(); - - HashMap<String, ByteIterator> entry; - - for (SearchHit hit : response.getHits()) { - entry = new HashMap<String, ByteIterator>(fields.size()); - - for (String field : fields) { - entry.put(field, new StringByteIterator((String) hit.getSource().get(field))); - } - - result.add(entry); - } - - return 0; - } catch (Exception e) { - e.printStackTrace(); - } - return 1; - } -} diff --git a/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java b/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java new file mode 100644 index 0000000000000000000000000000000000000000..76ddee1d2eade0335f34b8977a5c3cd07dcf6cb9 --- /dev/null +++ b/elasticsearch/src/main/java/com/yahoo/ycsb/db/ElasticsearchClient.java @@ -0,0 +1,369 @@ +/** + * Copyright (c) 2012 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 static org.elasticsearch.common.settings.Settings.Builder; +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; +import static org.elasticsearch.node.NodeBuilder.nodeBuilder; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; +import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; +import org.elasticsearch.action.delete.DeleteResponse; +import org.elasticsearch.action.get.GetResponse; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.client.Requests; +import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.transport.InetSocketTransportAddress; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.query.RangeQueryBuilder; +import org.elasticsearch.node.Node; +import org.elasticsearch.search.SearchHit; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; + +/** + * Elasticsearch client for YCSB framework. + * + * <p> + * Default properties to set: + * </p> + * <ul> + * <li>cluster.name = es.ycsb.cluster + * <li>es.index.key = es.ycsb + * <li>es.number_of_shards = 1 + * <li>es.number_of_replicas = 0 + * </ul> + */ +public class ElasticsearchClient extends DB { + + private static final String DEFAULT_CLUSTER_NAME = "es.ycsb.cluster"; + private static final String DEFAULT_INDEX_KEY = "es.ycsb"; + private static final String DEFAULT_REMOTE_HOST = "localhost:9300"; + private static final int NUMBER_OF_SHARDS = 1; + private static final int NUMBER_OF_REPLICAS = 0; + private Node node; + private Client client; + private String indexKey; + private Boolean remoteMode; + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public void init() throws DBException { + final Properties props = getProperties(); + + // Check if transport client needs to be used (To connect to multiple + // elasticsearch nodes) + remoteMode = Boolean.parseBoolean(props.getProperty("es.remote", "false")); + + final String pathHome = props.getProperty("path.home"); + + // when running in embedded mode, require path.home + if (!remoteMode && (pathHome == null || pathHome.isEmpty())) { + throw new IllegalArgumentException("path.home must be specified when running in embedded mode"); + } + + this.indexKey = props.getProperty("es.index.key", DEFAULT_INDEX_KEY); + + int numberOfShards = parseIntegerProperty(props, "es.number_of_shards", NUMBER_OF_SHARDS); + int numberOfReplicas = parseIntegerProperty(props, "es.number_of_replicas", NUMBER_OF_REPLICAS); + + Boolean newdb = Boolean.parseBoolean(props.getProperty("es.newdb", "false")); + Builder settings = Settings.settingsBuilder() + .put("cluster.name", DEFAULT_CLUSTER_NAME) + .put("node.local", Boolean.toString(!remoteMode)) + .put("path.home", pathHome); + + // if properties file contains elasticsearch user defined properties + // add it to the settings file (will overwrite the defaults). + settings.put(props); + final String clusterName = settings.get("cluster.name"); + System.err.println("Elasticsearch starting node = " + clusterName); + System.err.println("Elasticsearch node path.home = " + settings.get("path.home")); + System.err.println("Elasticsearch Remote Mode = " + remoteMode); + // Remote mode support for connecting to remote elasticsearch cluster + if (remoteMode) { + settings.put("client.transport.sniff", true) + .put("client.transport.ignore_cluster_name", false) + .put("client.transport.ping_timeout", "30s") + .put("client.transport.nodes_sampler_interval", "30s"); + // Default it to localhost:9300 + String[] nodeList = props.getProperty("es.hosts.list", DEFAULT_REMOTE_HOST).split(","); + System.out.println("Elasticsearch Remote Hosts = " + props.getProperty("es.hosts.list", DEFAULT_REMOTE_HOST)); + TransportClient tClient = TransportClient.builder().settings(settings).build(); + for (String h : nodeList) { + String[] nodes = h.split(":"); + try { + tClient.addTransportAddress(new InetSocketTransportAddress( + InetAddress.getByName(nodes[0]), + Integer.parseInt(nodes[1]) + )); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Unable to parse port number.", e); + } catch (UnknownHostException e) { + throw new IllegalArgumentException("Unable to Identify host.", e); + } + } + client = tClient; + } else { // Start node only if transport client mode is disabled + node = nodeBuilder().clusterName(clusterName).settings(settings).node(); + node.start(); + client = node.client(); + } + + final boolean exists = + client.admin().indices() + .exists(Requests.indicesExistsRequest(indexKey)).actionGet() + .isExists(); + if (exists && newdb) { + client.admin().indices().prepareDelete(indexKey).execute().actionGet(); + } + if (!exists || newdb) { + client.admin().indices().create( + new CreateIndexRequest(indexKey) + .settings( + Settings.builder() + .put("index.number_of_shards", numberOfShards) + .put("index.number_of_replicas", numberOfReplicas) + .put("index.mapping._id.indexed", true) + )).actionGet(); + } + client.admin().cluster().health(new ClusterHealthRequest().waitForGreenStatus()).actionGet(); + } + + private int parseIntegerProperty(Properties properties, String key, int defaultValue) { + String value = properties.getProperty(key); + return value == null ? defaultValue : Integer.parseInt(value); + } + + @Override + public void cleanup() throws DBException { + if (!remoteMode) { + if (!node.isClosed()) { + client.close(); + node.close(); + } + } else { + client.close(); + } + } + + /** + * 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 this class's + * description for a discussion of error codes. + */ + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + try { + final XContentBuilder doc = jsonBuilder().startObject(); + + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { + doc.field(entry.getKey(), entry.getValue()); + } + + doc.endObject(); + + client.prepareIndex(indexKey, table, key).setSource(doc).execute().actionGet(); + + return Status.OK; + } catch (Exception e) { + e.printStackTrace(); + 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 this class's + * description for a discussion of error codes. + */ + @Override + public Status delete(String table, String key) { + try { + DeleteResponse response = client.prepareDelete(indexKey, table, key).execute().actionGet(); + if (response.isFound()) { + return Status.OK; + } else { + return Status.NOT_FOUND; + } + } catch (Exception e) { + e.printStackTrace(); + 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". + */ + @Override + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + try { + final GetResponse response = client.prepareGet(indexKey, table, key).execute().actionGet(); + + if (response.isExists()) { + if (fields != null) { + for (String field : fields) { + result.put(field, new StringByteIterator( + (String) response.getSource().get(field))); + } + } else { + for (String field : response.getSource().keySet()) { + result.put(field, new StringByteIterator( + (String) response.getSource().get(field))); + } + } + return Status.OK; + } else { + return Status.NOT_FOUND; + } + } catch (Exception e) { + e.printStackTrace(); + 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, HashMap<String, ByteIterator> values) { + try { + final GetResponse response = client.prepareGet(indexKey, table, key).execute().actionGet(); + + if (response.isExists()) { + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { + response.getSource().put(entry.getKey(), entry.getValue()); + } + + client.prepareIndex(indexKey, table, key).setSource(response.getSource()).execute().actionGet(); + + return Status.OK; + } else { + return Status.NOT_FOUND; + } + } catch (Exception e) { + e.printStackTrace(); + 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 this 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) { + try { + final RangeQueryBuilder rangeQuery = rangeQuery("_id").gte(startkey); + final SearchResponse response = client.prepareSearch(indexKey) + .setTypes(table) + .setQuery(rangeQuery) + .setSize(recordcount) + .execute() + .actionGet(); + + HashMap<String, ByteIterator> entry; + + for (SearchHit hit : response.getHits()) { + entry = new HashMap<>(fields.size()); + for (String field : fields) { + entry.put(field, new StringByteIterator((String) hit.getSource().get(field))); + } + result.add(entry); + } + + return Status.OK; + } catch (Exception e) { + e.printStackTrace(); + return Status.ERROR; + } + } +} diff --git a/elasticsearch/src/main/java/com/yahoo/ycsb/db/package-info.java b/elasticsearch/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..5b831713b253d01a0c1ffc1b844a09b63a5e389a --- /dev/null +++ b/elasticsearch/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -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://www.elastic.co/products/elasticsearch">Elasticsearch</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticSearchClientTest.java b/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java similarity index 54% rename from elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticSearchClientTest.java rename to elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java index 3ef8ed9ce9baa79e0a0a157379940361f08c6904..d1ad64d187e642cfd2bf2eabc50f853c478b2825 100644 --- a/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticSearchClientTest.java +++ b/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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. + */ + /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -6,24 +23,28 @@ package com.yahoo.ycsb.db; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + import java.util.HashMap; +import java.util.Properties; import java.util.Set; import java.util.Vector; -import static org.testng.AssertJUnit.*; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -/** - * - * @author saden - */ -public class ElasticSearchClientTest { +import static org.junit.Assert.assertEquals; + +public class ElasticsearchClientTest { - protected final static ElasticSearchClient instance = new ElasticSearchClient(); + @ClassRule public final static TemporaryFolder temp = new TemporaryFolder(); + protected final static ElasticsearchClient instance = new ElasticsearchClient(); protected final static HashMap<String, ByteIterator> MOCK_DATA; protected final static String MOCK_TABLE = "MOCK_TABLE"; protected final static String MOCK_KEY0 = "0"; @@ -39,6 +60,9 @@ public class ElasticSearchClientTest { @BeforeClass public static void setUpClass() throws DBException { + final Properties props = new Properties(); + props.put("path.home", temp.getRoot().toString()); + instance.setProperties(props); instance.init(); } @@ -47,55 +71,52 @@ public class ElasticSearchClientTest { instance.cleanup(); } - @BeforeMethod + @Before public void setUp() { instance.insert(MOCK_TABLE, MOCK_KEY1, MOCK_DATA); instance.insert(MOCK_TABLE, MOCK_KEY2, MOCK_DATA); } - @AfterMethod + @After public void tearDown() { instance.delete(MOCK_TABLE, MOCK_KEY1); instance.delete(MOCK_TABLE, MOCK_KEY2); } /** - * Test of insert method, of class ElasticSearchClient. + * Test of insert method, of class ElasticsearchClient. */ @Test public void testInsert() { System.out.println("insert"); - int expResult = 0; - int result = instance.insert(MOCK_TABLE, MOCK_KEY0, MOCK_DATA); - assertEquals(expResult, result); + Status result = instance.insert(MOCK_TABLE, MOCK_KEY0, MOCK_DATA); + assertEquals(Status.OK, result); } /** - * Test of delete method, of class ElasticSearchClient. + * Test of delete method, of class ElasticsearchClient. */ @Test public void testDelete() { System.out.println("delete"); - int expResult = 0; - int result = instance.delete(MOCK_TABLE, MOCK_KEY1); - assertEquals(expResult, result); + Status result = instance.delete(MOCK_TABLE, MOCK_KEY1); + assertEquals(Status.OK, result); } /** - * Test of read method, of class ElasticSearchClient. + * Test of read method, of class ElasticsearchClient. */ @Test public void testRead() { System.out.println("read"); Set<String> fields = MOCK_DATA.keySet(); HashMap<String, ByteIterator> resultParam = new HashMap<String, ByteIterator>(10); - int expResult = 0; - int result = instance.read(MOCK_TABLE, MOCK_KEY1, fields, resultParam); - assertEquals(expResult, result); + Status result = instance.read(MOCK_TABLE, MOCK_KEY1, fields, resultParam); + assertEquals(Status.OK, result); } /** - * Test of update method, of class ElasticSearchClient. + * Test of update method, of class ElasticsearchClient. */ @Test public void testUpdate() { @@ -107,9 +128,8 @@ public class ElasticSearchClientTest { newValues.put("field" + i, new StringByteIterator("newvalue" + i)); } - int expResult = 0; - int result = instance.update(MOCK_TABLE, MOCK_KEY1, newValues); - assertEquals(expResult, result); + Status result = instance.update(MOCK_TABLE, MOCK_KEY1, newValues); + assertEquals(Status.OK, result); //validate that the values changed HashMap<String, ByteIterator> resultParam = new HashMap<String, ByteIterator>(10); @@ -122,7 +142,7 @@ public class ElasticSearchClientTest { } /** - * Test of scan method, of class ElasticSearchClient. + * Test of scan method, of class ElasticsearchClient. */ @Test public void testScan() { @@ -130,8 +150,7 @@ public class ElasticSearchClientTest { int recordcount = 10; Set<String> fields = MOCK_DATA.keySet(); Vector<HashMap<String, ByteIterator>> resultParam = new Vector<HashMap<String, ByteIterator>>(10); - int expResult = 0; - int result = instance.scan(MOCK_TABLE, MOCK_KEY1, recordcount, fields, resultParam); - assertEquals(expResult, result); + Status result = instance.scan(MOCK_TABLE, MOCK_KEY1, recordcount, fields, resultParam); + assertEquals(Status.OK, result); } } diff --git a/gemfire/pom.xml b/gemfire/pom.xml deleted file mode 100644 index 67a1bbe131e041325ddc033c76083464bf5cf6b1..0000000000000000000000000000000000000000 --- a/gemfire/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?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.3.0-SNAPSHOT</version> - <relativePath>../binding-parent</relativePath> - </parent> - - <artifactId>gemfire-binding</artifactId> - <name>Gemfire DB Binding</name> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>com.gemstone.gemfire</groupId> - <artifactId>gemfire</artifactId> - <version>${gemfire.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>core</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <repositories> - <repository> - <id>gemstone</id> - <url>http://dist.gemstone.com.s3.amazonaws.com/maven/release</url> - </repository> - </repositories> -</project> diff --git a/gemfire/src/main/conf/cache.xml b/gemfire/src/main/conf/cache.xml deleted file mode 100644 index 90254df09aed151860424ce52c734eb5473452fb..0000000000000000000000000000000000000000 --- a/gemfire/src/main/conf/cache.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> - -<!DOCTYPE cache PUBLIC - "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN" - "http://www.gemstone.com/dtd/cache6_5.dtd"> -<cache> - <region name="usertable" refid="PARTITION"/> -</cache> - diff --git a/gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java b/gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java deleted file mode 100644 index 6815c44e86f6319756243329768b343a9327983b..0000000000000000000000000000000000000000 --- a/gemfire/src/main/java/com/yahoo/ycsb/db/GemFireClient.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.yahoo.ycsb.db; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; - -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.GemFireCache; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionExistsException; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.cache.client.ClientCache; -import com.gemstone.gemfire.cache.client.ClientCacheFactory; -import com.gemstone.gemfire.cache.client.ClientRegionFactory; -import com.gemstone.gemfire.cache.client.ClientRegionShortcut; -import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId; -import com.yahoo.ycsb.ByteArrayByteIterator; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.StringByteIterator; - -/** - * VMware vFabric GemFire client for the YCSB benchmark.<br /> - * <p>By default acts as a GemFire client and tries to connect - * to GemFire cache server running on localhost with default - * cache server port. Hostname and port of a GemFire cacheServer - * can be provided using <code>gemfire.serverport=port</code> and <code> - * gemfire.serverhost=host</code> properties on YCSB command line. - * A locator may also be used for discovering a cacheServer - * by using the property <code>gemfire.locator=host[port]</code></p> - * - * <p>To run this client in a peer-to-peer topology with other GemFire - * nodes, use the property <code>gemfire.topology=p2p</code>. Running - * in p2p mode will enable embedded caching in this client.</p> - * - * <p>YCSB by default does its operations against "usertable". When running - * as a client this is a <code>ClientRegionShortcut.PROXY</code> region, - * when running in p2p mode it is a <code>RegionShortcut.PARTITION</code> - * region. A cache.xml defining "usertable" region can be placed in the - * working directory to override these region definitions.</p> - * - * @author Swapnil Bawaskar (sbawaska at vmware) - * - */ -public class GemFireClient extends DB { - - /** Return code when operation succeeded */ - private static final int SUCCESS = 0; - - /** Return code when operation did not succeed */ - private static final int ERROR = -1; - - /** property name of the port where GemFire server is listening for connections */ - private static final String SERVERPORT_PROPERTY_NAME = "gemfire.serverport"; - - /** property name of the host where GemFire server is running */ - private static final String SERVERHOST_PROPERTY_NAME = "gemfire.serverhost"; - - /** default value of {@link #SERVERHOST_PROPERTY_NAME} */ - private static final String SERVERHOST_PROPERTY_DEFAULT = "localhost"; - - /** property name to specify a GemFire locator. This property can be used in both - * client server and p2p topology */ - private static final String LOCATOR_PROPERTY_NAME = "gemfire.locator"; - - /** property name to specify GemFire topology */ - private static final String TOPOLOGY_PROPERTY_NAME = "gemfire.topology"; - - /** value of {@value #TOPOLOGY_PROPERTY_NAME} when peer to peer topology should be used. - * (client-server topology is default) */ - private static final String TOPOLOGY_P2P_VALUE = "p2p"; - - private GemFireCache cache; - - /** - * true if ycsb client runs as a client to a - * GemFire cache server - */ - private boolean isClient; - - @Override - public void init() throws DBException { - Properties props = getProperties(); - // hostName where GemFire cacheServer is running - String serverHost = null; - // port of GemFire cacheServer - int serverPort = 0; - String locatorStr = null; - - if (props != null && !props.isEmpty()) { - String serverPortStr = props.getProperty(SERVERPORT_PROPERTY_NAME); - if (serverPortStr != null) { - serverPort = Integer.parseInt(serverPortStr); - } - serverHost = props.getProperty(SERVERHOST_PROPERTY_NAME, SERVERHOST_PROPERTY_DEFAULT); - locatorStr = props.getProperty(LOCATOR_PROPERTY_NAME); - - String topology = props.getProperty(TOPOLOGY_PROPERTY_NAME); - if (topology != null && topology.equals(TOPOLOGY_P2P_VALUE)) { - CacheFactory cf = new CacheFactory(); - if (locatorStr != null) { - cf.set("locators", locatorStr); - } - cache = cf.create(); - isClient = false; - return; - } - } - isClient = true; - DistributionLocatorId locator = null; - if (locatorStr != null) { - locator = new DistributionLocatorId(locatorStr); - } - ClientCacheFactory ccf = new ClientCacheFactory(); - if (serverPort != 0) { - ccf.addPoolServer(serverHost, serverPort); - } else if (locator != null) { - ccf.addPoolLocator(locator.getHost().getCanonicalHostName(), locator.getPort()); - } - cache = ccf.create(); - } - - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - Region<String, Map<String, byte[]>> r = getRegion(table); - Map<String, byte[]> val = r.get(key); - if (val != null) { - if (fields == null) { - for (String k : val.keySet()) { - result.put(k, new ByteArrayByteIterator(val.get(k))); - } - } else { - for (String field : fields) { - result.put(field, new ByteArrayByteIterator(val.get(field))); - } - } - return SUCCESS; - } - return ERROR; - } - - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - // GemFire does not support scan - return ERROR; - } - - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - getRegion(table).put(key, convertToBytearrayMap(values)); - return 0; - } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - getRegion(table).put(key, convertToBytearrayMap(values)); - return 0; - } - - @Override - public int delete(String table, String key) { - getRegion(table).destroy(key); - return 0; - } - - private Map<String, byte[]> convertToBytearrayMap(Map<String,ByteIterator> values) { - Map<String, byte[]> retVal = new HashMap<String, byte[]>(); - for (String key : values.keySet()) { - retVal.put(key, values.get(key).toArray()); - } - return retVal; - } - - private Region<String, Map<String, byte[]>> getRegion(String table) { - Region<String, Map<String, byte[]>> r = cache.getRegion(table); - if (r == null) { - try { - if (isClient) { - ClientRegionFactory<String, Map<String, byte[]>> crf = ((ClientCache) cache).createClientRegionFactory(ClientRegionShortcut.PROXY); - r = crf.create(table); - } else { - RegionFactory<String, Map<String, byte[]>> rf = ((Cache)cache).createRegionFactory(RegionShortcut.PARTITION); - r = rf.create(table); - } - } catch (RegionExistsException e) { - // another thread created the region - r = cache.getRegion(table); - } - } - return r; - } - -} diff --git a/geode/README.md b/geode/README.md new file mode 100644 index 0000000000000000000000000000000000000000..59690bfe493c79f71641130eb2bad8004e751e24 --- /dev/null +++ b/geode/README.md @@ -0,0 +1,68 @@ +<!-- +Copyright (c) 2014 - 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. +--> + +## Quick Start + +This section describes how to run YCSB on Apache Geode (incubating). + +### Get Apache Geode + +You can download Geode from http://geode.incubator.apache.org/releases/ + +#### Start Geode Cluster + +Use the Geode shell (gfsh) to start the cluster. You will need to start +at-least one locator which is a member discovery service and one or more +Geode servers. + +Launch gfsh: + +``` +$ cd $GEODE_HOME +$ ./bin/gfsh +``` + +Start a locator and two servers: + +``` +gfsh> start locator --name=locator1 +gfsh> start server --name=server1 --server-port=40404 +gfsh> start server --name=server2 --server-port=40405 +gfsh> configure pdx --read-serialized=true +``` + +Create the "usertable" region required by YCSB driver: +``` +gfsh>create region --name=usertable --type=PARTITION +``` +gfsh has tab autocompletion, so you can play around with various options. + +### Start YCSB workload + +From your YCSB directory, you can run the ycsb workload as follows +``` +./bin/ycsb load geode -P workloads/workloada -p geode.locator=host[port] +``` +(default port of locator is 10334). + +In the default mode, ycsb geode driver will connect as a client to the geode +cluster. To make the ycsb driver a peer member of the distributed system +use the property +`-p geode.topology=p2p -p geode.locator=host[port]` + +Note: +For update workloads, please use the property `-p writeallfields=true` diff --git a/geode/pom.xml b/geode/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..4e20d9e2d9c5af2c471fbdd37a1e65f29f325f85 --- /dev/null +++ b/geode/pom.xml @@ -0,0 +1,74 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>geode-binding</artifactId> + <name>Geode DB Binding</name> + <packaging>jar</packaging> + + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.geode</groupId> + <artifactId>geode-core</artifactId> + <version>${geode.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + <configuration> + <consoleOutput>true</consoleOutput> + <configLocation>../checkstyle.xml</configLocation> + <failOnViolation>true</failOnViolation> + <failsOnError>true</failsOnError> + </configuration> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java b/geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java new file mode 100644 index 0000000000000000000000000000000000000000..603b7b7348b06a6743d95299c253538412659f55 --- /dev/null +++ b/geode/src/main/java/com/yahoo/ycsb/db/GeodeClient.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) 2013 - 2016 YCSB Contributors. All rights reserved. + * <p> + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.client.ClientCache; +import com.gemstone.gemfire.cache.client.ClientCacheFactory; +import com.gemstone.gemfire.cache.client.ClientRegionFactory; +import com.gemstone.gemfire.cache.client.ClientRegionShortcut; +import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId; +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.pdx.JSONFormatter; +import com.gemstone.gemfire.pdx.PdxInstance; +import com.gemstone.gemfire.pdx.PdxInstanceFactory; +import com.yahoo.ycsb.*; + +import java.util.*; + +/** + * Apache Geode (incubating) client for the YCSB benchmark.<br /> + * <p>By default acts as a Geode client and tries to connect + * to Geode cache server running on localhost with default + * cache server port. Hostname and port of a Geode cacheServer + * can be provided using <code>geode.serverport=port</code> and <code> + * geode.serverhost=host</code> properties on YCSB command line. + * A locator may also be used for discovering a cacheServer + * by using the property <code>geode.locator=host[port]</code></p> + * <p> + * <p>To run this client in a peer-to-peer topology with other Geode + * nodes, use the property <code>geode.topology=p2p</code>. Running + * in p2p mode will enable embedded caching in this client.</p> + * <p> + * <p>YCSB by default does its operations against "usertable". When running + * as a client this is a <code>ClientRegionShortcut.PROXY</code> region, + * when running in p2p mode it is a <code>RegionShortcut.PARTITION</code> + * region. A cache.xml defining "usertable" region can be placed in the + * working directory to override these region definitions.</p> + */ +public class GeodeClient extends DB { + /** + * property name of the port where Geode server is listening for connections. + */ + private static final String SERVERPORT_PROPERTY_NAME = "geode.serverport"; + + /** + * property name of the host where Geode server is running. + */ + private static final String SERVERHOST_PROPERTY_NAME = "geode.serverhost"; + + /** + * default value of {@link #SERVERHOST_PROPERTY_NAME}. + */ + private static final String SERVERHOST_PROPERTY_DEFAULT = "localhost"; + + /** + * property name to specify a Geode locator. This property can be used in both + * client server and p2p topology + */ + private static final String LOCATOR_PROPERTY_NAME = "geode.locator"; + + /** + * property name to specify Geode topology. + */ + private static final String TOPOLOGY_PROPERTY_NAME = "geode.topology"; + + /** + * value of {@value #TOPOLOGY_PROPERTY_NAME} when peer to peer topology should be used. + * (client-server topology is default) + */ + private static final String TOPOLOGY_P2P_VALUE = "p2p"; + + private GemFireCache cache; + + /** + * true if ycsb client runs as a client to a Geode cache server. + */ + private boolean isClient; + + @Override + public void init() throws DBException { + Properties props = getProperties(); + // hostName where Geode cacheServer is running + String serverHost = null; + // port of Geode cacheServer + int serverPort = 0; + String locatorStr = null; + + if (props != null && !props.isEmpty()) { + String serverPortStr = props.getProperty(SERVERPORT_PROPERTY_NAME); + if (serverPortStr != null) { + serverPort = Integer.parseInt(serverPortStr); + } + serverHost = props.getProperty(SERVERHOST_PROPERTY_NAME, SERVERHOST_PROPERTY_DEFAULT); + locatorStr = props.getProperty(LOCATOR_PROPERTY_NAME); + + String topology = props.getProperty(TOPOLOGY_PROPERTY_NAME); + if (topology != null && topology.equals(TOPOLOGY_P2P_VALUE)) { + CacheFactory cf = new CacheFactory(); + if (locatorStr != null) { + cf.set("locators", locatorStr); + } + cache = cf.create(); + isClient = false; + return; + } + } + isClient = true; + DistributionLocatorId locator = null; + if (locatorStr != null) { + locator = new DistributionLocatorId(locatorStr); + } + ClientCacheFactory ccf = new ClientCacheFactory(); + if (serverPort != 0) { + ccf.addPoolServer(serverHost, serverPort); + } else if (locator != null) { + ccf.addPoolLocator(locator.getHost().getCanonicalHostName(), locator.getPort()); + } + cache = ccf.create(); + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + Region<String, PdxInstance> r = getRegion(table); + PdxInstance val = r.get(key); + if (val != null) { + if (fields == null) { + for (String fieldName : val.getFieldNames()) { + result.put(fieldName, new ByteArrayByteIterator((byte[]) val.getField(fieldName))); + } + } else { + for (String field : fields) { + result.put(field, new ByteArrayByteIterator((byte[]) val.getField(field))); + } + } + return Status.OK; + } + return Status.ERROR; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + // Geode does not support scan + return Status.ERROR; + } + + @Override + public Status update(String table, String key, HashMap<String, ByteIterator> values) { + getRegion(table).put(key, convertToBytearrayMap(values)); + return Status.OK; + } + + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + getRegion(table).put(key, convertToBytearrayMap(values)); + return Status.OK; + } + + @Override + public Status delete(String table, String key) { + getRegion(table).destroy(key); + return Status.OK; + } + + private PdxInstance convertToBytearrayMap(Map<String, ByteIterator> values) { + GemFireCacheImpl gci = (GemFireCacheImpl) CacheFactory.getAnyInstance(); + PdxInstanceFactory pdxInstanceFactory = gci.createPdxInstanceFactory(JSONFormatter.JSON_CLASSNAME); + + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + pdxInstanceFactory.writeByteArray(entry.getKey(), entry.getValue().toArray()); + } + return pdxInstanceFactory.create(); + } + + private Region<String, PdxInstance> getRegion(String table) { + Region<String, PdxInstance> r = cache.getRegion(table); + if (r == null) { + try { + if (isClient) { + ClientRegionFactory<String, PdxInstance> crf = + ((ClientCache) cache).createClientRegionFactory(ClientRegionShortcut.PROXY); + r = crf.create(table); + } else { + RegionFactory<String, PdxInstance> rf = ((Cache) cache).createRegionFactory(RegionShortcut.PARTITION); + r = rf.create(table); + } + } catch (RegionExistsException e) { + // another thread created the region + r = cache.getRegion(table); + } + } + return r; + } +} \ No newline at end of file diff --git a/geode/src/main/java/com/yahoo/ycsb/db/package-info.java b/geode/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..1b6db476efe15b518a452d6b7cc06432fd1a267d --- /dev/null +++ b/geode/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2016, 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. + */ + +/** + * YCSB binding for <a href="https://geode.incubator.apache.org/">Apache Geode (incubating)</a>. + */ +package com.yahoo.ycsb.db; \ No newline at end of file diff --git a/googlebigtable/README.md b/googlebigtable/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3938b525eaa3fcc02ca06e8033cd402214ede08a --- /dev/null +++ b/googlebigtable/README.md @@ -0,0 +1,80 @@ +<!-- +Copyright (c) 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. +--> + +# Google Bigtable Driver for YCSB + +This driver provides a YCSB workload binding for Google's hosted Bigtable, the inspiration for a number of key-value stores like HBase and Cassandra. The Bigtable Java client provides both Protobuf based GRPC and HBase client APIs. This binding implements the Protobuf API for testing the native client. To test Bigtable using the HBase API, see the `hbase10` binding. + +## Quickstart + +### 1. Setup a Bigtable Cluster + +Login to the Google Cloud Console and follow the [Creating Cluster](https://cloud.google.com/bigtable/docs/creating-cluster) steps. Make a note of your cluster name, zone and project ID. + +### 2. Launch the Bigtable Shell + +From the Cloud Console, launch a shell and follow the [Quickstart](https://cloud.google.com/bigtable/docs/quickstart) up to step 4 where you launch the HBase shell. + +### 3. Create a Table + +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', 'cf', {SPLITS => (1..n_splits).map {|i| "user#{1000+i*(9999-1000)/n_splits}"}} +``` + +Make a note of the column family, in this example it's `cf``. + +### 4. Fetch the Proper ALPN Boot Jar + +The Bigtable protocol uses HTTP/2 which requires an ALPN protocol negotiation implementation. On JVM instantiation the implementation must be loaded before attempting to connect to the cluster. If you're using Java 7 or 8, use this [Jetty Version Table](http://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions) to determine the version appropriate for your JVM. (ALPN is included in JDK 9+). Download the proper jar from [Maven](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.mortbay.jetty.alpn%22%20AND%20a%3A%22alpn-boot%22) somewhere on your system. + +### 5. Download JSON Credentials + +Follow these instructions for [Generating a JSON key](https://cloud.google.com/bigtable/docs/installing-hbase-shell#service-account) and save it to your host. + +### 6. Load a Workload + +Switch to the root of the YCSB repo and choose the workload you want to run and `load` it first. With the CLI you must provide the column family, cluster properties and the ALPN jar to load. + +``` +bin/ycsb load googlebigtable -p columnfamily=cf -p google.bigtable.project.id=<PROJECT_ID> -p google.bigtable.cluster.name=<CLUSTER> -p google.bigtable.zone.name=<ZONE> -p google.bigtable.auth.service.account.enable=true -p google.bigtable.auth.json.keyfile=<PATH_TO_JSON_KEY> -jvm-args='-Xbootclasspath/p:<PATH_TO_ALPN_JAR>' -P workloads/workloada + +``` + +Make sure to replace the variables in the angle brackets above with the proper value from your cluster. Additional configuration parameters are available below. + +The `load` step only executes inserts into the datastore. After loading data, run the same workload to mix reads with writes. + +``` +bin/ycsb run googlebigtable -p columnfamily=cf -p google.bigtable.project.id=<PROJECT_ID> -p google.bigtable.cluster.name=<CLUSTER> -p google.bigtable.zone.name=<ZONE> -p google.bigtable.auth.service.account.enable=true -p google.bigtable.auth.json.keyfile=<PATH_TO_JSON_KEY> -jvm-args='-Xbootclasspath/p:<PATH_TO_ALPN_JAR>' -P workloads/workloada + +``` + +## Configuration Options + +The following options can be configured using CLI (using the `-p` parameter) or hbase-site.xml (add the HBase config directory to YCSB's class path via CLI). Check the [Cloud Bigtable Client](https://github.com/manolama/cloud-bigtable-client) project for additional tuning parameters. + +* `columnfamily`: (Required) The Bigtable column family to target. +* `google.bigtable.project.id`: (Required) The ID of a Bigtable project. +* `google.bigtable.cluster.name`: (Required) The name of a Bigtable cluster. +* `google.bigtable.zone.name`: (Required) Zone where the Bigtable cluster is running. +* `google.bigtable.auth.service.account.enable`: Whether or not to authenticate with a service account. The default is true. +* `google.bigtable.auth.json.keyfile`: (Required) A service account key for authentication. +* `debug`: If true, prints debug information to standard out. The default is false. +* `clientbuffering`: Whether or not to use client side buffering and batching of write operations. This can significantly improve performance and defaults to true. diff --git a/googlebigtable/pom.xml b/googlebigtable/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..a1c0e143cff2b57a80a3c8e783e3fea33a707e0e --- /dev/null +++ b/googlebigtable/pom.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>googlebigtable-binding</artifactId> + <name>Google Cloud Bigtable Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.google.cloud.bigtable</groupId> + <artifactId>bigtable-hbase-1.0</artifactId> + <version>${googlebigtable.version}</version> + </dependency> + + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + </dependencies> +</project> \ No newline at end of file diff --git a/googlebigtable/src/main/java/com/yahoo/ycsb/db/GoogleBigtableClient.java b/googlebigtable/src/main/java/com/yahoo/ycsb/db/GoogleBigtableClient.java new file mode 100644 index 0000000000000000000000000000000000000000..d0d21dda4b22e796a18d0918846f7afb8bce8842 --- /dev/null +++ b/googlebigtable/src/main/java/com/yahoo/ycsb/db/GoogleBigtableClient.java @@ -0,0 +1,445 @@ +/** + * Copyright (c) 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. + */ +package com.yahoo.ycsb.db; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.Properties; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.util.Bytes; + +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.ExecutionException; + +import com.google.bigtable.repackaged.com.google.protobuf.ByteString; +import com.google.bigtable.repackaged.com.google.protobuf.ServiceException; +import com.google.bigtable.v1.Column; +import com.google.bigtable.v1.Family; +import com.google.bigtable.v1.MutateRowRequest; +import com.google.bigtable.v1.Mutation; +import com.google.bigtable.v1.ReadRowsRequest; +import com.google.bigtable.v1.Row; +import com.google.bigtable.v1.RowFilter; +import com.google.bigtable.v1.RowRange; +import com.google.bigtable.v1.Mutation.DeleteFromRow; +import com.google.bigtable.v1.Mutation.SetCell; +import com.google.bigtable.v1.RowFilter.Chain.Builder; +import com.google.cloud.bigtable.config.BigtableOptions; +import com.google.cloud.bigtable.grpc.BigtableDataClient; +import com.google.cloud.bigtable.grpc.BigtableSession; +import com.google.cloud.bigtable.grpc.async.AsyncExecutor; +import com.google.cloud.bigtable.grpc.async.HeapSizeManager; +import com.google.cloud.bigtable.hbase.BigtableOptionsFactory; +import com.google.cloud.bigtable.util.ByteStringer; +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +/** + * Google Bigtable Proto client for YCSB framework. + * + * Bigtable offers two APIs. These include a native Protobuf GRPC API as well as + * an HBase API wrapper for the GRPC API. This client implements the Protobuf + * API to test the underlying calls wrapped up in the HBase API. To use the + * HBase API, see the hbase10 client binding. + */ +public class GoogleBigtableClient extends com.yahoo.ycsb.DB { + public static final Charset UTF8_CHARSET = Charset.forName("UTF8"); + + /** Property names for the CLI. */ + private static final String ASYNC_MUTATOR_MAX_MEMORY = "mutatorMaxMemory"; + private static final String ASYNC_MAX_INFLIGHT_RPCS = "mutatorMaxInflightRPCs"; + private static final String CLIENT_SIDE_BUFFERING = "clientbuffering"; + + /** Tracks running thread counts so we know when to close the session. */ + private static int threadCount = 0; + + /** This will load the hbase-site.xml config file and/or store CLI options. */ + private static final Configuration CONFIG = HBaseConfiguration.create(); + + /** Print debug information to standard out. */ + private boolean debug = false; + + /** Global Bigtable native API objects. */ + private static BigtableOptions options; + private static BigtableSession session; + + /** Thread loacal Bigtable native API objects. */ + private BigtableDataClient client; + private HeapSizeManager heapSizeManager; + private AsyncExecutor asyncExecutor; + + /** The column family use for the workload. */ + private byte[] columnFamilyBytes; + + /** Cache for the last table name/ID to avoid byte conversions. */ + private String lastTable = ""; + private byte[] lastTableBytes; + + /** + * If true, buffer mutations on the client. For measuring insert/update/delete + * latencies, client side buffering should be disabled. + */ + private boolean clientSideBuffering = false; + + @Override + public void init() throws DBException { + Properties props = getProperties(); + + // Defaults the user can override if needed + CONFIG.set("google.bigtable.auth.service.account.enable", "true"); + + // make it easy on ourselves by copying all CLI properties into the config object. + final Iterator<Entry<Object, Object>> it = props.entrySet().iterator(); + while (it.hasNext()) { + Entry<Object, Object> entry = it.next(); + CONFIG.set((String)entry.getKey(), (String)entry.getValue()); + } + + clientSideBuffering = getProperties().getProperty(CLIENT_SIDE_BUFFERING, "false") + .equals("true") ? true : false; + + System.err.println("Running Google Bigtable with Proto API" + + (clientSideBuffering ? " and client side buffering." : ".")); + + synchronized (CONFIG) { + ++threadCount; + if (session == null) { + try { + options = BigtableOptionsFactory.fromConfiguration(CONFIG); + session = new BigtableSession(options); + // important to instantiate the first client here, otherwise the + // other threads may receive an NPE from the options when they try + // to read the cluster name. + client = session.getDataClient(); + } catch (IOException e) { + throw new DBException("Error loading options from config: ", e); + } + } else { + client = session.getDataClient(); + } + + if (clientSideBuffering) { + heapSizeManager = new HeapSizeManager( + Long.parseLong( + getProperties().getProperty(ASYNC_MUTATOR_MAX_MEMORY, + Long.toString(AsyncExecutor.ASYNC_MUTATOR_MAX_MEMORY_DEFAULT))), + Integer.parseInt( + getProperties().getProperty(ASYNC_MAX_INFLIGHT_RPCS, + Integer.toString(AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT)))); + asyncExecutor = new AsyncExecutor(client, heapSizeManager); + } + } + + if ((getProperties().getProperty("debug") != null) + && (getProperties().getProperty("debug").compareTo("true") == 0)) { + debug = true; + } + + final String columnFamily = getProperties().getProperty("columnfamily"); + if (columnFamily == null) { + System.err.println("Error, must specify a columnfamily for Bigtable table"); + throw new DBException("No columnfamily specified"); + } + columnFamilyBytes = Bytes.toBytes(columnFamily); + } + + @Override + public void cleanup() throws DBException { + if (asyncExecutor != null) { + try { + asyncExecutor.flush(); + } catch (IOException e) { + throw new DBException(e); + } + } + synchronized (CONFIG) { + --threadCount; + if (threadCount <= 0) { + try { + session.close(); + } catch (IOException e) { + throw new DBException(e); + } + } + } + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + if (debug) { + System.out.println("Doing read from Bigtable columnfamily " + + new String(columnFamilyBytes)); + System.out.println("Doing read for key: " + key); + } + + setTable(table); + + RowFilter filter = RowFilter.newBuilder() + .setFamilyNameRegexFilterBytes(ByteStringer.wrap(columnFamilyBytes)) + .build(); + if (fields != null && fields.size() > 0) { + Builder filterChain = RowFilter.Chain.newBuilder(); + filterChain.addFilters(filter); + filterChain.addFilters(RowFilter.newBuilder() + .setCellsPerColumnLimitFilter(1) + .build()); + int count = 0; + // usually "field#" so pre-alloc + final StringBuilder regex = new StringBuilder(fields.size() * 6); + for (final String field : fields) { + if (count++ > 0) { + regex.append("|"); + } + regex.append(field); + } + filterChain.addFilters(RowFilter.newBuilder() + .setColumnQualifierRegexFilter( + ByteStringer.wrap(regex.toString().getBytes()))).build(); + filter = RowFilter.newBuilder().setChain(filterChain.build()).build(); + } + + final ReadRowsRequest.Builder rrr = ReadRowsRequest.newBuilder() + .setTableNameBytes(ByteStringer.wrap(lastTableBytes)) + .setFilter(filter) + .setRowKey(ByteStringer.wrap(key.getBytes())); + + List<Row> rows; + try { + rows = client.readRowsAsync(rrr.build()).get(); + if (rows == null || rows.isEmpty()) { + return Status.NOT_FOUND; + } + for (final Row row : rows) { + for (final Family family : row.getFamiliesList()) { + if (Arrays.equals(family.getNameBytes().toByteArray(), columnFamilyBytes)) { + for (final Column column : family.getColumnsList()) { + // we should only have a single cell per column + result.put(column.getQualifier().toString(UTF8_CHARSET), + new ByteArrayByteIterator(column.getCells(0).getValue().toByteArray())); + if (debug) { + System.out.println( + "Result for field: " + column.getQualifier().toString(UTF8_CHARSET) + + " is: " + column.getCells(0).getValue().toString(UTF8_CHARSET)); + } + } + } + } + } + + return Status.OK; + } catch (InterruptedException e) { + System.err.println("Interrupted during get: " + e); + Thread.currentThread().interrupt(); + return Status.ERROR; + } catch (ExecutionException e) { + System.err.println("Exception during get: " + e); + return Status.ERROR; + } + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + setTable(table); + + RowFilter filter = RowFilter.newBuilder() + .setFamilyNameRegexFilterBytes(ByteStringer.wrap(columnFamilyBytes)) + .build(); + if (fields != null && fields.size() > 0) { + Builder filterChain = RowFilter.Chain.newBuilder(); + filterChain.addFilters(filter); + filterChain.addFilters(RowFilter.newBuilder() + .setCellsPerColumnLimitFilter(1) + .build()); + int count = 0; + // usually "field#" so pre-alloc + final StringBuilder regex = new StringBuilder(fields.size() * 6); + for (final String field : fields) { + if (count++ > 0) { + regex.append("|"); + } + regex.append(field); + } + filterChain.addFilters(RowFilter.newBuilder() + .setColumnQualifierRegexFilter( + ByteStringer.wrap(regex.toString().getBytes()))).build(); + filter = RowFilter.newBuilder().setChain(filterChain.build()).build(); + } + + final RowRange range = RowRange.newBuilder() + .setStartKey(ByteStringer.wrap(startkey.getBytes())) + .build(); + + final ReadRowsRequest.Builder rrr = ReadRowsRequest.newBuilder() + .setTableNameBytes(ByteStringer.wrap(lastTableBytes)) + .setFilter(filter) + .setRowRange(range); + + List<Row> rows; + try { + rows = client.readRowsAsync(rrr.build()).get(); + if (rows == null || rows.isEmpty()) { + return Status.NOT_FOUND; + } + int numResults = 0; + + for (final Row row : rows) { + final HashMap<String, ByteIterator> rowResult = + new HashMap<String, ByteIterator>(fields != null ? fields.size() : 10); + + for (final Family family : row.getFamiliesList()) { + if (Arrays.equals(family.getNameBytes().toByteArray(), columnFamilyBytes)) { + for (final Column column : family.getColumnsList()) { + // we should only have a single cell per column + rowResult.put(column.getQualifier().toString(UTF8_CHARSET), + new ByteArrayByteIterator(column.getCells(0).getValue().toByteArray())); + if (debug) { + System.out.println( + "Result for field: " + column.getQualifier().toString(UTF8_CHARSET) + + " is: " + column.getCells(0).getValue().toString(UTF8_CHARSET)); + } + } + } + } + + result.add(rowResult); + + numResults++; + if (numResults >= recordcount) {// if hit recordcount, bail out + break; + } + } + return Status.OK; + } catch (InterruptedException e) { + System.err.println("Interrupted during scan: " + e); + Thread.currentThread().interrupt(); + return Status.ERROR; + } catch (ExecutionException e) { + System.err.println("Exception during scan: " + e); + return Status.ERROR; + } + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + if (debug) { + System.out.println("Setting up put for key: " + key); + } + + setTable(table); + + final MutateRowRequest.Builder rowMutation = MutateRowRequest.newBuilder(); + rowMutation.setRowKey(ByteString.copyFromUtf8(key)); + rowMutation.setTableNameBytes(ByteStringer.wrap(lastTableBytes)); + + for (final Entry<String, ByteIterator> entry : values.entrySet()) { + final Mutation.Builder mutationBuilder = rowMutation.addMutationsBuilder(); + final SetCell.Builder setCellBuilder = mutationBuilder.getSetCellBuilder(); + + setCellBuilder.setFamilyNameBytes(ByteStringer.wrap(columnFamilyBytes)); + setCellBuilder.setColumnQualifier(ByteStringer.wrap(entry.getKey().getBytes())); + setCellBuilder.setValue(ByteStringer.wrap(entry.getValue().toArray())); + + // Bigtable uses a 1ms granularity + setCellBuilder.setTimestampMicros(System.currentTimeMillis() * 1000); + } + + try { + if (clientSideBuffering) { + asyncExecutor.mutateRowAsync(rowMutation.build()); + } else { + client.mutateRow(rowMutation.build()); + } + return Status.OK; + } catch (ServiceException e) { + System.err.println("Failed to insert key: " + key + " " + e.getMessage()); + return Status.ERROR; + } catch (InterruptedException e) { + System.err.println("Interrupted while inserting key: " + key + " " + + e.getMessage()); + Thread.currentThread().interrupt(); + return Status.ERROR; // never get here, but lets make the compiler happy + } + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + return update(table, key, values); + } + + @Override + public Status delete(String table, String key) { + if (debug) { + System.out.println("Doing delete for key: " + key); + } + + setTable(table); + + final MutateRowRequest.Builder rowMutation = MutateRowRequest.newBuilder() + .setRowKey(ByteString.copyFromUtf8(key)) + .setTableNameBytes(ByteStringer.wrap(lastTableBytes)); + rowMutation.addMutationsBuilder().setDeleteFromRow( + DeleteFromRow.getDefaultInstance()); + + try { + if (clientSideBuffering) { + asyncExecutor.mutateRowAsync(rowMutation.build()); + } else { + client.mutateRow(rowMutation.build()); + } + return Status.OK; + } catch (ServiceException e) { + System.err.println("Failed to delete key: " + key + " " + e.getMessage()); + return Status.ERROR; + } catch (InterruptedException e) { + System.err.println("Interrupted while delete key: " + key + " " + + e.getMessage()); + Thread.currentThread().interrupt(); + return Status.ERROR; // never get here, but lets make the compiler happy + } + } + + /** + * Little helper to set the table byte array. If it's different than the last + * table we reset the byte array. Otherwise we just use the existing array. + * @param table The table we're operating against + */ + private void setTable(final String table) { + if (!lastTable.equals(table)) { + lastTable = table; + lastTableBytes = options + .getClusterName() + .toTableName(table) + .toString() + .getBytes(); + } + } + +} \ No newline at end of file diff --git a/googlebigtable/src/main/java/com/yahoo/ycsb/db/package-info.java b/googlebigtable/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..f0ab9e749b7ee9133db04737dcfe0986051ab745 --- /dev/null +++ b/googlebigtable/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 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. + */ + +/** + * The YCSB binding for Google's <a href="https://cloud.google.com/bigtable/"> + * Bigtable</a>. + */ +package com.yahoo.ycsb.db; diff --git a/googledatastore/README.md b/googledatastore/README.md new file mode 100644 index 0000000000000000000000000000000000000000..80b6a4cf8a12d95213a1a37c7a2f42588b132b6d --- /dev/null +++ b/googledatastore/README.md @@ -0,0 +1,94 @@ +<!-- +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. +--> + +# Google Cloud Datastore Binding + +https://cloud.google.com/datastore/docs/concepts/overview?hl=en + +Please refer [here] (https://cloud.google.com/datastore/docs/apis/overview) for more information on +Google Cloud Datastore API. + +## Configure + + YCSB_HOME - YCSB home directory + DATASTORE_HOME - Google Cloud Datastore YCSB client package files + +Please refer to https://github.com/brianfrankcooper/YCSB/wiki/Using-the-Database-Libraries +for more information on setup. + +# Benchmark + + $YCSB_HOME/bin/ycsb load googledatastore -P workloads/workloada -P googledatastore.properties + $YCSB_HOME/bin/ycsb run googledatastore -P workloads/workloada -P googledatastore.properties + +# Properties + + $DATASTORE_HOME/conf/googledatastore.properties + +# Details + +A. Configuration and setup: + +See this link for instructions about setting up Google Cloud Datastore and +authentication: + +https://cloud.google.com/datastore/docs/activate#accessing_the_datastore_api_from_another_platform + +After you setup your environment, you will have 3 pieces of information ready: +- datasetId, +- service account email, and +- a private key file in P12 format. + +These will be configured via corresponding properties in the googledatastore.properties file. + +B. EntityGroupingMode + +In Google Datastore, Entity Group is the unit in which the user can +perform strongly consistent query on multiple items; Meanwhile, Entity group +also has certain limitations in performance, especially with write QPS. + +We support two modes here: + +1. [default] One entity per group (ONE_ENTITY_PER_GROUP) + +In this mode, every entity is a "root" entity and sits in one group, +and every entity group has only one entity. Write QPS is high in this +mode (and there is no documented limitation on this). But query across +multiple entities are eventually consistent. + +When this mode is set, every entity is created with no ancestor key (meaning +the entity itself is the "root" entity). + +2. Multiple entities per group (MULTI_ENTITY_PER_GROUP) + +In this mode, all entities in one benchmark run are placed under one +ancestor (root) node therefore inside one entity group. Query/scan +performed on these entities will be strongly consistent but write QPS +will be subject to documented limitation (current is at 1 QPS). + +Because of the write QPS limit, it's highly recommended that you rate +limit your benchmark's test rate to avoid excessive errors. + +The goal of this MULTI_ENTITY_PER_GROUP mode is to allow user to +benchmark and understand performance characteristics of a single entity +group of the Google Datastore. + +While in this mode, one can optionally specify a root key name. If not +specified, a default name will be used. + + diff --git a/googledatastore/conf/googledatastore.properties b/googledatastore/conf/googledatastore.properties new file mode 100644 index 0000000000000000000000000000000000000000..408acf0d0d025f1dc419fa404633ea60f88ea133 --- /dev/null +++ b/googledatastore/conf/googledatastore.properties @@ -0,0 +1,56 @@ +# 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. + +# +# Sample property file for Google Cloud Datastore DB client + +## Mandatory parameters +# +# Your credentials to Google datastore. See README.md for details. +# +# googledatastore.datasetId=<string id of your dataset> +# googledatastore.privateKeyFile=<full path to your private key file> +# googledatastore.serviceAccountEmail=<Your service account email> + +# Google Cloud Datastore's read and update APIs do not support +# reading or updating a select subset of properties for an entity. +# (as of version v1beta3) +# Therefore, it's recommended that you set writeallfields and readallfields +# to true to get stable and comparable performance numbers. +writeallfields = true +readallfields = true + +## Optional parameters +# +# Decides the consistency level of read requests. Acceptable values are: +# EVENTUAL, STRONG (default is STRONG) +# +# googledatastore.readConsistency=STRONG + +# Decides how we group entities into entity groups. +# (See the details section in README.md for documentation) +# +# googledatastore.entityGroupingMode=ONE_ENTITY_PER_GROUP + +# If you set the googledatastore.entityGroupingMode property to +# MULTI_ENTITY_PER_GROUP, you can optionally specify the name of the root entity +# +# googledatastore.rootEntityName="YCSB_ROOT_ENTITY" + +# Strongly recommended to set to uniform. +# requestdistribution = uniform + +# Enable/disable debug message, default is false. +# googledatastore.debug = false \ No newline at end of file diff --git a/googledatastore/pom.xml b/googledatastore/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..554193a6f79f7e4e56e07efde620163c1f8e7bcd --- /dev/null +++ b/googledatastore/pom.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2015-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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>googledatastore-binding</artifactId> + <name>Google Cloud Datastore Binding</name> + <url>https://github.com/GoogleCloudPlatform/google-cloud-datastore</url> + + <dependencies> + <dependency> + <groupId>com.google.cloud.datastore</groupId> + <artifactId>datastore-v1-proto-client</artifactId> + <version>1.1.0</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java b/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java new file mode 100644 index 0000000000000000000000000000000000000000..7eb35b1e158729b8c618e35491d409a9e47f7d00 --- /dev/null +++ b/googledatastore/src/main/java/com/yahoo/ycsb/db/GoogleDatastoreClient.java @@ -0,0 +1,335 @@ +/* + * Copyright 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.google.api.client.auth.oauth2.Credential; +import com.google.datastore.v1.*; +import com.google.datastore.v1.CommitRequest.Mode; +import com.google.datastore.v1.ReadOptions.ReadConsistency; +import com.google.datastore.v1.client.Datastore; +import com.google.datastore.v1.client.DatastoreException; +import com.google.datastore.v1.client.DatastoreFactory; +import com.google.datastore.v1.client.DatastoreHelper; +import com.google.datastore.v1.client.DatastoreOptions; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.Vector; + +import javax.annotation.Nullable; + +/** + * Google Cloud Datastore Client for YCSB. + */ + +public class GoogleDatastoreClient extends DB { + /** + * Defines a MutationType used in this class. + */ + private enum MutationType { + UPSERT, + UPDATE, + DELETE + } + + /** + * Defines a EntityGroupingMode enum used in this class. + */ + private enum EntityGroupingMode { + ONE_ENTITY_PER_GROUP, + MULTI_ENTITY_PER_GROUP + } + + private static Logger logger = + Logger.getLogger(GoogleDatastoreClient.class); + + // Read consistency defaults to "STRONG" per YCSB guidance. + // User can override this via configure. + private ReadConsistency readConsistency = ReadConsistency.STRONG; + + private EntityGroupingMode entityGroupingMode = + EntityGroupingMode.ONE_ENTITY_PER_GROUP; + + private String rootEntityName; + + private Datastore datastore = null; + + /** + * Initialize any state for this DB. Called once per DB instance; there is + * one DB instance per client thread. + */ + @Override + public void init() throws DBException { + String debug = getProperties().getProperty("googledatastore.debug", null); + if (null != debug && "true".equalsIgnoreCase(debug)) { + logger.setLevel(Level.DEBUG); + } + + // We need the following 3 essential properties to initialize datastore: + // + // - DatasetId, + // - Path to private key file, + // - Service account email address. + String datasetId = getProperties().getProperty( + "googledatastore.datasetId", null); + if (datasetId == null) { + throw new DBException( + "Required property \"datasetId\" missing."); + } + + String privateKeyFile = getProperties().getProperty( + "googledatastore.privateKeyFile", null); + if (privateKeyFile == null) { + throw new DBException( + "Required property \"privateKeyFile\" missing."); + } + + String serviceAccountEmail = getProperties().getProperty( + "googledatastore.serviceAccountEmail", null); + if (serviceAccountEmail == null) { + throw new DBException( + "Required property \"serviceAccountEmail\" missing."); + } + + // Below are properties related to benchmarking. + + String readConsistencyConfig = getProperties().getProperty( + "googledatastore.readConsistency", null); + if (readConsistencyConfig != null) { + try { + this.readConsistency = ReadConsistency.valueOf( + readConsistencyConfig.trim().toUpperCase()); + } catch (IllegalArgumentException e) { + throw new DBException("Invalid read consistency specified: " + + readConsistencyConfig + ". Expecting STRONG or EVENTUAL."); + } + } + + // + // Entity Grouping Mode (googledatastore.entitygroupingmode), see + // documentation in conf/googledatastore.properties. + // + String entityGroupingConfig = getProperties().getProperty( + "googledatastore.entityGroupingMode", null); + if (entityGroupingConfig != null) { + try { + this.entityGroupingMode = EntityGroupingMode.valueOf( + entityGroupingConfig.trim().toUpperCase()); + } catch (IllegalArgumentException e) { + throw new DBException("Invalid entity grouping mode specified: " + + entityGroupingConfig + ". Expecting ONE_ENTITY_PER_GROUP or " + + "MULTI_ENTITY_PER_GROUP."); + } + } + + this.rootEntityName = getProperties().getProperty( + "googledatastore.rootEntityName", "YCSB_ROOT_ENTITY"); + + try { + // Setup the connection to Google Cloud Datastore with the credentials + // obtained from the configure. + DatastoreOptions.Builder options = new DatastoreOptions.Builder(); + Credential credential = DatastoreHelper.getServiceAccountCredential( + serviceAccountEmail, privateKeyFile); + logger.info("Using JWT Service Account credential."); + logger.info("DatasetID: " + datasetId + ", Service Account Email: " + + serviceAccountEmail + ", Private Key File Path: " + privateKeyFile); + + datastore = DatastoreFactory.get().create( + options.credential(credential).projectId(datasetId).build()); + + } catch (GeneralSecurityException exception) { + throw new DBException("Security error connecting to the datastore: " + + exception.getMessage(), exception); + + } catch (IOException exception) { + throw new DBException("I/O error connecting to the datastore: " + + exception.getMessage(), exception); + } + + logger.info("Datastore client instance created: " + + datastore.toString()); + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + LookupRequest.Builder lookupRequest = LookupRequest.newBuilder(); + lookupRequest.addKeys(buildPrimaryKey(table, key)); + lookupRequest.getReadOptionsBuilder().setReadConsistency( + this.readConsistency); + // Note above, datastore lookupRequest always reads the entire entity, it + // does not support reading a subset of "fields" (properties) of an entity. + + logger.debug("Built lookup request as: " + lookupRequest.toString()); + + LookupResponse response = null; + try { + response = datastore.lookup(lookupRequest.build()); + + } catch (DatastoreException exception) { + logger.error( + String.format("Datastore Exception when reading (%s): %s %s", + exception.getMessage(), + exception.getMethodName(), + exception.getCode())); + + // DatastoreException.getCode() returns an HTTP response code which we + // will bubble up to the user as part of the YCSB Status "name". + return new Status("ERROR-" + exception.getCode(), exception.getMessage()); + } + + if (response.getFoundCount() == 0) { + return new Status("ERROR-404", "Not Found, key is: " + key); + } else if (response.getFoundCount() > 1) { + // We only asked to lookup for one key, shouldn't have got more than one + // entity back. Unexpected State. + return Status.UNEXPECTED_STATE; + } + + Entity entity = response.getFound(0).getEntity(); + logger.debug("Read entity: " + entity.toString()); + + Map<String, Value> properties = entity.getProperties(); + Set<String> propertiesToReturn = + (fields == null ? properties.keySet() : fields); + + for (String name : propertiesToReturn) { + if (properties.containsKey(name)) { + result.put(name, new StringByteIterator(properties.get(name) + .getStringValue())); + } + } + + return Status.OK; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + // TODO: Implement Scan as query on primary key. + return Status.NOT_IMPLEMENTED; + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + + return doSingleItemMutation(table, key, values, MutationType.UPDATE); + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + // Use Upsert to allow overwrite of existing key instead of failing the + // load (or run) just because the DB already has the key. + // This is the same behavior as what other DB does here (such as + // the DynamoDB client). + return doSingleItemMutation(table, key, values, MutationType.UPSERT); + } + + @Override + public Status delete(String table, String key) { + return doSingleItemMutation(table, key, null, MutationType.DELETE); + } + + private Key.Builder buildPrimaryKey(String table, String key) { + Key.Builder result = Key.newBuilder(); + + if (this.entityGroupingMode == EntityGroupingMode.MULTI_ENTITY_PER_GROUP) { + // All entities are in side the same group when we are in this mode. + result.addPath(Key.PathElement.newBuilder().setKind(table). + setName(rootEntityName)); + } + + return result.addPath(Key.PathElement.newBuilder().setKind(table) + .setName(key)); + } + + private Status doSingleItemMutation(String table, String key, + @Nullable HashMap<String, ByteIterator> values, + MutationType mutationType) { + // First build the key. + Key.Builder datastoreKey = buildPrimaryKey(table, key); + + // Build a commit request in non-transactional mode. + // Single item mutation to google datastore + // is always atomic and strongly consistent. Transaction is only necessary + // for multi-item mutation, or Read-modify-write operation. + CommitRequest.Builder commitRequest = CommitRequest.newBuilder(); + commitRequest.setMode(Mode.NON_TRANSACTIONAL); + + if (mutationType == MutationType.DELETE) { + commitRequest.addMutationsBuilder().setDelete(datastoreKey); + + } else { + // If this is not for delete, build the entity. + Entity.Builder entityBuilder = Entity.newBuilder(); + entityBuilder.setKey(datastoreKey); + for (Entry<String, ByteIterator> val : values.entrySet()) { + entityBuilder.getMutableProperties() + .put(val.getKey(), + Value.newBuilder() + .setStringValue(val.getValue().toString()).build()); + } + Entity entity = entityBuilder.build(); + logger.debug("entity built as: " + entity.toString()); + + if (mutationType == MutationType.UPSERT) { + commitRequest.addMutationsBuilder().setUpsert(entity); + } else if (mutationType == MutationType.UPDATE){ + commitRequest.addMutationsBuilder().setUpdate(entity); + } else { + throw new RuntimeException("Impossible MutationType, code bug."); + } + } + + try { + datastore.commit(commitRequest.build()); + logger.debug("successfully committed."); + + } catch (DatastoreException exception) { + // Catch all Datastore rpc errors. + // Log the exception, the name of the method called and the error code. + logger.error( + String.format("Datastore Exception when committing (%s): %s %s", + exception.getMessage(), + exception.getMethodName(), + exception.getCode())); + + // DatastoreException.getCode() returns an HTTP response code which we + // will bubble up to the user as part of the YCSB Status "name". + return new Status("ERROR-" + exception.getCode(), exception.getMessage()); + } + + return Status.OK; + } +} diff --git a/googledatastore/src/main/java/com/yahoo/ycsb/db/package-info.java b/googledatastore/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..bccdf1e648e6b9cab0f7c84660c2e884efa2a5db --- /dev/null +++ b/googledatastore/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/** + * 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. + */ + +/** + * YCSB binding for +<a href="https://cloud.google.com/datastore/">Google Cloud Datastore</a>. + */ +package com.yahoo.ycsb.db; diff --git a/googledatastore/src/main/resources/log4j.properties b/googledatastore/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..f8f8689ef8d7d311f1f3e6e77e343c9fab303482 --- /dev/null +++ b/googledatastore/src/main/resources/log4j.properties @@ -0,0 +1,25 @@ +# 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. + +#define the console appender +log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender + +# now define the layout for the appender +log4j.appender.consoleAppender.layout = org.apache.log4j.PatternLayout +log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x -%m%n + +# now map our console appender as a root logger, means all log messages will go +# to this appender +log4j.rootLogger = INFO, consoleAppender diff --git a/hbase/pom.xml b/hbase/pom.xml deleted file mode 100644 index 7c4eec94a60478667b788419eb99ac175e293012..0000000000000000000000000000000000000000 --- a/hbase/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?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.3.0-SNAPSHOT</version> - <relativePath>../binding-parent/</relativePath> - </parent> - - <artifactId>hbase-binding</artifactId> - <name>HBase DB Binding</name> - - <dependencies> - <dependency> - <groupId>org.apache.hbase</groupId> - <artifactId>hbase-client</artifactId> - <version>${hbase.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/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java deleted file mode 100644 index b4e949873f5797920b9e4005c3f183a33b5c2486..0000000000000000000000000000000000000000 --- a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java +++ /dev/null @@ -1,500 +0,0 @@ -/** - * 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.google.common.base.Preconditions; - -import com.yahoo.ycsb.ByteArrayByteIterator; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.measurements.Measurements; - -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Cell; -import org.apache.hadoop.hbase.CellUtil; -import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.BufferedMutator; -import org.apache.hadoop.hbase.client.BufferedMutatorParams; -import org.apache.hadoop.hbase.client.Connection; -import org.apache.hadoop.hbase.client.ConnectionFactory; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.Durability; -import org.apache.hadoop.hbase.client.Get; -import org.apache.hadoop.hbase.client.HTable; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.client.ResultScanner; -import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.Table; -import org.apache.hadoop.hbase.util.Bytes; - -import java.io.IOException; -import java.util.ConcurrentModificationException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Properties; -import java.util.Random; -import java.util.Set; -import java.util.Vector; - -/** - * HBase 1.0 client for YCSB framework. - * - * A modified version of HBaseClient (which targets HBase v0.9) utilizing the - * HBase 1.0.0 API. - * - * This client also adds toggleable client-side buffering and configurable write durability. - */ -public class HBaseClient10 extends com.yahoo.ycsb.DB -{ - private static final Configuration config = HBaseConfiguration.create(); - - public boolean _debug=false; - - public String _tableName=""; - public Connection _connection=null; - - // Depending on the value of _clientBuffering, either _bufferedMutator - // (_clientBuffering) or _hTable (!_clientBuffering) will be used. - public Table _table=null; - public BufferedMutator _bufferedMutator=null; - - public String _columnFamily=""; - public byte _columnFamilyBytes[]; - - /** - * Durability to use for puts and deletes. - */ - public Durability _durability = Durability.USE_DEFAULT; - - /** - * If true, buffer mutations on the client. - * This is the default behavior for HBaseClient. For measuring - * insert/update/delete latencies, client side buffering should be disabled. - */ - public boolean _clientSideBuffering = false; - public long _writeBufferSize = 1024 * 1024 * 12; - - public static final int Ok=0; - public static final int ServerError=-1; - public static final int HttpError=-2; - public static final int NoMatchingRecord=-3; - - /** - * Initialize any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - @Override - public void init() throws DBException - { - if ("true".equals(getProperties().getProperty("clientbuffering", "false"))) { - this._clientSideBuffering = true; - } - if (getProperties().containsKey("writebuffersize")) { - _writeBufferSize = Long.parseLong(getProperties().getProperty("writebuffersize")); - } - - if (getProperties().getProperty("durability") != null) { - this._durability = Durability.valueOf(getProperties().getProperty("durability")); - } - - try { - _connection = ConnectionFactory.createConnection(config); - } catch (java.io.IOException e) { - throw new DBException(e); - } - - if ( (getProperties().getProperty("debug")!=null) && - (getProperties().getProperty("debug").compareTo("true")==0) ) - { - _debug=true; - } - - _columnFamily = getProperties().getProperty("columnfamily"); - if (_columnFamily == null) - { - System.err.println("Error, must specify a columnfamily for HBase table"); - throw new DBException("No columnfamily specified"); - } - _columnFamilyBytes = Bytes.toBytes(_columnFamily); - - // Terminate right now if table does not exist, since the client - // will not propagate this error upstream once the workload - // starts. - String table = com.yahoo.ycsb.workloads.CoreWorkload.table; - try - { - final TableName tableName = TableName.valueOf(table); - HTableDescriptor dsc = _connection.getTable(tableName).getTableDescriptor(); - } - catch (IOException e) - { - throw new DBException(e); - } - } - - /** - * Cleanup any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - @Override - public void cleanup() throws DBException - { - // Get the measurements instance as this is the only client that should - // count clean up time like an update if client-side buffering is - // enabled. - Measurements _measurements = Measurements.getMeasurements(); - try { - long st=System.nanoTime(); - if (_bufferedMutator != null) { - _bufferedMutator.close(); - } - if (_table != null) { - _table.close(); - } - long en=System.nanoTime(); - final String type = _clientSideBuffering ? "UPDATE" : "CLEANUP"; - _measurements.measure(type, (int)((en-st)/1000)); - _connection.close(); - } catch (IOException e) { - throw new DBException(e); - } - } - - public void getHTable(String table) throws IOException - { - final TableName tableName = TableName.valueOf(table); - this._table = this._connection.getTable(tableName); - //suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html - if (_clientSideBuffering) { - final BufferedMutatorParams p = new BufferedMutatorParams(tableName); - p.writeBufferSize(_writeBufferSize); - this._bufferedMutator = this._connection.getBufferedMutator(p); - } - } - - /** - * 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 - */ - public int read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) - { - //if this is a "new" table, init HTable object. Else, use existing one - if (!_tableName.equals(table)) { - _table = null; - try - { - getHTable(table); - _tableName = table; - } - catch (IOException e) - { - System.err.println("Error accessing HBase table: " + e); - return ServerError; - } - } - - Result r = null; - try - { - if (_debug) { - System.out.println("Doing read from HBase columnfamily "+_columnFamily); - System.out.println("Doing read for key: "+key); - } - Get g = new Get(Bytes.toBytes(key)); - if (fields == null) { - g.addFamily(_columnFamilyBytes); - } else { - for (String field : fields) { - g.addColumn(_columnFamilyBytes, Bytes.toBytes(field)); - } - } - r = _table.get(g); - } - catch (IOException e) - { - if (_debug) { - System.err.println("Error doing get: "+e); - } - return ServerError; - } - catch (ConcurrentModificationException e) - { - //do nothing for now...need to understand HBase concurrency model better - return ServerError; - } - - if (r.isEmpty()) { - return NoMatchingRecord; - } - for (Cell c : r.listCells()) { - result.put(Bytes.toString(CellUtil.cloneQualifier(c)), - new ByteArrayByteIterator(CellUtil.cloneValue(c))); - if (_debug) { - System.out.println("Result for field: "+Bytes.toString(CellUtil.cloneQualifier(c))+ - " is: "+Bytes.toString(CellUtil.cloneValue(c))); - } - } - return Ok; - } - - /** - * 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 - */ - @Override - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) - { - //if this is a "new" table, init HTable object. Else, use existing one - if (!_tableName.equals(table)) { - _table = null; - try - { - getHTable(table); - _tableName = table; - } - catch (IOException e) - { - System.err.println("Error accessing HBase table: "+e); - return ServerError; - } - } - - Scan s = new Scan(Bytes.toBytes(startkey)); - //HBase has no record limit. Here, assume recordcount is small enough to bring back in one call. - //We get back recordcount records - s.setCaching(recordcount); - - //add specified fields or else all fields - if (fields == null) - { - s.addFamily(_columnFamilyBytes); - } - else - { - for (String field : fields) - { - s.addColumn(_columnFamilyBytes,Bytes.toBytes(field)); - } - } - - //get results - ResultScanner scanner = null; - try { - scanner = _table.getScanner(s); - int numResults = 0; - for (Result rr = scanner.next(); rr != null; rr = scanner.next()) - { - //get row key - String key = Bytes.toString(rr.getRow()); - if (_debug) - { - System.out.println("Got scan result for key: "+key); - } - - HashMap<String,ByteIterator> rowResult = new HashMap<String, ByteIterator>(); - - for (KeyValue kv : rr.raw()) { - rowResult.put( - Bytes.toString(kv.getQualifier()), - new ByteArrayByteIterator(kv.getValue())); - } - //add rowResult to result vector - result.add(rowResult); - numResults++; - if (numResults >= recordcount) //if hit recordcount, bail out - { - break; - } - } //done with row - - } - - catch (IOException e) { - if (_debug) - { - System.out.println("Error in getting/parsing scan result: "+e); - } - return ServerError; - } - - finally { - if (scanner != null) - { - scanner.close(); - } - } - - return Ok; - } - - /** - * 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 - */ - @Override - public int update(String table, String key, HashMap<String,ByteIterator> values) - { - //if this is a "new" table, init HTable object. Else, use existing one - if (!_tableName.equals(table)) { - _table = null; - try - { - getHTable(table); - _tableName = table; - } - catch (IOException e) - { - System.err.println("Error accessing HBase table: "+e); - return ServerError; - } - } - - - if (_debug) { - System.out.println("Setting up put for key: "+key); - } - Put p = new Put(Bytes.toBytes(key)); - p.setDurability(_durability); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) - { - byte[] value = entry.getValue().toArray(); - if (_debug) { - System.out.println("Adding field/value " + entry.getKey() + "/"+ - Bytes.toStringBinary(value) + " to put request"); - } - p.add(_columnFamilyBytes,Bytes.toBytes(entry.getKey()), value); - } - - try - { - if (_clientSideBuffering) { - Preconditions.checkNotNull(_bufferedMutator); - _bufferedMutator.mutate(p); - } else{ - _table.put(p); - } - } - catch (IOException e) - { - if (_debug) { - System.err.println("Error doing put: "+e); - } - return ServerError; - } - catch (ConcurrentModificationException e) - { - //do nothing for now...hope this is rare - return ServerError; - } - - return Ok; - } - - /** - * 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 - */ - @Override - public int insert(String table, String key, HashMap<String,ByteIterator> values) - { - return update(table,key,values); - } - - /** - * 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 - */ - @Override - public int delete(String table, String key) - { - //if this is a "new" table, init HTable object. Else, use existing one - if (!_tableName.equals(table)) { - _table = null; - try - { - getHTable(table); - _tableName = table; - } - catch (IOException e) - { - System.err.println("Error accessing HBase table: "+e); - return ServerError; - } - } - - if (_debug) { - System.out.println("Doing delete for key: "+key); - } - - final Delete d = new Delete(Bytes.toBytes(key)); - d.setDurability(_durability); - try - { - if (_clientSideBuffering) { - Preconditions.checkNotNull(_bufferedMutator); - _bufferedMutator.mutate(d); - } else { - _table.delete(d); - } - } - catch (IOException e) - { - if (_debug) { - System.err.println("Error doing delete: "+e); - } - return ServerError; - } - - return Ok; - } -} - -/* For customized vim control - * set autoindent - * set si - * set shiftwidth=4 - */ - diff --git a/hbase094/README.md b/hbase094/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3df8264cfd89acc63bf07b929a5c4683d534f596 --- /dev/null +++ b/hbase094/README.md @@ -0,0 +1,23 @@ +<!-- +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 (0.94.x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a HBase 0.94.x Server cluster. It may also work against 0.92.x +To run against an HBase 0.98.x cluster, use the `hbase098` binding. +To run against an HBase >= 1.0 cluster, use the `hbase10` binding. + +See `hbase098/README.md` for configuration details. diff --git a/hbase094/pom.xml b/hbase094/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ff88ac76b35555fb60ca140157b8d828772fd38 --- /dev/null +++ b/hbase094/pom.xml @@ -0,0 +1,68 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>hbase094-binding</artifactId> + <name>HBase 0.94.x DB Binding</name> + + <dependencies> + <!-- This binding is identical to the HBase 0.98, other than dependencies. --> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase</artifactId> + <version>${hbase094.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-core</artifactId> + <version>1.0.4</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>hbase098-binding</artifactId> + <version>${project.version}</version> + <exclusions> + <!-- HBase 0.98.0 depends on hbase-client, HBase 0.94.0 on hbase. + Override all dependencies. --> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>1.7.12</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/README.md b/hbase098/README.md similarity index 55% rename from hbase/README.md rename to hbase098/README.md index 096d144b70a9fd34bff681af9689c7a16246c199..83c3c7a084743435736c88c6e840cc44e9829690 100644 --- a/hbase/README.md +++ b/hbase098/README.md @@ -1,5 +1,24 @@ -# HBase Driver for YCSB -This driver is a binding for the YCSB facilities to operate against a HBase Server cluster. +<!-- +Copyright (c) 2015-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. +--> + +# HBase (0.98.x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a HBase 0.98.x Server cluster. +To run against an HBase 0.94.x cluster, use the `hbase094` binding. +To run against an HBase >= 1.0 cluster, use the `hbase10` binding. ## Quickstart @@ -51,6 +70,13 @@ 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. +* `hbase.usepagefilter` : If true, HBase + [PageFilter](https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/PageFilter.html)s + are used to limit the number of records consumed in a scan operation. The default is true. +* `principal`: If testing need to be done against a secure HBase cluster using Kerberos Keytab, + this property can be used to pass the principal in the keytab file. +* `keytab`: The Kerberos keytab file name and location can be passed through this property. +* `writebuffersize`: The maximum amount, in bytes, of data to buffer on the client side before a flush is forced. The default is 12MB. + +Additional HBase settings should be provided in the `hbase-site.xml` file located in your `/HBASE-HOME-DIR/conf` directory. Typically this will be `/etc/hbase/conf`. \ No newline at end of file diff --git a/hbase098/pom.xml b/hbase098/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..646e5f8dd409c96a2d7e20633f34ebcff2450b48 --- /dev/null +++ b/hbase098/pom.xml @@ -0,0 +1,48 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>hbase098-binding</artifactId> + <name>HBase 0.98.x DB Binding</name> + + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-client</artifactId> + <version>${hbase098.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/HBaseClient.java b/hbase098/src/main/java/com/yahoo/ycsb/db/HBaseClient.java similarity index 81% rename from hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java rename to hbase098/src/main/java/com/yahoo/ycsb/db/HBaseClient.java index 4dc5bc7253660435b74978d81055f09675167105..9b097b37b4a39df69c4955bd9fbca36d09db124c 100644 --- a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java +++ b/hbase098/src/main/java/com/yahoo/ycsb/db/HBaseClient.java @@ -17,34 +17,40 @@ package com.yahoo.ycsb.db; - -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.ByteArrayByteIterator; - -import java.io.IOException; -import java.util.*; -//import java.util.HashMap; -//import java.util.Properties; -//import java.util.Set; -//import java.util.Vector; - +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.measurements.Measurements; + +import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.client.HTable; -//import org.apache.hadoop.hbase.client.Scanner; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.client.HConnectionManager; +import org.apache.hadoop.hbase.client.HConnection; +import org.apache.hadoop.hbase.client.HTableInterface; +import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Delete; -import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; -//import org.apache.hadoop.hbase.io.Cell; -//import org.apache.hadoop.hbase.io.RowResult; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.filter.PageFilter; import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.HBaseConfiguration; + +import java.io.IOException; +import java.util.ConcurrentModificationException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Random; +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.atomic.AtomicInteger; /** * HBase client for YCSB framework @@ -54,20 +60,21 @@ public class HBaseClient extends com.yahoo.ycsb.DB // BFC: Change to fix broken build (with HBase 0.20.6) //private static final Configuration config = HBaseConfiguration.create(); private static final Configuration config = HBaseConfiguration.create(); //new HBaseConfiguration(); + private static final AtomicInteger THREAD_COUNT = new AtomicInteger(0); public boolean _debug=false; public String _table=""; - public HTable _hTable=null; + private static HConnection _hConn=null; + public HTableInterface _hTable=null; public String _columnFamily=""; public byte _columnFamilyBytes[]; public boolean _clientSideBuffering = false; public long _writeBufferSize = 1024 * 1024 * 12; + /** Whether or not a page filter should be used to limit scan length. */ + public boolean _usePageFilter = true; - public static final int Ok=0; - public static final int ServerError=-1; public static final int HttpError=-2; - public static final int NoMatchingRecord=-3; public static final Object tableLock = new Object(); @@ -91,7 +98,32 @@ public class HBaseClient extends com.yahoo.ycsb.DB { _writeBufferSize = Long.parseLong(getProperties().getProperty("writebuffersize")); } - + if ("false".equals(getProperties().getProperty("hbase.usepagefilter", "true"))) { + _usePageFilter = false; + } + if ("kerberos".equalsIgnoreCase(config.get("hbase.security.authentication"))) { + config.set("hadoop.security.authentication", "Kerberos"); + UserGroupInformation.setConfiguration(config); + } + if ( (getProperties().getProperty("principal")!=null) && (getProperties().getProperty("keytab")!=null) ){ + try { + UserGroupInformation.loginUserFromKeytab(getProperties().getProperty("principal"), getProperties().getProperty("keytab")); + } catch (IOException e) { + System.err.println("Keytab file is not readable or not found"); + throw new DBException(e); + } + } + try { + THREAD_COUNT.getAndIncrement(); + synchronized(THREAD_COUNT) { + if (_hConn == null){ + _hConn = HConnectionManager.createConnection(config); + } + } + } catch (IOException e) { + System.err.println("Connection to HBase was not successful"); + throw new DBException(e); + } _columnFamily = getProperties().getProperty("columnfamily"); if (_columnFamily == null) { @@ -106,8 +138,8 @@ public class HBaseClient extends com.yahoo.ycsb.DB String table = com.yahoo.ycsb.workloads.CoreWorkload.table; try { - HTable ht = new HTable(config, table); - HTableDescriptor dsc = ht.getTableDescriptor(); + HTableInterface ht = _hConn.getTable(table); + ht.getTableDescriptor(); } catch (IOException e) { @@ -129,6 +161,12 @@ public class HBaseClient extends com.yahoo.ycsb.DB if (_hTable != null) { _hTable.flushCommits(); } + synchronized(THREAD_COUNT) { + int threadCount = THREAD_COUNT.decrementAndGet(); + if (threadCount <= 0 && _hConn != null) { + _hConn.close(); + } + } long en=System.nanoTime(); _measurements.measure("UPDATE", (int)((en-st)/1000)); } catch (IOException e) { @@ -139,7 +177,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB public void getHTable(String table) throws IOException { synchronized (tableLock) { - _hTable = new HTable(config, table); + _hTable = _hConn.getTable(table); //2 suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html _hTable.setAutoFlush(!_clientSideBuffering, true); _hTable.setWriteBufferSize(_writeBufferSize); @@ -157,7 +195,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB * @param result A HashMap of field/value pairs for the result * @return Zero on success, a non-zero error code on error */ - public int read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) + public Status read(String table, String key, Set<String> fields, HashMap<String,ByteIterator> result) { //if this is a "new" table, init HTable object. Else, use existing one if (!_table.equals(table)) { @@ -170,7 +208,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB catch (IOException e) { System.err.println("Error accessing HBase table: "+e); - return ServerError; + return Status.ERROR; } } @@ -194,12 +232,12 @@ public class HBaseClient extends com.yahoo.ycsb.DB catch (IOException e) { System.err.println("Error doing get: "+e); - return ServerError; + return Status.ERROR; } catch (ConcurrentModificationException e) { //do nothing for now...need to understand HBase concurrency model better - return ServerError; + return Status.ERROR; } for (KeyValue kv : r.raw()) { @@ -212,7 +250,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB } } - return Ok; + return Status.OK; } /** @@ -225,7 +263,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB * @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 */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) + public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,ByteIterator>> result) { //if this is a "new" table, init HTable object. Else, use existing one if (!_table.equals(table)) { @@ -238,7 +276,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB catch (IOException e) { System.err.println("Error accessing HBase table: "+e); - return ServerError; + return Status.ERROR; } } @@ -246,6 +284,9 @@ public class HBaseClient extends com.yahoo.ycsb.DB //HBase has no record limit. Here, assume recordcount is small enough to bring back in one call. //We get back recordcount records s.setCaching(recordcount); + if (this._usePageFilter) { + s.setFilter(new PageFilter(recordcount)); + } //add specified fields or else all fields if (fields == null) @@ -284,6 +325,9 @@ public class HBaseClient extends com.yahoo.ycsb.DB //add rowResult to result vector result.add(rowResult); numResults++; + + // PageFilter does not guarantee that the number of results is <= pageSize, so this + // break is required. if (numResults >= recordcount) //if hit recordcount, bail out { break; @@ -297,14 +341,14 @@ public class HBaseClient extends com.yahoo.ycsb.DB { System.out.println("Error in getting/parsing scan result: "+e); } - return ServerError; + return Status.ERROR; } finally { scanner.close(); } - return Ok; + return Status.OK; } /** @@ -316,7 +360,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB * @param values A HashMap of field/value pairs to update in the record * @return Zero on success, a non-zero error code on error */ - public int update(String table, String key, HashMap<String,ByteIterator> values) + public Status update(String table, String key, HashMap<String,ByteIterator> values) { //if this is a "new" table, init HTable object. Else, use existing one if (!_table.equals(table)) { @@ -329,7 +373,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB catch (IOException e) { System.err.println("Error accessing HBase table: "+e); - return ServerError; + return Status.ERROR; } } @@ -357,15 +401,15 @@ public class HBaseClient extends com.yahoo.ycsb.DB if (_debug) { System.err.println("Error doing put: "+e); } - return ServerError; + return Status.ERROR; } catch (ConcurrentModificationException e) { //do nothing for now...hope this is rare - return ServerError; + return Status.ERROR; } - return Ok; + return Status.OK; } /** @@ -377,7 +421,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB * @param values A HashMap of field/value pairs to insert in the record * @return Zero on success, a non-zero error code on error */ - public int insert(String table, String key, HashMap<String,ByteIterator> values) + public Status insert(String table, String key, HashMap<String,ByteIterator> values) { return update(table,key,values); } @@ -389,7 +433,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB * @param key The record key of the record to delete. * @return Zero on success, a non-zero error code on error */ - public int delete(String table, String key) + public Status delete(String table, String key) { //if this is a "new" table, init HTable object. Else, use existing one if (!_table.equals(table)) { @@ -402,7 +446,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB catch (IOException e) { System.err.println("Error accessing HBase table: "+e); - return ServerError; + return Status.ERROR; } } @@ -420,10 +464,10 @@ public class HBaseClient extends com.yahoo.ycsb.DB if (_debug) { System.err.println("Error doing delete: "+e); } - return ServerError; + return Status.ERROR; } - return Ok; + return Status.OK; } public static void main(String[] args) @@ -473,7 +517,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB int keynum=random.nextInt(keyspace); String key="user"+keynum; long st=System.currentTimeMillis(); - int rescode; + Status result; /* HashMap hm = new HashMap(); hm.put("field1","value1"); @@ -492,15 +536,15 @@ public class HBaseClient extends com.yahoo.ycsb.DB scanFields.add("field1"); scanFields.add("field3"); Vector<HashMap<String,ByteIterator>> scanResults = new Vector<HashMap<String,ByteIterator>>(); - rescode = cli.scan("table1","user2",20,null,scanResults); + result = cli.scan("table1","user2",20,null,scanResults); long en=System.currentTimeMillis(); accum+=(en-st); - if (rescode!=Ok) + if (!result.equals(Status.OK)) { - System.out.println("Error "+rescode+" for "+key); + System.out.println("Error "+result+" for "+key); } if (i%1==0) diff --git a/hbase10/README.md b/hbase10/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dd01249edbf169b6ab112af34c1a157dad4da067 --- /dev/null +++ b/hbase10/README.md @@ -0,0 +1,116 @@ +<!-- +Copyright (c) 2015-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. +--> + +# HBase (1.0.x) Driver for YCSB +This driver is a binding for the YCSB facilities to operate against a HBase 1.0.x Server cluster or Google's hosted Bigtable. +To run against an HBase 0.94.x cluster, use the `hbase094` binding. +To run against an HBase 0.98.x cluster, use the `hbase098` binding. + +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 `hbase10` 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. + +## Bigtable + +Google's Bigtable service provides an implementation of the HBase API for migrating existing applications. Users can perform load tests against Bigtable using this binding. + +### 1. Setup a Bigtable Cluster + +Login to the Google Cloud Console and follow the [Creating Cluster](https://cloud.google.com/bigtable/docs/creating-cluster) steps. Make a note of your cluster name, zone and project ID. + +### 2. Launch the Bigtable Shell + +From the Cloud Console, launch a shell and follow the [Quickstart](https://cloud.google.com/bigtable/docs/quickstart) up to step 4 where you launch the HBase shell. + +### 3. Create a Table + +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', 'cf', {SPLITS => (1..n_splits).map {|i| "user#{1000+i*(9999-1000)/n_splits}"}} +``` + +Make a note of the column family, in this example it's `cf``. + +### 4. Fetch the Proper ALPN Boot Jar + +The Bigtable protocol uses HTTP/2 which requires an ALPN protocol negotiation implementation. On JVM instantiation the implementation must be loaded before attempting to connect to the cluster. If you're using Java 7 or 8, use this [Jetty Version Table](http://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions) to determine the version appropriate for your JVM. (ALPN is included in JDK 9+). Download the proper jar from [Maven](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.mortbay.jetty.alpn%22%20AND%20a%3A%22alpn-boot%22) somewhere on your system. + +### 5. Download the Bigtable Client Jar + +Download one of the `bigtable-hbase-1.#` jars from [Maven](http://search.maven.org/#search%7Cga%7C1%7Ccom.google.cloud.bigtable) to your host. + +### 6. Download JSON Credentials + +Follow these instructions for [Generating a JSON key](https://cloud.google.com/bigtable/docs/installing-hbase-shell#service-account) and save it to your host. + +### 7. Create or Edit hbase-site.xml + +If you have an existing HBase configuration directory with an `hbase-site.xml` file, edit the file as per below. If not, create a directory called `conf` under the `hbase10` directory. Create a file in the conf directory named `hbase-site.xml`. Provide the following settings in the XML file, making sure to replace the bracketed examples with the proper values from your Cloud console. + +``` +<configuration> + <property> + <name>hbase.client.connection.impl</name> + <value>com.google.cloud.bigtable.hbase1_0.BigtableConnection</value> + </property> + <property> + <name>google.bigtable.cluster.name</name> + <value>[YOUR-CLUSTER-ID]</value> + </property> + <property> + <name>google.bigtable.project.id</name> + <value>[YOUR-PROJECT-ID]</value> + </property> + <property> + <name>google.bigtable.zone.name</name> + <value>[YOUR-ZONE-NAME]</value> + </property> + <property> + <name>google.bigtable.auth.service.account.enable</name> + <value>true</value> + </property> + <property> + <name>google.bigtable.auth.json.keyfile</name> + <value>[PATH-TO-YOUR-KEY-FILE]</value> + </property> +</configuration> +``` + +If you wish to try other API implementations (1.1.x or 1.2.x) change the `hbase.client.connection.impl` appropriately to match the JAR you downloaded. + +If you have an existing HBase config directory, make sure to add it to the class path via `-cp <PATH_TO_BIGTABLE_JAR>:<CONF_DIR>`. + +### 8. Execute a Workload + +Switch to the root of the YCSB repo and choose the workload you want to run and `load` it first. With the CLI you must provide the column family, cluster properties and the ALPN jar to load. + +``` +bin/ycsb load hbase10 -p columnfamily=cf -cp <PATH_TO_BIGTABLE_JAR> -jvm-args='-Xbootclasspath/p:<PATH_TO_ALPN_JAR>' -P workloads/workloada + +``` + +The `load` step only executes inserts into the datastore. After loading data, run the same workload to mix reads with writes. + +``` +bin/ycsb run hbase10 -p columnfamily=cf -jvm-args='-Xbootclasspath/p:<PATH_TO_ALPN_JAR>' -P workloads/workloada + +``` \ No newline at end of file diff --git a/hbase10/pom.xml b/hbase10/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..01db0ceb1b39c49e8770c0b2a76c3294437d9911 --- /dev/null +++ b/hbase10/pom.xml @@ -0,0 +1,56 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent/</relativePath> + </parent> + + <artifactId>hbase10-binding</artifactId> + <name>HBase 1.0 DB Binding</name> + + <dependencies> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-client</artifactId> + <version>${hbase10.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-testing-util</artifactId> + <version>${hbase10.version}</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/hbase10/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java b/hbase10/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java new file mode 100644 index 0000000000000000000000000000000000000000..da72f4f86c6d0101defde14c7548c49ea887f213 --- /dev/null +++ b/hbase10/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java @@ -0,0 +1,538 @@ +/** + * 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.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; + +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.measurements.Measurements; + +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.CellUtil; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.BufferedMutator; +import org.apache.hadoop.hbase.client.BufferedMutatorParams; +import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.client.ConnectionFactory; +import org.apache.hadoop.hbase.client.Delete; +import org.apache.hadoop.hbase.client.Durability; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.filter.PageFilter; +import org.apache.hadoop.hbase.util.Bytes; + +import java.io.IOException; +import java.util.ConcurrentModificationException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * HBase 1.0 client for YCSB framework. + * + * A modified version of HBaseClient (which targets HBase v0.9) utilizing the + * HBase 1.0.0 API. + * + * This client also adds toggleable client-side buffering and configurable write + * durability. + */ +public class HBaseClient10 extends com.yahoo.ycsb.DB { + private Configuration config = HBaseConfiguration.create(); + + private static AtomicInteger threadCount = new AtomicInteger(0); + + private boolean debug = false; + + private String tableName = ""; + + /** + * A Cluster Connection instance that is shared by all running ycsb threads. + * Needs to be initialized late so we pick up command-line configs if any. + * To ensure one instance only in a multi-threaded context, guard access + * with a 'lock' object. + * @See #CONNECTION_LOCK. + */ + private static Connection connection = null; + private static final Object CONNECTION_LOCK = new Object(); + + // Depending on the value of clientSideBuffering, either bufferedMutator + // (clientSideBuffering) or currentTable (!clientSideBuffering) will be used. + private Table currentTable = null; + private BufferedMutator bufferedMutator = null; + + private String columnFamily = ""; + private byte[] columnFamilyBytes; + + /** + * Durability to use for puts and deletes. + */ + private Durability durability = Durability.USE_DEFAULT; + + /** Whether or not a page filter should be used to limit scan length. */ + private boolean usePageFilter = true; + + /** + * If true, buffer mutations on the client. This is the default behavior for + * HBaseClient. For measuring insert/update/delete latencies, client side + * buffering should be disabled. + */ + private boolean clientSideBuffering = false; + private long writeBufferSize = 1024 * 1024 * 12; + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public void init() throws DBException { + if ("true" + .equals(getProperties().getProperty("clientbuffering", "false"))) { + this.clientSideBuffering = true; + } + if (getProperties().containsKey("writebuffersize")) { + writeBufferSize = + Long.parseLong(getProperties().getProperty("writebuffersize")); + } + + if (getProperties().getProperty("durability") != null) { + this.durability = + Durability.valueOf(getProperties().getProperty("durability")); + } + + if ("kerberos".equalsIgnoreCase(config.get("hbase.security.authentication"))) { + config.set("hadoop.security.authentication", "Kerberos"); + UserGroupInformation.setConfiguration(config); + } + + if ((getProperties().getProperty("principal")!=null) + && (getProperties().getProperty("keytab")!=null)) { + try { + UserGroupInformation.loginUserFromKeytab(getProperties().getProperty("principal"), + getProperties().getProperty("keytab")); + } catch (IOException e) { + System.err.println("Keytab file is not readable or not found"); + throw new DBException(e); + } + } + + try { + threadCount.getAndIncrement(); + synchronized (CONNECTION_LOCK) { + if (connection == null) { + // Initialize if not set up already. + connection = ConnectionFactory.createConnection(config); + } + } + } catch (java.io.IOException e) { + throw new DBException(e); + } + + if ((getProperties().getProperty("debug") != null) + && (getProperties().getProperty("debug").compareTo("true") == 0)) { + debug = true; + } + + if ("false" + .equals(getProperties().getProperty("hbase.usepagefilter", "true"))) { + usePageFilter = false; + } + + columnFamily = getProperties().getProperty("columnfamily"); + if (columnFamily == null) { + System.err.println("Error, must specify a columnfamily for HBase table"); + throw new DBException("No columnfamily specified"); + } + columnFamilyBytes = Bytes.toBytes(columnFamily); + + // Terminate right now if table does not exist, since the client + // will not propagate this error upstream once the workload + // starts. + String table = com.yahoo.ycsb.workloads.CoreWorkload.table; + try { + final TableName tName = TableName.valueOf(table); + synchronized (CONNECTION_LOCK) { + connection.getTable(tName).getTableDescriptor(); + } + } catch (IOException e) { + throw new DBException(e); + } + } + + /** + * Cleanup any state for this DB. Called once per DB instance; there is one DB + * instance per client thread. + */ + @Override + public void cleanup() throws DBException { + // Get the measurements instance as this is the only client that should + // count clean up time like an update if client-side buffering is + // enabled. + Measurements measurements = Measurements.getMeasurements(); + try { + long st = System.nanoTime(); + if (bufferedMutator != null) { + bufferedMutator.close(); + } + if (currentTable != null) { + currentTable.close(); + } + long en = System.nanoTime(); + final String type = clientSideBuffering ? "UPDATE" : "CLEANUP"; + measurements.measure(type, (int) ((en - st) / 1000)); + threadCount.decrementAndGet(); + if (threadCount.get() <= 0) { + // Means we are done so ok to shut down the Connection. + synchronized (CONNECTION_LOCK) { + if (connection != null) { + connection.close(); + connection = null; + } + } + } + } catch (IOException e) { + throw new DBException(e); + } + } + + public void getHTable(String table) throws IOException { + final TableName tName = TableName.valueOf(table); + synchronized (CONNECTION_LOCK) { + this.currentTable = connection.getTable(tName); + if (clientSideBuffering) { + final BufferedMutatorParams p = new BufferedMutatorParams(tName); + p.writeBufferSize(writeBufferSize); + this.bufferedMutator = connection.getBufferedMutator(p); + } + } + } + + /** + * 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 + */ + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + // if this is a "new" table, init HTable object. Else, use existing one + if (!tableName.equals(table)) { + currentTable = null; + try { + getHTable(table); + tableName = table; + } catch (IOException e) { + System.err.println("Error accessing HBase table: " + e); + return Status.ERROR; + } + } + + Result r = null; + try { + if (debug) { + System.out + .println("Doing read from HBase columnfamily " + columnFamily); + System.out.println("Doing read for key: " + key); + } + Get g = new Get(Bytes.toBytes(key)); + if (fields == null) { + g.addFamily(columnFamilyBytes); + } else { + for (String field : fields) { + g.addColumn(columnFamilyBytes, Bytes.toBytes(field)); + } + } + r = currentTable.get(g); + } catch (IOException e) { + if (debug) { + System.err.println("Error doing get: " + e); + } + return Status.ERROR; + } catch (ConcurrentModificationException e) { + // do nothing for now...need to understand HBase concurrency model better + return Status.ERROR; + } + + if (r.isEmpty()) { + return Status.NOT_FOUND; + } + + while (r.advance()) { + final Cell c = r.current(); + result.put(Bytes.toString(CellUtil.cloneQualifier(c)), + new ByteArrayByteIterator(CellUtil.cloneValue(c))); + if (debug) { + System.out.println( + "Result for field: " + Bytes.toString(CellUtil.cloneQualifier(c)) + + " is: " + Bytes.toString(CellUtil.cloneValue(c))); + } + } + return Status.OK; + } + + /** + * 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 + */ + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + // if this is a "new" table, init HTable object. Else, use existing one + if (!tableName.equals(table)) { + currentTable = null; + try { + getHTable(table); + tableName = table; + } catch (IOException e) { + System.err.println("Error accessing HBase table: " + e); + return Status.ERROR; + } + } + + Scan s = new Scan(Bytes.toBytes(startkey)); + // HBase has no record limit. Here, assume recordcount is small enough to + // bring back in one call. + // We get back recordcount records + s.setCaching(recordcount); + if (this.usePageFilter) { + s.setFilter(new PageFilter(recordcount)); + } + + // add specified fields or else all fields + if (fields == null) { + s.addFamily(columnFamilyBytes); + } else { + for (String field : fields) { + s.addColumn(columnFamilyBytes, Bytes.toBytes(field)); + } + } + + // get results + ResultScanner scanner = null; + try { + scanner = currentTable.getScanner(s); + int numResults = 0; + for (Result rr = scanner.next(); rr != null; rr = scanner.next()) { + // get row key + String key = Bytes.toString(rr.getRow()); + + if (debug) { + System.out.println("Got scan result for key: " + key); + } + + HashMap<String, ByteIterator> rowResult = + new HashMap<String, ByteIterator>(); + + while (rr.advance()) { + final Cell cell = rr.current(); + rowResult.put(Bytes.toString(CellUtil.cloneQualifier(cell)), + new ByteArrayByteIterator(CellUtil.cloneValue(cell))); + } + + // add rowResult to result vector + result.add(rowResult); + numResults++; + + // PageFilter does not guarantee that the number of results is <= + // pageSize, so this + // break is required. + if (numResults >= recordcount) {// if hit recordcount, bail out + break; + } + } // done with row + } catch (IOException e) { + if (debug) { + System.out.println("Error in getting/parsing scan result: " + e); + } + return Status.ERROR; + } finally { + if (scanner != null) { + scanner.close(); + } + } + + return Status.OK; + } + + /** + * 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 + */ + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + // if this is a "new" table, init HTable object. Else, use existing one + if (!tableName.equals(table)) { + currentTable = null; + try { + getHTable(table); + tableName = table; + } catch (IOException e) { + System.err.println("Error accessing HBase table: " + e); + return Status.ERROR; + } + } + + if (debug) { + System.out.println("Setting up put for key: " + key); + } + Put p = new Put(Bytes.toBytes(key)); + p.setDurability(durability); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + byte[] value = entry.getValue().toArray(); + if (debug) { + System.out.println("Adding field/value " + entry.getKey() + "/" + + Bytes.toStringBinary(value) + " to put request"); + } + p.addColumn(columnFamilyBytes, Bytes.toBytes(entry.getKey()), value); + } + + try { + if (clientSideBuffering) { + Preconditions.checkNotNull(bufferedMutator); + bufferedMutator.mutate(p); + } else { + currentTable.put(p); + } + } catch (IOException e) { + if (debug) { + System.err.println("Error doing put: " + e); + } + return Status.ERROR; + } catch (ConcurrentModificationException e) { + // do nothing for now...hope this is rare + return Status.ERROR; + } + + return Status.OK; + } + + /** + * 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 + */ + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + return update(table, key, values); + } + + /** + * 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 + */ + @Override + public Status delete(String table, String key) { + // if this is a "new" table, init HTable object. Else, use existing one + if (!tableName.equals(table)) { + currentTable = null; + try { + getHTable(table); + tableName = table; + } catch (IOException e) { + System.err.println("Error accessing HBase table: " + e); + return Status.ERROR; + } + } + + if (debug) { + System.out.println("Doing delete for key: " + key); + } + + final Delete d = new Delete(Bytes.toBytes(key)); + d.setDurability(durability); + try { + if (clientSideBuffering) { + Preconditions.checkNotNull(bufferedMutator); + bufferedMutator.mutate(d); + } else { + currentTable.delete(d); + } + } catch (IOException e) { + if (debug) { + System.err.println("Error doing delete: " + e); + } + return Status.ERROR; + } + + return Status.OK; + } + + @VisibleForTesting + void setConfiguration(final Configuration newConfig) { + this.config = newConfig; + } +} + +/* + * For customized vim control set autoindent set si set shiftwidth=4 + */ diff --git a/hbase10/src/main/java/com/yahoo/ycsb/db/package-info.java b/hbase10/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..2b12ae41ec78895f8a8726b1bb4bbbee7f6b1b6f --- /dev/null +++ b/hbase10/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -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.0.0 API. + */ +package com.yahoo.ycsb.db; + diff --git a/hbase10/src/test/java/com/yahoo/ycsb/db/HBaseClient10Test.java b/hbase10/src/test/java/com/yahoo/ycsb/db/HBaseClient10Test.java new file mode 100644 index 0000000000000000000000000000000000000000..631e822710d70d2227ab327e9eb0a97b5817b8e4 --- /dev/null +++ b/hbase10/src/test/java/com/yahoo/ycsb/db/HBaseClient10Test.java @@ -0,0 +1,209 @@ +/** + * 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 static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; +import com.yahoo.ycsb.measurements.Measurements; +import com.yahoo.ycsb.workloads.CoreWorkload; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Properties; +import java.util.Vector; + +/** + * Integration tests for the YCSB HBase client 1.0, using an HBase minicluster. + */ +public class HBaseClient10Test { + + private final static String COLUMN_FAMILY = "cf"; + + private static HBaseTestingUtility testingUtil; + private HBaseClient10 client; + private Table table = null; + + private static boolean isWindows() { + final String os = System.getProperty("os.name"); + return os.startsWith("Windows"); + } + + /** + * Creates a mini-cluster for use in these tests. + * + * This is a heavy-weight operation, so invoked only once for the test class. + */ + @BeforeClass + public static void setUpClass() throws Exception { + // Minicluster setup fails on Windows with an UnsatisfiedLinkError. + // Skip if windows. + assumeTrue(!isWindows()); + testingUtil = HBaseTestingUtility.createLocalHTU(); + testingUtil.startMiniCluster(); + } + + /** + * Tears down mini-cluster. + */ + @AfterClass + public static void tearDownClass() throws Exception { + if (testingUtil != null) { + testingUtil.shutdownMiniCluster(); + } + } + + /** + * Sets up the mini-cluster for testing. + * + * We re-create the table for each test. + */ + @Before + public void setUp() throws Exception { + client = new HBaseClient10(); + client.setConfiguration(new Configuration(testingUtil.getConfiguration())); + + Properties p = new Properties(); + p.setProperty("columnfamily", COLUMN_FAMILY); + + Measurements.setProperties(p); + final CoreWorkload workload = new CoreWorkload(); + workload.init(p); + + table = testingUtil.createTable(TableName.valueOf(CoreWorkload.table), Bytes.toBytes(COLUMN_FAMILY)); + + client.setProperties(p); + client.init(); + } + + @After + public void tearDown() throws Exception { + table.close(); + testingUtil.deleteTable(CoreWorkload.table); + } + + @Test + public void testRead() throws Exception { + final String rowKey = "row1"; + final Put p = new Put(Bytes.toBytes(rowKey)); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes("column1"), Bytes.toBytes("value1")); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes("column2"), Bytes.toBytes("value2")); + table.put(p); + + final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); + final Status status = client.read(CoreWorkload.table, rowKey, null, result); + assertEquals(Status.OK, status); + assertEquals(2, result.size()); + assertEquals("value1", result.get("column1").toString()); + assertEquals("value2", result.get("column2").toString()); + } + + @Test + public void testReadMissingRow() throws Exception { + final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); + final Status status = client.read(CoreWorkload.table, "Missing row", null, result); + assertEquals(Status.NOT_FOUND, status); + assertEquals(0, result.size()); + } + + @Test + public void testScan() throws Exception { + // Fill with data + final String colStr = "row_number"; + final byte[] col = Bytes.toBytes(colStr); + final int n = 10; + final List<Put> puts = new ArrayList<Put>(n); + for(int i = 0; i < n; i++) { + final byte[] key = Bytes.toBytes(String.format("%05d", i)); + final byte[] value = java.nio.ByteBuffer.allocate(4).putInt(i).array(); + final Put p = new Put(key); + p.addColumn(Bytes.toBytes(COLUMN_FAMILY), col, value); + puts.add(p); + } + table.put(puts); + + // Test + final Vector<HashMap<String, ByteIterator>> result = + new Vector<HashMap<String, ByteIterator>>(); + + // Scan 5 records, skipping the first + client.scan(CoreWorkload.table, "00001", 5, null, result); + + assertEquals(5, result.size()); + for(int i = 0; i < 5; i++) { + final HashMap<String, ByteIterator> row = result.get(i); + assertEquals(1, row.size()); + assertTrue(row.containsKey(colStr)); + final byte[] bytes = row.get(colStr).toArray(); + final ByteBuffer buf = ByteBuffer.wrap(bytes); + final int rowNum = buf.getInt(); + assertEquals(i + 1, rowNum); + } + } + + @Test + public void testUpdate() throws Exception{ + final String key = "key"; + final HashMap<String, String> input = new HashMap<String, String>(); + input.put("column1", "value1"); + input.put("column2", "value2"); + final Status status = client.insert(CoreWorkload.table, key, StringByteIterator.getByteIteratorMap(input)); + assertEquals(Status.OK, status); + + // Verify result + final Get get = new Get(Bytes.toBytes(key)); + final Result result = this.table.get(get); + assertFalse(result.isEmpty()); + assertEquals(2, result.size()); + for(final java.util.Map.Entry<String, String> entry : input.entrySet()) { + assertEquals(entry.getValue(), + new String(result.getValue(Bytes.toBytes(COLUMN_FAMILY), + Bytes.toBytes(entry.getKey())))); + } + } + + @Test + @Ignore("Not yet implemented") + public void testDelete() { + fail("Not yet implemented"); + } +} + diff --git a/hbase10/src/test/resources/hbase-site.xml b/hbase10/src/test/resources/hbase-site.xml new file mode 100644 index 0000000000000000000000000000000000000000..a8b29e451f440ad7c09b3b2f25eebaf56f07e6bb --- /dev/null +++ b/hbase10/src/test/resources/hbase-site.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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. +--> + +<configuration> + <property> + <name>hbase.master.info.port</name> + <value>-1</value> + <description>The port for the hbase master web UI + Set to -1 if you do not want the info server to run. + </description> + </property> + <property> + <name>hbase.regionserver.info.port</name> + <value>-1</value> + <description>The port for the hbase regionserver web UI + Set to -1 if you do not want the info server to run. + </description> + </property> +</configuration> diff --git a/hbase10/src/test/resources/log4j.properties b/hbase10/src/test/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..a9df32e044b9374097b9c110a79f35ff34b5a793 --- /dev/null +++ b/hbase10/src/test/resources/log4j.properties @@ -0,0 +1,28 @@ +# +# 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. +# + +# Root logger option +log4j.rootLogger=WARN, stderr + +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n + +# Suppress messages from ZKTableStateManager: Creates a large number of table +# state change messages. +log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKTableStateManager=ERROR diff --git a/hypertable/README b/hypertable/README.md similarity index 60% rename from hypertable/README rename to hypertable/README.md index 671ffc0b37712d24d772e69daa92f355661708cd..1a8da55178b4a7187e8cb7397739f20bfc93b62f 100644 --- a/hypertable/README +++ b/hypertable/README.md @@ -1,39 +1,54 @@ -1 Install Hypertable +<!-- +Copyright (c) 2010 Yahoo! Inc., 2012 - 2015 YCSB contributors. +All rights reserved. -Installation instructions for Hypertable can be found at: +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 -code.google.com/p/hypertable/wiki/HypertableManual +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. +--> +# Install Hypertable -2 Set Up YCSB +Installation instructions for Hypertable can be found at: -Clone the YCSB git repository and compile: + code.google.com/p/hypertable/wiki/HypertableManual -]$ git clone git://github.com/brianfrankcooper/YCSB.git -]$ cd YCSB -]$ mvn clean package +# Set Up YCSB + +Clone the YCSB git repository and compile: + ]$ git clone git://github.com/brianfrankcooper/YCSB.git + ]$ cd YCSB + ]$ mvn clean package -3 Run Hypertable +# Run Hypertable Once it has been installed, start Hypertable by running -]$ ./bin/ht start all-servers hadoop + ]$ ./bin/ht start all-servers hadoop if an instance of HDFS is running or -]$ ./bin/ht start all-servers local + ]$ ./bin/ht start all-servers local if the database is backed by the local file system. YCSB accesses a table called 'usertable' by default. Create this table through the Hypertable shell by running -]$ ./bin/ht shell -hypertable> use '/ycsb'; -hypertable> create table usertable(family); -hypertable> quit + ]$ ./bin/ht shell + hypertable> use '/ycsb'; + hypertable> create table usertable(family); + hypertable> quit All iteractions by YCSB take place under the Hypertable namespace '/ycsb'. Hypertable also uses an additional data grouping structure called a column @@ -44,31 +59,27 @@ The name of this column family must be passed to YCSB. The table can be manipulated from within the hypertable shell without interfering with the operation of YCSB. - - -4 Run YCSB +# Run YCSB Make sure that an instance of Hypertable is running. To access the database through the YCSB shell, from the YCSB directory run: -]$ ./bin/ycsb shell hypertable -p columnfamily=family + ]$ ./bin/ycsb shell hypertable -p columnfamily=family where the value passed to columnfamily matches that used in the table creation. To run a workload, first load the data: -]$ ./bin/ycsb load hypertable -P workloads/workloada -p columnfamily=family + ]$ ./bin/ycsb load hypertable -P workloads/workloada -p columnfamily=family Then run the workload: -]$ ./bin/ycsb run hypertable -P workloads/workloada -p columnfamily=family + ]$ ./bin/ycsb run hypertable -P workloads/workloada -p columnfamily=family This example runs the core workload 'workloada' that comes packaged with YCSB. The state of the YCSB data in the Hypertable database can be reset by dropping usertable and recreating it. - - -+ Configuration Parameters +# Configuration Parameters Hypertable configuration settings can be found in conf/hypertable.cfg under your main hypertable directory. Make sure that the constant THRIFTBROKER_PORT diff --git a/hypertable/pom.xml b/hypertable/pom.xml index 3c46004d91b821360617fe832790b37166aa16c9..637effe05966a2dbbaf3aafa4e3171f7c66135b0 100644 --- a/hypertable/pom.xml +++ b/hypertable/pom.xml @@ -1,10 +1,27 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> @@ -12,6 +29,10 @@ <name>Hypertable DB Binding</name> <packaging>jar</packaging> + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + <dependencies> <dependency> <groupId>com.yahoo.ycsb</groupId> @@ -30,6 +51,30 @@ <version>${hypertable.version}</version> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + <configuration> + <consoleOutput>true</consoleOutput> + <configLocation>../checkstyle.xml</configLocation> + <failOnViolation>true</failOnViolation> + <failsOnError>true</failsOnError> + </configuration> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> <repositories> <repository> diff --git a/hypertable/src/main/java/com/yahoo/ycsb/db/HypertableClient.java b/hypertable/src/main/java/com/yahoo/ycsb/db/HypertableClient.java index 44ac15da345c59b4e74333d91e4adfabf4c858d1..22b6a2c855ccdf4956f7e14dac6a463492acdaf6 100644 --- a/hypertable/src/main/java/com/yahoo/ycsb/db/HypertableClient.java +++ b/hypertable/src/main/java/com/yahoo/ycsb/db/HypertableClient.java @@ -15,15 +15,14 @@ package com.yahoo.ycsb.db; - -import java.nio.ByteBuffer; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.Vector; +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import org.apache.thrift.TException; import org.hypertable.thrift.SerializedCellsFlag; +import org.hypertable.thrift.SerializedCellsReader; import org.hypertable.thrift.SerializedCellsWriter; import org.hypertable.thrift.ThriftClient; import org.hypertable.thriftgen.Cell; @@ -32,314 +31,316 @@ import org.hypertable.thriftgen.Key; import org.hypertable.thriftgen.KeyFlag; import org.hypertable.thriftgen.RowInterval; import org.hypertable.thriftgen.ScanSpec; -import org.hypertable.thrift.SerializedCellsReader; -import com.yahoo.ycsb.ByteArrayByteIterator; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DBException; +import java.nio.ByteBuffer; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.Vector; /** - * Hypertable client for YCSB framework + * Hypertable client for YCSB framework. */ -public class HypertableClient extends com.yahoo.ycsb.DB -{ - private boolean _debug = false; - - private ThriftClient connection; - private long ns; - - private String _columnFamily = ""; - - public static final int OK = 0; - public static final int SERVERERROR = -1; - - public static final String NAMESPACE = "/ycsb"; - public static final int THRIFTBROKER_PORT = 38080; - - //TODO: make dynamic - public static final int BUFFER_SIZE = 4096; - - /** - * Initialize any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - @Override - public void init() throws DBException - { - if ( (getProperties().getProperty("debug") != null) && - (getProperties().getProperty("debug").equals("true")) ) - { - _debug = true; - } - - try { - connection = ThriftClient.create("localhost", THRIFTBROKER_PORT); - - if (!connection.namespace_exists(NAMESPACE)) { - connection.namespace_create(NAMESPACE); - } - ns = connection.open_namespace(NAMESPACE); - } catch (ClientException e) { - throw new DBException("Could not open namespace", e); - } catch (TException e) { - throw new DBException("Could not open namespace", e); - } - - - _columnFamily = getProperties().getProperty("columnfamily"); - if (_columnFamily == null) - { - System.err.println("Error, must specify a " + - "columnfamily for Hypertable table"); - throw new DBException("No columnfamily specified"); - } - } +public class HypertableClient extends com.yahoo.ycsb.DB { + public static final String NAMESPACE = "/ycsb"; + public static final int THRIFTBROKER_PORT = 38080; + public static final int BUFFER_SIZE = 4096; - /** - * Cleanup any state for this DB. - * Called once per DB instance; there is one DB instance per client thread. - */ - @Override - public void cleanup() throws DBException - { - try { - connection.namespace_close(ns); - } catch (ClientException e) { - throw new DBException("Could not close namespace", e); - } catch (TException e) { - throw new DBException("Could not close namespace", e); - } + private boolean debug = false; + + private ThriftClient connection; + private long ns; + + private String columnFamily = ""; + + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public void init() throws DBException { + if ((getProperties().getProperty("debug") != null) + && (getProperties().getProperty("debug").equals("true"))) { + debug = true; } - - /** - * 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 - */ - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) - { - //SELECT _column_family:field[i] - // FROM table WHERE ROW=key MAX_VERSIONS 1; - - if (_debug) { - System.out.println("Doing read from Hypertable columnfamily " + - _columnFamily); - System.out.println("Doing read for key: " + key); - } - - try { - if (null != fields) { - Vector<HashMap<String, ByteIterator>> resMap = - new Vector<HashMap<String, ByteIterator>>(); - if (0 != scan(table, key, 1, fields, resMap)) { - return SERVERERROR; - } - if (!resMap.isEmpty()) - result.putAll(resMap.firstElement()); - } else { - SerializedCellsReader reader = new SerializedCellsReader(null); - reader.reset(connection.get_row_serialized(ns, table, key)); - while (reader.next()) { - result.put(new String(reader.get_column_qualifier()), - new ByteArrayByteIterator(reader.get_value())); - } - } - } catch (ClientException e) { - if (_debug) { - System.err.println("Error doing read: " + e.message); - } - return SERVERERROR; - } catch (TException e) { - if (_debug) - System.err.println("Error doing read"); - return SERVERERROR; - } - return OK; + try { + connection = ThriftClient.create("localhost", THRIFTBROKER_PORT); + + if (!connection.namespace_exists(NAMESPACE)) { + connection.namespace_create(NAMESPACE); + } + ns = connection.open_namespace(NAMESPACE); + } catch (ClientException e) { + throw new DBException("Could not open namespace", e); + } catch (TException e) { + throw new DBException("Could not open namespace", e); } - - /** - * 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 - */ - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) - { - //SELECT _columnFamily:fields FROM table WHERE (ROW >= startkey) - // LIMIT recordcount MAX_VERSIONS 1; - - ScanSpec spec = new ScanSpec(); - RowInterval elem = new RowInterval(); - elem.setStart_inclusive(true); - elem.setStart_row(startkey); - spec.addToRow_intervals(elem); - if (null != fields) { - for (String field : fields) { - spec.addToColumns(_columnFamily + ":" + field); - } - } - spec.setVersions(1); - spec.setRow_limit(recordcount); - SerializedCellsReader reader = new SerializedCellsReader(null); + columnFamily = getProperties().getProperty("columnfamily"); + if (columnFamily == null) { + System.err.println( + "Error, must specify a " + "columnfamily for Hypertable table"); + throw new DBException("No columnfamily specified"); + } + } - try { - long sc = connection.scanner_open(ns, table, spec); - - String lastRow = null; - boolean eos = false; - while (!eos) { - reader.reset(connection.scanner_get_cells_serialized(sc)); - while (reader.next()) { - String currentRow = new String(reader.get_row()); - if (!currentRow.equals(lastRow)) { - result.add(new HashMap<String, ByteIterator>()); - lastRow = currentRow; - } - result.lastElement().put( - new String(reader.get_column_qualifier()), - new ByteArrayByteIterator(reader.get_value())); - } - eos = reader.eos(); - - - if (_debug) { - System.out.println("Number of rows retrieved so far: " + - result.size()); - } - } - connection.scanner_close(sc); - } catch (ClientException e) { - if (_debug) { - System.err.println("Error doing scan: " + e.message); - } - return SERVERERROR; - } catch (TException e) { - if (_debug) - System.err.println("Error doing scan"); - return SERVERERROR; - } - - return OK; + /** + * Cleanup any state for this DB. Called once per DB instance; there is one DB + * instance per client thread. + */ + @Override + public void cleanup() throws DBException { + try { + connection.namespace_close(ns); + } catch (ClientException e) { + throw new DBException("Could not close namespace", e); + } catch (TException e) { + throw new DBException("Could not close namespace", e); } + } + + /** + * 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 + */ + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + // SELECT _column_family:field[i] + // FROM table WHERE ROW=key MAX_VERSIONS 1; - /** - * 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 - */ - @Override - public int update(String table, String key, - HashMap<String, ByteIterator> values) - { - return insert(table, key, values); + if (debug) { + System.out + .println("Doing read from Hypertable columnfamily " + columnFamily); + System.out.println("Doing read for key: " + key); } - /** - * 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 - */ - @Override - public int insert(String table, String key, - HashMap<String, ByteIterator> values) - { - //INSERT INTO table VALUES - // (key, _column_family:entry,getKey(), entry.getValue()), (...); - - if (_debug) { - System.out.println("Setting up put for key: " + key); + try { + if (null != fields) { + Vector<HashMap<String, ByteIterator>> resMap = + new Vector<HashMap<String, ByteIterator>>(); + if (!scan(table, key, 1, fields, resMap).equals(Status.OK)) { + return Status.ERROR; } - - try { - long mutator = connection.mutator_open(ns, table, 0, 0); - SerializedCellsWriter writer = - new SerializedCellsWriter(BUFFER_SIZE*values.size(), true); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - writer.add(key, _columnFamily, entry.getKey(), - SerializedCellsFlag.AUTO_ASSIGN, - ByteBuffer.wrap(entry.getValue().toArray())); - } - connection.mutator_set_cells_serialized(mutator, - writer.buffer(), true); - connection.mutator_close(mutator); - } catch (ClientException e) { - if (_debug) { - System.err.println("Error doing set: " + e.message); - } - return SERVERERROR; - } catch (TException e) { - if (_debug) - System.err.println("Error doing set"); - return SERVERERROR; + if (!resMap.isEmpty()) { + result.putAll(resMap.firstElement()); + } + } else { + SerializedCellsReader reader = new SerializedCellsReader(null); + reader.reset(connection.get_row_serialized(ns, table, key)); + while (reader.next()) { + result.put(new String(reader.get_column_qualifier()), + new ByteArrayByteIterator(reader.get_value())); } - - return OK; + } + } catch (ClientException e) { + if (debug) { + System.err.println("Error doing read: " + e.message); + } + return Status.ERROR; + } catch (TException e) { + if (debug) { + System.err.println("Error doing read"); + } + 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 - */ - @Override - public int delete(String table, String key) - { - //DELETE * FROM table WHERE ROW=key; - - if (_debug) { - System.out.println("Doing delete for key: "+key); + return Status.OK; + } + + /** + * 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 + */ + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + // SELECT _columnFamily:fields FROM table WHERE (ROW >= startkey) + // LIMIT recordcount MAX_VERSIONS 1; + + ScanSpec spec = new ScanSpec(); + RowInterval elem = new RowInterval(); + elem.setStart_inclusive(true); + elem.setStart_row(startkey); + spec.addToRow_intervals(elem); + if (null != fields) { + for (String field : fields) { + spec.addToColumns(columnFamily + ":" + field); + } + } + spec.setVersions(1); + spec.setRow_limit(recordcount); + + SerializedCellsReader reader = new SerializedCellsReader(null); + + try { + long sc = connection.scanner_open(ns, table, spec); + + String lastRow = null; + boolean eos = false; + while (!eos) { + reader.reset(connection.scanner_get_cells_serialized(sc)); + while (reader.next()) { + String currentRow = new String(reader.get_row()); + if (!currentRow.equals(lastRow)) { + result.add(new HashMap<String, ByteIterator>()); + lastRow = currentRow; + } + result.lastElement().put(new String(reader.get_column_qualifier()), + new ByteArrayByteIterator(reader.get_value())); } - - Cell entry = new Cell(); - entry.key = new Key(); - entry.key.row = key; - entry.key.flag = KeyFlag.DELETE_ROW; - - try { - connection.set_cell(ns, table, entry); - } catch (ClientException e) { - if (_debug) { - System.err.println("Error doing delete: " + e.message); - } - return SERVERERROR; - } catch (TException e) { - if (_debug) - System.err.println("Error doing delete"); - return SERVERERROR; + eos = reader.eos(); + + if (debug) { + System.out + .println("Number of rows retrieved so far: " + result.size()); } - - return OK; + } + connection.scanner_close(sc); + } catch (ClientException e) { + if (debug) { + System.err.println("Error doing scan: " + e.message); + } + return Status.ERROR; + } catch (TException e) { + if (debug) { + System.err.println("Error doing scan"); + } + return Status.ERROR; + } + + return Status.OK; + } + + /** + * 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 + */ + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + return insert(table, key, values); + } + + /** + * 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 + */ + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + // INSERT INTO table VALUES + // (key, _column_family:entry,getKey(), entry.getValue()), (...); + + if (debug) { + System.out.println("Setting up put for key: " + key); + } + + try { + long mutator = connection.mutator_open(ns, table, 0, 0); + SerializedCellsWriter writer = + new SerializedCellsWriter(BUFFER_SIZE * values.size(), true); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + writer.add(key, columnFamily, entry.getKey(), + SerializedCellsFlag.AUTO_ASSIGN, + ByteBuffer.wrap(entry.getValue().toArray())); + } + connection.mutator_set_cells_serialized(mutator, writer.buffer(), true); + connection.mutator_close(mutator); + } catch (ClientException e) { + if (debug) { + System.err.println("Error doing set: " + e.message); + } + return Status.ERROR; + } catch (TException e) { + if (debug) { + System.err.println("Error doing set"); + } + return Status.ERROR; } -} + return Status.OK; + } + /** + * 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 + */ + @Override + public Status delete(String table, String key) { + // DELETE * FROM table WHERE ROW=key; + + if (debug) { + System.out.println("Doing delete for key: " + key); + } + + Cell entry = new Cell(); + entry.key = new Key(); + entry.key.row = key; + entry.key.flag = KeyFlag.DELETE_ROW; + + try { + connection.set_cell(ns, table, entry); + } catch (ClientException e) { + if (debug) { + System.err.println("Error doing delete: " + e.message); + } + return Status.ERROR; + } catch (TException e) { + if (debug) { + System.err.println("Error doing delete"); + } + return Status.ERROR; + } + + return Status.OK; + } +} diff --git a/hypertable/src/main/java/com/yahoo/ycsb/db/package-info.java b/hypertable/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..89efad2dde66f94ab280e99166a35daff05ce22d --- /dev/null +++ b/hypertable/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * 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="http://hypertable.org/">Hypertable</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/infinispan/README.md b/infinispan/README.md index d1303ceb001daac36e07992fbcd7cfa92bccd365..c4673aae09b24e59f080f12236efaff49ec85d5f 100644 --- a/infinispan/README.md +++ b/infinispan/README.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + ## Quick Start This section describes how to run YCSB on infinispan. diff --git a/infinispan/pom.xml b/infinispan/pom.xml index b0577e8325445e0b405c414c4c4852c26e8e360e..8e0177db83bb62d36891ef7604198f7367dd2a42 100644 --- a/infinispan/pom.xml +++ b/infinispan/pom.xml @@ -1,10 +1,27 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> @@ -12,6 +29,10 @@ <name>Infinispan DB Binding</name> <packaging>jar</packaging> + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + <dependencies> <dependency> <groupId>org.infinispan</groupId> @@ -30,4 +51,28 @@ <scope>provided</scope> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + <configuration> + <consoleOutput>true</consoleOutput> + <configLocation>../checkstyle.xml</configLocation> + <failOnViolation>true</failOnViolation> + <failsOnError>true</failsOnError> + </configuration> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/infinispan/src/main/conf/infinispan-config.xml b/infinispan/src/main/conf/infinispan-config.xml index 15b9978c60118c999fba6579611346718cb3f5b3..fedf281610a5ec92e40a0bc71ca0c3730f6694d0 100644 --- a/infinispan/src/main/conf/infinispan-config.xml +++ b/infinispan/src/main/conf/infinispan-config.xml @@ -1,4 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2012 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. +--> <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/infinispan/src/main/conf/remote-cache.properties b/infinispan/src/main/conf/remote-cache.properties index 04e50054dab7267c0bfeea1f4b662cfb7cbe31c3..8e96ff5e6cb1752cc9b456bb835d32758f1570bb 100644 --- a/infinispan/src/main/conf/remote-cache.properties +++ b/infinispan/src/main/conf/remote-cache.properties @@ -1,3 +1,18 @@ +# 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. + infinispan.client.hotrod.server_list=192.168.101.17:11222 infinispan.client.hotrod.force_return_values=false diff --git a/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanClient.java b/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanClient.java index 528ded5ca70d1a9dbf3ad311103883a96b9afa9d..7fa75fd13f46d28e51d139fb239853f387f36d4a 100644 --- a/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanClient.java +++ b/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanClient.java @@ -1,8 +1,26 @@ +/** + * 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. + */ + package com.yahoo.ycsb.db; +import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; import org.infinispan.Cache; @@ -21,116 +39,118 @@ import java.util.Vector; /** * This is a client implementation for Infinispan 5.x. - * - * Some settings: - * - * @author Manik Surtani (manik AT jboss DOT org) */ public class InfinispanClient extends DB { - - private static final int OK = 0; - private static final int ERROR = -1; - private static final int NOT_FOUND = -2; - - // An optimisation for clustered mode - private final boolean clustered; - - private EmbeddedCacheManager infinispanManager; - - private static final Log logger = LogFactory.getLog(InfinispanClient.class); - - public InfinispanClient() { - clustered = Boolean.getBoolean("infinispan.clustered"); - } - - public void init() throws DBException { - try { - infinispanManager = new DefaultCacheManager("infinispan-config.xml"); - } catch (IOException e) { - throw new DBException(e); + private static final Log LOGGER = LogFactory.getLog(InfinispanClient.class); + + // An optimisation for clustered mode + private final boolean clustered; + + private EmbeddedCacheManager infinispanManager; + + public InfinispanClient() { + clustered = Boolean.getBoolean("infinispan.clustered"); + } + + public void init() throws DBException { + try { + infinispanManager = new DefaultCacheManager("infinispan-config.xml"); + } catch (IOException e) { + throw new DBException(e); + } + } + + public void cleanup() { + infinispanManager.stop(); + infinispanManager = null; + } + + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + try { + Map<String, String> row; + if (clustered) { + row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key, false); + } else { + Cache<String, Map<String, String>> cache = infinispanManager.getCache(table); + row = cache.get(key); } - } - - public void cleanup() { - infinispanManager.stop(); - infinispanManager = null; - } - - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { - try { - Map<String, String> row; - if (clustered) { - row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key, false); - } else { - Cache<String, Map<String, String>> cache = infinispanManager.getCache(table); - row = cache.get(key); - } - if (row != null) { - result.clear(); - if (fields == null || fields.isEmpty()) { - StringByteIterator.putAllAsByteIterators(result, row); - } else { - for (String field : fields) result.put(field, new StringByteIterator(row.get(field))); - } - } - return OK; - } catch (Exception e) { - return ERROR; + if (row != null) { + result.clear(); + if (fields == null || fields.isEmpty()) { + StringByteIterator.putAllAsByteIterators(result, row); + } else { + for (String field : fields) { + result.put(field, new StringByteIterator(row.get(field))); + } + } } - } - - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - logger.warn("Infinispan does not support scan semantics"); - return OK; - } - - public int update(String table, String key, HashMap<String, ByteIterator> values) { - try { - if (clustered) { - AtomicMap<String, String> row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key); - StringByteIterator.putAllAsStrings(row, values); - } else { - Cache<String, Map<String, String>> cache = infinispanManager.getCache(table); - Map<String, String> row = cache.get(key); - if (row == null) { - row = StringByteIterator.getStringMap(values); - cache.put(key, row); - } else { - StringByteIterator.putAllAsStrings(row, values); - } - } - - return OK; - } catch (Exception e) { - return ERROR; + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + LOGGER.warn("Infinispan does not support scan semantics"); + return Status.OK; + } + + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + try { + if (clustered) { + AtomicMap<String, String> row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key); + StringByteIterator.putAllAsStrings(row, values); + } else { + Cache<String, Map<String, String>> cache = infinispanManager.getCache(table); + Map<String, String> row = cache.get(key); + if (row == null) { + row = StringByteIterator.getStringMap(values); + cache.put(key, row); + } else { + StringByteIterator.putAllAsStrings(row, values); + } } - } - - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - try { - if (clustered) { - AtomicMap<String, String> row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key); - row.clear(); - StringByteIterator.putAllAsStrings(row, values); - } else { - infinispanManager.getCache(table).put(key, values); - } - - return OK; - } catch (Exception e) { - return ERROR; + + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + try { + if (clustered) { + AtomicMap<String, String> row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key); + row.clear(); + StringByteIterator.putAllAsStrings(row, values); + } else { + infinispanManager.getCache(table).put(key, values); } - } - - public int delete(String table, String key) { - try { - if (clustered) - AtomicMapLookup.removeAtomicMap(infinispanManager.getCache(table), key); - else - infinispanManager.getCache(table).remove(key); - return OK; - } catch (Exception e) { - return ERROR; + + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + public Status delete(String table, String key) { + try { + if (clustered) { + AtomicMapLookup.removeAtomicMap(infinispanManager.getCache(table), key); + } else { + infinispanManager.getCache(table).remove(key); } - } + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } } diff --git a/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanRemoteClient.java b/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanRemoteClient.java index f670357ad014534d69c5b451c321b8a58ff4462e..26ce835942d452cd8fe90064b38831e6de900b2d 100644 --- a/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanRemoteClient.java +++ b/infinispan/src/main/java/com/yahoo/ycsb/db/InfinispanRemoteClient.java @@ -1,128 +1,139 @@ -package com.yahoo.ycsb.db; +/** + * Copyright (c) 2015-2016 YCSB contributors. All rights reserved. + * <p> + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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. + */ -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.Vector; +package com.yahoo.ycsb.db; +import com.yahoo.ycsb.*; import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.util.logging.Log; import org.infinispan.util.logging.LogFactory; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.StringByteIterator; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.Vector; /** * This is a client implementation for Infinispan 5.x in client-server mode. - * - * @author mylesjao - * */ public class InfinispanRemoteClient extends DB { - private RemoteCacheManager remoteIspnManager; - - private String cacheName = null; - - private static final Log logger = LogFactory.getLog(InfinispanRemoteClient.class); - - public InfinispanRemoteClient() { - - } - - @Override - public void init() throws DBException { - remoteIspnManager = RemoteCacheManagerHolder.getInstance(getProperties()); - cacheName = getProperties().getProperty("cache"); - } - - @Override - public void cleanup() { - remoteIspnManager.stop(); - remoteIspnManager = null; - } - - @Override - public int insert(String table, String recordKey, HashMap<String, ByteIterator> values) { - String compositKey = createKey(table, recordKey); - Map<String, String> stringValues = new HashMap<String,String>(); - StringByteIterator.putAllAsStrings(stringValues, values); - try { - cache().put(compositKey, stringValues); - return Status.OK; - } catch (Exception e) { - return Status.ERROR; - } - } - - @Override - public int read(String table, String recordKey, Set<String> fields, HashMap<String, ByteIterator> result) { - String compositKey = createKey(table, recordKey); - try { - Map<String, String> values = cache().get(compositKey); - - if(values == null || values.isEmpty()){ - return Status.NOT_FOUND; - } - - if(fields == null){ //get all field/value pairs - StringByteIterator.putAllAsByteIterators(result, values); - }else{ - for(String field: fields){ - String value = values.get(field); - if(value != null){ - result.put(field, new StringByteIterator(value) ); - } - } - } - - return Status.OK; - } catch (Exception e) { - return Status.ERROR; - } - } - - @Override - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - logger.warn("Infinispan does not support scan semantics"); - return Status.NOT_SUPPORT; - } - - @Override - public int update(String table, String recordKey, HashMap<String, ByteIterator> values) { - String compositKey = createKey(table, recordKey); - try { - Map<String, String> stringValues = new HashMap<String, String>(); - StringByteIterator.putAllAsStrings(stringValues, values); - cache().put(compositKey, stringValues); - return Status.OK; - } catch (Exception e) { - return Status.ERROR; + private static final Log LOGGER = LogFactory.getLog(InfinispanRemoteClient.class); + + private RemoteCacheManager remoteIspnManager; + private String cacheName = null; + + @Override + public void init() throws DBException { + remoteIspnManager = RemoteCacheManagerHolder.getInstance(getProperties()); + cacheName = getProperties().getProperty("cache"); + } + + @Override + public void cleanup() { + remoteIspnManager.stop(); + remoteIspnManager = null; + } + + @Override + public Status insert(String table, String recordKey, HashMap<String, ByteIterator> values) { + String compositKey = createKey(table, recordKey); + Map<String, String> stringValues = new HashMap<>(); + StringByteIterator.putAllAsStrings(stringValues, values); + try { + cache().put(compositKey, stringValues); + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + @Override + public Status read(String table, String recordKey, Set<String> fields, HashMap<String, ByteIterator> result) { + String compositKey = createKey(table, recordKey); + try { + Map<String, String> values = cache().get(compositKey); + + if (values == null || values.isEmpty()) { + return Status.NOT_FOUND; } - } - @Override - public int delete(String table, String recordKey) { - String compositKey = createKey(table, recordKey); - try { - cache().remove(compositKey); - return Status.OK; - } catch (Exception e) { - return Status.ERROR; + + if (fields == null) { //get all field/value pairs + StringByteIterator.putAllAsByteIterators(result, values); + } else { + for (String field : fields) { + String value = values.get(field); + if (value != null) { + result.put(field, new StringByteIterator(value)); + } + } } - } - - private RemoteCache<String, Map<String,String>> cache(){ - if(this.cacheName != null){ - return remoteIspnManager.getCache(cacheName); - }else{ - return remoteIspnManager.getCache(); - } - } - - private String createKey(String table, String recordKey){ - return table + "-" + recordKey; - } + + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + @Override + public Status scan(String table, String startkey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { + LOGGER.warn("Infinispan does not support scan semantics"); + return Status.NOT_IMPLEMENTED; + } + + @Override + public Status update(String table, String recordKey, HashMap<String, ByteIterator> values) { + String compositKey = createKey(table, recordKey); + try { + Map<String, String> stringValues = new HashMap<>(); + StringByteIterator.putAllAsStrings(stringValues, values); + cache().put(compositKey, stringValues); + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + @Override + public Status delete(String table, String recordKey) { + String compositKey = createKey(table, recordKey); + try { + cache().remove(compositKey); + return Status.OK; + } catch (Exception e) { + LOGGER.error(e); + return Status.ERROR; + } + } + + private RemoteCache<String, Map<String, String>> cache() { + if (this.cacheName != null) { + return remoteIspnManager.getCache(cacheName); + } else { + return remoteIspnManager.getCache(); + } + } + + private String createKey(String table, String recordKey) { + return table + "-" + recordKey; + } } diff --git a/infinispan/src/main/java/com/yahoo/ycsb/db/RemoteCacheManagerHolder.java b/infinispan/src/main/java/com/yahoo/ycsb/db/RemoteCacheManagerHolder.java index ffdc9371b4fda49d16d8d5be947d2857d2d772af..aea795e00f2c020039cd0b23811d536400856d25 100644 --- a/infinispan/src/main/java/com/yahoo/ycsb/db/RemoteCacheManagerHolder.java +++ b/infinispan/src/main/java/com/yahoo/ycsb/db/RemoteCacheManagerHolder.java @@ -1,25 +1,47 @@ +/** + * Copyright (c) 2015-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. + */ + package com.yahoo.ycsb.db; import java.util.Properties; import org.infinispan.client.hotrod.RemoteCacheManager; -public class RemoteCacheManagerHolder { - - private static volatile RemoteCacheManager cacheManager = null; - - private RemoteCacheManagerHolder() {} - - public static RemoteCacheManager getInstance(Properties props){ - RemoteCacheManager result = cacheManager; - if(result == null){ - synchronized (RemoteCacheManagerHolder.class) { - result = cacheManager; - if (result == null) { - cacheManager = result = new RemoteCacheManager(props); - } - } - } - return result; - } +/** + * Utility class to ensure only a single RemoteCacheManager is created. + */ +final class RemoteCacheManagerHolder { + + private static volatile RemoteCacheManager cacheManager = null; + + private RemoteCacheManagerHolder() { + } + + static RemoteCacheManager getInstance(Properties props) { + RemoteCacheManager result = cacheManager; + if (result == null) { + synchronized (RemoteCacheManagerHolder.class) { + result = cacheManager; + if (result == null) { + result = new RemoteCacheManager(props); + cacheManager = new RemoteCacheManager(props); + } + } + } + return result; + } } diff --git a/infinispan/src/main/java/com/yahoo/ycsb/db/Status.java b/infinispan/src/main/java/com/yahoo/ycsb/db/Status.java deleted file mode 100644 index 661dc72376e9a27ab41adeaae680ef7a15f289e2..0000000000000000000000000000000000000000 --- a/infinispan/src/main/java/com/yahoo/ycsb/db/Status.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.yahoo.ycsb.db; - -public class Status { - public static final int OK = 0; - public static final int ERROR = 1; - public static final int NOT_FOUND = 2; - public static final int CONFLICT = 3; - public static final int NOT_SUPPORT = 4; -} diff --git a/infinispan/src/main/java/com/yahoo/ycsb/db/package-info.java b/infinispan/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..01231c0248e67601251217039dbec0b39d4e5179 --- /dev/null +++ b/infinispan/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015-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. + */ + +/** + * The YCSB binding for <a href="http://infinispan.org/">Infinispan</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/jdbc/README.md b/jdbc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f74ff54f019a1d576205463ef97c4b4a7cf12688 --- /dev/null +++ b/jdbc/README.md @@ -0,0 +1,106 @@ +<!-- +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. +--> + +# JDBC Driver for YCSB +This driver enables YCSB to work with databases accessible via the JDBC protocol. + +## Getting Started +### 1. Start your database +This driver will connect to databases that use the JDBC protocol, please refer to your databases documentation on information on how to install, configure and start your system. + +### 2. Set up YCSB +You can clone the YCSB project and compile it to stay up to date with the latest changes. Or you can just download the latest release and unpack it. Either way, instructions for doing so can be found here: https://github.com/brianfrankcooper/YCSB. + +### 3. Configure your database and table. +You can name your database what ever you want, you will need to provide the database name in the JDBC connection string. + +You can name your table whatever you like also, but it needs to be specified using the YCSB core properties, the default is to just use 'usertable' as the table name. + +The expected table schema will look similar to the following, syntactical differences may exist with your specific database: + +```sql +CREATE TABLE usertable ( + YCSB_KEY VARCHAR(255) PRIMARY KEY, + FIELD0 TEXT, FIELD1 TEXT, + FIELD2 TEXT, FIELD3 TEXT, + FIELD4 TEXT, FIELD5 TEXT, + FIELD6 TEXT, FIELD7 TEXT, + FIELD8 TEXT, FIELD9 TEXT +); +``` + +Key take aways: + +* The primary key field needs to be named YCSB_KEY +* The other fields need to be prefixed with FIELD and count up starting from 1 +* Add the same number of FIELDs as you specify in the YCSB core properties, default is 10. +* The type of the fields is not so important as long as they can accept strings of the length that you specify in the YCSB core properties, default is 100. + +#### JdbcDBCreateTable Utility +YCSB has a utility to help create your SQL table. NOTE: It does not support all databases flavors, if it does not work for you, you will have to create your table manually with the schema given above. An example usage of the utility: + +```sh +java -cp YCSB_HOME/jdbc-binding/lib/jdbc-binding-0.4.0.jar:mysql-connector-java-5.1.37-bin.jar com.yahoo.ycsb.db.JdbcDBCreateTable -P testworkload -P db.properties -n usertable +``` + +Hint: you need to include your Driver jar in the classpath as well as specify your loading options via a workload file, JDBC connection information, and a table name with ```-n```. + +Simply executing the JdbcDBCreateTable class without any other parameters will print out usage information. + +### 4. Configure YCSB connection properties +You need to set the following connection configurations: + +```sh +db.driver=com.mysql.jdbc.Driver +db.url=jdbc:mysql://127.0.0.1:3306/ycsb +db.user=admin +db.passwd=admin +``` + +Be sure to use your driver class, a valid JDBC connection string, and credentials to your database. + +You can add these to your workload configuration or a separate properties file and specify it with ```-P``` or you can add the properties individually to your ycsb command with ```-p```. + +### 5. Add your JDBC Driver to the classpath +There are several ways to do this, but a couple easy methods are to put a copy of your Driver jar in ```YCSB_HOME/jdbc-binding/lib/``` or just specify the path to your Driver jar with ```-cp``` in your ycsb command. + +### 6. Running a workload +Before you can actually run the workload, you need to "load" the data first. + +```sh +bin/ycsb load jdbc -P workloads/workloada -P db.properties -cp mysql-connector-java.jar +``` + +Then, you can run the workload: + +```sh +bin/ycsb run jdbc -P workloads/workloada -P db.properties -cp mysql-connector-java.jar +``` + +## Configuration Properties + +```sh +db.driver=com.mysql.jdbc.Driver # The JDBC driver class to use. +db.url=jdbc:mysql://127.0.0.1:3306/ycsb # The Database connection URL. +db.user=admin # User name for the connection. +db.passwd=admin # Password for the connection. +db.batchsize=1000 # The batch size for doing batched inserts. Defaults to 0. Set to >0 to use batching. +jdbc.fetchsize=10 # The JDBC fetch size hinted to the driver. +jdbc.autocommit=true # The JDBC connection auto-commit property for the driver. +``` + +Please refer to https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties for all other YCSB core properties. diff --git a/jdbc/pom.xml b/jdbc/pom.xml index 8c7e65d0fbd0e53297403573df78d477f7c18930..fad308f10923cc49b9f9bf59faa12df50fd880ef 100644 --- a/jdbc/pom.xml +++ b/jdbc/pom.xml @@ -1,10 +1,27 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> @@ -24,5 +41,17 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <version>2.3.3</version> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/jdbc/src/main/conf/db.properties b/jdbc/src/main/conf/db.properties index dac28e236d9270dacb2b6ecf5b6b59b7f2f8a4ac..81849a6320ec69ea0847c6100a8a3c3da702f587 100644 --- a/jdbc/src/main/conf/db.properties +++ b/jdbc/src/main/conf/db.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # Properties file that contains database connection information. jdbc.driver=org.h2.Driver diff --git a/jdbc/src/main/conf/h2.properties b/jdbc/src/main/conf/h2.properties index c985d57bc4c329971764bff1906e30d799853611..d698edec43f5d952b73086b62490f1991916a414 100644 --- a/jdbc/src/main/conf/h2.properties +++ b/jdbc/src/main/conf/h2.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # Properties file that contains database connection information. jdbc.driver=org.h2.Driver diff --git a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCli.java b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCli.java index d736eaf85f63dbec8e95dee4b45300fb7bdff363..fc3b67be09edec624b0bf2526791dcdb71cefc0c 100644 --- a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCli.java +++ b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCli.java @@ -1,17 +1,17 @@ /** - * Copyright (c) 2010 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 + * Copyright (c) 2010 - 2016 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. */ package com.yahoo.ycsb.db; @@ -29,32 +29,30 @@ import java.util.Properties; * Execute a JDBC command line. * * @author sudipto - * */ -public class JdbcDBCli implements JdbcDBClientConstants { - +public final class JdbcDBCli { + private static void usageMessage() { System.out.println("JdbcCli. Options:"); System.out.println(" -p key=value properties defined."); System.out.println(" -P location of the properties file to load."); System.out.println(" -c SQL command to execute."); } - - private static void executeCommand(Properties props, String sql) - throws SQLException { - String driver = props.getProperty(DRIVER_CLASS); - String username = props.getProperty(CONNECTION_USER); - String password = props.getProperty(CONNECTION_PASSWD, ""); - String url = props.getProperty(CONNECTION_URL); + + private static void executeCommand(Properties props, String sql) throws SQLException { + String driver = props.getProperty(JdbcDBClient.DRIVER_CLASS); + String username = props.getProperty(JdbcDBClient.CONNECTION_USER); + String password = props.getProperty(JdbcDBClient.CONNECTION_PASSWD, ""); + String url = props.getProperty(JdbcDBClient.CONNECTION_URL); if (driver == null || username == null || url == null) { throw new SQLException("Missing connection information."); } - + Connection conn = null; - + try { Class.forName(driver); - + conn = DriverManager.getConnection(url, username, password); Statement stmt = conn.createStatement(); stmt.execute(sql); @@ -73,12 +71,12 @@ public class JdbcDBCli implements JdbcDBClientConstants { * @param args */ public static void main(String[] args) { - + if (args.length == 0) { usageMessage(); System.exit(0); } - + Properties props = new Properties(); Properties fileprops = new Properties(); String sql = null; @@ -105,8 +103,7 @@ public class JdbcDBCli implements JdbcDBClientConstants { // Issue #5 - remove call to stringPropertyNames to make compilable // under Java 1.5 - for (Enumeration<?> e = myfileprops.propertyNames(); e - .hasMoreElements();) { + for (Enumeration<?> e = myfileprops.propertyNames(); e.hasMoreElements();) { String prop = (String) e.nextElement(); fileprops.setProperty(prop, myfileprops.getProperty(prop)); @@ -160,13 +157,13 @@ public class JdbcDBCli implements JdbcDBClientConstants { fileprops.setProperty(prop, props.getProperty(prop)); } - + if (sql == null) { System.err.println("Missing command."); usageMessage(); System.exit(1); } - + try { executeCommand(fileprops, sql); } catch (SQLException e) { @@ -175,4 +172,10 @@ public class JdbcDBCli implements JdbcDBClientConstants { } } + /** + * Hidden constructor. + */ + private JdbcDBCli() { + super(); + } } diff --git a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java index c800ff0ae07cb3b5e8a17011b5334ead46138b32..80dd338ef221361bb918c44e21910ec934bd13bd 100644 --- a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java +++ b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBClient.java @@ -1,25 +1,25 @@ /** - * Copyright (c) 2010 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. + * Copyright (c) 2010 - 2016 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. */ - package com.yahoo.ycsb.db; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; import java.sql.*; @@ -28,54 +28,101 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** - * A class that wraps a JDBC compliant database to allow it to be interfaced with YCSB. - * This class extends {@link DB} and implements the database interface used by YCSB client. - * - * <br> Each client will have its own instance of this class. This client is - * not thread safe. - * - * <br> This interface expects a schema <key> <field1> <field2> <field3> ... - * All attributes are of type VARCHAR. All accesses are through the primary key. Therefore, - * only one index on the primary key is needed. - * - * <p> The following options must be passed when using this database client. - * - * <ul> - * <li><b>db.driver</b> The JDBC driver class to use.</li> - * <li><b>db.url</b> The Database connection URL.</li> - * <li><b>db.user</b> User name for the connection.</li> - * <li><b>db.passwd</b> Password for the connection.</li> - * </ul> - * - * @author sudipto + * A class that wraps a JDBC compliant database to allow it to be interfaced + * with YCSB. This class extends {@link DB} and implements the database + * interface used by YCSB client. * + * <br> + * Each client will have its own instance of this class. This client is not + * thread safe. + * + * <br> + * This interface expects a schema <key> <field1> <field2> <field3> ... All + * attributes are of type VARCHAR. All accesses are through the primary key. + * Therefore, only one index on the primary key is needed. */ -public class JdbcDBClient extends DB implements JdbcDBClientConstants { - +public class JdbcDBClient extends DB { + + /** The class to use as the jdbc driver. */ + public static final String DRIVER_CLASS = "db.driver"; + + /** The URL to connect to the database. */ + public static final String CONNECTION_URL = "db.url"; + + /** The user name to use to connect to the database. */ + public static final String CONNECTION_USER = "db.user"; + + /** The password to use for establishing the connection. */ + public static final String CONNECTION_PASSWD = "db.passwd"; + + /** The batch size for batched inserts. Set to >0 to use batching */ + public static final String DB_BATCH_SIZE = "db.batchsize"; + + /** The JDBC fetch size hinted to the driver. */ + public static final String JDBC_FETCH_SIZE = "jdbc.fetchsize"; + + /** The JDBC connection auto-commit property for the driver. */ + public static final String JDBC_AUTO_COMMIT = "jdbc.autocommit"; + + /** The name of the property for the number of fields in a record. */ + public static final String FIELD_COUNT_PROPERTY = "fieldcount"; + + /** Default number of fields in a record. */ + public static final String FIELD_COUNT_PROPERTY_DEFAULT = "10"; + + /** Representing a NULL value. */ + public static final String NULL_VALUE = "NULL"; + + /** The primary key in the user table. */ + public static final String PRIMARY_KEY = "YCSB_KEY"; + + /** The field name prefix in the table. */ + public static final String COLUMN_PREFIX = "FIELD"; + private ArrayList<Connection> conns; private boolean initialized = false; private Properties props; - private Integer jdbcFetchSize; + private int jdbcFetchSize; + private int batchSize; private static final String DEFAULT_PROP = ""; private ConcurrentMap<StatementType, PreparedStatement> cachedStatements; - + private long numRowsInBatch = 0; + + /** + * Ordered field information for insert and update statements. + */ + private static class OrderedFieldInfo { + private String fieldKeys; + private List<String> fieldValues; + + OrderedFieldInfo(String fieldKeys, List<String> fieldValues) { + this.fieldKeys = fieldKeys; + this.fieldValues = fieldValues; + } + + String getFieldKeys() { + return fieldKeys; + } + + List<String> getFieldValues() { + return fieldValues; + } + } + /** * The statement type for the prepared statements. */ private static class StatementType { - + enum Type { - INSERT(1), - DELETE(2), - READ(3), - UPDATE(4), - SCAN(5), - ; - int internalType; + INSERT(1), DELETE(2), READ(3), UPDATE(4), SCAN(5); + + private final int internalType; + private Type(int type) { internalType = type; } - + int getHashCode() { final int prime = 31; int result = 1; @@ -83,17 +130,19 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants { return result; } } - - Type type; - int shardIndex; - int numFields; - String tableName; - - StatementType(Type type, String tableName, int numFields, int _shardIndex) { + + private Type type; + private int shardIndex; + private int numFields; + private String tableName; + private String fieldString; + + StatementType(Type type, String tableName, int numFields, String fieldString, int shardIndex) { this.type = type; this.tableName = tableName; this.numFields = numFields; - this.shardIndex = _shardIndex; + this.fieldString = fieldString; + this.shardIndex = shardIndex; } @Override @@ -101,229 +150,259 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants { final int prime = 31; int result = 1; result = prime * result + numFields + 100 * shardIndex; - result = prime * result - + ((tableName == null) ? 0 : tableName.hashCode()); + result = prime * result + ((tableName == null) ? 0 : tableName.hashCode()); result = prime * result + ((type == null) ? 0 : type.getHashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } StatementType other = (StatementType) obj; - if (numFields != other.numFields) + if (numFields != other.numFields) { return false; - if (shardIndex != other.shardIndex) + } + if (shardIndex != other.shardIndex) { return false; + } if (tableName == null) { - if (other.tableName != null) + if (other.tableName != null) { return false; - } else if (!tableName.equals(other.tableName)) + } + } else if (!tableName.equals(other.tableName)) { + return false; + } + if (type != other.type) { return false; - if (type != other.type) + } + if (!fieldString.equals(other.fieldString)) { return false; + } return true; } } - /** - * For the given key, returns what shard contains data for this key - * - * @param key Data key to do operation on - * @return Shard index - */ - private int getShardIndexByKey(String key) { - int ret = Math.abs(key.hashCode()) % conns.size(); - //System.out.println(conns.size() + ": Shard instance for "+ key + " (hash " + key.hashCode()+ " ) " + " is " + ret); - return ret; - } + /** + * For the given key, returns what shard contains data for this key. + * + * @param key Data key to do operation on + * @return Shard index + */ + private int getShardIndexByKey(String key) { + int ret = Math.abs(key.hashCode()) % conns.size(); + return ret; + } + + /** + * For the given key, returns Connection object that holds connection to the + * shard that contains this key. + * + * @param key Data key to get information for + * @return Connection object + */ + private Connection getShardConnectionByKey(String key) { + return conns.get(getShardIndexByKey(key)); + } - /** - * For the given key, returns Connection object that holds connection - * to the shard that contains this key - * - * @param key Data key to get information for - * @return Connection object - */ - private Connection getShardConnectionByKey(String key) { - return conns.get(getShardIndexByKey(key)); + private void cleanupAllConnections() throws SQLException { + for (Connection conn : conns) { + conn.close(); } + } - private void cleanupAllConnections() throws SQLException { - for(Connection conn: conns) { - conn.close(); - } + /** Returns parsed int value from the properties if set, otherwise returns -1. */ + private static int getIntProperty(Properties props, String key) throws DBException { + String valueStr = props.getProperty(key); + if (valueStr != null) { + try { + return Integer.parseInt(valueStr); + } catch (NumberFormatException nfe) { + System.err.println("Invalid " + key + " specified: " + valueStr); + throw new DBException(nfe); + } } - - /** - * Initialize the database connection and set it up for sending requests to the database. - * This must be called once per client. - * @throws - */ + return -1; + } + @Override - public void init() throws DBException { - if (initialized) { - System.err.println("Client connection already initialized."); - return; - } - props = getProperties(); - String urls = props.getProperty(CONNECTION_URL, DEFAULT_PROP); - String user = props.getProperty(CONNECTION_USER, DEFAULT_PROP); - String passwd = props.getProperty(CONNECTION_PASSWD, DEFAULT_PROP); - String driver = props.getProperty(DRIVER_CLASS); - - String jdbcFetchSizeStr = props.getProperty(JDBC_FETCH_SIZE); - if (jdbcFetchSizeStr != null) { - try { - this.jdbcFetchSize = Integer.parseInt(jdbcFetchSizeStr); - } catch (NumberFormatException nfe) { - System.err.println("Invalid JDBC fetch size specified: " + jdbcFetchSizeStr); - throw new DBException(nfe); - } + public void init() throws DBException { + if (initialized) { + System.err.println("Client connection already initialized."); + return; + } + props = getProperties(); + String urls = props.getProperty(CONNECTION_URL, DEFAULT_PROP); + String user = props.getProperty(CONNECTION_USER, DEFAULT_PROP); + String passwd = props.getProperty(CONNECTION_PASSWD, DEFAULT_PROP); + String driver = props.getProperty(DRIVER_CLASS); + + this.jdbcFetchSize = getIntProperty(props, JDBC_FETCH_SIZE); + this.batchSize = getIntProperty(props, DB_BATCH_SIZE); + + String autoCommitStr = props.getProperty(JDBC_AUTO_COMMIT, Boolean.TRUE.toString()); + Boolean autoCommit = Boolean.parseBoolean(autoCommitStr); + + try { + if (driver != null) { + Class.forName(driver); } + int shardCount = 0; + conns = new ArrayList<Connection>(3); + for (String url : urls.split(",")) { + System.out.println("Adding shard node URL: " + url); + Connection conn = DriverManager.getConnection(url, user, passwd); - String autoCommitStr = props.getProperty(JDBC_AUTO_COMMIT, Boolean.TRUE.toString()); - Boolean autoCommit = Boolean.parseBoolean(autoCommitStr); + // Since there is no explicit commit method in the DB interface, all + // operations should auto commit, except when explicitly told not to + // (this is necessary in cases such as for PostgreSQL when running a + // scan workload with fetchSize) + conn.setAutoCommit(autoCommit); - try { - if (driver != null) { - Class.forName(driver); - } - int shardCount = 0; - conns = new ArrayList<Connection>(3); - for (String url: urls.split(",")) { - System.out.println("Adding shard node URL: " + url); - Connection conn = DriverManager.getConnection(url, user, passwd); - - // Since there is no explicit commit method in the DB interface, all - // operations should auto commit, except when explicitly told not to - // (this is necessary in cases such as for PostgreSQL when running a - // scan workload with fetchSize) - conn.setAutoCommit(autoCommit); - - shardCount++; - conns.add(conn); - } + shardCount++; + conns.add(conn); + } - System.out.println("Using " + shardCount + " shards"); + System.out.println("Using shards: " + shardCount + ", batchSize:" + batchSize + ", fetchSize: " + jdbcFetchSize); - cachedStatements = new ConcurrentHashMap<StatementType, PreparedStatement>(); - } catch (ClassNotFoundException e) { - System.err.println("Error in initializing the JDBS driver: " + e); - throw new DBException(e); - } catch (SQLException e) { - System.err.println("Error in database operation: " + e); + cachedStatements = new ConcurrentHashMap<StatementType, PreparedStatement>(); + } catch (ClassNotFoundException e) { + System.err.println("Error in initializing the JDBS driver: " + e); + throw new DBException(e); + } catch (SQLException e) { + System.err.println("Error in database operation: " + e); throw new DBException(e); } catch (NumberFormatException e) { System.err.println("Invalid value for fieldcount property. " + e); throw new DBException(e); } - initialized = true; - } - + initialized = true; + } + @Override - public void cleanup() throws DBException { - try { + public void cleanup() throws DBException { + if (batchSize > 0) { + try { + // commit un-finished batches + for (PreparedStatement st : cachedStatements.values()) { + if (!st.getConnection().isClosed() && !st.isClosed() && (numRowsInBatch % batchSize != 0)) { + st.executeBatch(); + } + } + } catch (SQLException e) { + System.err.println("Error in cleanup execution. " + e); + throw new DBException(e); + } + } + + try { cleanupAllConnections(); } catch (SQLException e) { System.err.println("Error in closing the connection. " + e); throw new DBException(e); } - } - - private PreparedStatement createAndCacheInsertStatement(StatementType insertType, String key) - throws SQLException { - StringBuilder insert = new StringBuilder("INSERT INTO "); - insert.append(insertType.tableName); - insert.append(" VALUES(?"); + } + + private PreparedStatement createAndCacheInsertStatement(StatementType insertType, String key) throws SQLException { + StringBuilder insert = new StringBuilder("INSERT INTO "); + insert.append(insertType.tableName); + insert.append(" (" + PRIMARY_KEY + "," + insertType.fieldString + ")"); + insert.append(" VALUES(?"); for (int i = 0; i < insertType.numFields; i++) { insert.append(",?"); } - insert.append(");"); + insert.append(")"); PreparedStatement insertStatement = getShardConnectionByKey(key).prepareStatement(insert.toString()); PreparedStatement stmt = cachedStatements.putIfAbsent(insertType, insertStatement); - if (stmt == null) return insertStatement; - else return stmt; - } - - private PreparedStatement createAndCacheReadStatement(StatementType readType, String key) - throws SQLException { + if (stmt == null) { + return insertStatement; + } + return stmt; + } + + private PreparedStatement createAndCacheReadStatement(StatementType readType, String key) throws SQLException { StringBuilder read = new StringBuilder("SELECT * FROM "); read.append(readType.tableName); read.append(" WHERE "); read.append(PRIMARY_KEY); read.append(" = "); - read.append("?;"); + read.append("?"); PreparedStatement readStatement = getShardConnectionByKey(key).prepareStatement(read.toString()); PreparedStatement stmt = cachedStatements.putIfAbsent(readType, readStatement); - if (stmt == null) return readStatement; - else return stmt; + if (stmt == null) { + return readStatement; + } + return stmt; } - - private PreparedStatement createAndCacheDeleteStatement(StatementType deleteType, String key) - throws SQLException { + + private PreparedStatement createAndCacheDeleteStatement(StatementType deleteType, String key) throws SQLException { StringBuilder delete = new StringBuilder("DELETE FROM "); delete.append(deleteType.tableName); delete.append(" WHERE "); delete.append(PRIMARY_KEY); - delete.append(" = ?;"); + delete.append(" = ?"); PreparedStatement deleteStatement = getShardConnectionByKey(key).prepareStatement(delete.toString()); PreparedStatement stmt = cachedStatements.putIfAbsent(deleteType, deleteStatement); - if (stmt == null) return deleteStatement; - else return stmt; + if (stmt == null) { + return deleteStatement; + } + return stmt; } - - private PreparedStatement createAndCacheUpdateStatement(StatementType updateType, String key) - throws SQLException { + + private PreparedStatement createAndCacheUpdateStatement(StatementType updateType, String key) throws SQLException { + String[] fieldKeys = updateType.fieldString.split(","); StringBuilder update = new StringBuilder("UPDATE "); update.append(updateType.tableName); update.append(" SET "); - for (int i = 1; i <= updateType.numFields; i++) { - update.append(COLUMN_PREFIX); - update.append(i); + for (int i = 0; i < fieldKeys.length; i++) { + update.append(fieldKeys[i]); update.append("=?"); - if (i < updateType.numFields) update.append(", "); + if (i < fieldKeys.length - 1) { + update.append(", "); + } } update.append(" WHERE "); update.append(PRIMARY_KEY); - update.append(" = ?;"); + update.append(" = ?"); PreparedStatement insertStatement = getShardConnectionByKey(key).prepareStatement(update.toString()); PreparedStatement stmt = cachedStatements.putIfAbsent(updateType, insertStatement); - if (stmt == null) return insertStatement; - else return stmt; + if (stmt == null) { + return insertStatement; + } + return stmt; } - - private PreparedStatement createAndCacheScanStatement(StatementType scanType, String key) - throws SQLException { - StringBuilder select = new StringBuilder("SELECT * FROM "); + + private PreparedStatement createAndCacheScanStatement(StatementType scanType, String key) throws SQLException { + StringBuilder select = new StringBuilder("SELECT * FROM "); select.append(scanType.tableName); select.append(" WHERE "); select.append(PRIMARY_KEY); - select.append(" >= "); - select.append("?;"); + select.append(" >= ?"); + select.append(" ORDER BY "); + select.append(PRIMARY_KEY); + select.append(" LIMIT ?"); PreparedStatement scanStatement = getShardConnectionByKey(key).prepareStatement(select.toString()); - if (this.jdbcFetchSize != null) scanStatement.setFetchSize(this.jdbcFetchSize); + if (this.jdbcFetchSize > 0) { + scanStatement.setFetchSize(this.jdbcFetchSize); + } PreparedStatement stmt = cachedStatements.putIfAbsent(scanType, scanStatement); - if (stmt == null) return scanStatement; - else return stmt; + if (stmt == null) { + return scanStatement; + } + return stmt; } - @Override - public int read(String tableName, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - if (tableName == null) { - return -1; - } - if (key == null) { - return -1; - } + @Override + public Status read(String tableName, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { - StatementType type = new StatementType(StatementType.Type.READ, tableName, 1, getShardIndexByKey(key)); + StatementType type = new StatementType(StatementType.Type.READ, tableName, 1, "", getShardIndexByKey(key)); PreparedStatement readStatement = cachedStatements.get(type); if (readStatement == null) { readStatement = createAndCacheReadStatement(type, key); @@ -332,7 +411,7 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants { ResultSet resultSet = readStatement.executeQuery(); if (!resultSet.next()) { resultSet.close(); - return 1; + return Status.NOT_FOUND; } if (result != null && fields != null) { for (String field : fields) { @@ -341,29 +420,24 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants { } } resultSet.close(); - return SUCCESS; + return Status.OK; } catch (SQLException e) { - System.err.println("Error in processing read of table " + tableName + ": "+e); - return -2; + System.err.println("Error in processing read of table " + tableName + ": " + e); + return Status.ERROR; } - } + } - @Override - public int scan(String tableName, String startKey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - if (tableName == null) { - return -1; - } - if (startKey == null) { - return -1; - } + @Override + public Status scan(String tableName, String startKey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { try { - StatementType type = new StatementType(StatementType.Type.SCAN, tableName, 1, getShardIndexByKey(startKey)); + StatementType type = new StatementType(StatementType.Type.SCAN, tableName, 1, "", getShardIndexByKey(startKey)); PreparedStatement scanStatement = cachedStatements.get(type); if (scanStatement == null) { scanStatement = createAndCacheScanStatement(type, startKey); } scanStatement.setString(1, startKey); + scanStatement.setInt(2, recordcount); ResultSet resultSet = scanStatement.executeQuery(); for (int i = 0; i < recordcount && resultSet.next(); i++) { if (result != null && fields != null) { @@ -376,93 +450,115 @@ public class JdbcDBClient extends DB implements JdbcDBClientConstants { } } resultSet.close(); - return SUCCESS; + return Status.OK; } catch (SQLException e) { System.err.println("Error in processing scan of table: " + tableName + e); - return -2; + return Status.ERROR; } - } + } - @Override - public int update(String tableName, String key, HashMap<String, ByteIterator> values) { - if (tableName == null) { - return -1; - } - if (key == null) { - return -1; - } + @Override + public Status update(String tableName, String key, HashMap<String, ByteIterator> values) { try { int numFields = values.size(); - StatementType type = new StatementType(StatementType.Type.UPDATE, tableName, numFields, getShardIndexByKey(key)); + OrderedFieldInfo fieldInfo = getFieldInfo(values); + StatementType type = new StatementType(StatementType.Type.UPDATE, tableName, + numFields, fieldInfo.getFieldKeys(), getShardIndexByKey(key)); PreparedStatement updateStatement = cachedStatements.get(type); if (updateStatement == null) { updateStatement = createAndCacheUpdateStatement(type, key); } int index = 1; - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - updateStatement.setString(index++, entry.getValue().toString()); + for (String value: fieldInfo.getFieldValues()) { + updateStatement.setString(index++, value); } updateStatement.setString(index, key); int result = updateStatement.executeUpdate(); - if (result == 1) return SUCCESS; - else return 1; + if (result == 1) { + return Status.OK; + } + return Status.UNEXPECTED_STATE; } catch (SQLException e) { System.err.println("Error in processing update to table: " + tableName + e); - return -1; + return Status.ERROR; } - } - - @Override - public int insert(String tableName, String key, HashMap<String, ByteIterator> values) { - if (tableName == null) { - return -1; - } - if (key == null) { - return -1; - } - try { - int numFields = values.size(); - StatementType type = new StatementType(StatementType.Type.INSERT, tableName, numFields, getShardIndexByKey(key)); - PreparedStatement insertStatement = cachedStatements.get(type); - if (insertStatement == null) { - insertStatement = createAndCacheInsertStatement(type, key); - } + } + + @Override + public Status insert(String tableName, String key, HashMap<String, ByteIterator> values) { + try { + int numFields = values.size(); + OrderedFieldInfo fieldInfo = getFieldInfo(values); + StatementType type = new StatementType(StatementType.Type.INSERT, tableName, + numFields, fieldInfo.getFieldKeys(), getShardIndexByKey(key)); + PreparedStatement insertStatement = cachedStatements.get(type); + if (insertStatement == null) { + insertStatement = createAndCacheInsertStatement(type, key); + } insertStatement.setString(1, key); int index = 2; - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - String field = entry.getValue().toString(); - insertStatement.setString(index++, field); + for (String value: fieldInfo.getFieldValues()) { + insertStatement.setString(index++, value); + } + int result; + if (batchSize > 0) { + insertStatement.addBatch(); + if (++numRowsInBatch % batchSize == 0) { + int[] results = insertStatement.executeBatch(); + for (int r : results) { + if (r != 1) { + return Status.ERROR; + } + } + return Status.OK; + } + return Status.BATCHED_OK; + } else { + result = insertStatement.executeUpdate(); } - int result = insertStatement.executeUpdate(); - if (result == 1) return SUCCESS; - else return 1; + if (result == 1) { + return Status.OK; + } + return Status.UNEXPECTED_STATE; } catch (SQLException e) { System.err.println("Error in processing insert to table: " + tableName + e); - return -1; + return Status.ERROR; } - } + } - @Override - public int delete(String tableName, String key) { - if (tableName == null) { - return -1; - } - if (key == null) { - return -1; - } + @Override + public Status delete(String tableName, String key) { try { - StatementType type = new StatementType(StatementType.Type.DELETE, tableName, 1, getShardIndexByKey(key)); + StatementType type = new StatementType(StatementType.Type.DELETE, tableName, 1, "", getShardIndexByKey(key)); PreparedStatement deleteStatement = cachedStatements.get(type); if (deleteStatement == null) { deleteStatement = createAndCacheDeleteStatement(type, key); } deleteStatement.setString(1, key); int result = deleteStatement.executeUpdate(); - if (result == 1) return SUCCESS; - else return 1; + if (result == 1) { + return Status.OK; + } + return Status.UNEXPECTED_STATE; } catch (SQLException e) { System.err.println("Error in processing delete to table: " + tableName + e); - return -1; + return Status.ERROR; + } + } + + private OrderedFieldInfo getFieldInfo(HashMap<String, ByteIterator> values) { + String fieldKeys = ""; + List<String> fieldValues = new ArrayList(); + int count = 0; + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + fieldKeys += entry.getKey(); + if (count < values.size() - 1) { + fieldKeys += ","; + } + fieldValues.add(count, entry.getValue().toString()); + count++; } - } + + return new OrderedFieldInfo(fieldKeys, fieldValues); + } } diff --git a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCreateTable.java b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCreateTable.java index 7416d05a4f1abb5cf8cf6c09f47561818da862f8..8dfb26ddefd4eb301e9e34b35ed059021b852758 100644 --- a/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCreateTable.java +++ b/jdbc/src/main/java/com/yahoo/ycsb/db/JdbcDBCreateTable.java @@ -1,17 +1,17 @@ /** - * Copyright (c) 2010 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 + * Copyright (c) 2010 - 2016 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. */ package com.yahoo.ycsb.db; @@ -29,9 +29,8 @@ import java.util.Properties; * Utility class to create the table to be used by the benchmark. * * @author sudipto - * */ -public class JdbcDBCreateTable implements JdbcDBClientConstants { +public final class JdbcDBCreateTable { private static void usageMessage() { System.out.println("Create Table Client. Options:"); @@ -40,47 +39,46 @@ public class JdbcDBCreateTable implements JdbcDBClientConstants { System.out.println(" -n name of the table."); System.out.println(" -f number of fields (default 10)."); } - - private static void createTable(Properties props, String tablename) - throws SQLException { - String driver = props.getProperty(DRIVER_CLASS); - String username = props.getProperty(CONNECTION_USER); - String password = props.getProperty(CONNECTION_PASSWD, ""); - String url = props.getProperty(CONNECTION_URL); - int fieldcount = Integer.parseInt(props.getProperty(FIELD_COUNT_PROPERTY, - FIELD_COUNT_PROPERTY_DEFAULT)); - + + private static void createTable(Properties props, String tablename) throws SQLException { + String driver = props.getProperty(JdbcDBClient.DRIVER_CLASS); + String username = props.getProperty(JdbcDBClient.CONNECTION_USER); + String password = props.getProperty(JdbcDBClient.CONNECTION_PASSWD, ""); + String url = props.getProperty(JdbcDBClient.CONNECTION_URL); + int fieldcount = Integer.parseInt(props.getProperty(JdbcDBClient.FIELD_COUNT_PROPERTY, + JdbcDBClient.FIELD_COUNT_PROPERTY_DEFAULT)); + if (driver == null || username == null || url == null) { throw new SQLException("Missing connection information."); } - + Connection conn = null; - + try { Class.forName(driver); - + conn = DriverManager.getConnection(url, username, password); Statement stmt = conn.createStatement(); - + StringBuilder sql = new StringBuilder("DROP TABLE IF EXISTS "); sql.append(tablename); sql.append(";"); - + stmt.execute(sql.toString()); - + sql = new StringBuilder("CREATE TABLE "); sql.append(tablename); - sql.append(" (KEY VARCHAR PRIMARY KEY"); - + sql.append(" (YCSB_KEY VARCHAR PRIMARY KEY"); + for (int idx = 0; idx < fieldcount; idx++) { sql.append(", FIELD"); sql.append(idx); sql.append(" VARCHAR"); } sql.append(");"); - + stmt.execute(sql.toString()); - + System.out.println("Table " + tablename + " created.."); } catch (ClassNotFoundException e) { throw new SQLException("JDBC Driver class not found."); @@ -91,17 +89,17 @@ public class JdbcDBCreateTable implements JdbcDBClientConstants { } } } - + /** * @param args */ public static void main(String[] args) { - + if (args.length == 0) { usageMessage(); System.exit(0); } - + String tablename = null; int fieldcount = -1; Properties props = new Properties(); @@ -129,8 +127,7 @@ public class JdbcDBCreateTable implements JdbcDBClientConstants { // Issue #5 - remove call to stringPropertyNames to make compilable // under Java 1.5 - for (Enumeration<?> e = myfileprops.propertyNames(); e - .hasMoreElements();) { + for (Enumeration<?> e = myfileprops.propertyNames(); e.hasMoreElements();) { String prop = (String) e.nextElement(); fileprops.setProperty(prop, myfileprops.getProperty(prop)); @@ -199,17 +196,17 @@ public class JdbcDBCreateTable implements JdbcDBClientConstants { } props = fileprops; - + if (tablename == null) { System.err.println("table name missing."); usageMessage(); System.exit(1); } - + if (fieldcount > 0) { - props.setProperty(FIELD_COUNT_PROPERTY, String.valueOf(fieldcount)); + props.setProperty(JdbcDBClient.FIELD_COUNT_PROPERTY, String.valueOf(fieldcount)); } - + try { createTable(props, tablename); } catch (SQLException e) { @@ -217,4 +214,11 @@ public class JdbcDBCreateTable implements JdbcDBClientConstants { System.exit(1); } } + + /** + * Hidden constructor. + */ + private JdbcDBCreateTable() { + super(); + } } diff --git a/jdbc/src/main/java/com/yahoo/ycsb/db/package-info.java b/jdbc/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..993a8817efc55acde7ede7caff60857bb2397a7f --- /dev/null +++ b/jdbc/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014 - 2016, 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 stores that can be accessed via JDBC. + */ +package com.yahoo.ycsb.db; + diff --git a/jdbc/src/main/resources/sql/README b/jdbc/src/main/resources/sql/README deleted file mode 100644 index 3afd7047226914a1480e84b19a21b74153339cca..0000000000000000000000000000000000000000 --- a/jdbc/src/main/resources/sql/README +++ /dev/null @@ -1 +0,0 @@ -Contains all the SQL statements used by the JDBC client. diff --git a/jdbc/src/main/resources/sql/README.md b/jdbc/src/main/resources/sql/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ec41b86c04750354fd3e0abd93fc7d9a8c43fa0d --- /dev/null +++ b/jdbc/src/main/resources/sql/README.md @@ -0,0 +1,18 @@ +<!-- +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. +--> +Contains all the SQL statements used by the JDBC client. diff --git a/jdbc/src/main/resources/sql/create_table.mysql b/jdbc/src/main/resources/sql/create_table.mysql index 7b89e3e5b45280901ac93acbe7ff4276b174ccc8..a88a73afeec0367ae35cb1a148542cf33fddaac6 100644 --- a/jdbc/src/main/resources/sql/create_table.mysql +++ b/jdbc/src/main/resources/sql/create_table.mysql @@ -1,3 +1,18 @@ +-- 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. + -- Creates a Table. -- Drop the table if it exists; @@ -5,8 +20,8 @@ DROP TABLE IF EXISTS usertable; -- Create the user table with 5 fields. CREATE TABLE usertable(YCSB_KEY VARCHAR (255) PRIMARY KEY, - FIELD1 TEXT, FIELD2 TEXT, - FIELD3 TEXT, FIELD4 TEXT, - FIELD5 TEXT, FIELD6 TEXT, - FIELD7 TEXT, FIELD8 TEXT, - FIELD9 TEXT, FIELD10 TEXT); + FIELD0 TEXT, FIELD1 TEXT, + FIELD2 TEXT, FIELD3 TEXT, + FIELD4 TEXT, FIELD5 TEXT, + FIELD6 TEXT, FIELD7 TEXT, + FIELD8 TEXT, FIELD9 TEXT); diff --git a/jdbc/src/main/resources/sql/create_table.sql b/jdbc/src/main/resources/sql/create_table.sql index c394f26f354c2a411bdfd3e5374e578806836d78..33158accdfe0d7cffc5ca3d7c24fd417a5253db7 100644 --- a/jdbc/src/main/resources/sql/create_table.sql +++ b/jdbc/src/main/resources/sql/create_table.sql @@ -1,3 +1,18 @@ +-- 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. + -- Creates a Table. -- Drop the table if it exists; @@ -5,8 +20,8 @@ DROP TABLE IF EXISTS usertable; -- Create the user table with 5 fields. CREATE TABLE usertable(YCSB_KEY VARCHAR PRIMARY KEY, - FIELD1 VARCHAR, FIELD2 VARCHAR, - FIELD3 VARCHAR, FIELD4 VARCHAR, - FIELD5 VARCHAR, FIELD6 VARCHAR, - FIELD7 VARCHAR, FIELD8 VARCHAR, - FIELD9 VARCHAR, FIELD10 VARCHAR); + FIELD0 VARCHAR, FIELD1 VARCHAR, + FIELD2 VARCHAR, FIELD3 VARCHAR, + FIELD4 VARCHAR, FIELD5 VARCHAR, + FIELD6 VARCHAR, FIELD7 VARCHAR, + FIELD8 VARCHAR, FIELD9 VARCHAR); diff --git a/jdbc/src/test/java/com/yahoo/ycsb/db/JdbcDBClientTest.java b/jdbc/src/test/java/com/yahoo/ycsb/db/JdbcDBClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6317f483c3f63aecf9cbf0ab216c23d473db2469 --- /dev/null +++ b/jdbc/src/test/java/com/yahoo/ycsb/db/JdbcDBClientTest.java @@ -0,0 +1,388 @@ +/** + * Copyright (c) 2015 - 2016 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. + */ + +package com.yahoo.ycsb.db; + +import static org.junit.Assert.*; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.StringByteIterator; +import org.junit.*; + +import java.sql.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Properties; +import java.util.Vector; + +public class JdbcDBClientTest { + private static final String TEST_DB_DRIVER = "org.hsqldb.jdbc.JDBCDriver"; + private static final String TEST_DB_URL = "jdbc:hsqldb:mem:ycsb"; + private static final String TEST_DB_USER = "sa"; + private static final String TABLE_NAME = "USERTABLE"; + private static final int FIELD_LENGTH = 32; + private static final String FIELD_PREFIX = "FIELD"; + private static final String KEY_PREFIX = "user"; + private static final String KEY_FIELD = "YCSB_KEY"; + private static final int NUM_FIELDS = 3; + + private static Connection jdbcConnection = null; + private static JdbcDBClient jdbcDBClient = null; + + @BeforeClass + public static void setup() { + setupWithBatch(1); + } + + public static void setupWithBatch(int batchSize) { + try { + jdbcConnection = DriverManager.getConnection(TEST_DB_URL); + jdbcDBClient = new JdbcDBClient(); + + Properties p = new Properties(); + p.setProperty(JdbcDBClient.CONNECTION_URL, TEST_DB_URL); + p.setProperty(JdbcDBClient.DRIVER_CLASS, TEST_DB_DRIVER); + p.setProperty(JdbcDBClient.CONNECTION_USER, TEST_DB_USER); + p.setProperty(JdbcDBClient.DB_BATCH_SIZE, Integer.toString(batchSize)); + + jdbcDBClient.setProperties(p); + jdbcDBClient.init(); + } catch (SQLException e) { + e.printStackTrace(); + fail("Could not create local Database"); + } catch (DBException e) { + e.printStackTrace(); + fail("Could not create JdbcDBClient instance"); + } + } + + @AfterClass + public static void teardown() { + try { + if (jdbcConnection != null) { + jdbcConnection.close(); + } + } catch (SQLException e) { + e.printStackTrace(); + } + + try { + if (jdbcDBClient != null) { + jdbcDBClient.cleanup(); + } + } catch (DBException e) { + e.printStackTrace(); + } + } + + @Before + public void prepareTest() { + try { + DatabaseMetaData metaData = jdbcConnection.getMetaData(); + ResultSet tableResults = metaData.getTables(null, null, TABLE_NAME, null); + if (tableResults.next()) { + // If the table already exists, just truncate it + jdbcConnection.prepareStatement( + String.format("TRUNCATE TABLE %s", TABLE_NAME) + ).execute(); + } else { + // If the table does not exist then create it + StringBuilder createString = new StringBuilder( + String.format("CREATE TABLE %s (%s VARCHAR(100) PRIMARY KEY", TABLE_NAME, KEY_FIELD) + ); + for (int i = 0; i < NUM_FIELDS; i++) { + createString.append( + String.format(", %s%d VARCHAR(100)", FIELD_PREFIX, i) + ); + } + createString.append(")"); + jdbcConnection.prepareStatement(createString.toString()).execute(); + } + } catch (SQLException e) { + e.printStackTrace(); + fail("Failed to prepare test"); + } + } + + /* + This is a copy of buildDeterministicValue() from core:com.yahoo.ycsb.workloads.CoreWorkload.java. + That method is neither public nor static so we need a copy. + */ + private String buildDeterministicValue(String key, String fieldkey) { + int size = FIELD_LENGTH; + StringBuilder sb = new StringBuilder(size); + sb.append(key); + sb.append(':'); + sb.append(fieldkey); + while (sb.length() < size) { + sb.append(':'); + sb.append(sb.toString().hashCode()); + } + sb.setLength(size); + + return sb.toString(); + } + + /* + Inserts a row of deterministic values for the given insertKey using the jdbcDBClient. + */ + private HashMap<String, ByteIterator> insertRow(String insertKey) { + HashMap<String, ByteIterator> insertMap = new HashMap<String, ByteIterator>(); + for (int i = 0; i < 3; i++) { + insertMap.put(FIELD_PREFIX + i, new StringByteIterator(buildDeterministicValue(insertKey, FIELD_PREFIX + i))); + } + jdbcDBClient.insert(TABLE_NAME, insertKey, insertMap); + + return insertMap; + } + + @Test + public void insertTest() { + try { + String insertKey = "user0"; + HashMap<String, ByteIterator> insertMap = insertRow(insertKey); + + ResultSet resultSet = jdbcConnection.prepareStatement( + String.format("SELECT * FROM %s", TABLE_NAME) + ).executeQuery(); + + // Check we have a result Row + assertTrue(resultSet.next()); + // Check that all the columns have expected values + assertEquals(resultSet.getString(KEY_FIELD), insertKey); + for (int i = 0; i < 3; i++) { + assertEquals(resultSet.getString(FIELD_PREFIX + i), insertMap.get(FIELD_PREFIX + i).toString()); + } + // Check that we do not have any more rows + assertFalse(resultSet.next()); + + resultSet.close(); + } catch (SQLException e) { + e.printStackTrace(); + fail("Failed insertTest"); + } + } + + @Test + public void updateTest() { + try { + String preupdateString = "preupdate"; + StringBuilder fauxInsertString = new StringBuilder( + String.format("INSERT INTO %s VALUES(?", TABLE_NAME) + ); + for (int i = 0; i < NUM_FIELDS; i++) { + fauxInsertString.append(",?"); + } + fauxInsertString.append(")"); + + PreparedStatement fauxInsertStatement = jdbcConnection.prepareStatement(fauxInsertString.toString()); + for (int i = 2; i < NUM_FIELDS + 2; i++) { + fauxInsertStatement.setString(i, preupdateString); + } + + fauxInsertStatement.setString(1, "user0"); + fauxInsertStatement.execute(); + fauxInsertStatement.setString(1, "user1"); + fauxInsertStatement.execute(); + fauxInsertStatement.setString(1, "user2"); + fauxInsertStatement.execute(); + + HashMap<String, ByteIterator> updateMap = new HashMap<String, ByteIterator>(); + for (int i = 0; i < 3; i++) { + updateMap.put(FIELD_PREFIX + i, new StringByteIterator(buildDeterministicValue("user1", FIELD_PREFIX + i))); + } + + jdbcDBClient.update(TABLE_NAME, "user1", updateMap); + + ResultSet resultSet = jdbcConnection.prepareStatement( + String.format("SELECT * FROM %s ORDER BY %s", TABLE_NAME, KEY_FIELD) + ).executeQuery(); + + // Ensure that user0 record was not changed + resultSet.next(); + assertEquals("Assert first row key is user0", resultSet.getString(KEY_FIELD), "user0"); + for (int i = 0; i < 3; i++) { + assertEquals("Assert first row fields contain preupdateString", resultSet.getString(FIELD_PREFIX + i), preupdateString); + } + + // Check that all the columns have expected values for user1 record + resultSet.next(); + assertEquals(resultSet.getString(KEY_FIELD), "user1"); + for (int i = 0; i < 3; i++) { + assertEquals(resultSet.getString(FIELD_PREFIX + i), updateMap.get(FIELD_PREFIX + i).toString()); + } + + // Ensure that user2 record was not changed + resultSet.next(); + assertEquals("Assert third row key is user2", resultSet.getString(KEY_FIELD), "user2"); + for (int i = 0; i < 3; i++) { + assertEquals("Assert third row fields contain preupdateString", resultSet.getString(FIELD_PREFIX + i), preupdateString); + } + resultSet.close(); + } catch (SQLException e) { + e.printStackTrace(); + fail("Failed updateTest"); + } + } + + @Test + public void readTest() { + String insertKey = "user0"; + HashMap<String, ByteIterator> insertMap = insertRow(insertKey); + HashSet<String> readFields = new HashSet<String>(); + HashMap<String, ByteIterator> readResultMap = new HashMap<String, ByteIterator>(); + + // Test reading a single field + readFields.add("FIELD0"); + jdbcDBClient.read(TABLE_NAME, insertKey, readFields, readResultMap); + assertEquals("Assert that result has correct number of fields", readFields.size(), readResultMap.size()); + for (String field: readFields) { + assertEquals("Assert " + field + " was read correctly", insertMap.get(field).toString(), readResultMap.get(field).toString()); + } + + readResultMap = new HashMap<String, ByteIterator>(); + + // Test reading all fields + readFields.add("FIELD1"); + readFields.add("FIELD2"); + jdbcDBClient.read(TABLE_NAME, insertKey, readFields, readResultMap); + assertEquals("Assert that result has correct number of fields", readFields.size(), readResultMap.size()); + for (String field: readFields) { + assertEquals("Assert " + field + " was read correctly", insertMap.get(field).toString(), readResultMap.get(field).toString()); + } + } + + @Test + public void deleteTest() { + try { + insertRow("user0"); + String deleteKey = "user1"; + insertRow(deleteKey); + insertRow("user2"); + + jdbcDBClient.delete(TABLE_NAME, deleteKey); + + ResultSet resultSet = jdbcConnection.prepareStatement( + String.format("SELECT * FROM %s", TABLE_NAME) + ).executeQuery(); + + int totalRows = 0; + while (resultSet.next()) { + assertNotEquals("Assert this is not the deleted row key", deleteKey, resultSet.getString(KEY_FIELD)); + totalRows++; + } + // Check we do not have a result Row + assertEquals("Assert we ended with the correct number of rows", totalRows, 2); + + resultSet.close(); + } catch (SQLException e) { + e.printStackTrace(); + fail("Failed deleteTest"); + } + } + + @Test + public void scanTest() throws SQLException { + HashMap<String, HashMap<String, ByteIterator>> keyMap = new HashMap<String, HashMap<String, ByteIterator>>(); + for (int i = 0; i < 5; i++) { + String insertKey = KEY_PREFIX + i; + keyMap.put(insertKey, insertRow(insertKey)); + } + HashSet<String> fieldSet = new HashSet<String>(); + fieldSet.add("FIELD0"); + fieldSet.add("FIELD1"); + int startIndex = 1; + int resultRows = 3; + + Vector<HashMap<String, ByteIterator>> resultVector = new Vector<HashMap<String, ByteIterator>>(); + jdbcDBClient.scan(TABLE_NAME, KEY_PREFIX + startIndex, resultRows, fieldSet, resultVector); + + // Check the resultVector is the correct size + assertEquals("Assert the correct number of results rows were returned", resultRows, resultVector.size()); + // Check each vector row to make sure we have the correct fields + int testIndex = startIndex; + for (HashMap<String, ByteIterator> result: resultVector) { + assertEquals("Assert that this row has the correct number of fields", fieldSet.size(), result.size()); + for (String field: fieldSet) { + assertEquals("Assert this field is correct in this row", keyMap.get(KEY_PREFIX + testIndex).get(field).toString(), result.get(field).toString()); + } + testIndex++; + } + } + + @Test + public void insertBatchTest() throws DBException { + insertBatchTest(20); + } + + @Test + public void insertPartialBatchTest() throws DBException { + insertBatchTest(19); + } + + public void insertBatchTest(int numRows) throws DBException { + teardown(); + setupWithBatch(10); + + try { + String insertKey = "user0"; + HashMap<String, ByteIterator> insertMap = insertRow(insertKey); + + ResultSet resultSet = jdbcConnection.prepareStatement( + String.format("SELECT * FROM %s", TABLE_NAME) + ).executeQuery(); + + // Check we do not have a result Row (because batch is not full yet + assertFalse(resultSet.next()); + + // insert more rows, completing 1 batch (still results are partial). + for (int i = 1; i < numRows; i++) { + insertMap = insertRow("user" + i); + } + + // + assertNumRows(10 * (numRows / 10)); + + // call cleanup, which should insert the partial batch + jdbcDBClient.cleanup(); + + // Check that we have all rows + assertNumRows(numRows); + + } catch (SQLException e) { + e.printStackTrace(); + fail("Failed insertBatchTest"); + } finally { + teardown(); // for next tests + setup(); + } + } + + private void assertNumRows(long numRows) throws SQLException { + ResultSet resultSet = jdbcConnection.prepareStatement( + String.format("SELECT * FROM %s", TABLE_NAME) + ).executeQuery(); + + for (int i = 0; i < numRows; i++) { + assertTrue("expecting " + numRows + " results, received only " + i, resultSet.next()); + } + assertFalse("expecting " + numRows + " results, received more", resultSet.next()); + + resultSet.close(); + } +} diff --git a/kudu/README.md b/kudu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e1f2b286438411b562d9b15d8e4dab2458cf2148 --- /dev/null +++ b/kudu/README.md @@ -0,0 +1,56 @@ +<!-- +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. +--> + +# Kudu bindings for YCSB + +[Kudu](http://getkudu.io) is a storage engine that enables fast analytics on fast data. + +## Benchmarking Kudu + +Use the following command line to load the initial data into an existing Kudu cluster with default +configurations. + +``` +bin/ycsb load kudu -P workloads/workloada +``` + +Additional configurations: +* `kudu_master_addresses`: The master's address. The default configuration expects a master on localhost. +* `kudu_pre_split_num_tablets`: The number of tablets (or partitions) to create for the table. The default +uses 4 tablets. A good rule of thumb is to use 5 per tablet server. +* `kudu_table_num_replicas`: The number of replicas that each tablet will have. The default is 3. Should +only be configured to use 1 instead, for single node tests. +* `kudu_sync_ops`: If the client should wait after every write operation. The default is true. +* `kudu_block_size`: The data block size used to configure columns. The default is 4096 bytes. + +Then, you can run the workload: + +``` +bin/ycsb run kudu -P workloads/workloada +``` + +## Using a previous client version + +If you wish to use a different Kudu client version than the one shipped with YCSB, you can specify on the +command line with `-Dkudu.version=x`. For example: + +``` +mvn -pl com.yahoo.ycsb:kudu-binding -am package -DskipTests -Dkudu.version=0.7.1 +``` + +Note that prior to 1.0, Kudu doesn't guarantee wire or API compability between versions and only the latest +one is officially supported. diff --git a/kudu/pom.xml b/kudu/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..9d3746e737ff93d768e7ed8faccbe318c3a44226 --- /dev/null +++ b/kudu/pom.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2015-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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>kudu-binding</artifactId> + <name>Kudu DB Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.kududb</groupId> + <artifactId>kudu-client</artifactId> + <version>${kudu.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> + <repositories> + <repository> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + <id>cloudera-repo</id> + <name>Cloudera Releases</name> + <url>https://repository.cloudera.com/artifactory/cloudera-repos</url> + </repository> + </repositories> +</project> diff --git a/kudu/src/main/conf/log4j.properties b/kudu/src/main/conf/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..7317ad1cf75bdf3b19f45d725662dee6ed0b9bf5 --- /dev/null +++ b/kudu/src/main/conf/log4j.properties @@ -0,0 +1,24 @@ +# +# 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. +# +# Enables getting logs from the client. + +log4j.rootLogger = INFO, out +log4j.appender.out = org.apache.log4j.ConsoleAppender +log4j.appender.out.layout = org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern = %d (%t) [%p - %l] %m%n + +log4j.logger.kudu = INFO diff --git a/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java b/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java new file mode 100644 index 0000000000000000000000000000000000000000..4a771a7fa7a29193321bc1f9a514448fe9462a36 --- /dev/null +++ b/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java @@ -0,0 +1,352 @@ +/** + * 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. + */ + +package com.yahoo.ycsb.db; + +import com.stumbleupon.async.TimeoutException; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; +import com.yahoo.ycsb.workloads.CoreWorkload; +import org.kududb.ColumnSchema; +import org.kududb.Schema; +import org.kududb.client.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; + +import static org.kududb.Type.STRING; + +/** + * Kudu client for YCSB framework. Example to load: <blockquote> + * + * <pre> + * <code> + * $ ./bin/ycsb load kudu -P workloads/workloada -threads 5 + * </code> + * </pre> + * + * </blockquote> Example to run: <blockquote> + * + * <pre> + * <code> + * ./bin/ycsb run kudu -P workloads/workloada -p kudu_sync_ops=true -threads 5 + * </code> + * </pre> + * + * </blockquote> + */ +public class KuduYCSBClient extends com.yahoo.ycsb.DB { + public static final String KEY = "key"; + public static final Status TIMEOUT = + new Status("TIMEOUT", "The operation timed out."); + public static final int MAX_TABLETS = 9000; + public static final long DEFAULT_SLEEP = 60000; + private static final String SYNC_OPS_OPT = "kudu_sync_ops"; + private static final String DEBUG_OPT = "kudu_debug"; + private static final String PRINT_ROW_ERRORS_OPT = "kudu_print_row_errors"; + private static final String PRE_SPLIT_NUM_TABLETS_OPT = + "kudu_pre_split_num_tablets"; + private static final String TABLE_NUM_REPLICAS = "kudu_table_num_replicas"; + private static final String BLOCK_SIZE_OPT = "kudu_block_size"; + private static final String MASTER_ADDRESSES_OPT = "kudu_master_addresses"; + private static final int BLOCK_SIZE_DEFAULT = 4096; + private static final List<String> COLUMN_NAMES = new ArrayList<String>(); + private static KuduClient client; + private static Schema schema; + private static int fieldCount; + private boolean debug = false; + private boolean printErrors = false; + private String tableName; + private KuduSession session; + private KuduTable kuduTable; + + @Override + public void init() throws DBException { + if (getProperties().getProperty(DEBUG_OPT) != null) { + this.debug = getProperties().getProperty(DEBUG_OPT).equals("true"); + } + if (getProperties().getProperty(PRINT_ROW_ERRORS_OPT) != null) { + this.printErrors = + getProperties().getProperty(PRINT_ROW_ERRORS_OPT).equals("true"); + } + if (getProperties().getProperty(PRINT_ROW_ERRORS_OPT) != null) { + this.printErrors = + getProperties().getProperty(PRINT_ROW_ERRORS_OPT).equals("true"); + } + this.tableName = com.yahoo.ycsb.workloads.CoreWorkload.table; + initClient(debug, tableName, getProperties()); + this.session = client.newSession(); + if (getProperties().getProperty(SYNC_OPS_OPT) != null + && getProperties().getProperty(SYNC_OPS_OPT).equals("false")) { + this.session.setFlushMode(KuduSession.FlushMode.AUTO_FLUSH_BACKGROUND); + this.session.setMutationBufferSpace(100); + } else { + this.session.setFlushMode(KuduSession.FlushMode.AUTO_FLUSH_SYNC); + } + + try { + this.kuduTable = client.openTable(tableName); + } catch (Exception e) { + throw new DBException("Could not open a table because of:", e); + } + } + + private static synchronized void initClient(boolean debug, String tableName, + Properties prop) throws DBException { + if (client != null) { + return; + } + + String masterAddresses = prop.getProperty(MASTER_ADDRESSES_OPT); + if (masterAddresses == null) { + masterAddresses = "localhost:7051"; + } + + int numTablets = getIntFromProp(prop, PRE_SPLIT_NUM_TABLETS_OPT, 4); + if (numTablets > MAX_TABLETS) { + throw new DBException("Specified number of tablets (" + numTablets + + ") must be equal " + "or below " + MAX_TABLETS); + } + + int numReplicas = getIntFromProp(prop, TABLE_NUM_REPLICAS, 3); + + int blockSize = getIntFromProp(prop, BLOCK_SIZE_OPT, BLOCK_SIZE_DEFAULT); + + client = new KuduClient.KuduClientBuilder(masterAddresses) + .defaultSocketReadTimeoutMs(DEFAULT_SLEEP) + .defaultOperationTimeoutMs(DEFAULT_SLEEP) + .defaultAdminOperationTimeoutMs(DEFAULT_SLEEP).build(); + if (debug) { + System.out.println("Connecting to the masters at " + masterAddresses); + } + + fieldCount = getIntFromProp(prop, CoreWorkload.FIELD_COUNT_PROPERTY, + Integer.parseInt(CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT)); + + List<ColumnSchema> columns = new ArrayList<ColumnSchema>(fieldCount + 1); + + ColumnSchema keyColumn = new ColumnSchema.ColumnSchemaBuilder(KEY, STRING) + .key(true).desiredBlockSize(blockSize).build(); + columns.add(keyColumn); + COLUMN_NAMES.add(KEY); + for (int i = 0; i < fieldCount; i++) { + String name = "field" + i; + COLUMN_NAMES.add(name); + columns.add(new ColumnSchema.ColumnSchemaBuilder(name, STRING) + .desiredBlockSize(blockSize).build()); + } + schema = new Schema(columns); + + CreateTableOptions builder = new CreateTableOptions(); + List<String> rangePartitionColumns = new ArrayList<>(1); + rangePartitionColumns.add(KEY); + builder.setRangePartitionColumns(rangePartitionColumns); + builder.setNumReplicas(numReplicas); + // create n-1 split keys, which will end up being n tablets master-side + for (int i = 1; i < numTablets + 0; i++) { + // We do +1000 since YCSB starts at user1. + int startKeyInt = (MAX_TABLETS / numTablets * i) + 1000; + String startKey = String.format("%04d", startKeyInt); + PartialRow splitRow = schema.newPartialRow(); + splitRow.addString(0, "user" + startKey); + builder.addSplitRow(splitRow); + } + + try { + client.createTable(tableName, schema, builder); + } catch (Exception e) { + if (!e.getMessage().contains("ALREADY_PRESENT")) { + throw new DBException("Couldn't create the table", e); + } + } + } + + private static int getIntFromProp(Properties prop, String propName, + int defaultValue) throws DBException { + String intStr = prop.getProperty(propName); + if (intStr == null) { + return defaultValue; + } else { + try { + return Integer.valueOf(intStr); + } catch (NumberFormatException ex) { + throw new DBException( + "Provided number for " + propName + " isn't a valid integer"); + } + } + } + + @Override + public void cleanup() throws DBException { + try { + this.session.close(); + } catch (Exception e) { + throw new DBException("Couldn't cleanup the session", e); + } + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + Vector<HashMap<String, ByteIterator>> results = + new Vector<HashMap<String, ByteIterator>>(); + final Status status = scan(table, key, 1, fields, results); + if (!status.equals(Status.OK)) { + return status; + } + if (results.size() != 1) { + return Status.NOT_FOUND; + } + result.putAll(results.firstElement()); + return Status.OK; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + try { + KuduScanner.KuduScannerBuilder scannerBuilder = + client.newScannerBuilder(this.kuduTable); + List<String> querySchema; + if (fields == null) { + querySchema = COLUMN_NAMES; + // No need to set the projected columns with the whole schema. + } else { + querySchema = new ArrayList<>(fields); + scannerBuilder.setProjectedColumnNames(querySchema); + } + + PartialRow lowerBound = schema.newPartialRow(); + lowerBound.addString(0, startkey); + scannerBuilder.lowerBound(lowerBound); + + if (recordcount == 1) { + PartialRow upperBound = schema.newPartialRow(); + upperBound.addString(0, startkey + '\0'); + scannerBuilder.exclusiveUpperBound(upperBound); + } + + scannerBuilder.limit(recordcount); // currently noop + + KuduScanner scanner = scannerBuilder.build(); + + while (scanner.hasMoreRows()) { + RowResultIterator data = scanner.nextRows(); + addAllRowsToResult(data, recordcount, querySchema, result); + if (recordcount == result.size()) { + break; + } + } + RowResultIterator closer = scanner.close(); + addAllRowsToResult(closer, recordcount, querySchema, result); + } catch (TimeoutException te) { + if (printErrors) { + System.err.println( + "Waited too long for a scan operation with start key=" + startkey); + } + return TIMEOUT; + } catch (Exception e) { + System.err.println("Unexpected exception " + e); + e.printStackTrace(); + return Status.ERROR; + } + return Status.OK; + } + + private void addAllRowsToResult(RowResultIterator it, int recordcount, + List<String> querySchema, Vector<HashMap<String, ByteIterator>> result) + throws Exception { + RowResult row; + HashMap<String, ByteIterator> rowResult = + new HashMap<String, ByteIterator>(querySchema.size()); + if (it == null) { + return; + } + while (it.hasNext()) { + if (result.size() == recordcount) { + return; + } + row = it.next(); + int colIdx = 0; + for (String col : querySchema) { + rowResult.put(col, new StringByteIterator(row.getString(colIdx))); + colIdx++; + } + result.add(rowResult); + } + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + Update update = this.kuduTable.newUpdate(); + PartialRow row = update.getRow(); + row.addString(KEY, key); + for (int i = 1; i < schema.getColumnCount(); i++) { + String columnName = schema.getColumnByIndex(i).getName(); + if (values.containsKey(columnName)) { + String value = values.get(columnName).toString(); + row.addString(columnName, value); + } + } + apply(update); + return Status.OK; + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + Insert insert = this.kuduTable.newInsert(); + PartialRow row = insert.getRow(); + row.addString(KEY, key); + for (int i = 1; i < schema.getColumnCount(); i++) { + row.addString(i, new String( + values.get(schema.getColumnByIndex(i).getName()).toArray())); + } + apply(insert); + return Status.OK; + } + + @Override + public Status delete(String table, String key) { + Delete delete = this.kuduTable.newDelete(); + PartialRow row = delete.getRow(); + row.addString(KEY, key); + apply(delete); + return Status.OK; + } + + private void apply(Operation op) { + try { + OperationResponse response = session.apply(op); + if (response != null && response.hasRowError() && printErrors) { + System.err.println("Got a row error " + response.getRowError()); + } + } catch (Exception ex) { + if (printErrors) { + System.err.println("Failed to apply an operation " + ex.toString()); + ex.printStackTrace(); + } + } + } +} diff --git a/kudu/src/main/java/com/yahoo/ycsb/db/package-info.java b/kudu/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..5d6c49613dea051f5b251960bc5a9ad8f9f2347c --- /dev/null +++ b/kudu/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * 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="http://getkudu.io/">Kudu</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/mapkeeper/README b/mapkeeper/README.md similarity index 100% rename from mapkeeper/README rename to mapkeeper/README.md diff --git a/mapkeeper/pom.xml b/mapkeeper/pom.xml index 86b9eb9e02fade71d4efa9f7a30e4300f24c2e13..202c81085cdac7a93b5b4726fa86a98271accafb 100644 --- a/mapkeeper/pom.xml +++ b/mapkeeper/pom.xml @@ -1,10 +1,27 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> diff --git a/mapkeeper/src/main/java/com/yahoo/ycsb/db/MapKeeperClient.java b/mapkeeper/src/main/java/com/yahoo/ycsb/db/MapKeeperClient.java index 5af5ed9e14e05d01bbce276bcac73e39ae550bb4..012a96cbf18e0927ffbc370d0a06fa754cc75ba0 100644 --- a/mapkeeper/src/main/java/com/yahoo/ycsb/db/MapKeeperClient.java +++ b/mapkeeper/src/main/java/com/yahoo/ycsb/db/MapKeeperClient.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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 java.nio.ByteBuffer; @@ -57,19 +74,19 @@ public class MapKeeperClient extends DB { ByteBuffer encode(HashMap<String, ByteIterator> values) { int len = 0; - for(String k : values.keySet()) { - len += (k.length() + 1 + values.get(k).bytesLeft() + 1); + for(Map.Entry<String, ByteIterator> entry : values.entrySet()) { + len += (entry.getKey().length() + 1 + entry.getValue().bytesLeft() + 1); } byte[] array = new byte[len]; int i = 0; - for(String k : values.keySet()) { - for(int j = 0; j < k.length(); j++) { - array[i] = (byte)k.charAt(j); + for(Map.Entry<String, ByteIterator> entry : values.entrySet()) { + for(int j = 0; j < entry.getKey().length(); j++) { + array[i] = (byte)entry.getKey().charAt(j); i++; } array[i] = '\t'; // XXX would like to use sane delimiter (null, 254, 255, ...) but java makes this nearly impossible i++; - ByteIterator v = values.get(k); + ByteIterator v = entry.getValue(); i = v.nextBuf(array, i); array[i] = '\t'; i++; @@ -165,8 +182,8 @@ public class MapKeeperClient extends DB { if(!writeallfields) { HashMap<String, ByteIterator> oldval = new HashMap<String, ByteIterator>(); read(table, key, null, oldval); - for(String k: values.keySet()) { - oldval.put(k, values.get(k)); + for(Map.Entry<String, ByteIterator> entry : values.entrySet()) { + oldval.put(entry.getKey(), entry.getValue())); } values = oldval; } diff --git a/memcached/README.md b/memcached/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2126b2da09eadc323458c7182081cf27e9008bb0 --- /dev/null +++ b/memcached/README.md @@ -0,0 +1,97 @@ +<!-- +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. +--> + +# YCSB Memcached binding + +This section describes how to run YCSB on memcached. + +## 1. Install and start memcached service on the host(s) + +Debian / Ubuntu: + + sudo apt-get install memcached + +RedHat / CentOS: + + sudo yum install memcached + +## 2. Install Java and Maven + +See step 2 in [`../mongodb/README.md`](../mongodb/README.md). + +## 3. Set up YCSB + +Git clone YCSB and compile: + + git clone http://github.com/brianfrankcooper/YCSB.git + cd YCSB + mvn -pl com.yahoo.ycsb:memcached-binding -am clean package + +## 4. Load data and run tests + +Load the data: + + ./bin/ycsb load memcached -s -P workloads/workloada > outputLoad.txt + +Run the workload test: + + ./bin/ycsb run memcached -s -P workloads/workloada > outputRun.txt + +## 5. memcached Connection Parameters + +A sample configuration is provided in +[`conf/memcached.properties`](conf/memcached.properties). + +### Required params + +- `memcached.hosts` + + This is a comma-separated list of hosts providing the memcached interface. + You can use IPs or hostnames. The port is optional and defaults to the + memcached standard port of `11211` if not specified. + +### Optional params + +- `memcached.shutdownTimeoutMillis` + + Shutdown timeout in milliseconds. + +- `memcached.objectExpirationTime` + + Object expiration time for memcached; defaults to `Integer.MAX_VALUE`. + +- `memcached.checkOperationStatus` + + Whether to verify the success of each operation; defaults to true. + +- `memcached.readBufferSize` + + Read buffer size, in bytes. + +- `memcached.opTimeoutMillis` + + Operation timeout, in milliseconds. + +- `memcached.failureMode` + + What to do with failures; this is one of `net.spy.memcached.FailureMode` enum + values, which are currently: `Redistribute`, `Retry`, or `Cancel`. + +You can set properties on the command line via `-p`, e.g.: + + ./bin/ycsb load memcached -s -P workloads/workloada \ + -p "memcached.hosts=127.0.0.1" > outputLoad.txt diff --git a/memcached/conf/memcached.properties b/memcached/conf/memcached.properties new file mode 100644 index 0000000000000000000000000000000000000000..e65f2fa74b9c15626741158c78d919443d5eccb4 --- /dev/null +++ b/memcached/conf/memcached.properties @@ -0,0 +1,52 @@ +# 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. + +# +# Sample property file for Memcached Client + +## Mandatory parameters + +# A comma-separated list of memcached server endpoints, each being an IP or +# hostname with an optional port; the port defaults to the memcached-standard +# port of 11211 if not specified. +# +# memcached.hosts = + +## Optional parameters + +# Shutdown timeout in milliseconds. +# +# memcached.shutdownTimeoutMillis = 30000 + +# Object expiration time for memcached; defaults to `Integer.MAX_VALUE`. +# +# memcached.objectExpirationTime = 2147483647 + +# Whether to verify the success of each operation; defaults to true. +# +# memcached.checkOperationStatus = true + +# Read buffer size, in bytes. +# +# memcached.readBufferSize = 3000000 + +# Operation timeout, in milliseconds. +# +# memcached.opTimeoutMillis = 60000 + +# What to do with failures; this is one of `net.spy.memcached.FailureMode` enum +# values, which are currently: `Redistribute`, `Retry`, or `Cancel`. +# +# memcached.failureMode = Redistribute diff --git a/memcached/pom.xml b/memcached/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a3b0b9ffd61875cc66386011fecde88b0cd05f3 --- /dev/null +++ b/memcached/pom.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2014-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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>memcached-binding</artifactId> + <name>memcached binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-mapper-asl</artifactId> + <version>1.9.13</version> + </dependency> + <dependency> + <groupId>net.spy</groupId> + <artifactId>spymemcached</artifactId> + <version>2.11.4</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${maven.assembly.version}</version> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java b/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java new file mode 100644 index 0000000000000000000000000000000000000000..9ce0b93c9293d9dbb7daa99df531c0cc3a4b190f --- /dev/null +++ b/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) 2014-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.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; +import java.net.InetSocketAddress; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; + +import net.spy.memcached.ConnectionFactoryBuilder; +import net.spy.memcached.FailureMode; +// We also use `net.spy.memcached.MemcachedClient`; it is not imported +// explicitly and referred to with its full path to avoid conflicts with the +// class of the same name in this file. +import net.spy.memcached.internal.GetFuture; +import net.spy.memcached.internal.OperationFuture; + +import org.codehaus.jackson.JsonFactory; +import org.codehaus.jackson.JsonGenerator; +import org.codehaus.jackson.JsonNode; +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.node.ObjectNode; + +import org.apache.log4j.Logger; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; + +/** + * Concrete Memcached client implementation. + */ +public class MemcachedClient extends DB { + + private final Logger logger = Logger.getLogger(getClass()); + + protected static final ObjectMapper MAPPER = new ObjectMapper(); + + private boolean checkOperationStatus; + private long shutdownTimeoutMillis; + private int objectExpirationTime; + + public static final String HOSTS_PROPERTY = "memcached.hosts"; + + public static final int DEFAULT_PORT = 11211; + + private static final String TEMPORARY_FAILURE_MSG = "Temporary failure"; + private static final String CANCELLED_MSG = "cancelled"; + + public static final String SHUTDOWN_TIMEOUT_MILLIS_PROPERTY = + "memcached.shutdownTimeoutMillis"; + public static final String DEFAULT_SHUTDOWN_TIMEOUT_MILLIS = "30000"; + + public static final String OBJECT_EXPIRATION_TIME_PROPERTY = + "memcached.objectExpirationTime"; + public static final String DEFAULT_OBJECT_EXPIRATION_TIME = + String.valueOf(Integer.MAX_VALUE); + + public static final String CHECK_OPERATION_STATUS_PROPERTY = + "memcached.checkOperationStatus"; + public static final String CHECK_OPERATION_STATUS_DEFAULT = "true"; + + public static final String READ_BUFFER_SIZE_PROPERTY = + "memcached.readBufferSize"; + public static final String DEFAULT_READ_BUFFER_SIZE = "3000000"; + + public static final String OP_TIMEOUT_PROPERTY = "memcached.opTimeoutMillis"; + public static final String DEFAULT_OP_TIMEOUT = "60000"; + + public static final String FAILURE_MODE_PROPERTY = "memcached.failureMode"; + public static final FailureMode FAILURE_MODE_PROPERTY_DEFAULT = + FailureMode.Redistribute; + + /** + * The MemcachedClient implementation that will be used to communicate + * with the memcached server. + */ + private net.spy.memcached.MemcachedClient client; + + /** + * @returns Underlying Memcached protocol client, implemented by + * SpyMemcached. + */ + protected net.spy.memcached.MemcachedClient memcachedClient() { + return client; + } + + @Override + public void init() throws DBException { + try { + client = createMemcachedClient(); + checkOperationStatus = Boolean.parseBoolean( + getProperties().getProperty(CHECK_OPERATION_STATUS_PROPERTY, + CHECK_OPERATION_STATUS_DEFAULT)); + objectExpirationTime = Integer.parseInt( + getProperties().getProperty(OBJECT_EXPIRATION_TIME_PROPERTY, + DEFAULT_OBJECT_EXPIRATION_TIME)); + shutdownTimeoutMillis = Integer.parseInt( + getProperties().getProperty(SHUTDOWN_TIMEOUT_MILLIS_PROPERTY, + DEFAULT_SHUTDOWN_TIMEOUT_MILLIS)); + } catch (Exception e) { + throw new DBException(e); + } + } + + protected net.spy.memcached.MemcachedClient createMemcachedClient() + throws Exception { + ConnectionFactoryBuilder connectionFactoryBuilder = + new ConnectionFactoryBuilder(); + + connectionFactoryBuilder.setReadBufferSize(Integer.parseInt( + getProperties().getProperty(READ_BUFFER_SIZE_PROPERTY, + DEFAULT_READ_BUFFER_SIZE))); + + connectionFactoryBuilder.setOpTimeout(Integer.parseInt( + getProperties().getProperty(OP_TIMEOUT_PROPERTY, DEFAULT_OP_TIMEOUT))); + + String failureString = getProperties().getProperty(FAILURE_MODE_PROPERTY); + connectionFactoryBuilder.setFailureMode( + failureString == null ? FAILURE_MODE_PROPERTY_DEFAULT + : FailureMode.valueOf(failureString)); + + // Note: this only works with IPv4 addresses due to its assumption of + // ":" being the separator of hostname/IP and port; this is not the case + // when dealing with IPv6 addresses. + // + // TODO(mbrukman): fix this. + List<InetSocketAddress> addresses = new ArrayList<InetSocketAddress>(); + String[] hosts = getProperties().getProperty(HOSTS_PROPERTY).split(","); + for (String address : hosts) { + int colon = address.indexOf(":"); + int port = DEFAULT_PORT; + String host = address; + if (colon != -1) { + port = Integer.parseInt(address.substring(colon + 1)); + host = address.substring(0, colon); + } + addresses.add(new InetSocketAddress(host, port)); + } + return new net.spy.memcached.MemcachedClient( + connectionFactoryBuilder.build(), addresses); + } + + @Override + public Status read( + String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + key = createQualifiedKey(table, key); + try { + GetFuture<Object> future = memcachedClient().asyncGet(key); + Object document = future.get(); + if (document != null) { + fromJson((String) document, fields, result); + } + return Status.OK; + } catch (Exception e) { + logger.error("Error encountered for key: " + key, e); + return Status.ERROR; + } + } + + @Override + public Status scan( + String table, String startkey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result){ + return Status.NOT_IMPLEMENTED; + } + + @Override + public Status update( + String table, String key, HashMap<String, ByteIterator> values) { + key = createQualifiedKey(table, key); + try { + OperationFuture<Boolean> future = + memcachedClient().replace(key, objectExpirationTime, toJson(values)); + return getReturnCode(future); + } catch (Exception e) { + logger.error("Error updating value with key: " + key, e); + return Status.ERROR; + } + } + + @Override + public Status insert( + String table, String key, HashMap<String, ByteIterator> values) { + key = createQualifiedKey(table, key); + try { + OperationFuture<Boolean> future = + memcachedClient().add(key, objectExpirationTime, toJson(values)); + return getReturnCode(future); + } catch (Exception e) { + logger.error("Error inserting value", e); + return Status.ERROR; + } + } + + @Override + public Status delete(String table, String key) { + key = createQualifiedKey(table, key); + try { + OperationFuture<Boolean> future = memcachedClient().delete(key); + return getReturnCode(future); + } catch (Exception e) { + logger.error("Error deleting value", e); + return Status.ERROR; + } + } + + protected Status getReturnCode(OperationFuture<Boolean> future) { + if (!checkOperationStatus) { + return Status.OK; + } + if (future.getStatus().isSuccess()) { + return Status.OK; + } else if (TEMPORARY_FAILURE_MSG.equals(future.getStatus().getMessage())) { + return new Status("TEMPORARY_FAILURE", TEMPORARY_FAILURE_MSG); + } else if (CANCELLED_MSG.equals(future.getStatus().getMessage())) { + return new Status("CANCELLED_MSG", CANCELLED_MSG); + } + return new Status("ERROR", future.getStatus().getMessage()); + } + + @Override + public void cleanup() throws DBException { + if (client != null) { + memcachedClient().shutdown(shutdownTimeoutMillis, MILLISECONDS); + } + } + + protected static String createQualifiedKey(String table, String key) { + return MessageFormat.format("{0}-{1}", table, key); + } + + protected static void fromJson( + String value, Set<String> fields, + Map<String, ByteIterator> result) throws IOException { + JsonNode json = MAPPER.readTree(value); + boolean checkFields = fields != null && !fields.isEmpty(); + for (Iterator<Map.Entry<String, JsonNode>> jsonFields = json.getFields(); + jsonFields.hasNext(); + /* increment in loop body */) { + Map.Entry<String, JsonNode> jsonField = jsonFields.next(); + String name = jsonField.getKey(); + if (checkFields && fields.contains(name)) { + continue; + } + JsonNode jsonValue = jsonField.getValue(); + if (jsonValue != null && !jsonValue.isNull()) { + result.put(name, new StringByteIterator(jsonValue.asText())); + } + } + } + + protected static String toJson(Map<String, ByteIterator> values) + throws IOException { + ObjectNode node = MAPPER.createObjectNode(); + HashMap<String, String> stringMap = StringByteIterator.getStringMap(values); + for (Map.Entry<String, String> pair : stringMap.entrySet()) { + node.put(pair.getKey(), pair.getValue()); + } + JsonFactory jsonFactory = new JsonFactory(); + Writer writer = new StringWriter(); + JsonGenerator jsonGenerator = jsonFactory.createJsonGenerator(writer); + MAPPER.writeTree(jsonGenerator, node); + return writer.toString(); + } +} diff --git a/memcached/src/main/java/com/yahoo/ycsb/db/package-info.java b/memcached/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..27dbc34c900b0461e51fa746b0385b59e7550c2c --- /dev/null +++ b/memcached/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/** + * 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. + */ + +/** + * YCSB binding for memcached. + */ +package com.yahoo.ycsb.db; diff --git a/mongodb/README.md b/mongodb/README.md index 26c59fda08ecdd021203c4010688dfbb1cbcb942..b24814517b704a9ee00fee82eabaa86fb1c02ec1 100644 --- a/mongodb/README.md +++ b/mongodb/README.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + ## Quick Start This section describes how to run YCSB on MongoDB. @@ -51,9 +68,9 @@ Reload bash and test mvn Download the YCSB zip file and compile: - git clone git://github.com/brianfrankcooper/YCSB.git - cd YCSB - mvn -pl com.yahoo.ycsb:mongodb-binding -am clean package + curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.5.0/ycsb-0.5.0.tar.gz + tar xfvz ycsb-0.5.0.tar.gz + cd ycsb-0.5.0 ### 4. Run YCSB @@ -75,6 +92,13 @@ Then, run the workload: See the next section for the list of configuration parameters for MongoDB. +## Log Level Control +Due to the mongodb driver defaulting to a log level of DEBUG, a logback.xml file is included with this module that restricts the org.mongodb logging to WARN. You can control this by overriding the logback.xml and defining it in your ycsb command by adding this flag: + +``` +bin/ycsb run mongodb -jvm-args="-Dlogback.configurationFile=/path/to/logback.xml" +``` + ## MongoDB Configuration Parameters - `mongodb.url` @@ -91,8 +115,14 @@ See the next section for the list of configuration parameters for MongoDB. - Useful for the insert workload as it will submit the inserts in batches inproving throughput. - Default value is `1`. +- `mongodb.upsert` + - Determines if the insert operation performs an update with the upsert operation or a insert. + Upserts have the advantage that they will continue to work for a partially loaded data set. + - Setting to `true` uses updates, `false` uses insert operations. + - Default value is `false`. + - `mongodb.writeConcern` - - **Deprecated** - Use the `w` and `journal` options on the MongoDB URI provided by the `mongodb.uri`. + - **Deprecated** - Use the `w` and `journal` options on the MongoDB URI provided by the `mongodb.url`. - Allowed values are : - `errors_ignored` - `unacknowledged` @@ -103,7 +133,7 @@ See the next section for the list of configuration parameters for MongoDB. - Default value is `acknowledged`. - `mongodb.readPreference` - - **Deprecated** - Use the `readPreference` options on the MongoDB URI provided by the `mongodb.uri`. + - **Deprecated** - Use the `readPreference` options on the MongoDB URI provided by the `mongodb.url`. - Allowed values are : - `primary` - `primary_preferred` @@ -113,11 +143,11 @@ See the next section for the list of configuration parameters for MongoDB. - Default value is `primary`. - `mongodb.maxconnections` - - **Deprecated** - Use the `maxPoolSize` options on the MongoDB URI provided by the `mongodb.uri`. + - **Deprecated** - Use the `maxPoolSize` options on the MongoDB URI provided by the `mongodb.url`. - Default value is `100`. - `mongodb.threadsAllowedToBlockForConnectionMultiplier` - - **Deprecated** - Use the `waitQueueMultiple` options on the MongoDB URI provided by the `mongodb.uri`. + - **Deprecated** - Use the `waitQueueMultiple` options on the MongoDB URI provided by the `mongodb.url`. - Default value is `5`. For example: diff --git a/mongodb/pom.xml b/mongodb/pom.xml index 5a7d7d8660168cf23b8f2b89ce7d150b12ab12ef..c4ef745d5442116a7bd9682edc9900335c92e0dc 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -1,64 +1,82 @@ <?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.3.0-SNAPSHOT</version> - <relativePath>../binding-parent</relativePath> - </parent> +<!-- +Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. - <artifactId>mongodb-binding</artifactId> - <name>MongoDB Binding</name> - <packaging>jar</packaging> +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 - <dependencies> - <dependency> - <groupId>org.mongodb</groupId> - <artifactId>mongo-java-driver</artifactId> - <version>${mongodb.version}</version> - </dependency> - <dependency> - <groupId>com.allanbank</groupId> - <artifactId>mongodb-async-driver</artifactId> - <version>${mongodb.async.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>core</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.1.2</version> - <scope>runtime</scope> - </dependency> +http://www.apache.org/licenses/LICENSE-2.0 - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - </dependencies> - <repositories> - <repository> - <releases> - <enabled>true</enabled> - <updatePolicy>always</updatePolicy> - <checksumPolicy>warn</checksumPolicy> - </releases> - <snapshots> - <enabled>false</enabled> - <updatePolicy>never</updatePolicy> - <checksumPolicy>fail</checksumPolicy> - </snapshots> - <id>allanbank</id> - <name>Allanbank Releases</name> - <url>http://www.allanbank.com/repo/</url> - <layout>default</layout> - </repository> - </repositories> - </project> +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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>mongodb-binding</artifactId> + <name>MongoDB Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.mongodb</groupId> + <artifactId>mongo-java-driver</artifactId> + <version>${mongodb.version}</version> + </dependency> + <dependency> + <groupId>com.allanbank</groupId> + <artifactId>mongodb-async-driver</artifactId> + <version>${mongodb.async.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>1.1.2</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> + <repositories> + <repository> + <releases> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + <checksumPolicy>warn</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + <updatePolicy>never</updatePolicy> + <checksumPolicy>fail</checksumPolicy> + </snapshots> + <id>allanbank</id> + <name>Allanbank Releases</name> + <url>http://www.allanbank.com/repo/</url> + <layout>default</layout> + </repository> + </repositories> +</project> diff --git a/mongodb/src/main/java/com/yahoo/ycsb/db/AsyncMongoDbClient.java b/mongodb/src/main/java/com/yahoo/ycsb/db/AsyncMongoDbClient.java index 63ae2a7e41959ecc4e7b538aa436368e09b4a570..a977fbe456182a563e424ca1b7cc2d700d016da1 100644 --- a/mongodb/src/main/java/com/yahoo/ycsb/db/AsyncMongoDbClient.java +++ b/mongodb/src/main/java/com/yahoo/ycsb/db/AsyncMongoDbClient.java @@ -1,31 +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. +/* + * 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. */ package com.yahoo.ycsb.db; import static com.allanbank.mongodb.builder.QueryBuilder.where; -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 com.allanbank.mongodb.Durability; import com.allanbank.mongodb.LockType; import com.allanbank.mongodb.MongoClient; @@ -49,495 +41,510 @@ import com.allanbank.mongodb.builder.Sort; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +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; /** - * MongoDB asynchronous client for YCSB framework. - * - * Properties to set: - * - * mongodb.url=mongodb://localhost:27017 - * mongodb.writeConcern=normal - * + * MongoDB asynchronous client for YCSB framework using the <a + * href="http://www.allanbank.com/mongodb-async-driver/">Asynchronous Java + * Driver</a> + * <p> + * See the <code>README.md</code> for configuration information. + * </p> + * * @author rjm + * @see <a href="http://www.allanbank.com/mongodb-async-driver/">Asynchronous + * Java Driver</a> */ public class AsyncMongoDbClient extends DB { - /** Used to include a field in a response. */ - protected static final int INCLUDE = 1; + /** Used to include a field in a response. */ + protected static final int INCLUDE = 1; - /** The database to use. */ - private static String databaseName; + /** The database to use. */ + private static String databaseName; - /** Thread local document builder. */ - private static final ThreadLocal<DocumentBuilder> DOCUMENT_BUILDER = new ThreadLocal<DocumentBuilder>() { + /** Thread local document builder. */ + private static final ThreadLocal<DocumentBuilder> DOCUMENT_BUILDER = + new ThreadLocal<DocumentBuilder>() { @Override protected DocumentBuilder initialValue() { - return BuilderFactory.start(); + return BuilderFactory.start(); + } + }; + + /** The write concern for the requests. */ + private static final AtomicInteger INIT_COUNT = new AtomicInteger(0); + + /** The connection to MongoDB. */ + private static MongoClient mongoClient; + + /** The write concern for the requests. */ + private static Durability writeConcern; + + /** Which servers to use for reads. */ + private static ReadPreference readPreference; + + /** The database to MongoDB. */ + private MongoDatabase database; + + /** The batch size to use for inserts. */ + private static int batchSize; + + /** If true then use updates with the upsert option for inserts. */ + private static boolean useUpsert; + + /** The bulk inserts pending for the thread. */ + private final BatchedWrite.Builder batchedWrite = BatchedWrite.builder() + .mode(BatchedWriteMode.REORDERED); + + /** The number of writes in the batchedWrite. */ + private int batchedWriteCount = 0; + + /** + * Cleanup any state for this DB. Called once per DB instance; there is one DB + * instance per client thread. + */ + @Override + public final void cleanup() throws DBException { + if (INIT_COUNT.decrementAndGet() == 0) { + try { + mongoClient.close(); + } catch (final Exception e1) { + System.err.println("Could not close MongoDB connection pool: " + + e1.toString()); + e1.printStackTrace(); + return; + } finally { + mongoClient = null; + database = null; + } + } + } + + /** + * 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 this class's + * description for a discussion of error codes. + */ + @Override + public final Status delete(final String table, final String key) { + try { + final MongoCollection collection = database.getCollection(table); + final Document q = BuilderFactory.start().add("_id", key).build(); + final long res = collection.delete(q, writeConcern); + if (res == 0) { + System.err.println("Nothing deleted for key " + key); + return Status.NOT_FOUND; + } + return Status.OK; + } catch (final Exception e) { + System.err.println(e.toString()); + return Status.ERROR; + } + } + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public final void init() throws DBException { + final int count = INIT_COUNT.incrementAndGet(); + + synchronized (AsyncMongoDbClient.class) { + final Properties props = getProperties(); + + if (mongoClient != null) { + database = mongoClient.getDatabase(databaseName); + + // If there are more threads (count) than connections then the + // Low latency spin lock is not really needed as we will keep + // the connections occupied. + if (count > mongoClient.getConfig().getMaxConnectionCount()) { + mongoClient.getConfig().setLockType(LockType.MUTEX); } - }; - - /** The write concern for the requests. */ - private static final AtomicInteger initCount = new AtomicInteger(0); - - /** The connection to MongoDB. */ - private static MongoClient mongoClient; - - /** The write concern for the requests. */ - private static Durability writeConcern; - /** Which servers to use for reads. */ - private static ReadPreference readPreference; + return; + } + + // Set insert batchsize, default 1 - to be YCSB-original equivalent + batchSize = Integer.parseInt(props.getProperty("mongodb.batchsize", "1")); + + // Set is inserts are done as upserts. Defaults to false. + useUpsert = Boolean.parseBoolean( + props.getProperty("mongodb.upsert", "false")); + + // Just use the standard connection format URL + // http://docs.mongodb.org/manual/reference/connection-string/ + // to configure the client. + String url = + props + .getProperty("mongodb.url", "mongodb://localhost:27017/ycsb?w=1"); + if (!url.startsWith("mongodb://")) { + System.err.println("ERROR: Invalid URL: '" + url + + "'. Must be of the form " + + "'mongodb://<host1>:<port1>,<host2>:<port2>/database?" + + "options'. See " + + "http://docs.mongodb.org/manual/reference/connection-string/."); + System.exit(1); + } + + MongoDbUri uri = new MongoDbUri(url); + + try { + databaseName = uri.getDatabase(); + if ((databaseName == null) || databaseName.isEmpty()) { + // Default database is "ycsb" if database is not + // specified in URL + databaseName = "ycsb"; + } - /** The database to MongoDB. */ - private MongoDatabase database; + mongoClient = MongoFactory.createClient(uri); - /** The batch size to use for inserts. */ - private static int batchSize; + MongoClientConfiguration config = mongoClient.getConfig(); + if (!url.toLowerCase().contains("locktype=")) { + config.setLockType(LockType.LOW_LATENCY_SPIN); // assumed... + } - /** The bulk inserts pending for the thread. */ - private final BatchedWrite.Builder batchedWrite = BatchedWrite.builder() - .mode(BatchedWriteMode.REORDERED); + readPreference = config.getDefaultReadPreference(); + writeConcern = config.getDefaultDurability(); - /** The number of writes in the batchedWrite. */ - private int batchedWriteCount = 0; + database = mongoClient.getDatabase(databaseName); - /** - * Cleanup any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - @Override - public final void cleanup() throws DBException { - if (initCount.decrementAndGet() == 0) { - try { - mongoClient.close(); - } - catch (final Exception e1) { - System.err.println("Could not close MongoDB connection pool: " - + e1.toString()); - e1.printStackTrace(); - return; - } - finally { - mongoClient = null; - database = null; - } - } + System.out.println("mongo connection created with " + url); + } catch (final Exception e1) { + System.err + .println("Could not initialize MongoDB connection pool for Loader: " + + e1.toString()); + e1.printStackTrace(); + return; + } } - - /** - * 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 this class's - * description for a discussion of error codes. - */ - @Override - public final int delete(final String table, final String key) { - try { - final MongoCollection collection = database.getCollection(table); - final Document q = BuilderFactory.start().add("_id", key).build(); - final long res = collection.delete(q, writeConcern); - if (res == 0) { - System.err.println("Nothing deleted for key " + key); - return 1; - } - return 0; + } + + /** + * 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 final Status insert(final String table, final String key, + final HashMap<String, ByteIterator> values) { + try { + final MongoCollection collection = database.getCollection(table); + final DocumentBuilder toInsert = + DOCUMENT_BUILDER.get().reset().add("_id", key); + final Document query = toInsert.build(); + for (final Map.Entry<String, ByteIterator> entry : values.entrySet()) { + toInsert.add(entry.getKey(), entry.getValue().toArray()); + } + + // Do an upsert. + if (batchSize <= 1) { + long result; + if (useUpsert) { + result = collection.update(query, toInsert, + /* multi= */false, /* upsert= */true, writeConcern); + } else { + // Return is not stable pre-SERVER-4381. No exception is success. + collection.insert(writeConcern, toInsert); + result = 1; } - catch (final Exception e) { - System.err.println(e.toString()); - return 1; + return result == 1 ? Status.OK : Status.NOT_FOUND; + } + + // Use a bulk insert. + try { + if (useUpsert) { + batchedWrite.update(query, toInsert, /* multi= */false, + /* upsert= */true); + } else { + batchedWrite.insert(toInsert); } - } + batchedWriteCount += 1; - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - */ - @Override - public final void init() throws DBException { - final int count = initCount.incrementAndGet(); - - synchronized (AsyncMongoDbClient.class) { - final Properties props = getProperties(); - - if (mongoClient != null) { - database = mongoClient.getDatabase(databaseName); - - // If there are more threads (count) than connections then the - // Low latency spin lock is not really needed as we will keep - // the connections occupied. - if (count > mongoClient.getConfig().getMaxConnectionCount()) { - mongoClient.getConfig().setLockType(LockType.MUTEX); - } - - return; - } - - // Set insert batchsize, default 1 - to be YCSB-original equivalent - batchSize = Integer.parseInt(props.getProperty("mongodb.batchsize", "1")); - - // Just use the standard connection format URL - // http://docs.mongodb.org/manual/reference/connection-string/ - // to configure the client. - String url = props.getProperty("mongodb.url", - "mongodb://localhost:27017/ycsb?w=1"); - if (!url.startsWith("mongodb://")) { - System.err - .println("ERROR: Invalid URL: '" - + url - + "'. Must be of the form " - + "'mongodb://<host1>:<port1>,<host2>:<port2>/database?options'. " - + "See http://docs.mongodb.org/manual/reference/connection-string/."); - System.exit(1); - } - - MongoDbUri uri = new MongoDbUri(url); - - try { - databaseName = uri.getDatabase(); - if ((databaseName == null) || databaseName.isEmpty()) { - // Default database is "ycsb" if database is not - // specified in URL - databaseName="ycsb"; - } - - mongoClient = MongoFactory.createClient(uri); - - MongoClientConfiguration config = mongoClient.getConfig(); - if (!url.toLowerCase().contains("locktype=")) { - config.setLockType(LockType.LOW_LATENCY_SPIN); // assumed... - } - - readPreference = config.getDefaultReadPreference(); - writeConcern = config.getDefaultDurability(); - - database = mongoClient.getDatabase(databaseName); - - System.out.println("mongo connection created with " + url); - } - catch (final Exception e1) { - System.err - .println("Could not initialize MongoDB connection pool for Loader: " - + e1.toString()); - e1.printStackTrace(); - return; - } + if (batchedWriteCount < batchSize) { + return Status.BATCHED_OK; } - } - /** - * 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 final int insert(final String table, final String key, - final HashMap<String, ByteIterator> values) { - try { - final MongoCollection collection = database.getCollection(table); - final DocumentBuilder toInsert = DOCUMENT_BUILDER.get().reset() - .add("_id", key); - final Document query = toInsert.build(); - for (final Map.Entry<String, ByteIterator> entry : values - .entrySet()) { - toInsert.add(entry.getKey(), entry.getValue().toArray()); - } - - // Do an upsert. - if (batchSize <= 1) { - long result = collection.update(query, toInsert, - /* multi= */false, /* upsert= */true, writeConcern); - - return result == 1 ? 0 : 1; - } - - // Use a bulk insert. - try { - batchedWrite.insert(toInsert); - batchedWriteCount += 1; - - if (batchedWriteCount < batchSize) { - return 0; - } - - long count = collection.write(batchedWrite); - if (count == batchedWriteCount) { - batchedWrite.reset().mode(BatchedWriteMode.REORDERED); - batchedWriteCount = 0; - return 0; - } - - System.err - .println("Number of inserted documents doesn't match the number sent, " - + count - + " inserted, sent " - + batchedWriteCount); - batchedWrite.reset().mode(BatchedWriteMode.REORDERED); - batchedWriteCount = 0; - return 1; - } - catch (Exception e) { - System.err.println("Exception while trying bulk insert with " - + batchedWriteCount); - e.printStackTrace(); - return 1; - } - } - catch (final Exception e) { - e.printStackTrace(); - return 1; + long count = collection.write(batchedWrite); + if (count == batchedWriteCount) { + batchedWrite.reset().mode(BatchedWriteMode.REORDERED); + batchedWriteCount = 0; + return Status.OK; } + + System.err.println("Number of inserted documents doesn't match the " + + "number sent, " + count + " inserted, sent " + batchedWriteCount); + batchedWrite.reset().mode(BatchedWriteMode.REORDERED); + batchedWriteCount = 0; + return Status.ERROR; + } catch (Exception e) { + System.err.println("Exception while trying bulk insert with " + + batchedWriteCount); + e.printStackTrace(); + return Status.ERROR; + } + } catch (final Exception e) { + e.printStackTrace(); + 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". + */ + @Override + public final Status read(final String table, final String key, + final Set<String> fields, final HashMap<String, ByteIterator> result) { + try { + final MongoCollection collection = database.getCollection(table); + final DocumentBuilder query = + DOCUMENT_BUILDER.get().reset().add("_id", key); + + Document queryResult = null; + if (fields != null) { + final DocumentBuilder fieldsToReturn = BuilderFactory.start(); + final Iterator<String> iter = fields.iterator(); + while (iter.hasNext()) { + fieldsToReturn.add(iter.next(), 1); + } - /** - * 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". - */ - @Override - public final int read(final String table, final String key, - final Set<String> fields, final HashMap<String, ByteIterator> result) { - try { - final MongoCollection collection = database.getCollection(table); - final DocumentBuilder query = DOCUMENT_BUILDER.get().reset() - .add("_id", key); - - Document queryResult = null; - if (fields != null) { - final DocumentBuilder fieldsToReturn = BuilderFactory.start(); - final Iterator<String> iter = fields.iterator(); - while (iter.hasNext()) { - fieldsToReturn.add(iter.next(), 1); - } - - final Find.Builder fb = new Find.Builder(query); - fb.projection(fieldsToReturn); - fb.setLimit(1); - fb.setBatchSize(1); - fb.readPreference(readPreference); - - final MongoIterator<Document> ci = collection.find(fb.build()); - if (ci.hasNext()) { - queryResult = ci.next(); - ci.close(); - } - } - else { - queryResult = collection.findOne(query); - } - - if (queryResult != null) { - fillMap(result, queryResult); - } - return queryResult != null ? 0 : 1; + final Find.Builder fb = new Find.Builder(query); + fb.projection(fieldsToReturn); + fb.setLimit(1); + fb.setBatchSize(1); + fb.readPreference(readPreference); + + final MongoIterator<Document> ci = collection.find(fb.build()); + if (ci.hasNext()) { + queryResult = ci.next(); + ci.close(); } - catch (final Exception e) { - System.err.println(e.toString()); - return 1; + } else { + queryResult = collection.findOne(query); + } + + if (queryResult != null) { + fillMap(result, queryResult); + } + return queryResult != null ? Status.OK : Status.NOT_FOUND; + } catch (final Exception e) { + System.err.println(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 final Status scan(final String table, final String startkey, + final int recordcount, final Set<String> fields, + final Vector<HashMap<String, ByteIterator>> result) { + try { + final MongoCollection collection = database.getCollection(table); + + final Find.Builder find = + Find.builder().query(where("_id").greaterThanOrEqualTo(startkey)) + .limit(recordcount).batchSize(recordcount).sort(Sort.asc("_id")) + .readPreference(readPreference); + + if (fields != null) { + final DocumentBuilder fieldsDoc = BuilderFactory.start(); + for (final String field : fields) { + fieldsDoc.add(field, INCLUDE); } + find.projection(fieldsDoc); + } + + result.ensureCapacity(recordcount); + + final MongoIterator<Document> cursor = collection.find(find); + if (!cursor.hasNext()) { + System.err.println("Nothing found in scan for key " + startkey); + return Status.NOT_FOUND; + } + while (cursor.hasNext()) { + // toMap() returns a Map but result.add() expects a + // Map<String,String>. Hence, the suppress warnings. + final Document doc = cursor.next(); + final HashMap<String, ByteIterator> docAsMap = + new HashMap<String, ByteIterator>(); + + fillMap(docAsMap, doc); + + result.add(docAsMap); + } + + return Status.OK; + } catch (final Exception e) { + System.err.println(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 the {@link DB} + * class's description for a discussion of error codes. + */ + @Override + public final Status update(final String table, final String key, + final HashMap<String, ByteIterator> values) { + try { + final MongoCollection collection = database.getCollection(table); + final DocumentBuilder query = BuilderFactory.start().add("_id", key); + final DocumentBuilder update = BuilderFactory.start(); + final DocumentBuilder fieldsToSet = update.push("$set"); + + for (final Map.Entry<String, ByteIterator> entry : values.entrySet()) { + fieldsToSet.add(entry.getKey(), entry.getValue().toArray()); + } + final long res = + collection.update(query, update, false, false, writeConcern); + return writeConcern == Durability.NONE || res == 1 ? Status.OK : Status.NOT_FOUND; + } catch (final Exception e) { + System.err.println(e.toString()); + return Status.ERROR; + } + } + + /** + * Fills the map with the ByteIterators from the document. + * + * @param result + * The map to fill. + * @param queryResult + * The document to fill from. + */ + protected final void fillMap(final HashMap<String, ByteIterator> result, + final Document queryResult) { + for (final Element be : queryResult) { + if (be.getType() == ElementType.BINARY) { + result.put(be.getName(), + new BinaryByteArrayIterator((BinaryElement) be)); + } + } + } + + /** + * BinaryByteArrayIterator provides an adapter from a {@link BinaryElement} to + * a {@link ByteIterator}. + */ + private static final class BinaryByteArrayIterator extends ByteIterator { + + /** The binary data. */ + private final BinaryElement binaryElement; + + /** The current offset into the binary element. */ + private int offset; /** - * 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. + * Creates a new BinaryByteArrayIterator. * - * @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. + * @param element + * The {@link BinaryElement} to iterate over. */ - @Override - public final int scan(final String table, final String startkey, - final int recordcount, final Set<String> fields, - final Vector<HashMap<String, ByteIterator>> result) { - try { - final MongoCollection collection = database.getCollection(table); - - final Find.Builder find = Find.builder() - .query(where("_id").greaterThanOrEqualTo(startkey)) - .limit(recordcount).batchSize(recordcount) - .sort(Sort.asc("_id")).readPreference(readPreference); - - if (fields != null) { - final DocumentBuilder fieldsDoc = BuilderFactory.start(); - for (final String field : fields) { - fieldsDoc.add(field, INCLUDE); - } - - find.projection(fieldsDoc); - } - - result.ensureCapacity(recordcount); - - final MongoIterator<Document> cursor = collection.find(find); - if (!cursor.hasNext()) { - System.err.println("Nothing found in scan for key " + startkey); - return 1; - } - while (cursor.hasNext()) { - // toMap() returns a Map but result.add() expects a - // Map<String,String>. Hence, the suppress warnings. - final Document doc = cursor.next(); - final HashMap<String, ByteIterator> docAsMap = new HashMap<String, ByteIterator>(); - - fillMap(docAsMap, doc); - - result.add(docAsMap); - } - - return 0; - } - catch (final Exception e) { - System.err.println(e.toString()); - return 1; - } + public BinaryByteArrayIterator(final BinaryElement element) { + this.binaryElement = element; + this.offset = 0; } /** - * 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 the - * {@link DB} class's description for a discussion of error codes. + * {@inheritDoc} + * <p> + * Overridden to return the number of bytes remaining in the iterator. + * </p> */ @Override - public final int update(final String table, final String key, - final HashMap<String, ByteIterator> values) { - try { - final MongoCollection collection = database.getCollection(table); - final DocumentBuilder query = BuilderFactory.start() - .add("_id", key); - final DocumentBuilder update = BuilderFactory.start(); - final DocumentBuilder fieldsToSet = update.push("$set"); - - for (final Map.Entry<String, ByteIterator> entry : values - .entrySet()) { - fieldsToSet.add(entry.getKey(), entry.getValue().toArray()); - } - final long res = collection.update(query, update, false, false, - writeConcern); - return res == 1 ? 0 : 1; - } - catch (final Exception e) { - System.err.println(e.toString()); - return 1; - } + public long bytesLeft() { + return Math.max(0, binaryElement.length() - offset); } /** - * Fills the map with the ByteIterators from the document. - * - * @param result - * The map to fill. - * @param queryResult - * The document to fill from. + * {@inheritDoc} + * <p> + * Overridden to return true if there is more data in the + * {@link BinaryElement}. + * </p> */ - protected final void fillMap(final HashMap<String, ByteIterator> result, - final Document queryResult) { - for (final Element be : queryResult) { - if (be.getType() == ElementType.BINARY) { - result.put(be.getName(), new BinaryByteArrayIterator( - (BinaryElement) be)); - } - } + @Override + public boolean hasNext() { + return (offset < binaryElement.length()); } /** - * BinaryByteArrayIterator provides an adapter from a {@link BinaryElement} - * to a {@link ByteIterator}. + * {@inheritDoc} + * <p> + * Overridden to return the next value and advance the iterator. + * </p> */ - private final static class BinaryByteArrayIterator extends ByteIterator { - - /** The binary data. */ - private final BinaryElement binaryElement; - - /** The current offset into the binary element. */ - private int offset; - - /** - * Creates a new BinaryByteArrayIterator. - * - * @param element - * The {@link BinaryElement} to iterate over. - */ - public BinaryByteArrayIterator(final BinaryElement element) { - this.binaryElement = element; - this.offset = 0; - } - - /** - * {@inheritDoc} - * <p> - * Overridden to return the number of bytes remaining in the iterator. - * </p> - */ - @Override - public long bytesLeft() { - return Math.max(0, binaryElement.length() - offset); - } - - /** - * {@inheritDoc} - * <p> - * Overridden to return true if there is more data in the - * {@link BinaryElement}. - * </p> - */ - @Override - public boolean hasNext() { - return (offset < binaryElement.length()); - } - - /** - * {@inheritDoc} - * <p> - * Overridden to return the next value and advance the iterator. - * </p> - */ - @Override - public byte nextByte() { - final byte value = binaryElement.get(offset); - offset += 1; + @Override + public byte nextByte() { + final byte value = binaryElement.get(offset); + offset += 1; - return value; - } + return value; } + } } diff --git a/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java b/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java index 343a2e5e42d7fa0fda9c9c40e5290f84f7775864..2b7cb114fe7a7c09ccdee7d27cede1221c612bbc 100644 --- a/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java +++ b/mongodb/src/main/java/com/yahoo/ycsb/db/MongoDbClient.java @@ -1,38 +1,39 @@ /** + * 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. + */ + +/* * MongoDB client binding for YCSB. * * Submitted by Yen Pai on 5/11/2010. * * https://gist.github.com/000a66b8db2caf42467b#file_mongo_database.java - * */ - package com.yahoo.ycsb.db; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; -import java.util.concurrent.atomic.AtomicInteger; - -import org.bson.Document; -import org.bson.types.Binary; - import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; import com.mongodb.ReadPreference; import com.mongodb.WriteConcern; -import com.mongodb.bulk.BulkWriteResult; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoCursor; import com.mongodb.client.MongoDatabase; -import com.mongodb.client.model.BulkWriteOptions; -import com.mongodb.client.model.InsertOneModel; +import com.mongodb.client.model.InsertManyOptions; +import com.mongodb.client.model.UpdateOneModel; import com.mongodb.client.model.UpdateOptions; import com.mongodb.client.result.DeleteResult; import com.mongodb.client.result.UpdateResult; @@ -40,432 +41,430 @@ import com.yahoo.ycsb.ByteArrayByteIterator; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +import org.bson.Document; +import org.bson.types.Binary; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; +import java.util.concurrent.atomic.AtomicInteger; /** - * MongoDB client for YCSB framework. - * - * Properties to set: - * - * mongodb.url=mongodb://localhost:27017 - * mongodb.writeConcern=acknowledged + * MongoDB binding for YCSB framework using the MongoDB Inc. <a + * href="http://docs.mongodb.org/ecosystem/drivers/java/">driver</a> + * <p> + * See the <code>README.md</code> for configuration information. + * </p> * * @author ypai + * @see <a href="http://docs.mongodb.org/ecosystem/drivers/java/">MongoDB Inc. + * driver</a> */ public class MongoDbClient extends DB { - /** Update options to do an upsert. */ - private static final UpdateOptions UPSERT = new UpdateOptions() - .upsert(true); - - /** Used to include a field in a response. */ - protected static final Integer INCLUDE = Integer.valueOf(1); - - /** The database name to access. */ - private static String databaseName; - - /** The database name to access. */ - private static MongoDatabase database; - - /** - * Count the number of times initialized to teardown on the last - * {@link #cleanup()}. - */ - private static final AtomicInteger initCount = new AtomicInteger(0); - - /** A singleton Mongo instance. */ - private static MongoClient mongoClient; - - /** The default read preference for the test */ - private static ReadPreference readPreference; - - /** The default write concern for the test. */ - private static WriteConcern writeConcern; - - /** The batch size to use for inserts. */ - private static int batchSize; - - /** The bulk inserts pending for the thread. */ - private final List<InsertOneModel<Document>> bulkInserts = new ArrayList<InsertOneModel<Document>>(); - - /** - * Cleanup any state for this DB. Called once per DB instance; there is one - * DB instance per client thread. - */ - @Override - public void cleanup() throws DBException { - if (initCount.decrementAndGet() == 0) { - try { - mongoClient.close(); - } - catch (Exception e1) { - System.err.println("Could not close MongoDB connection pool: " - + e1.toString()); - e1.printStackTrace(); - return; - } - finally { - database = null; - mongoClient = null; - } - } + /** Used to include a field in a response. */ + private static final Integer INCLUDE = Integer.valueOf(1); + + /** The options to use for inserting many documents. */ + private static final InsertManyOptions INSERT_UNORDERED = + new InsertManyOptions().ordered(false); + + /** The options to use for inserting a single document. */ + private static final UpdateOptions UPDATE_WITH_UPSERT = new UpdateOptions() + .upsert(true); + + /** + * The database name to access. + */ + private static String databaseName; + + /** The database name to access. */ + private static MongoDatabase database; + + /** + * Count the number of times initialized to teardown on the last + * {@link #cleanup()}. + */ + private static final AtomicInteger INIT_COUNT = new AtomicInteger(0); + + /** A singleton Mongo instance. */ + private static MongoClient mongoClient; + + /** The default read preference for the test. */ + private static ReadPreference readPreference; + + /** The default write concern for the test. */ + private static WriteConcern writeConcern; + + /** The batch size to use for inserts. */ + private static int batchSize; + + /** If true then use updates with the upsert option for inserts. */ + private static boolean useUpsert; + + /** The bulk inserts pending for the thread. */ + private final List<Document> bulkInserts = new ArrayList<Document>(); + + /** + * Cleanup any state for this DB. Called once per DB instance; there is one DB + * instance per client thread. + */ + @Override + public void cleanup() throws DBException { + if (INIT_COUNT.decrementAndGet() == 0) { + try { + mongoClient.close(); + } catch (Exception e1) { + System.err.println("Could not close MongoDB connection pool: " + + e1.toString()); + e1.printStackTrace(); + return; + } finally { + database = null; + mongoClient = null; + } } - - /** - * 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 int delete(String table, String key) { - try { - MongoCollection<Document> collection = database - .getCollection(table); - - Document query = new Document("_id", key); - DeleteResult result = collection.withWriteConcern(writeConcern) - .deleteOne(query); - if (result.wasAcknowledged() && result.getDeletedCount() == 0) { - System.err.println("Nothing deleted for key " + key); - return 1; - } - return 0; - } - catch (Exception e) { - System.err.println(e.toString()); - return 1; - } + } + + /** + * 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 { + MongoCollection<Document> collection = database.getCollection(table); + + Document query = new Document("_id", key); + DeleteResult result = + collection.withWriteConcern(writeConcern).deleteOne(query); + if (result.wasAcknowledged() && result.getDeletedCount() == 0) { + System.err.println("Nothing deleted for key " + key); + return Status.NOT_FOUND; + } + return Status.OK; + } catch (Exception e) { + System.err.println(e.toString()); + return Status.ERROR; } + } + + /** + * Initialize any state for this DB. Called once per DB instance; there is one + * DB instance per client thread. + */ + @Override + public void init() throws DBException { + INIT_COUNT.incrementAndGet(); + synchronized (INCLUDE) { + if (mongoClient != null) { + return; + } + + Properties props = getProperties(); + + // Set insert batchsize, default 1 - to be YCSB-original equivalent + batchSize = Integer.parseInt(props.getProperty("batchsize", "1")); + + // Set is inserts are done as upserts. Defaults to false. + useUpsert = Boolean.parseBoolean( + props.getProperty("mongodb.upsert", "false")); + + // Just use the standard connection format URL + // http://docs.mongodb.org/manual/reference/connection-string/ + // to configure the client. + String url = props.getProperty("mongodb.url", null); + boolean defaultedUrl = false; + if (url == null) { + defaultedUrl = true; + url = "mongodb://localhost:27017/ycsb?w=1"; + } + + url = OptionsSupport.updateUrl(url, props); + + if (!url.startsWith("mongodb://")) { + System.err.println("ERROR: Invalid URL: '" + url + + "'. Must be of the form " + + "'mongodb://<host1>:<port1>,<host2>:<port2>/database?options'. " + + "http://docs.mongodb.org/manual/reference/connection-string/"); + System.exit(1); + } + + try { + MongoClientURI uri = new MongoClientURI(url); + + String uriDb = uri.getDatabase(); + if (!defaultedUrl && (uriDb != null) && !uriDb.isEmpty() + && !"admin".equals(uriDb)) { + databaseName = uriDb; + } else { + // If no database is specified in URI, use "ycsb" + databaseName = "ycsb"; - /** - * Initialize any state for this DB. Called once per DB instance; there is - * one DB instance per client thread. - */ - @Override - public void init() throws DBException { - initCount.incrementAndGet(); - synchronized (INCLUDE) { - if (mongoClient != null) { - return; - } - - Properties props = getProperties(); - - // Set insert batchsize, default 1 - to be YCSB-original equivalent - batchSize = Integer.parseInt(props.getProperty("batchsize", "1")); - - // Just use the standard connection format URL - // http://docs.mongodb.org/manual/reference/connection-string/ - // to configure the client. - String url = props.getProperty("mongodb.url", null); - boolean defaultedUrl = false; - if (url == null) { - defaultedUrl = true; - url = "mongodb://localhost:27017/ycsb?w=1"; - } - - url = OptionsSupport.updateUrl(url, props); - - if (!url.startsWith("mongodb://")) { - System.err - .println("ERROR: Invalid URL: '" - + url - + "'. Must be of the form " - + "'mongodb://<host1>:<port1>,<host2>:<port2>/database?options'. " - + "http://docs.mongodb.org/manual/reference/connection-string/"); - System.exit(1); - } - - try { - MongoClientURI uri = new MongoClientURI(url); - - String uriDb = uri.getDatabase(); - if (!defaultedUrl && (uriDb != null) && !uriDb.isEmpty() - && !"admin".equals(uriDb)) { - databaseName = uriDb; - } - else { - //If no database is specified in URI, use "ycsb" - databaseName = "ycsb"; - - } - - - readPreference = uri.getOptions().getReadPreference(); - writeConcern = uri.getOptions().getWriteConcern(); - - mongoClient = new MongoClient(uri); - database = mongoClient.getDatabase(databaseName); - - System.out.println("mongo client connection created with " - + url); - } - catch (Exception e1) { - System.err - .println("Could not initialize MongoDB connection pool for Loader: " - + e1.toString()); - e1.printStackTrace(); - return; - } } - } - - /** - * 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 int insert(String table, String key, - HashMap<String, ByteIterator> values) { - try { - MongoCollection<Document> collection = database - .getCollection(table); - Document criteria = new Document("_id", key); - Document toInsert = new Document("_id", key); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - toInsert.put(entry.getKey(), entry.getValue().toArray()); - } - - // Do a single upsert. - if (batchSize <= 1) { - UpdateResult result = collection.withWriteConcern(writeConcern) - .replaceOne(criteria, toInsert, UPSERT); - if (!result.wasAcknowledged() - || result.getMatchedCount() > 0 - || (result.isModifiedCountAvailable() && (result - .getModifiedCount() > 0)) - || result.getUpsertedId() != null) { - return 0; - } - - System.err.println("Nothing inserted for key " + key); - return 1; - } - // Use a bulk insert. - try { - bulkInserts.add(new InsertOneModel<Document>(toInsert)); - if (bulkInserts.size() < batchSize) { - return 0; - } - - BulkWriteResult result = collection.withWriteConcern( - writeConcern).bulkWrite(bulkInserts, - new BulkWriteOptions().ordered(false)); - if (!result.wasAcknowledged() - || result.getInsertedCount() == bulkInserts.size()) { - bulkInserts.clear(); - return 0; - } - - System.err - .println("Number of inserted documents doesn't match the number sent, " - + result.getInsertedCount() - + " inserted, sent " + bulkInserts.size()); - bulkInserts.clear(); - return 1; - } - catch (Exception e) { - System.err.println("Exception while trying bulk insert with " - + bulkInserts.size()); - e.printStackTrace(); - return 1; - } + readPreference = uri.getOptions().getReadPreference(); + writeConcern = uri.getOptions().getWriteConcern(); + + mongoClient = new MongoClient(uri); + database = + mongoClient.getDatabase(databaseName) + .withReadPreference(readPreference) + .withWriteConcern(writeConcern); + + System.out.println("mongo client connection created with " + url); + } catch (Exception e1) { + System.err + .println("Could not initialize MongoDB connection pool for Loader: " + + e1.toString()); + e1.printStackTrace(); + return; + } + } + } + + /** + * 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, + HashMap<String, ByteIterator> values) { + try { + MongoCollection<Document> collection = database.getCollection(table); + Document toInsert = new Document("_id", key); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + toInsert.put(entry.getKey(), entry.getValue().toArray()); + } + + if (batchSize == 1) { + if (useUpsert) { + // this is effectively an insert, but using an upsert instead due + // to current inability of the framework to clean up after itself + // between test runs. + collection.replaceOne(new Document("_id", toInsert.get("_id")), + toInsert, UPDATE_WITH_UPSERT); + } else { + collection.insertOne(toInsert); } - catch (Exception e) { - e.printStackTrace(); - return 1; + } else { + bulkInserts.add(toInsert); + if (bulkInserts.size() == batchSize) { + if (useUpsert) { + List<UpdateOneModel<Document>> updates = + new ArrayList<UpdateOneModel<Document>>(bulkInserts.size()); + for (Document doc : bulkInserts) { + updates.add(new UpdateOneModel<Document>( + new Document("_id", doc.get("_id")), + doc, UPDATE_WITH_UPSERT)); + } + collection.bulkWrite(updates); + } else { + collection.insertMany(bulkInserts, INSERT_UNORDERED); + } + bulkInserts.clear(); + } else { + return Status.BATCHED_OK; } - + } + return Status.OK; + } catch (Exception e) { + System.err.println("Exception while trying bulk insert with " + + bulkInserts.size()); + e.printStackTrace(); + 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". - */ - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - try { - MongoCollection<Document> collection = database - .getCollection(table); - Document query = new Document("_id", key); - Document fieldsToReturn = new Document(); - - Document queryResult = null; - if (fields != null) { - Iterator<String> iter = fields.iterator(); - while (iter.hasNext()) { - fieldsToReturn.put(iter.next(), INCLUDE); - } - queryResult = collection.withReadPreference(readPreference) - .find(query).projection(fieldsToReturn).first(); - } - else { - queryResult = collection.withReadPreference(readPreference) - .find(query).first(); - } - - if (queryResult != null) { - fillMap(result, queryResult); - } - return queryResult != null ? 0 : 1; - } - catch (Exception e) { - System.err.println(e.toString()); - return 1; + } + + /** + * 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". + */ + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + try { + MongoCollection<Document> collection = database.getCollection(table); + Document query = new Document("_id", key); + + FindIterable<Document> findIterable = collection.find(query); + + if (fields != null) { + Document projection = new Document(); + for (String field : fields) { + projection.put(field, INCLUDE); } + findIterable.projection(projection); + } + + Document queryResult = findIterable.first(); + + if (queryResult != null) { + fillMap(result, queryResult); + } + return queryResult != null ? Status.OK : Status.NOT_FOUND; + } catch (Exception e) { + System.err.println(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) { + MongoCursor<Document> cursor = null; + try { + MongoCollection<Document> collection = database.getCollection(table); + + Document scanRange = new Document("$gte", startkey); + Document query = new Document("_id", scanRange); + Document sort = new Document("_id", INCLUDE); + + FindIterable<Document> findIterable = + collection.find(query).sort(sort).limit(recordcount); + + if (fields != null) { + Document projection = new Document(); + for (String fieldName : fields) { + projection.put(fieldName, INCLUDE); + } + findIterable.projection(projection); + } - /** - * 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 int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - FindIterable<Document> cursor = null; - MongoCursor<Document> iter = null; - try { - MongoCollection<Document> collection = database - .getCollection(table); - - Document scanRange = new Document("$gte", startkey); - Document query = new Document("_id", scanRange); - Document sort = new Document("_id", INCLUDE); - Document projection = null; - if (fields != null) { - projection = new Document(); - for (String fieldName : fields) { - projection.put(fieldName, INCLUDE); - } - } + cursor = findIterable.iterator(); - cursor = collection.withReadPreference(readPreference).find(query) - .projection(projection).sort(sort).limit(recordcount); + if (!cursor.hasNext()) { + System.err.println("Nothing found in scan for key " + startkey); + return Status.ERROR; + } - // Do the query. - iter = cursor.iterator(); - if (!iter.hasNext()) { - System.err.println("Nothing found in scan for key " + startkey); - return 1; - } - while (iter.hasNext()) { - HashMap<String, ByteIterator> resultMap = new HashMap<String, ByteIterator>(); + result.ensureCapacity(recordcount); - Document obj = iter.next(); - fillMap(resultMap, obj); + while (cursor.hasNext()) { + HashMap<String, ByteIterator> resultMap = + new HashMap<String, ByteIterator>(); - result.add(resultMap); - } + Document obj = cursor.next(); + fillMap(resultMap, obj); - return 0; - } - catch (Exception e) { - System.err.println(e.toString()); - return 1; - } - finally { - if (iter != null) { - iter.close(); - } - } - } + result.add(resultMap); + } - /** - * 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 int update(String table, String key, - HashMap<String, ByteIterator> values) { - try { - MongoCollection<Document> collection = database - .getCollection(table); - - Document query = new Document("_id", key); - Document fieldsToSet = new Document(); - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - fieldsToSet.put(entry.getKey(), entry.getValue().toArray()); - } - Document update = new Document("$set", fieldsToSet); - - UpdateResult result = collection.withWriteConcern(writeConcern) - .updateOne(query, update); - if (result.wasAcknowledged() && result.getMatchedCount() == 0) { - System.err.println("Nothing updated for key " + key); - return 1; - } - return 0; - } - catch (Exception e) { - System.err.println(e.toString()); - return 1; - } + return Status.OK; + } catch (Exception e) { + System.err.println(e.toString()); + return Status.ERROR; + } finally { + if (cursor != null) { + cursor.close(); + } } - - /** - * Fills the map with the values from the DBObject. - * - * @param resultMap - * The map to fill/ - * @param obj - * The object to copy values from. - */ - protected void fillMap(HashMap<String, ByteIterator> resultMap, Document obj) { - for (Map.Entry<String, Object> entry : obj.entrySet()) { - if (entry.getValue() instanceof Binary) { - resultMap.put(entry.getKey(), new ByteArrayByteIterator( - ((Binary) entry.getValue()).getData())); - } - } + } + + /** + * 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, + HashMap<String, ByteIterator> values) { + try { + MongoCollection<Document> collection = database.getCollection(table); + + Document query = new Document("_id", key); + Document fieldsToSet = new Document(); + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + fieldsToSet.put(entry.getKey(), entry.getValue().toArray()); + } + Document update = new Document("$set", fieldsToSet); + + UpdateResult result = collection.updateOne(query, update); + if (result.wasAcknowledged() && result.getMatchedCount() == 0) { + System.err.println("Nothing updated for key " + key); + return Status.NOT_FOUND; + } + return Status.OK; + } catch (Exception e) { + System.err.println(e.toString()); + return Status.ERROR; + } + } + + /** + * Fills the map with the values from the DBObject. + * + * @param resultMap + * The map to fill/ + * @param obj + * The object to copy values from. + */ + protected void fillMap(Map<String, ByteIterator> resultMap, Document obj) { + for (Map.Entry<String, Object> entry : obj.entrySet()) { + if (entry.getValue() instanceof Binary) { + resultMap.put(entry.getKey(), + new ByteArrayByteIterator(((Binary) entry.getValue()).getData())); + } } + } } diff --git a/mongodb/src/main/java/com/yahoo/ycsb/db/OptionsSupport.java b/mongodb/src/main/java/com/yahoo/ycsb/db/OptionsSupport.java index b8aa6f4d5ddd37d93c326c94a96664045faf1b54..62092a0d10a51e4384156235f4a59504585ea853 100644 --- a/mongodb/src/main/java/com/yahoo/ycsb/db/OptionsSupport.java +++ b/mongodb/src/main/java/com/yahoo/ycsb/db/OptionsSupport.java @@ -1,148 +1,145 @@ /* - * #%L - * OptionsSupport.java - mongodb-binding - Yahoo!, Inc. - * %% - * Copyright (C) 2015 Yahoo!, Inc. - * %% - * 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 - * + * 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. - * #L% + * 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 java.util.Properties; /** * OptionsSupport provides methods for handling legacy options. - * + * * @author rjm */ public final class OptionsSupport { - /** Value for an unavailable property. */ - protected static final String UNAVAILABLE = "n/a"; - - /** - * Updates the URL with the appropriate attributes if legacy properties are - * set and the URL does not have the property already set. - * - * @param url - * The URL to update. - * @param props - * The legacy properties. - * @return The updated URL. - */ - public static String updateUrl(String url, Properties props) { - String result = url; + /** Value for an unavailable property. */ + private static final String UNAVAILABLE = "n/a"; - // max connections. - final String maxConnections = props.getProperty( - "mongodb.maxconnections", UNAVAILABLE).toLowerCase(); - if (!UNAVAILABLE.equals(maxConnections)) { - result = addUrlOption(result, "maxPoolSize", maxConnections); - } + /** + * Updates the URL with the appropriate attributes if legacy properties are + * set and the URL does not have the property already set. + * + * @param url + * The URL to update. + * @param props + * The legacy properties. + * @return The updated URL. + */ + public static String updateUrl(String url, Properties props) { + String result = url; - // Blocked thread multiplier. - final String threadsAllowedToBlockForConnectionMultiplier = props - .getProperty( - "mongodb.threadsAllowedToBlockForConnectionMultiplier", - UNAVAILABLE).toLowerCase(); - if (!UNAVAILABLE.equals(threadsAllowedToBlockForConnectionMultiplier)) { - result = addUrlOption(result, "waitQueueMultiple", - threadsAllowedToBlockForConnectionMultiplier); - } + // max connections. + final String maxConnections = + props.getProperty("mongodb.maxconnections", UNAVAILABLE).toLowerCase(); + if (!UNAVAILABLE.equals(maxConnections)) { + result = addUrlOption(result, "maxPoolSize", maxConnections); + } - // write concern - String writeConcernType = props.getProperty("mongodb.writeConcern", + // Blocked thread multiplier. + final String threadsAllowedToBlockForConnectionMultiplier = + props + .getProperty( + "mongodb.threadsAllowedToBlockForConnectionMultiplier", UNAVAILABLE).toLowerCase(); - if (!UNAVAILABLE.equals(writeConcernType)) { - if ("errors_ignored".equals(writeConcernType)) { - result = addUrlOption(result, "w", "0"); - } - else if ("unacknowledged".equals(writeConcernType)) { - result = addUrlOption(result, "w", "0"); - } - else if ("acknowledged".equals(writeConcernType)) { - result = addUrlOption(result, "w", "1"); - } - else if ("journaled".equals(writeConcernType)) { - result = addUrlOption(result, "journal", "true"); - } - else if ("replica_acknowledged".equals(writeConcernType)) { - result = addUrlOption(result, "w", "2"); - } - else if ("majority".equals(writeConcernType)) { - result = addUrlOption(result, "w", "majority"); - } - else { - System.err.println("WARNING: Invalid writeConcern: '" - + writeConcernType + "' will be ignored. " - + "Must be one of [ unacknowledged | acknowledged | " - + "journaled | replica_acknowledged | majority ]"); - } - } + if (!UNAVAILABLE.equals(threadsAllowedToBlockForConnectionMultiplier)) { + result = + addUrlOption(result, "waitQueueMultiple", + threadsAllowedToBlockForConnectionMultiplier); + } - // read preference - String readPreferenceType = props.getProperty("mongodb.readPreference", - UNAVAILABLE).toLowerCase(); - if (!UNAVAILABLE.equals(readPreferenceType)) { - if ("primary".equals(readPreferenceType)) { - result = addUrlOption(result, "readPreference", "primary"); - } - else if ("primary_preferred".equals(readPreferenceType)) { - result = addUrlOption(result, "readPreference", - "primaryPreferred"); - } - else if ("secondary".equals(readPreferenceType)) { - result = addUrlOption(result, "readPreference", "secondary"); - } - else if ("secondary_preferred".equals(readPreferenceType)) { - result = addUrlOption(result, "readPreference", - "secondaryPreferred"); - } - else if ("nearest".equals(readPreferenceType)) { - result = addUrlOption(result, "readPreference", "nearest"); - } - else { - System.err.println("WARNING: Invalid readPreference: '" - + readPreferenceType + "' will be ignored. " - + "Must be one of [ primary | primary_preferred | " - + "secondary | secondary_preferred | nearest ]"); - } - } + // write concern + String writeConcernType = + props.getProperty("mongodb.writeConcern", UNAVAILABLE).toLowerCase(); + if (!UNAVAILABLE.equals(writeConcernType)) { + if ("errors_ignored".equals(writeConcernType)) { + result = addUrlOption(result, "w", "0"); + } else if ("unacknowledged".equals(writeConcernType)) { + result = addUrlOption(result, "w", "0"); + } else if ("acknowledged".equals(writeConcernType)) { + result = addUrlOption(result, "w", "1"); + } else if ("journaled".equals(writeConcernType)) { + result = addUrlOption(result, "journal", "true"); // this is the + // documented option + // name + result = addUrlOption(result, "j", "true"); // but keep this until + // MongoDB Java driver + // supports "journal" option + } else if ("replica_acknowledged".equals(writeConcernType)) { + result = addUrlOption(result, "w", "2"); + } else if ("majority".equals(writeConcernType)) { + result = addUrlOption(result, "w", "majority"); + } else { + System.err.println("WARNING: Invalid writeConcern: '" + + writeConcernType + "' will be ignored. " + + "Must be one of [ unacknowledged | acknowledged | " + + "journaled | replica_acknowledged | majority ]"); + } + } - return result; + // read preference + String readPreferenceType = + props.getProperty("mongodb.readPreference", UNAVAILABLE).toLowerCase(); + if (!UNAVAILABLE.equals(readPreferenceType)) { + if ("primary".equals(readPreferenceType)) { + result = addUrlOption(result, "readPreference", "primary"); + } else if ("primary_preferred".equals(readPreferenceType)) { + result = addUrlOption(result, "readPreference", "primaryPreferred"); + } else if ("secondary".equals(readPreferenceType)) { + result = addUrlOption(result, "readPreference", "secondary"); + } else if ("secondary_preferred".equals(readPreferenceType)) { + result = addUrlOption(result, "readPreference", "secondaryPreferred"); + } else if ("nearest".equals(readPreferenceType)) { + result = addUrlOption(result, "readPreference", "nearest"); + } else { + System.err.println("WARNING: Invalid readPreference: '" + + readPreferenceType + "' will be ignored. " + + "Must be one of [ primary | primary_preferred | " + + "secondary | secondary_preferred | nearest ]"); + } } - /** - * Adds an option to the url if it does not already contain the option. - * - * @param url - * The URL to append the options to. - * @param name - * The name of the option. - * @param value - * The value for the option. - * @return The updated URL. - */ - private static String addUrlOption(String url, String name, String value) { - String fullName = name + "="; - if (!url.contains(fullName)) { - if (url.contains("?")) { - return url + "&" + fullName + value; - } - return url + "?" + fullName + value; - } - return url; + return result; + } + + /** + * Adds an option to the url if it does not already contain the option. + * + * @param url + * The URL to append the options to. + * @param name + * The name of the option. + * @param value + * The value for the option. + * @return The updated URL. + */ + private static String addUrlOption(String url, String name, String value) { + String fullName = name + "="; + if (!url.contains(fullName)) { + if (url.contains("?")) { + return url + "&" + fullName + value; + } + return url + "?" + fullName + value; } + return url; + } + + /** + * Hidden Constructor. + */ + private OptionsSupport() { + // Nothing. + } } diff --git a/mongodb/src/main/java/com/yahoo/ycsb/db/package-info.java b/mongodb/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..6c64e3fa7434b191b5bc4374cb0c763fc633e769 --- /dev/null +++ b/mongodb/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,32 @@ +/* + * 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://www.mongodb.org/">MongoDB</a>. + * For additional details on using and configuring the binding see the + * accompanying <a + * href="https://github.com/brianfrankcooper/YCSB/blob/master/mongodb/README.md" + * >README.md</a>. + * <p> + * A YCSB binding is provided for both the the + * <a href="http://www.allanbank.com/mongodb-async-driver/">Asynchronous + * Java Driver</a> and the MongoDB Inc. + * <a href="http://docs.mongodb.org/ecosystem/drivers/java/">driver</a>. + * </p> + */ +package com.yahoo.ycsb.db; + diff --git a/mongodb/src/main/resources/log4j.properties b/mongodb/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..266877c4aff8caf4e3145f812d85a6f2d272893b --- /dev/null +++ b/mongodb/src/main/resources/log4j.properties @@ -0,0 +1,25 @@ +# Copyright (c) 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. + +#define the console appender +log4j.appender.consoleAppender = org.apache.log4j.ConsoleAppender + +# now define the layout for the appender +log4j.appender.consoleAppender.layout = org.apache.log4j.PatternLayout +log4j.appender.consoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x -%m%n + +# now map our console appender as a root logger, means all log messages will go +# to this appender +log4j.rootLogger = INFO, consoleAppender diff --git a/mongodb/src/main/resources/logback.xml b/mongodb/src/main/resources/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..73354e060f8be3145f416c9f038645deb4aa9f7f --- /dev/null +++ b/mongodb/src/main/resources/logback.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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. +--> +<configuration> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> + </encoder> + </appender> + + <logger name="org.mongodb" level="WARN"> + <appender-ref ref="STDOUT"/> + </logger> + + <root level="INFO"> + <appender-ref ref="STDOUT"/> + </root> +</configuration> diff --git a/mongodb/src/test/java/com/yahoo/ycsb/db/AbstractDBTestCases.java b/mongodb/src/test/java/com/yahoo/ycsb/db/AbstractDBTestCases.java index 79340e8016f11ab4ee6bb13368d207cd4eeb7b01..9a0b095f3d7c36a864b31744cd4714167704e9f6 100644 --- a/mongodb/src/test/java/com/yahoo/ycsb/db/AbstractDBTestCases.java +++ b/mongodb/src/test/java/com/yahoo/ycsb/db/AbstractDBTestCases.java @@ -1,18 +1,18 @@ -/* - * 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. +/* + * 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. */ package com.yahoo.ycsb.db; @@ -24,21 +24,23 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeNoException; +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.Status; + +import org.junit.BeforeClass; +import org.junit.Test; + import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.util.Collections; import java.util.HashMap; +import java.util.Properties; import java.util.Set; import java.util.Vector; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.yahoo.ycsb.ByteArrayByteIterator; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.DB; - /** * MongoDbClientTest provides runs the basic DB test cases. * <p> @@ -49,219 +51,289 @@ import com.yahoo.ycsb.DB; @SuppressWarnings("boxing") public abstract class AbstractDBTestCases { - /** The default port for MongoDB. */ - private static final int MONGODB_DEFAULT_PORT = 27017; - - /** - * Verifies the mongod process (or some process) is running on port 27017, - * if not the tests are skipped. - */ - @BeforeClass - public static void setUpBeforeClass() { - // Test if we can connect. - Socket socket = null; + /** The default port for MongoDB. */ + private static final int MONGODB_DEFAULT_PORT = 27017; + + /** + * Verifies the mongod process (or some process) is running on port 27017, if + * not the tests are skipped. + */ + @BeforeClass + public static void setUpBeforeClass() { + // Test if we can connect. + Socket socket = null; + try { + // Connect + socket = new Socket(InetAddress.getLocalHost(), MONGODB_DEFAULT_PORT); + assertThat("Socket is not bound.", socket.getLocalPort(), not(-1)); + } catch (IOException connectFailed) { + assumeNoException("MongoDB is not running. Skipping tests.", + connectFailed); + } finally { + if (socket != null) { try { - // Connect - socket = new Socket(InetAddress.getLocalHost(), - MONGODB_DEFAULT_PORT); - assertThat("Socket is not bound.", socket.getLocalPort(), not(-1)); - } - catch (IOException connectFailed) { - assumeNoException("MongoDB is not running. Skipping tests.", - connectFailed); - } - finally { - if (socket != null) { - try { - socket.close(); - } - catch (IOException ignore) { - // Ignore. - } - } - socket = null; + socket.close(); + } catch (IOException ignore) { + // Ignore. } + } + socket = null; } + } - /** - * Test method for {@link DB#insert}, {@link DB#read}, and {@link DB#delete} - * . - */ - @Test - public void testInsertReadDelete() { - final DB client = getDB(); - - final String table = "test"; - final String id = "delete"; - - HashMap<String, ByteIterator> inserted = new HashMap<String, ByteIterator>(); - inserted.put("a", new ByteArrayByteIterator(new byte[] { 1, 2, 3, 4 })); - int result = client.insert(table, id, inserted); - assertThat("Insert did not return success (0).", result, is(0)); - - HashMap<String, ByteIterator> read = new HashMap<String, ByteIterator>(); - Set<String> keys = Collections.singleton("a"); - result = client.read(table, id, keys, read); - assertThat("Read did not return success (0).", result, is(0)); - for (String key : keys) { - ByteIterator iter = read.get(key); - - assertThat("Did not read the inserted field: " + key, iter, - notNullValue()); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 1))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 2))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 3))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 4))); - assertFalse(iter.hasNext()); - } + /** + * Test method for {@link DB#insert}, {@link DB#read}, and {@link DB#delete} . + */ + @Test + public void testInsertReadDelete() { + final DB client = getDB(); + + final String table = getClass().getSimpleName(); + final String id = "delete"; - result = client.delete(table, id); - assertThat("Delete did not return success (0).", result, is(0)); + HashMap<String, ByteIterator> inserted = + new HashMap<String, ByteIterator>(); + inserted.put("a", new ByteArrayByteIterator(new byte[] { 1, 2, 3, 4 })); + Status result = client.insert(table, id, inserted); + assertThat("Insert did not return success (0).", result, is(Status.OK)); - read.clear(); - result = client.read(table, id, null, read); - assertThat("Read, after delete, did not return not found (1).", result, - is(1)); - assertThat("Found the deleted fields.", read.size(), is(0)); + HashMap<String, ByteIterator> read = new HashMap<String, ByteIterator>(); + Set<String> keys = Collections.singleton("a"); + result = client.read(table, id, keys, read); + assertThat("Read did not return success (0).", result, is(Status.OK)); + for (String key : keys) { + ByteIterator iter = read.get(key); - result = client.delete(table, id); - assertThat("Delete did not return not found (1).", result, is(1)); + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 1))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 2))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 3))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 4))); + assertFalse(iter.hasNext()); } - /** - * Test method for {@link DB#insert}, {@link DB#read}, and {@link DB#update} - * . - */ - @Test - public void testInsertReadUpdate() { - DB client = getDB(); - - final String table = "test"; - final String id = "update"; - - HashMap<String, ByteIterator> inserted = new HashMap<String, ByteIterator>(); - inserted.put("a", new ByteArrayByteIterator(new byte[] { 1, 2, 3, 4 })); - int result = client.insert(table, id, inserted); - assertThat("Insert did not return success (0).", result, is(0)); - - HashMap<String, ByteIterator> read = new HashMap<String, ByteIterator>(); - Set<String> keys = Collections.singleton("a"); - result = client.read(table, id, keys, read); - assertThat("Read did not return success (0).", result, is(0)); - for (String key : keys) { - ByteIterator iter = read.get(key); - - assertThat("Did not read the inserted field: " + key, iter, - notNullValue()); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 1))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 2))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 3))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 4))); - assertFalse(iter.hasNext()); - } + result = client.delete(table, id); + assertThat("Delete did not return success (0).", result, is(Status.OK)); - HashMap<String, ByteIterator> updated = new HashMap<String, ByteIterator>(); - updated.put("a", new ByteArrayByteIterator(new byte[] { 5, 6, 7, 8 })); - result = client.update(table, id, updated); - assertThat("Update did not return success (0).", result, is(0)); - - read.clear(); - result = client.read(table, id, null, read); - assertThat("Read, after update, did not return success (0).", result, - is(0)); - for (String key : keys) { - ByteIterator iter = read.get(key); - - assertThat("Did not read the inserted field: " + key, iter, - notNullValue()); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 5))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 6))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 7))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), is(Byte.valueOf((byte) 8))); - assertFalse(iter.hasNext()); - } + read.clear(); + result = client.read(table, id, null, read); + assertThat("Read, after delete, did not return not found (1).", result, + is(Status.NOT_FOUND)); + assertThat("Found the deleted fields.", read.size(), is(0)); + + result = client.delete(table, id); + assertThat("Delete did not return not found (1).", result, is(Status.NOT_FOUND)); + } + + /** + * Test method for {@link DB#insert}, {@link DB#read}, and {@link DB#update} . + */ + @Test + public void testInsertReadUpdate() { + DB client = getDB(); + + final String table = getClass().getSimpleName(); + final String id = "update"; + + HashMap<String, ByteIterator> inserted = + new HashMap<String, ByteIterator>(); + inserted.put("a", new ByteArrayByteIterator(new byte[] { 1, 2, 3, 4 })); + Status result = client.insert(table, id, inserted); + assertThat("Insert did not return success (0).", result, is(Status.OK)); + + HashMap<String, ByteIterator> read = new HashMap<String, ByteIterator>(); + Set<String> keys = Collections.singleton("a"); + result = client.read(table, id, keys, read); + assertThat("Read did not return success (0).", result, is(Status.OK)); + for (String key : keys) { + ByteIterator iter = read.get(key); + + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 1))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 2))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 3))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 4))); + assertFalse(iter.hasNext()); } - /** - * Test method for {@link DB#scan}. - */ - @Test - public void testScan() { - final DB client = getDB(); - - final String table = "test"; - - // Insert a bunch of documents. - for (int i = 0; i < 100; ++i) { - HashMap<String, ByteIterator> inserted = new HashMap<String, ByteIterator>(); - inserted.put("a", new ByteArrayByteIterator(new byte[] { - (byte) (i & 0xFF), (byte) (i >> 8 & 0xFF), - (byte) (i >> 16 & 0xFF), (byte) (i >> 24 & 0xFF) })); - int result = client.insert(table, padded(i), inserted); - assertThat("Insert did not return success (0).", result, is(0)); - } + HashMap<String, ByteIterator> updated = new HashMap<String, ByteIterator>(); + updated.put("a", new ByteArrayByteIterator(new byte[] { 5, 6, 7, 8 })); + result = client.update(table, id, updated); + assertThat("Update did not return success (0).", result, is(Status.OK)); - Set<String> keys = Collections.singleton("a"); - Vector<HashMap<String, ByteIterator>> results = new Vector<HashMap<String, ByteIterator>>(); - int result = client.scan(table, "00050", 5, null, results); - assertThat("Read did not return success (0).", result, is(0)); - assertThat(results.size(), is(5)); - for (int i = 0; i < 5; ++i) { - HashMap<String, ByteIterator> read = results.get(i); - for (String key : keys) { - ByteIterator iter = read.get(key); - - assertThat("Did not read the inserted field: " + key, iter, - notNullValue()); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), - is(Byte.valueOf((byte) ((i + 50) & 0xFF)))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), - is(Byte.valueOf((byte) ((i + 50) >> 8 & 0xFF)))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), - is(Byte.valueOf((byte) ((i + 50) >> 16 & 0xFF)))); - assertTrue(iter.hasNext()); - assertThat(iter.nextByte(), - is(Byte.valueOf((byte) ((i + 50) >> 24 & 0xFF)))); - assertFalse(iter.hasNext()); - } - } + read.clear(); + result = client.read(table, id, null, read); + assertThat("Read, after update, did not return success (0).", result, is(Status.OK)); + for (String key : keys) { + ByteIterator iter = read.get(key); + + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 5))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 6))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 7))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 8))); + assertFalse(iter.hasNext()); } + } - /** - * Gets the test DB. - * - * @return The test DB. - */ - protected abstract DB getDB(); - - /** - * Creates a zero padded integer. - * - * @param i - * The integer to padd. - * @return The padded integer. - */ - private String padded(int i) { - String result = String.valueOf(i); - while (result.length() < 5) { - result = "0" + result; - } - return result; + /** + * Test method for {@link DB#insert}, {@link DB#read}, and {@link DB#update} . + */ + @Test + public void testInsertReadUpdateWithUpsert() { + Properties props = new Properties(); + props.setProperty("mongodb.upsert", "true"); + DB client = getDB(props); + + final String table = getClass().getSimpleName(); + final String id = "updateWithUpsert"; + + HashMap<String, ByteIterator> inserted = + new HashMap<String, ByteIterator>(); + inserted.put("a", new ByteArrayByteIterator(new byte[] { 1, 2, 3, 4 })); + Status result = client.insert(table, id, inserted); + assertThat("Insert did not return success (0).", result, is(Status.OK)); + + HashMap<String, ByteIterator> read = new HashMap<String, ByteIterator>(); + Set<String> keys = Collections.singleton("a"); + result = client.read(table, id, keys, read); + assertThat("Read did not return success (0).", result, is(Status.OK)); + for (String key : keys) { + ByteIterator iter = read.get(key); + + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 1))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 2))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 3))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 4))); + assertFalse(iter.hasNext()); + } + + HashMap<String, ByteIterator> updated = new HashMap<String, ByteIterator>(); + updated.put("a", new ByteArrayByteIterator(new byte[] { 5, 6, 7, 8 })); + result = client.update(table, id, updated); + assertThat("Update did not return success (0).", result, is(Status.OK)); + + read.clear(); + result = client.read(table, id, null, read); + assertThat("Read, after update, did not return success (0).", result, is(Status.OK)); + for (String key : keys) { + ByteIterator iter = read.get(key); + + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 5))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 6))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 7))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) 8))); + assertFalse(iter.hasNext()); + } + } + + /** + * Test method for {@link DB#scan}. + */ + @Test + public void testScan() { + final DB client = getDB(); + + final String table = getClass().getSimpleName(); + + // Insert a bunch of documents. + for (int i = 0; i < 100; ++i) { + HashMap<String, ByteIterator> inserted = + new HashMap<String, ByteIterator>(); + inserted.put("a", new ByteArrayByteIterator(new byte[] { + (byte) (i & 0xFF), (byte) (i >> 8 & 0xFF), (byte) (i >> 16 & 0xFF), + (byte) (i >> 24 & 0xFF) })); + Status result = client.insert(table, padded(i), inserted); + assertThat("Insert did not return success (0).", result, is(Status.OK)); + } + + Set<String> keys = Collections.singleton("a"); + Vector<HashMap<String, ByteIterator>> results = + new Vector<HashMap<String, ByteIterator>>(); + Status result = client.scan(table, "00050", 5, null, results); + assertThat("Read did not return success (0).", result, is(Status.OK)); + assertThat(results.size(), is(5)); + for (int i = 0; i < 5; ++i) { + HashMap<String, ByteIterator> read = results.get(i); + for (String key : keys) { + ByteIterator iter = read.get(key); + + assertThat("Did not read the inserted field: " + key, iter, + notNullValue()); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), is(Byte.valueOf((byte) ((i + 50) & 0xFF)))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), + is(Byte.valueOf((byte) ((i + 50) >> 8 & 0xFF)))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), + is(Byte.valueOf((byte) ((i + 50) >> 16 & 0xFF)))); + assertTrue(iter.hasNext()); + assertThat(iter.nextByte(), + is(Byte.valueOf((byte) ((i + 50) >> 24 & 0xFF)))); + assertFalse(iter.hasNext()); + } + } + } + + /** + * Gets the test DB. + * + * @return The test DB. + */ + protected DB getDB() { + return getDB(new Properties()); + } + + /** + * Gets the test DB. + * + * @param props + * Properties to pass to the client. + * @return The test DB. + */ + protected abstract DB getDB(Properties props); + + /** + * Creates a zero padded integer. + * + * @param i + * The integer to padd. + * @return The padded integer. + */ + private String padded(int i) { + String result = String.valueOf(i); + while (result.length() < 5) { + result = "0" + result; } + return result; + } } \ No newline at end of file diff --git a/mongodb/src/test/java/com/yahoo/ycsb/db/AsyncMongoDbClientTest.java b/mongodb/src/test/java/com/yahoo/ycsb/db/AsyncMongoDbClientTest.java index f5ee7b658e5f0e5b6a018a9fb0cb244d3422ffcd..c387be491dec02f9fefd75f7e0c1398793d42a24 100644 --- a/mongodb/src/test/java/com/yahoo/ycsb/db/AsyncMongoDbClientTest.java +++ b/mongodb/src/test/java/com/yahoo/ycsb/db/AsyncMongoDbClientTest.java @@ -1,77 +1,30 @@ -/* - * 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. +/* + * 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. */ package com.yahoo.ycsb.db; -import static org.junit.Assume.assumeNoException; - -import java.util.Properties; - -import org.junit.After; -import org.junit.Before; - import com.yahoo.ycsb.DB; /** * AsyncMongoDbClientTest provides runs the basic workload operations. */ -public class AsyncMongoDbClientTest extends AbstractDBTestCases { - - /** The client to use. */ - private AsyncMongoDbClient myClient = null; - - /** - * Start a test client. - */ - @Before - public void setUp() { - myClient = new AsyncMongoDbClient(); - myClient.setProperties(new Properties()); - try { - myClient.init(); - } - catch (Exception error) { - assumeNoException(error); - } - } - - /** - * Stops the test client. - */ - @After - public void tearDown() { - try { - myClient.cleanup(); - } - catch (Exception error) { - // Ignore. - } - finally { - myClient = null; - } - } +public class AsyncMongoDbClientTest extends MongoDbClientTest { - /** - * {@inheritDoc} - * <p> - * Overriden to return the {@link AsyncMongoDbClient}. - * </p> - */ - @Override - protected DB getDB() { - return myClient; - } + @Override + protected DB instantiateClient() { + return new AsyncMongoDbClient(); + } } diff --git a/mongodb/src/test/java/com/yahoo/ycsb/db/MongoDbClientTest.java b/mongodb/src/test/java/com/yahoo/ycsb/db/MongoDbClientTest.java index 515fb8026309e576c36ccba399d161505d90719d..3a4b4f0277beaa0425bcb674fabbece51dc90214 100644 --- a/mongodb/src/test/java/com/yahoo/ycsb/db/MongoDbClientTest.java +++ b/mongodb/src/test/java/com/yahoo/ycsb/db/MongoDbClientTest.java @@ -1,18 +1,18 @@ -/* - * 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. +/* + * 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. */ package com.yahoo.ycsb.db; @@ -21,7 +21,6 @@ import static org.junit.Assume.assumeNoException; import java.util.Properties; import org.junit.After; -import org.junit.Before; import com.yahoo.ycsb.DB; @@ -30,48 +29,44 @@ import com.yahoo.ycsb.DB; */ public class MongoDbClientTest extends AbstractDBTestCases { - /** The client to use. */ - private MongoDbClient myClient = null; + /** The client to use. */ + private DB myClient = null; - /** - * Start a test client. - */ - @Before - public void setUp() { - myClient = new MongoDbClient(); - myClient.setProperties(new Properties()); - try { - myClient.init(); - } - catch (Exception error) { - assumeNoException(error); - } - } + protected DB instantiateClient() { + return new MongoDbClient(); + } - /** - * Stops the test client. - */ - @After - public void tearDown() { - try { - myClient.cleanup(); - } - catch (Exception error) { - // Ignore. - } - finally { - myClient = null; - } + /** + * Stops the test client. + */ + @After + public void tearDown() { + try { + myClient.cleanup(); + } catch (Exception error) { + // Ignore. + } finally { + myClient = null; } + } - /** - * {@inheritDoc} - * <p> - * Overriden to return the {@link MongoDbClient}. - * </p> - */ - @Override - protected DB getDB() { - return myClient; + /** + * {@inheritDoc} + * <p> + * Overridden to return the {@link MongoDbClient}. + * </p> + */ + @Override + protected DB getDB(Properties props) { + if( myClient == null ) { + myClient = instantiateClient(); + myClient.setProperties(props); + try { + myClient.init(); + } catch (Exception error) { + assumeNoException(error); + } } + return myClient; + } } diff --git a/mongodb/src/test/java/com/yahoo/ycsb/db/OptionsSupportTest.java b/mongodb/src/test/java/com/yahoo/ycsb/db/OptionsSupportTest.java index 20829d55571b3f7f0db7a16b56acf674be6b8791..be7f52fe1d6a8ffbe53bdd9a743869c1eccbca60 100644 --- a/mongodb/src/test/java/com/yahoo/ycsb/db/OptionsSupportTest.java +++ b/mongodb/src/test/java/com/yahoo/ycsb/db/OptionsSupportTest.java @@ -1,23 +1,19 @@ /* - * #%L - * OptionsSupport.java - mongodb-binding - Yahoo!, Inc. - * %% - * Copyright (C) 2015 Yahoo!, Inc. - * %% - * 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 - * + * 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. - * #L% + * 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 static com.yahoo.ycsb.db.OptionsSupport.updateUrl; @@ -30,164 +26,159 @@ import org.junit.Test; /** * OptionsSupportTest provides tests for the OptionsSupport class. - * + * * @author rjm */ public class OptionsSupportTest { - /** - * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for - * {@code mongodb.maxconnections}. - */ - @Test - public void testUpdateUrlMaxConnections() { - assertThat( - updateUrl("mongodb://locahost:27017/", - props("mongodb.maxconnections", "1234")), - is("mongodb://locahost:27017/?maxPoolSize=1234")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.maxconnections", "1234")), - is("mongodb://locahost:27017/?foo=bar&maxPoolSize=1234")); - assertThat( - updateUrl("mongodb://locahost:27017/?maxPoolSize=1", - props("mongodb.maxconnections", "1234")), - is("mongodb://locahost:27017/?maxPoolSize=1")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("foo", "1234")), - is("mongodb://locahost:27017/?foo=bar")); - } - - /** - * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for - * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. - */ - @Test - public void testUpdateUrlWaitQueueMultiple() { - assertThat( - updateUrl( - "mongodb://locahost:27017/", - props("mongodb.threadsAllowedToBlockForConnectionMultiplier", - "1234")), - is("mongodb://locahost:27017/?waitQueueMultiple=1234")); - assertThat( - updateUrl( - "mongodb://locahost:27017/?foo=bar", - props("mongodb.threadsAllowedToBlockForConnectionMultiplier", - "1234")), - is("mongodb://locahost:27017/?foo=bar&waitQueueMultiple=1234")); - assertThat( - updateUrl( - "mongodb://locahost:27017/?waitQueueMultiple=1", - props("mongodb.threadsAllowedToBlockForConnectionMultiplier", - "1234")), - is("mongodb://locahost:27017/?waitQueueMultiple=1")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("foo", "1234")), - is("mongodb://locahost:27017/?foo=bar")); - } - - /** - * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for - * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. - */ - @Test - public void testUpdateUrlWriteConcern() { - assertThat( - updateUrl("mongodb://locahost:27017/", - props("mongodb.writeConcern", "errors_ignored")), - is("mongodb://locahost:27017/?w=0")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.writeConcern", "unacknowledged")), - is("mongodb://locahost:27017/?foo=bar&w=0")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.writeConcern", "acknowledged")), - is("mongodb://locahost:27017/?foo=bar&w=1")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.writeConcern", "journaled")), - is("mongodb://locahost:27017/?foo=bar&journal=true")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.writeConcern", "replica_acknowledged")), - is("mongodb://locahost:27017/?foo=bar&w=2")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.writeConcern", "majority")), - is("mongodb://locahost:27017/?foo=bar&w=majority")); - - // w already exists. - assertThat( - updateUrl("mongodb://locahost:27017/?w=1", - props("mongodb.writeConcern", "acknowledged")), - is("mongodb://locahost:27017/?w=1")); - - // Unknown options - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("foo", "1234")), - is("mongodb://locahost:27017/?foo=bar")); - } - - /** - * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for - * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. - */ - @Test - public void testUpdateUrlReadPreference() { - assertThat( - updateUrl("mongodb://locahost:27017/", - props("mongodb.readPreference", "primary")), - is("mongodb://locahost:27017/?readPreference=primary")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.readPreference", "primary_preferred")), - is("mongodb://locahost:27017/?foo=bar&readPreference=primaryPreferred")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.readPreference", "secondary")), - is("mongodb://locahost:27017/?foo=bar&readPreference=secondary")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.readPreference", "secondary_preferred")), - is("mongodb://locahost:27017/?foo=bar&readPreference=secondaryPreferred")); - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("mongodb.readPreference", "nearest")), - is("mongodb://locahost:27017/?foo=bar&readPreference=nearest")); - - // readPreference already exists. - assertThat( - updateUrl("mongodb://locahost:27017/?readPreference=primary", - props("mongodb.readPreference", "secondary")), - is("mongodb://locahost:27017/?readPreference=primary")); - - // Unknown options - assertThat( - updateUrl("mongodb://locahost:27017/?foo=bar", - props("foo", "1234")), - is("mongodb://locahost:27017/?foo=bar")); - } - - /** - * Factory method for a {@link Properties} object. - * - * @param key - * The key for the property to set. - * @param value - * The value for the property to set. - * @return The {@link Properties} with the property added. - */ - private Properties props(String key, String value) { - Properties props = new Properties(); - - props.setProperty(key, value); - - return props; - } + /** + * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for + * {@code mongodb.maxconnections}. + */ + @Test + public void testUpdateUrlMaxConnections() { + assertThat( + updateUrl("mongodb://locahost:27017/", + props("mongodb.maxconnections", "1234")), + is("mongodb://locahost:27017/?maxPoolSize=1234")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.maxconnections", "1234")), + is("mongodb://locahost:27017/?foo=bar&maxPoolSize=1234")); + assertThat( + updateUrl("mongodb://locahost:27017/?maxPoolSize=1", + props("mongodb.maxconnections", "1234")), + is("mongodb://locahost:27017/?maxPoolSize=1")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", props("foo", "1234")), + is("mongodb://locahost:27017/?foo=bar")); + } + + /** + * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for + * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. + */ + @Test + public void testUpdateUrlWaitQueueMultiple() { + assertThat( + updateUrl( + "mongodb://locahost:27017/", + props("mongodb.threadsAllowedToBlockForConnectionMultiplier", + "1234")), + is("mongodb://locahost:27017/?waitQueueMultiple=1234")); + assertThat( + updateUrl( + "mongodb://locahost:27017/?foo=bar", + props("mongodb.threadsAllowedToBlockForConnectionMultiplier", + "1234")), + is("mongodb://locahost:27017/?foo=bar&waitQueueMultiple=1234")); + assertThat( + updateUrl( + "mongodb://locahost:27017/?waitQueueMultiple=1", + props("mongodb.threadsAllowedToBlockForConnectionMultiplier", + "1234")), is("mongodb://locahost:27017/?waitQueueMultiple=1")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", props("foo", "1234")), + is("mongodb://locahost:27017/?foo=bar")); + } + + /** + * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for + * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. + */ + @Test + public void testUpdateUrlWriteConcern() { + assertThat( + updateUrl("mongodb://locahost:27017/", + props("mongodb.writeConcern", "errors_ignored")), + is("mongodb://locahost:27017/?w=0")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.writeConcern", "unacknowledged")), + is("mongodb://locahost:27017/?foo=bar&w=0")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.writeConcern", "acknowledged")), + is("mongodb://locahost:27017/?foo=bar&w=1")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.writeConcern", "journaled")), + is("mongodb://locahost:27017/?foo=bar&journal=true&j=true")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.writeConcern", "replica_acknowledged")), + is("mongodb://locahost:27017/?foo=bar&w=2")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.writeConcern", "majority")), + is("mongodb://locahost:27017/?foo=bar&w=majority")); + + // w already exists. + assertThat( + updateUrl("mongodb://locahost:27017/?w=1", + props("mongodb.writeConcern", "acknowledged")), + is("mongodb://locahost:27017/?w=1")); + + // Unknown options + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", props("foo", "1234")), + is("mongodb://locahost:27017/?foo=bar")); + } + + /** + * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for + * {@code mongodb.threadsAllowedToBlockForConnectionMultiplier}. + */ + @Test + public void testUpdateUrlReadPreference() { + assertThat( + updateUrl("mongodb://locahost:27017/", + props("mongodb.readPreference", "primary")), + is("mongodb://locahost:27017/?readPreference=primary")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.readPreference", "primary_preferred")), + is("mongodb://locahost:27017/?foo=bar&readPreference=primaryPreferred")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.readPreference", "secondary")), + is("mongodb://locahost:27017/?foo=bar&readPreference=secondary")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.readPreference", "secondary_preferred")), + is("mongodb://locahost:27017/?foo=bar&readPreference=secondaryPreferred")); + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", + props("mongodb.readPreference", "nearest")), + is("mongodb://locahost:27017/?foo=bar&readPreference=nearest")); + + // readPreference already exists. + assertThat( + updateUrl("mongodb://locahost:27017/?readPreference=primary", + props("mongodb.readPreference", "secondary")), + is("mongodb://locahost:27017/?readPreference=primary")); + + // Unknown options + assertThat( + updateUrl("mongodb://locahost:27017/?foo=bar", props("foo", "1234")), + is("mongodb://locahost:27017/?foo=bar")); + } + + /** + * Factory method for a {@link Properties} object. + * + * @param key + * The key for the property to set. + * @param value + * The value for the property to set. + * @return The {@link Properties} with the property added. + */ + private Properties props(String key, String value) { + Properties props = new Properties(); + + props.setProperty(key, value); + + return props; + } } diff --git a/nosqldb/README b/nosqldb/README.md similarity index 100% rename from nosqldb/README rename to nosqldb/README.md diff --git a/nosqldb/pom.xml b/nosqldb/pom.xml index 33d5fbd50459eda79bb9f382bb98cf226b23c439..75603bf11b7cd3697f6fbdda9a659f043bb0e3e1 100644 --- a/nosqldb/pom.xml +++ b/nosqldb/pom.xml @@ -1,21 +1,39 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> <artifactId>nosqldb-binding</artifactId> <name>Oracle NoSQL Database Binding</name> + <packaging>jar</packaging> <dependencies> <dependency> - <groupId>com.oracle</groupId> - <artifactId>kvclient</artifactId> - <version>1.2.123</version> + <groupId>com.oracle.kv</groupId> + <artifactId>oracle-nosql-client</artifactId> + <version>3.0.5</version> </dependency> <dependency> <groupId>com.yahoo.ycsb</groupId> diff --git a/nosqldb/src/main/conf/nosqldb.properties b/nosqldb/src/main/conf/nosqldb.properties index 22f2504e110e52e2df94accda85a024ad7efccb4..9ab5cd1c77d7beaf0f9edcab0b6a92435290998d 100644 --- a/nosqldb/src/main/conf/nosqldb.properties +++ b/nosqldb/src/main/conf/nosqldb.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # # Sample property file for Oracle NoSQL Database client # diff --git a/nosqldb/src/main/conf/script.txt b/nosqldb/src/main/conf/script.txt index 87f1c8af413ceeb9be4c1317e4ddc9a91d12e85b..679d76213878dc2f036c4e68475c72d2958ba94c 100644 --- a/nosqldb/src/main/conf/script.txt +++ b/nosqldb/src/main/conf/script.txt @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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. + # Simple configuration file; only one node in a system configure kvstore plan -execute -name "Deploy DC" deploy-datacenter "Local" diff --git a/nosqldb/src/main/java/com/yahoo/ycsb/db/NoSqlDbClient.java b/nosqldb/src/main/java/com/yahoo/ycsb/db/NoSqlDbClient.java index a19d8f8fe47446f32ef235284786920e46730282..8282062053890b0d2a3f78bf97d342519af19243 100644 --- a/nosqldb/src/main/java/com/yahoo/ycsb/db/NoSqlDbClient.java +++ b/nosqldb/src/main/java/com/yahoo/ycsb/db/NoSqlDbClient.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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 java.util.ArrayList; @@ -25,197 +42,209 @@ import com.yahoo.ycsb.ByteArrayByteIterator; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; /** * A database interface layer for Oracle NoSQL Database. */ public class NoSqlDbClient extends DB { - - public static final int OK = 0; - public static final int ERROR = -1; - - KVStore store; - - private int getPropertyInt(Properties properties, String key, int defaultValue) throws DBException { - String p = properties.getProperty(key); - int i = defaultValue; - if (p != null) { - try { - i = Integer.parseInt(p); - } catch (NumberFormatException e) { - throw new DBException("Illegal number format in " + key + " property"); - } - } - return i; - } - - @Override - public void init() throws DBException { - Properties properties = getProperties(); - - /* Mandatory properties */ - String storeName = properties.getProperty("storeName", "kvstore"); - String[] helperHosts = properties.getProperty("helperHost", "localhost:5000").split(","); - - KVStoreConfig config = new KVStoreConfig(storeName, helperHosts); - - /* Optional properties */ - String p; - - p = properties.getProperty("consistency"); - if (p != null) { - if (p.equalsIgnoreCase("ABSOLUTE")) { - config.setConsistency(Consistency.ABSOLUTE); - } else if (p.equalsIgnoreCase("NONE_REQUIRED")) { - config.setConsistency(Consistency.NONE_REQUIRED); - } else { - throw new DBException("Illegal value in consistency property"); - } - } - - p = properties.getProperty("durability"); - if (p != null) { - if (p.equalsIgnoreCase("COMMIT_NO_SYNC")) { - config.setDurability(Durability.COMMIT_NO_SYNC); - } else if (p.equalsIgnoreCase("COMMIT_SYNC")) { - config.setDurability(Durability.COMMIT_SYNC); - } else if (p.equalsIgnoreCase("COMMIT_WRITE_NO_SYNC")) { - config.setDurability(Durability.COMMIT_WRITE_NO_SYNC); - } else { - throw new DBException("Illegal value in durability property"); - } - } - - int maxActiveRequests = getPropertyInt(properties, - "requestLimit.maxActiveRequests", RequestLimitConfig.DEFAULT_MAX_ACTIVE_REQUESTS); - int requestThresholdPercent = getPropertyInt(properties, - "requestLimit.requestThresholdPercent", RequestLimitConfig.DEFAULT_REQUEST_THRESHOLD_PERCENT); - int nodeLimitPercent = getPropertyInt(properties, - "requestLimit.nodeLimitPercent", RequestLimitConfig.DEFAULT_NODE_LIMIT_PERCENT); - RequestLimitConfig requestLimitConfig; - /* It is said that the constructor could throw NodeRequestLimitException in Javadoc, the exception is not provided */ -// try { - requestLimitConfig = new RequestLimitConfig(maxActiveRequests, requestThresholdPercent, nodeLimitPercent); -// } catch (NodeRequestLimitException e) { -// throw new DBException(e); -// } - config.setRequestLimit(requestLimitConfig); - - p = properties.getProperty("requestTimeout"); - if (p != null) { - long timeout = 1; - try { - timeout = Long.parseLong(p); - } catch (NumberFormatException e) { - throw new DBException("Illegal number format in requestTimeout property"); - } - try { - // TODO Support other TimeUnit - config.setRequestTimeout(timeout, TimeUnit.SECONDS); - } catch (IllegalArgumentException e) { - throw new DBException(e); - } - } - - try { - store = KVStoreFactory.getStore(config); - } catch (FaultException e) { - throw new DBException(e); - } - } - - @Override - public void cleanup() throws DBException { - store.close(); - } - - /** - * Create a key object. - * We map "table" and (YCSB's) "key" to a major component of the oracle.kv.Key, - * and "field" to a minor component. - * - * @return An oracle.kv.Key object. - */ - private static Key createKey(String table, String key, String field) { - List<String> majorPath = new ArrayList<String>(); - majorPath.add(table); - majorPath.add(key); - if (field == null) { - return Key.createKey(majorPath); - } - - return Key.createKey(majorPath, field); - } - - private static Key createKey(String table, String key) { - return createKey(table, key, null); - } - - private static String getFieldFromKey(Key key) { - return key.getMinorPath().get(0); - } - - @Override - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { - Key kvKey = createKey(table, key); - SortedMap<Key, ValueVersion> kvResult; - try { - kvResult = store.multiGet(kvKey, null, null); - } catch (FaultException e) { - System.err.println(e); - return ERROR; - } - - for (Map.Entry<Key, ValueVersion> entry : kvResult.entrySet()) { - /* If fields is null, read all fields */ - String field = getFieldFromKey(entry.getKey()); - if (fields != null && !fields.contains(field)) { - continue; - } - result.put(field, new ByteArrayByteIterator(entry.getValue().getValue().getValue())); - } - - return OK; - } - - @Override - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - System.err.println("Oracle NoSQL Database does not support Scan semantics"); - return ERROR; - } - - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { - Key kvKey = createKey(table, key, entry.getKey()); - Value kvValue = Value.createValue(entry.getValue().toArray()); - try { - store.put(kvKey, kvValue); - } catch (FaultException e) { - System.err.println(e); - return ERROR; - } - } - - return OK; - } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - return update(table, key, values); - } - - @Override - public int delete(String table, String key) { - Key kvKey = createKey(table, key); - try { - store.multiDelete(kvKey, null, null); - } catch (FaultException e) { - System.err.println(e); - return ERROR; - } - - return OK; - } + + private KVStore store; + + private int getPropertyInt(Properties properties, String key, + int defaultValue) throws DBException { + String p = properties.getProperty(key); + int i = defaultValue; + if (p != null) { + try { + i = Integer.parseInt(p); + } catch (NumberFormatException e) { + throw new DBException("Illegal number format in " + key + " property"); + } + } + return i; + } + + @Override + public void init() throws DBException { + Properties properties = getProperties(); + + /* Mandatory properties */ + String storeName = properties.getProperty("storeName", "kvstore"); + String[] helperHosts = + properties.getProperty("helperHost", "localhost:5000").split(","); + + KVStoreConfig config = new KVStoreConfig(storeName, helperHosts); + + /* Optional properties */ + String p; + + p = properties.getProperty("consistency"); + if (p != null) { + if (p.equalsIgnoreCase("ABSOLUTE")) { + config.setConsistency(Consistency.ABSOLUTE); + } else if (p.equalsIgnoreCase("NONE_REQUIRED")) { + config.setConsistency(Consistency.NONE_REQUIRED); + } else { + throw new DBException("Illegal value in consistency property"); + } + } + + p = properties.getProperty("durability"); + if (p != null) { + if (p.equalsIgnoreCase("COMMIT_NO_SYNC")) { + config.setDurability(Durability.COMMIT_NO_SYNC); + } else if (p.equalsIgnoreCase("COMMIT_SYNC")) { + config.setDurability(Durability.COMMIT_SYNC); + } else if (p.equalsIgnoreCase("COMMIT_WRITE_NO_SYNC")) { + config.setDurability(Durability.COMMIT_WRITE_NO_SYNC); + } else { + throw new DBException("Illegal value in durability property"); + } + } + + int maxActiveRequests = + getPropertyInt(properties, "requestLimit.maxActiveRequests", + RequestLimitConfig.DEFAULT_MAX_ACTIVE_REQUESTS); + int requestThresholdPercent = + getPropertyInt(properties, "requestLimit.requestThresholdPercent", + RequestLimitConfig.DEFAULT_REQUEST_THRESHOLD_PERCENT); + int nodeLimitPercent = + getPropertyInt(properties, "requestLimit.nodeLimitPercent", + RequestLimitConfig.DEFAULT_NODE_LIMIT_PERCENT); + RequestLimitConfig requestLimitConfig; + /* + * It is said that the constructor could throw NodeRequestLimitException in + * Javadoc, the exception is not provided + */ + // try { + requestLimitConfig = new RequestLimitConfig(maxActiveRequests, + requestThresholdPercent, nodeLimitPercent); + // } catch (NodeRequestLimitException e) { + // throw new DBException(e); + // } + config.setRequestLimit(requestLimitConfig); + + p = properties.getProperty("requestTimeout"); + if (p != null) { + long timeout = 1; + try { + timeout = Long.parseLong(p); + } catch (NumberFormatException e) { + throw new DBException( + "Illegal number format in requestTimeout property"); + } + try { + // TODO Support other TimeUnit + config.setRequestTimeout(timeout, TimeUnit.SECONDS); + } catch (IllegalArgumentException e) { + throw new DBException(e); + } + } + + try { + store = KVStoreFactory.getStore(config); + } catch (FaultException e) { + throw new DBException(e); + } + } + + @Override + public void cleanup() throws DBException { + store.close(); + } + + /** + * Create a key object. We map "table" and (YCSB's) "key" to a major component + * of the oracle.kv.Key, and "field" to a minor component. + * + * @return An oracle.kv.Key object. + */ + private static Key createKey(String table, String key, String field) { + List<String> majorPath = new ArrayList<String>(); + majorPath.add(table); + majorPath.add(key); + if (field == null) { + return Key.createKey(majorPath); + } + + return Key.createKey(majorPath, field); + } + + private static Key createKey(String table, String key) { + return createKey(table, key, null); + } + + private static String getFieldFromKey(Key key) { + return key.getMinorPath().get(0); + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + Key kvKey = createKey(table, key); + SortedMap<Key, ValueVersion> kvResult; + try { + kvResult = store.multiGet(kvKey, null, null); + } catch (FaultException e) { + System.err.println(e); + return Status.ERROR; + } + + for (Map.Entry<Key, ValueVersion> entry : kvResult.entrySet()) { + /* If fields is null, read all fields */ + String field = getFieldFromKey(entry.getKey()); + if (fields != null && !fields.contains(field)) { + continue; + } + result.put(field, + new ByteArrayByteIterator(entry.getValue().getValue().getValue())); + } + + return Status.OK; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + System.err.println("Oracle NoSQL Database does not support Scan semantics"); + return Status.ERROR; + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { + Key kvKey = createKey(table, key, entry.getKey()); + Value kvValue = Value.createValue(entry.getValue().toArray()); + try { + store.put(kvKey, kvValue); + } catch (FaultException e) { + System.err.println(e); + return Status.ERROR; + } + } + + return Status.OK; + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + return update(table, key, values); + } + + @Override + public Status delete(String table, String key) { + Key kvKey = createKey(table, key); + try { + store.multiDelete(kvKey, null, null); + } catch (FaultException e) { + System.err.println(e); + return Status.ERROR; + } + + return Status.OK; + } } diff --git a/nosqldb/src/main/java/com/yahoo/ycsb/db/package-info.java b/nosqldb/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..2e8b9c5a1220587b3a42f9b792a845db3c6789b9 --- /dev/null +++ b/nosqldb/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * 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= + * "http://www.oracle.com/us/products/database/nosql/overview/index.html">Oracle + * 's NoSQL DB</a>. + */ +package com.yahoo.ycsb.db; diff --git a/orientdb/README.md b/orientdb/README.md index 05211935a07d5f181dcfaf5e4493884da43bd29f..578a5abb346798260cee505afb147501056c0a6e 100644 --- a/orientdb/README.md +++ b/orientdb/README.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + ## Quick Start This section describes how to run YCSB on OrientDB running locally. @@ -6,7 +23,7 @@ This section describes how to run YCSB on OrientDB running locally. Clone the YCSB git repository and compile: - git clone git://github.com/nuvolabase/YCSB.git + git clone https://github.com/brianfrankcooper/YCSB.git cd YCSB mvn clean package @@ -22,10 +39,37 @@ Then, run the workload: See the next section for the list of configuration parameters for OrientDB. +## DB creation with the OrientDBClient +This client will create a database for you if the connection database you specify does not exists. You can also specify connection information to a preexisting database. + +You can use the ```orientdb.newdb=true``` property to allow this client to drop and create a new database instance during the ```load``` phase. + +NOTE: understand that using the ```orientdb.newdb=true``` property will drop and recreate databases even if it was a preexisting instance. + +WARNING: Creating a new database will be done safely with multiple threads on a single YCSB instance, but is not guaranteed to work when launching multiple YCSB instances. In that scenario it is suggested that you create the db before hand, or run the ```load``` phase with a single YCSB instance. + ## OrientDB Configuration Parameters -### `OrientDB.url` (default: `local:C:/temp/databases/ycsb`) +* ```orientdb.url``` - (required) The address to your database. + * Supported storage types: memory, plocal, remote + * EX. ```plocal:/path/to/database``` +* ```orientdb.user``` - The user to connect to the database with. + * Default: ```admin``` +* ```orientdb.password``` - The password to connect to the database with. + * Default: ```admin``` +* ```orientdb.newdb``` - Overwrite the database if it already exists. + * Only effects the ```load``` phase. + * Default: ```false``` +* ```orientdb.intent``` - Declare an Intent to the database. + * This is an optimization feature provided by OrientDB: http://orientdb.com/docs/2.1/Performance-Tuning.html#massive-insertion + * Possible values are: + * massiveinsert + * massiveread + * nocache +* ```orientdb.remote.storagetype``` - Storage type of the database on remote server + * This is only required if using a ```remote:``` connection url -### `OrientDB.user` (default `admin`) +## Known Issues -### `OrientDB.password` (default `admin`) +* There is a performance issue around the scan operation. This binding uses OIndex.iterateEntriesMajor() which will return unnecessarily large iterators. This has a performance impact as the recordcount goes up. There are ideas in the works to fix it, track it here: [#568](https://github.com/brianfrankcooper/YCSB/issues/568). +* Iterator methods needed to perform scans are Unsupported in the OrientDB API for remote database connections and so will return NOT_IMPLEMENTED status if attempted. diff --git a/orientdb/pom.xml b/orientdb/pom.xml index 32745ae331d914b5dd54d349a03ab85e3db96fad..d7a91aa7adf60d2d3a777855621a15a12f512f28 100644 --- a/orientdb/pom.xml +++ b/orientdb/pom.xml @@ -1,34 +1,62 @@ <?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.3.0-SNAPSHOT</version> - <relativePath>../binding-parent</relativePath> - </parent> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>binding-parent</artifactId> + <version>0.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> - <artifactId>orientdb-binding</artifactId> - <name>OrientDB Binding</name> - <packaging>jar</packaging> - <repositories> - <repository> - <id>sonatype-nexus-snapshots</id> - <name>Sonatype Nexus Snapshots</name> - <url>https://oss.sonatype.org/content/repositories/snapshots</url> - </repository> - </repositories> - <dependencies> - <dependency> - <groupId>com.yahoo.ycsb</groupId> - <artifactId>core</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.orientechnologies</groupId> - <artifactId>orientdb-core</artifactId> - <version>1.7.10</version> - </dependency> - </dependencies> + <artifactId>orientdb-binding</artifactId> + <name>OrientDB Binding</name> + <packaging>jar</packaging> + <repositories> + <repository> + <id>sonatype-nexus-snapshots</id> + <name>Sonatype Nexus Snapshots</name> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.orientechnologies</groupId> + <artifactId>orientdb-client</artifactId> + <version>${orientdb.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.10</version> + </dependency> + </dependencies> </project> diff --git a/orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java b/orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java index 692d56d6e528a850132bbdae2a9fffd3bd05c849..d1d2920506a683df059df2faca13447e9d145053 100644 --- a/orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java +++ b/orientdb/src/main/java/com/yahoo/ycsb/db/OrientDBClient.java @@ -1,25 +1,45 @@ /** - * OrientDB client binding for YCSB. + * Copyright (c) 2012 - 2016 YCSB contributors. All rights reserved. * - * Submitted by Luca Garulli on 5/10/2012. + * 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.orientechnologies.orient.core.config.OGlobalConfiguration; +import com.orientechnologies.common.exception.OException; +import com.orientechnologies.orient.client.remote.OEngineRemote; +import com.orientechnologies.orient.client.remote.OServerAdmin; +import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.dictionary.ODictionary; +import com.orientechnologies.orient.core.exception.ODatabaseException; import com.orientechnologies.orient.core.index.OIndexCursor; import com.orientechnologies.orient.core.intent.OIntentMassiveInsert; -import com.orientechnologies.orient.core.record.ORecordInternal; +import com.orientechnologies.orient.core.intent.OIntentMassiveRead; +import com.orientechnologies.orient.core.intent.OIntentNoCache; +import com.orientechnologies.orient.core.record.ORecord; import com.orientechnologies.orient.core.record.impl.ODocument; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.IOException; import java.util.HashMap; import java.util.Map.Entry; import java.util.Properties; @@ -28,75 +48,152 @@ import java.util.Vector; /** * OrientDB client for YCSB framework. - * - * Properties to set: - * - * orientdb.url=local:C:/temp/databases or remote:localhost:2424 <br> - * orientdb.database=ycsb <br> - * orientdb.user=admin <br> - * orientdb.password=admin <br> - * - * @author Luca Garulli - * */ public class OrientDBClient extends DB { - private static final String CLASS = "usertable"; - private ODatabaseDocumentTx db; - private ODictionary<ORecordInternal<?>> dictionary; + private static final String CLASS = "usertable"; + private ODatabaseDocumentTx db; + private ODictionary<ORecord> dictionary; + private boolean isRemote = false; + + private static final String URL_PROPERTY = "orientdb.url"; + + private static final String USER_PROPERTY = "orientdb.user"; + private static final String USER_PROPERTY_DEFAULT = "admin"; + + private static final String PASSWORD_PROPERTY = "orientdb.password"; + private static final String PASSWORD_PROPERTY_DEFAULT = "admin"; + + private static final String NEWDB_PROPERTY = "orientdb.newdb"; + private static final String NEWDB_PROPERTY_DEFAULT = "false"; + + private static final String STORAGE_TYPE_PROPERTY = "orientdb.remote.storagetype"; + + private static final String INTENT_PROPERTY = "orientdb.intent"; + private static final String INTENT_PROPERTY_DEFAULT = ""; + + private static final String DO_TRANSACTIONS_PROPERTY = "dotransactions"; + private static final String DO_TRANSACTIONS_PROPERTY_DEFAULT = "true"; + + private static final String ORIENTDB_DOCUMENT_TYPE = "document"; + private static final String ORIENTDB_MASSIVEINSERT = "massiveinsert"; + private static final String ORIENTDB_MASSIVEREAD = "massiveread"; + private static final String ORIENTDB_NOCACHE = "nocache"; + + private static final Logger LOG = LoggerFactory.getLogger(OrientDBClient.class); /** - * Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread. + * This method abstracts the administration of OrientDB namely creating and connecting to a database. + * Creating a database needs to be done in a synchronized method so that multiple threads do not all try + * to run the creation operation simultaneously, this ends in failure. + * + * @param props Workload properties object + * @return a usable ODatabaseDocumentTx object + * @throws DBException */ - public void init() throws DBException { - // initialize OrientDB driver - Properties props = getProperties(); + private static synchronized ODatabaseDocumentTx initDB(Properties props) throws DBException { + String url = props.getProperty(URL_PROPERTY); + String user = props.getProperty(USER_PROPERTY, USER_PROPERTY_DEFAULT); + String password = props.getProperty(PASSWORD_PROPERTY, PASSWORD_PROPERTY_DEFAULT); + Boolean newdb = Boolean.parseBoolean(props.getProperty(NEWDB_PROPERTY, NEWDB_PROPERTY_DEFAULT)); + String remoteStorageType = props.getProperty(STORAGE_TYPE_PROPERTY); + Boolean isrun = Boolean.parseBoolean(props.getProperty(DO_TRANSACTIONS_PROPERTY, DO_TRANSACTIONS_PROPERTY_DEFAULT)); + + ODatabaseDocumentTx dbconn; - String url; - if (System.getProperty("os.name").toLowerCase().contains("win")) - url = props.getProperty("orientdb.url", "plocal:C:/temp/databases/ycsb"); - else - url = props.getProperty("orientdb.url", "plocal:/temp/databases/ycsb"); + if (url == null) { + throw new DBException(String.format("Required property \"%s\" missing for OrientDBClient", URL_PROPERTY)); + } - String user = props.getProperty("orientdb.user", "admin"); - String password = props.getProperty("orientdb.password", "admin"); - Boolean newdb = Boolean.parseBoolean(props.getProperty("orientdb.newdb", "false")); + LOG.info("OrientDB loading database url = " + url); - try { - System.out.println("OrientDB loading database url = " + url); - - OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false); - db = new ODatabaseDocumentTx(url); - if (db.exists()) { - db.open(user, password); - if (newdb) { - System.out.println("OrientDB drop and recreate fresh db"); - db.drop(); - db.create(); + // If using a remote database, use the OServerAdmin interface to connect + if (url.startsWith(OEngineRemote.NAME)) { + if (remoteStorageType == null) { + throw new DBException("When connecting to a remote OrientDB instance, " + + "specify a database storage type (plocal or memory) with " + STORAGE_TYPE_PROPERTY); + } + + try { + OServerAdmin server = new OServerAdmin(url).connect(user, password); + + if (server.existsDatabase()) { + if (newdb && !isrun) { + LOG.info("OrientDB dropping and recreating fresh db on remote server."); + server.dropDatabase(remoteStorageType); + server.createDatabase(server.getURL(), ORIENTDB_DOCUMENT_TYPE, remoteStorageType); + } + } else { + LOG.info("OrientDB database not found, creating fresh db"); + server.createDatabase(server.getURL(), ORIENTDB_DOCUMENT_TYPE, remoteStorageType); + } + + server.close(); + dbconn = new ODatabaseDocumentTx(url).open(user, password); + } catch (IOException | OException e) { + throw new DBException(String.format("Error interfacing with %s", url), e); + } + } else { + try { + dbconn = new ODatabaseDocumentTx(url); + if (dbconn.exists()) { + dbconn.open(user, password); + if (newdb && !isrun) { + LOG.info("OrientDB dropping and recreating fresh db."); + dbconn.drop(); + dbconn.create(); + } + } else { + LOG.info("OrientDB database not found, creating fresh db"); + dbconn.create(); } - } else { - System.out.println("OrientDB database not found, create fresh db"); - db.create(); + } catch (ODatabaseException e) { + throw new DBException(String.format("Error interfacing with %s", url), e); } + } - System.out.println("OrientDB connection created with " + url); + if (dbconn == null) { + throw new DBException("Could not establish connection to: " + url); + } - dictionary = db.getMetadata().getIndexManager().getDictionary(); - if (!db.getMetadata().getSchema().existsClass(CLASS)) - db.getMetadata().getSchema().createClass(CLASS); + LOG.info("OrientDB connection created with " + url); + return dbconn; + } - db.declareIntent(new OIntentMassiveInsert()); + @Override + public void init() throws DBException { + Properties props = getProperties(); + + String intent = props.getProperty(INTENT_PROPERTY, INTENT_PROPERTY_DEFAULT); + + db = initDB(props); - } catch (Exception e1) { - System.err.println("Could not initialize OrientDB connection pool for Loader: " + e1.toString()); - e1.printStackTrace(); - return; + if (db.getURL().startsWith(OEngineRemote.NAME)) { + isRemote = true; } + dictionary = db.getMetadata().getIndexManager().getDictionary(); + if (!db.getMetadata().getSchema().existsClass(CLASS)) { + db.getMetadata().getSchema().createClass(CLASS); + } + + if (intent.equals(ORIENTDB_MASSIVEINSERT)) { + LOG.info("Declaring intent of MassiveInsert."); + db.declareIntent(new OIntentMassiveInsert()); + } else if (intent.equals(ORIENTDB_MASSIVEREAD)) { + LOG.info("Declaring intent of MassiveRead."); + db.declareIntent(new OIntentMassiveRead()); + } else if (intent.equals(ORIENTDB_NOCACHE)) { + LOG.info("Declaring intent of NoCache."); + db.declareIntent(new OIntentNoCache()); + } } @Override public void cleanup() throws DBException { + // Set this thread's db reference (needed for thread safety in testing) + ODatabaseRecordThreadLocal.INSTANCE.set(db); + if (db != null) { db.close(); db = null; @@ -104,130 +201,112 @@ public class OrientDBClient extends DB { } @Override - /** - * 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 this class's description for a discussion of error codes. - */ - public int insert(String table, String key, HashMap<String, ByteIterator> values) { + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { try { final ODocument document = new ODocument(CLASS); - for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { document.field(entry.getKey(), entry.getValue()); + } document.save(); dictionary.put(key, document); - return 0; + return Status.OK; } catch (Exception e) { e.printStackTrace(); } - return 1; + return Status.ERROR; } @Override - /** - * 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 this class's description for a discussion of error codes. - */ - public int delete(String table, String key) { + public Status delete(String table, String key) { try { dictionary.remove(key); - return 0; + return Status.OK; } catch (Exception e) { e.printStackTrace(); } - return 1; + return Status.ERROR; } @Override - /** - * 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". - */ - public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { final ODocument document = dictionary.get(key); if (document != null) { - if (fields != null) - for (String field : fields) + if (fields != null) { + for (String field : fields) { result.put(field, new StringByteIterator((String) document.field(field))); - else - for (String field : document.fieldNames()) + } + } else { + for (String field : document.fieldNames()) { result.put(field, new StringByteIterator((String) document.field(field))); - return 0; + } + } + return Status.OK; } } catch (Exception e) { e.printStackTrace(); } - return 1; + return Status.ERROR; } @Override - /** - * 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. - */ - public int update(String table, String key, HashMap<String, ByteIterator> values) { + public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { final ODocument document = dictionary.get(key); if (document != null) { - for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { document.field(entry.getKey(), entry.getValue()); + } document.save(); - return 0; + return Status.OK; } } catch (Exception e) { e.printStackTrace(); } - return 1; + return Status.ERROR; } @Override - /** - * 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 this class's description for a discussion of error codes. - */ - public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + public Status scan(String table, String startkey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { + if (isRemote) { + // Iterator methods needed for scanning are Unsupported for remote database connections. + LOG.warn("OrientDB scan operation is not implemented for remote database connections."); + return Status.NOT_IMPLEMENTED; + } + try { + int entrycount = 0; final OIndexCursor entries = dictionary.getIndex().iterateEntriesMajor(startkey, true, true); - while (entries.hasNext()) { - final Entry<Object, OIdentifiable> entry = entries.nextEntry(); - final ODocument document = entry.getValue().getRecord(); + + while (entries.hasNext() && entrycount < recordcount) { + final OIdentifiable entry = entries.next(); + final ODocument document = entry.getRecord(); final HashMap<String, ByteIterator> map = new HashMap<String, ByteIterator>(); result.add(map); - for (String field : fields) - map.put(field, new StringByteIterator((String) document.field(field))); + if (fields != null && !fields.isEmpty()) { + for (String field : fields) { + map.put(field, new StringByteIterator((String) document.field(field))); + } + } + + entrycount++; } - return 0; + return Status.OK; } catch (Exception e) { e.printStackTrace(); } - return 1; + return Status.ERROR; + } + + /** + * Access method to db variable for unit testing. + **/ + ODatabaseDocumentTx getDB() { + return db; } } diff --git a/orientdb/src/main/java/com/yahoo/ycsb/db/package-info.java b/orientdb/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..d4568271c407b3d06833d5221dc1448661b02f00 --- /dev/null +++ b/orientdb/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 - 2016, 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="http://orientdb.com/orientdb/">OrientDB</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/orientdb/src/main/resources/log4j.properties b/orientdb/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..0ede1d4c141192a2de7e00461b3cb9998a8e8a68 --- /dev/null +++ b/orientdb/src/main/resources/log4j.properties @@ -0,0 +1,8 @@ +# Root logger option +log4j.rootLogger=INFO, stderr + +# Direct log messages to stderr +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.Target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n diff --git a/orientdb/src/test/java/com/yahoo/ycsb/db/OrientDBClientTest.java b/orientdb/src/test/java/com/yahoo/ycsb/db/OrientDBClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..140a97730f6fa351d1f81f7f810a038623ee94e2 --- /dev/null +++ b/orientdb/src/test/java/com/yahoo/ycsb/db/OrientDBClientTest.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) 2015 - 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. + */ + +package com.yahoo.ycsb.db; + +import com.orientechnologies.orient.core.dictionary.ODictionary; +import com.orientechnologies.orient.core.record.ORecord; +import com.orientechnologies.orient.core.record.impl.ODocument; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.StringByteIterator; + +import org.junit.*; +import java.util.*; + +import static org.junit.Assert.*; + +/** + * Created by kruthar on 12/29/15. + */ +public class OrientDBClientTest { + // TODO: This must be copied because it is private in OrientDBClient, but this should defer to table property. + private static final String CLASS = "usertable"; + private static final int FIELD_LENGTH = 32; + private static final String FIELD_PREFIX = "FIELD"; + private static final String KEY_PREFIX = "user"; + private static final int NUM_FIELDS = 3; + private static final String TEST_DB_URL = "memory:test"; + + private static ODictionary<ORecord> orientDBDictionary; + private static OrientDBClient orientDBClient = null; + + @Before + public void setup() throws DBException { + orientDBClient = new OrientDBClient(); + + Properties p = new Properties(); + // TODO: Extract the property names into final variables in OrientDBClient + p.setProperty("orientdb.url", TEST_DB_URL); + + orientDBClient.setProperties(p); + orientDBClient.init(); + orientDBDictionary = orientDBClient.getDB().getDictionary(); + } + + @After + public void teardown() throws DBException { + if (orientDBClient != null) { + orientDBClient.cleanup(); + } + } + + /* + This is a copy of buildDeterministicValue() from core:com.yahoo.ycsb.workloads.CoreWorkload.java. + That method is neither public nor static so we need a copy. + */ + private String buildDeterministicValue(String key, String fieldkey) { + int size = FIELD_LENGTH; + StringBuilder sb = new StringBuilder(size); + sb.append(key); + sb.append(':'); + sb.append(fieldkey); + while (sb.length() < size) { + sb.append(':'); + sb.append(sb.toString().hashCode()); + } + sb.setLength(size); + + return sb.toString(); + } + + /* + Inserts a row of deterministic values for the given insertKey using the orientDBClient. + */ + private Map<String, ByteIterator> insertRow(String insertKey) { + HashMap<String, ByteIterator> insertMap = new HashMap<>(); + for (int i = 0; i < 3; i++) { + insertMap.put(FIELD_PREFIX + i, new StringByteIterator(buildDeterministicValue(insertKey, FIELD_PREFIX + i))); + } + orientDBClient.insert(CLASS, insertKey, insertMap); + + return insertMap; + } + + @Test + public void insertTest() { + String insertKey = "user0"; + Map<String, ByteIterator> insertMap = insertRow(insertKey); + + ODocument result = orientDBDictionary.get(insertKey); + + assertTrue("Assert a row was inserted.", result != null); + + for (int i = 0; i < NUM_FIELDS; i++) { + assertEquals("Assert all inserted columns have correct values.", result.field(FIELD_PREFIX + i), insertMap.get(FIELD_PREFIX + i).toString()); + } + } + + @Test + public void updateTest() { + String preupdateString = "preupdate"; + String user0 = "user0"; + String user1 = "user1"; + String user2 = "user2"; + + // Manually insert three documents + for(String key: Arrays.asList(user0, user1, user2)) { + ODocument doc = new ODocument(CLASS); + for (int i = 0; i < NUM_FIELDS; i++) { + doc.field(FIELD_PREFIX + i, preupdateString); + } + doc.save(); + orientDBDictionary.put(key, doc); + } + + HashMap<String, ByteIterator> updateMap = new HashMap<>(); + for (int i = 0; i < NUM_FIELDS; i++) { + updateMap.put(FIELD_PREFIX + i, new StringByteIterator(buildDeterministicValue(user1, FIELD_PREFIX + i))); + } + + orientDBClient.update(CLASS, user1, updateMap); + + // Ensure that user0 record was not changed + ODocument result = orientDBDictionary.get(user0); + for (int i = 0; i < NUM_FIELDS; i++) { + assertEquals("Assert first row fields contain preupdateString", result.field(FIELD_PREFIX + i), preupdateString); + } + + // Check that all the columns have expected values for user1 record + result = orientDBDictionary.get(user1); + for (int i = 0; i < NUM_FIELDS; i++) { + assertEquals("Assert updated row fields are correct", result.field(FIELD_PREFIX + i), updateMap.get(FIELD_PREFIX + i).toString()); + } + + // Ensure that user2 record was not changed + result = orientDBDictionary.get(user2); + for (int i = 0; i < NUM_FIELDS; i++) { + assertEquals("Assert third row fields contain preupdateString", result.field(FIELD_PREFIX + i), preupdateString); + } + } + + @Test + public void readTest() { + String insertKey = "user0"; + Map<String, ByteIterator> insertMap = insertRow(insertKey); + HashSet<String> readFields = new HashSet<>(); + HashMap<String, ByteIterator> readResultMap = new HashMap<>(); + + // Test reading a single field + readFields.add("FIELD0"); + orientDBClient.read(CLASS, insertKey, readFields, readResultMap); + assertEquals("Assert that result has correct number of fields", readFields.size(), readResultMap.size()); + for (String field: readFields) { + assertEquals("Assert " + field + " was read correctly", insertMap.get(field).toString(), readResultMap.get(field).toString()); + } + + readResultMap = new HashMap<>(); + + // Test reading all fields + readFields.add("FIELD1"); + readFields.add("FIELD2"); + orientDBClient.read(CLASS, insertKey, readFields, readResultMap); + assertEquals("Assert that result has correct number of fields", readFields.size(), readResultMap.size()); + for (String field: readFields) { + assertEquals("Assert " + field + " was read correctly", insertMap.get(field).toString(), readResultMap.get(field).toString()); + } + } + + @Test + public void deleteTest() { + String user0 = "user0"; + String user1 = "user1"; + String user2 = "user2"; + + insertRow(user0); + insertRow(user1); + insertRow(user2); + + orientDBClient.delete(CLASS, user1); + + assertNotNull("Assert user0 still exists", orientDBDictionary.get(user0)); + assertNull("Assert user1 does not exist", orientDBDictionary.get(user1)); + assertNotNull("Assert user2 still exists", orientDBDictionary.get(user2)); + } + + @Test + public void scanTest() { + Map<String, Map<String, ByteIterator>> keyMap = new HashMap<>(); + for (int i = 0; i < 5; i++) { + String insertKey = KEY_PREFIX + i; + keyMap.put(insertKey, insertRow(insertKey)); + } + + Set<String> fieldSet = new HashSet<>(); + fieldSet.add("FIELD0"); + fieldSet.add("FIELD1"); + int startIndex = 1; + int resultRows = 3; + + Vector<HashMap<String, ByteIterator>> resultVector = new Vector<>(); + orientDBClient.scan(CLASS, KEY_PREFIX + startIndex, resultRows, fieldSet, resultVector); + + // Check the resultVector is the correct size + assertEquals("Assert the correct number of results rows were returned", resultRows, resultVector.size()); + + /** + * Part of the known issue about the broken iterator in orientdb is that the iterator + * starts at index 1 instead of index 0. Because of this, to test it we must increment + * the start index. When that known issue has been fixed, remove the increment below. + * Track the issue here: https://github.com/orientechnologies/orientdb/issues/5541 + * This fix was implemented for orientechnologies:orientdb-client:2.1.8 + */ + int testIndex = startIndex; + + // Check each vector row to make sure we have the correct fields + for (HashMap<String, ByteIterator> result: resultVector) { + assertEquals("Assert that this row has the correct number of fields", fieldSet.size(), result.size()); + for (String field: fieldSet) { + assertEquals("Assert this field is correct in this row", keyMap.get(KEY_PREFIX + testIndex).get(field).toString(), result.get(field).toString()); + } + testIndex++; + } + } +} diff --git a/pom.xml b/pom.xml index 799c0b2bef31fc9050e62c3185af6059d63747ca..5357142baa9a05ac99eb1939bafece357a005fff 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,27 @@ <?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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.yahoo.ycsb</groupId> <artifactId>root</artifactId> - <version>0.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <packaging>pom</packaging> <name>YCSB Root</name> @@ -20,7 +37,6 @@ </scm> <dependencyManagement> <dependencies> - <!-- voldemort --> <dependency> <groupId>checkstyle</groupId> <artifactId>checkstyle</artifactId> @@ -52,25 +68,34 @@ <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> + <asynchbase.version>1.7.1</asynchbase.version> + <hbase094.version>0.94.27</hbase094.version> + <hbase098.version>0.98.14-hadoop2</hbase098.version> + <hbase10.version>1.0.2</hbase10.version> <accumulo.version>1.6.0</accumulo.version> - <cassandra.version>1.2.9</cassandra.version> - <cassandra.cql.version>1.0.3</cassandra.cql.version> - <gemfire.version>8.1.0</gemfire.version> + <cassandra.cql.version>3.0.0</cassandra.cql.version> + <geode.version>1.0.0-incubating.M3</geode.version> + <googlebigtable.version>0.2.3</googlebigtable.version> <infinispan.version>7.2.2.Final</infinispan.version> + <kudu.version>0.9.0</kudu.version> <openjpa.jdbc.version>2.1.1</openjpa.jdbc.version> <!--<mapkeeper.version>1.0</mapkeeper.version>--> - <mongodb.version>3.0.2</mongodb.version> + <mongodb.version>3.0.3</mongodb.version> <mongodb.async.version>2.0.1</mongodb.async.version> - <orientdb.version>1.0.1</orientdb.version> + <orientdb.version>2.1.8</orientdb.version> <redis.version>2.0.0</redis.version> + <s3.version>1.10.20</s3.version> <voldemort.version>0.81</voldemort.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <thrift.version>0.8.0</thrift.version> <hypertable.version>0.9.5.6</hypertable.version> - <couchbase.version>1.1.8</couchbase.version> - <tarantool.version>1.6.1</tarantool.version> + <couchbase.version>1.4.10</couchbase.version> + <couchbase2.version>2.3.1</couchbase2.version> + <tarantool.version>1.6.5</tarantool.version> + <riak.version>2.0.5</riak.version> <aerospike.version>3.1.2</aerospike.version> + <solr.version>5.4.0</solr.version> + <arangodb.version>2.7.3</arangodb.version> </properties> <modules> @@ -80,51 +105,71 @@ <!-- all the datastore bindings, lex sorted please --> <module>accumulo</module> <module>aerospike</module> + <module>arangodb</module> + <module>asynchbase</module> <module>cassandra</module> <module>couchbase</module> + <module>couchbase2</module> <module>distribution</module> <module>dynamodb</module> <module>elasticsearch</module> - <module>gemfire</module> - <module>hbase</module> + <module>geode</module> + <module>googlebigtable</module> + <module>googledatastore</module> + <module>hbase094</module> + <module>hbase098</module> + <module>hbase10</module> <module>hypertable</module> <module>infinispan</module> <module>jdbc</module> + <module>kudu</module> <!--<module>mapkeeper</module>--> + <module>memcached</module> <module>mongodb</module> - <!--module>nosqldb</module--> + <module>nosqldb</module> <module>orientdb</module> + <module>rados</module> <module>redis</module> + <module>riak</module> + <module>s3</module> + <module>solr</module> <module>tarantool</module> <!--<module>voldemort</module>--> </modules> <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + </plugin> + </plugins> + </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> - <source>1.6</source> - <target>1.6</target> + <source>1.7</source> + <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.15</version> - <configuration> - <consoleOutput>true</consoleOutput> - <configLocation>checkstyle.xml</configLocation> - </configuration> <executions> <execution> - <id>validate</id> + <id>validate</id> <phase>validate</phase> <goals> - <goal>checkstyle</goal> + <goal>check</goal> </goals> + <configuration> + <configLocation>checkstyle.xml</configLocation> + </configuration> </execution> </executions> </plugin> diff --git a/rados/README.md b/rados/README.md new file mode 100644 index 0000000000000000000000000000000000000000..826b0189e02fedadd362c5082dc7952e4dd10306 --- /dev/null +++ b/rados/README.md @@ -0,0 +1,72 @@ +<!-- +Copyright (c) 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. +--> + +## Quick Start + +This section describes how to run YCSB on RADOS of Ceph. + +### 1. Start RADOS + +After you start your Ceph cluster, check your cluster’s health first. You can check on the health of your cluster with the following: + + ceph health + +### 2. Install Java and Maven + +### 3. Set Up YCSB + +Git clone YCSB and compile: + + git clone http://github.com/brianfrankcooper/YCSB.git + cd YCSB + mvn clean package + +You can compile only RADOS-binding, EG: + + mvn -pl com.yahoo.ycsb:rados-binding -am clean package + +You can skip the test, EG: + + mvn -pl com.yahoo.ycsb:rados-binding -am clean package -DskipTests + +### 4. Configuration Parameters + +- `rados.configfile` + - The path of the Ceph configuration file + - Default value is '/etc/ceph/ceph.conf' + +- `rados.id` + - The user id to access the RADOS service + - Default value is 'admin' + +- `rados.pool` + - The pool name to be used for benchmark + - Default value is 'data' + +You can set configurations with the shell command, EG: + + ./bin/ycsb load rados -s -P workloads/workloada -p "rados.configfile=/etc/ceph/ceph.conf" -p "rados.id=admin" -p "rados.pool=data" > outputLoad.txt + +### 5. Load data and run tests + +Load the data: + + ./bin/ycsb load rados -s -P workloads/workloada > outputLoad.txt + +Run the workload test: + + ./bin/ycsb run rados -s -P workloads/workloada > outputRun.txt diff --git a/rados/pom.xml b/rados/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..3676f270a1840a67aa146031175556fcd50a3a8f --- /dev/null +++ b/rados/pom.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>rados-binding</artifactId> + <name>rados of Ceph FS binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.ceph</groupId> + <artifactId>rados</artifactId> + <version>${rados.version}</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + <version>${json.version}</version> + </dependency> + <dependency> + <groupId>net.java.dev.jna</groupId> + <artifactId>jna</artifactId> + <version>4.2.2</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> + + <properties> + <rados.version>0.2.0</rados.version> + <json.version>20160212</json.version> + </properties> +</project> diff --git a/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java b/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java new file mode 100644 index 0000000000000000000000000000000000000000..4e296abc9ac23ec94fa0bfe503d7136810bbc37e --- /dev/null +++ b/rados/src/main/java/com/yahoo/ycsb/db/RadosClient.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.db; + +import com.ceph.rados.Rados; +import com.ceph.rados.IoCTX; +import com.ceph.rados.jna.RadosObjectInfo; +import com.ceph.rados.ReadOp; +import com.ceph.rados.ReadOp.ReadResult; +import com.ceph.rados.exceptions.RadosException; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import java.io.File; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; + +import org.json.JSONObject; + +/** + * YCSB binding for <a href="http://ceph.org/">RADOS of Ceph</a>. + * + * See {@code rados/README.md} for details. + */ +public class RadosClient extends DB { + + private Rados rados; + private IoCTX ioctx; + + public static final String CONFIG_FILE_PROPERTY = "rados.configfile"; + public static final String CONFIG_FILE_DEFAULT = "/etc/ceph/ceph.conf"; + public static final String ID_PROPERTY = "rados.id"; + public static final String ID_DEFAULT = "admin"; + public static final String POOL_PROPERTY = "rados.pool"; + public static final String POOL_DEFAULT = "data"; + + private boolean isInited = false; + + public void init() throws DBException { + Properties props = getProperties(); + + String configfile = props.getProperty(CONFIG_FILE_PROPERTY); + if (configfile == null) { + configfile = CONFIG_FILE_DEFAULT; + } + + String id = props.getProperty(ID_PROPERTY); + if (id == null) { + id = ID_DEFAULT; + } + + String pool = props.getProperty(POOL_PROPERTY); + if (pool == null) { + pool = POOL_DEFAULT; + } + + // try { + // } catch (UnsatisfiedLinkError e) { + // throw new DBException("RADOS library is not loaded."); + // } + + rados = new Rados(id); + try { + rados.confReadFile(new File(configfile)); + rados.connect(); + ioctx = rados.ioCtxCreate(pool); + } catch (RadosException e) { + throw new DBException(e.getMessage() + ": " + e.getReturnValue()); + } + + isInited = true; + } + + public void cleanup() throws DBException { + if (isInited) { + rados.shutDown(); + rados.ioCtxDestroy(ioctx); + isInited = false; + } + } + + @Override + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + byte[] buffer; + + try { + RadosObjectInfo info = ioctx.stat(key); + buffer = new byte[(int)info.getSize()]; + + ReadOp rop = ioctx.readOpCreate(); + ReadResult readResult = rop.queueRead(0, info.getSize()); + // TODO: more size than byte length possible; + // rop.operate(key, Rados.OPERATION_NOFLAG); // for rados-java 0.3.0 + rop.operate(key, 0); + // readResult.raiseExceptionOnError("Error ReadOP(%d)", readResult.getRVal()); // for rados-java 0.3.0 + if (readResult.getRVal() < 0) { + throw new RadosException("Error ReadOP", readResult.getRVal()); + } + if (info.getSize() != readResult.getBytesRead()) { + return new Status("ERROR", "Error the object size read"); + } + readResult.getBuffer().get(buffer); + } catch (RadosException e) { + return new Status("ERROR-" + e.getReturnValue(), e.getMessage()); + } + + JSONObject json = new JSONObject(new String(buffer, java.nio.charset.StandardCharsets.UTF_8)); + Set<String> fieldsToReturn = (fields == null ? json.keySet() : fields); + + for (String name : fieldsToReturn) { + result.put(name, new StringByteIterator(json.getString(name))); + } + + return result.isEmpty() ? Status.ERROR : Status.OK; + } + + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + JSONObject json = new JSONObject(); + for (final Entry<String, ByteIterator> e : values.entrySet()) { + json.put(e.getKey(), e.getValue().toString()); + } + + try { + ioctx.write(key, json.toString()); + } catch (RadosException e) { + return new Status("ERROR-" + e.getReturnValue(), e.getMessage()); + } + return Status.OK; + } + + @Override + public Status delete(String table, String key) { + try { + ioctx.remove(key); + } catch (RadosException e) { + return new Status("ERROR-" + e.getReturnValue(), e.getMessage()); + } + return Status.OK; + } + + @Override + public Status update(String table, String key, HashMap<String, ByteIterator> values) { + Status rtn = delete(table, key); + if (rtn.equals(Status.OK)) { + return insert(table, key, values); + } + return rtn; + } + + @Override + public Status scan(String table, String startkey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { + return Status.NOT_IMPLEMENTED; + } +} diff --git a/rados/src/main/java/com/yahoo/ycsb/db/package-info.java b/rados/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..e03a0446452b74609fc6ab022a026e572c973987 --- /dev/null +++ b/rados/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 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. + */ + +/** + * YCSB binding for RADOS of Ceph. + */ +package com.yahoo.ycsb.db; diff --git a/rados/src/test/java/com/yahoo/ycsb/db/RadosClientTest.java b/rados/src/test/java/com/yahoo/ycsb/db/RadosClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..1501a626a4c2141e132951d660e2409aa7fcd8d8 --- /dev/null +++ b/rados/src/test/java/com/yahoo/ycsb/db/RadosClientTest.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeNoException; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import org.junit.AfterClass; +import org.junit.After; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.UUID; + + + /** + * Test for the binding of <a href="http://ceph.org/">RADOS of Ceph</a>. + * + * See {@code rados/README.md} for details. + */ + +public class RadosClientTest { + + private static RadosClient radosclient; + + public static final String POOL_PROPERTY = "rados.pool"; + public static final String POOL_TEST = "rbd"; + + private static final String TABLE_NAME = "table0"; + private static final String KEY0 = "key0"; + private static final String KEY1 = "key1"; + private static final String KEY2 = "key2"; + private static final HashMap<String, ByteIterator> DATA; + private static final HashMap<String, ByteIterator> DATA_UPDATED; + + static { + DATA = new HashMap<String, ByteIterator>(10); + DATA_UPDATED = new HashMap<String, ByteIterator>(10); + for (int i = 0; i < 10; i++) { + String key = "key" + UUID.randomUUID(); + DATA.put(key, new StringByteIterator("data" + UUID.randomUUID())); + DATA_UPDATED.put(key, new StringByteIterator("data" + UUID.randomUUID())); + } + } + + @BeforeClass + public static void setupClass() throws DBException { + radosclient = new RadosClient(); + + Properties p = new Properties(); + p.setProperty(POOL_PROPERTY, POOL_TEST); + + try { + radosclient.setProperties(p); + radosclient.init(); + } + catch (DBException|UnsatisfiedLinkError e) { + assumeNoException("Ceph cluster is not running. Skipping tests.", e); + } + } + + @AfterClass + public static void teardownClass() throws DBException { + if (radosclient != null) { + radosclient.cleanup(); + } + } + + @Before + public void setUp() { + radosclient.insert(TABLE_NAME, KEY0, DATA); + } + + @After + public void tearDown() { + radosclient.delete(TABLE_NAME, KEY0); + } + + @Test + public void insertTest() { + Status result = radosclient.insert(TABLE_NAME, KEY1, DATA); + assertEquals(Status.OK, result); + } + + @Test + public void updateTest() { + radosclient.insert(TABLE_NAME, KEY2, DATA); + + Status result = radosclient.update(TABLE_NAME, KEY2, DATA_UPDATED); + assertEquals(Status.OK, result); + + HashMap<String, ByteIterator> ret = new HashMap<String, ByteIterator>(10); + radosclient.read(TABLE_NAME, KEY2, DATA.keySet(), ret); + compareMap(DATA_UPDATED, ret); + + radosclient.delete(TABLE_NAME, KEY2); + } + + @Test + public void readTest() { + HashMap<String, ByteIterator> ret = new HashMap<String, ByteIterator>(10); + Status result = radosclient.read(TABLE_NAME, KEY0, DATA.keySet(), ret); + assertEquals(Status.OK, result); + compareMap(DATA, ret); + } + + private void compareMap(HashMap<String, ByteIterator> src, HashMap<String, ByteIterator> dest) { + assertEquals(src.size(), dest.size()); + + Set setSrc = src.entrySet(); + Iterator<Map.Entry> itSrc = setSrc.iterator(); + for (int i = 0; i < 10; i++) { + Map.Entry<String, ByteIterator> entrySrc = itSrc.next(); + assertEquals(entrySrc.getValue().toString(), dest.get(entrySrc.getKey()).toString()); + } + } + + @Test + public void deleteTest() { + Status result = radosclient.delete(TABLE_NAME, KEY0); + assertEquals(Status.OK, result); + } + +} diff --git a/redis/README.md b/redis/README.md index d2ef806a950d0944fba47493e1b89b3dacedc572..bc883271b071e9419195e4c390ed9268ef35eef7 100644 --- a/redis/README.md +++ b/redis/README.md @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2014 - 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. +--> + ## Quick Start This section describes how to run YCSB on Redis. @@ -19,7 +36,7 @@ Git clone YCSB and compile: Set the host, port, and password (do not redis auth is not turned on) in the workload you plan to run. -- `redis.url` +- `redis.host` - `redis.port` - `redis.password` diff --git a/redis/pom.xml b/redis/pom.xml index df4e282cc3a8ad0a32b6413d292e7388989f4cb8..6e6fbe38fc2d212c46f54cfa23f702de95289f54 100644 --- a/redis/pom.xml +++ b/redis/pom.xml @@ -1,10 +1,27 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> diff --git a/redis/src/main/java/com/yahoo/ycsb/db/RedisClient.java b/redis/src/main/java/com/yahoo/ycsb/db/RedisClient.java index 0d5c3ff1efee1522b57d56688b90bf0be2e5fcba..fbcfcb0a31dfb4c36a5b68a78538448ca03a6ad8 100644 --- a/redis/src/main/java/com/yahoo/ycsb/db/RedisClient.java +++ b/redis/src/main/java/com/yahoo/ycsb/db/RedisClient.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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. + */ + /** * Redis client binding for YCSB. * @@ -6,12 +23,16 @@ */ package com.yahoo.ycsb.db; + +import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.StringByteIterator; -import java.util.Map; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.Protocol; + import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -19,113 +40,118 @@ import java.util.Properties; import java.util.Set; import java.util.Vector; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.Protocol; - +/** + * YCSB binding for <a href="http://redis.io/">Redis</a>. + * + * See {@code redis/README.md} for details. + */ public class RedisClient extends DB { - private Jedis jedis; - - public static final String HOST_PROPERTY = "redis.host"; - public static final String PORT_PROPERTY = "redis.port"; - public static final String PASSWORD_PROPERTY = "redis.password"; + private Jedis jedis; - public static final String INDEX_KEY = "_indices"; + public static final String HOST_PROPERTY = "redis.host"; + public static final String PORT_PROPERTY = "redis.port"; + public static final String PASSWORD_PROPERTY = "redis.password"; - public void init() throws DBException { - Properties props = getProperties(); - int port; + public static final String INDEX_KEY = "_indices"; - String portString = props.getProperty(PORT_PROPERTY); - if (portString != null) { - port = Integer.parseInt(portString); - } - else { - port = Protocol.DEFAULT_PORT; - } - String host = props.getProperty(HOST_PROPERTY); - - jedis = new Jedis(host, port); - jedis.connect(); - - String password = props.getProperty(PASSWORD_PROPERTY); - if (password != null) { - jedis.auth(password); - } - } + public void init() throws DBException { + Properties props = getProperties(); + int port; - public void cleanup() throws DBException { - jedis.disconnect(); + String portString = props.getProperty(PORT_PROPERTY); + if (portString != null) { + port = Integer.parseInt(portString); + } else { + port = Protocol.DEFAULT_PORT; } + String host = props.getProperty(HOST_PROPERTY); - /* Calculate a hash for a key to store it in an index. The actual return - * value of this function is not interesting -- it primarily needs to be - * fast and scattered along the whole space of doubles. In a real world - * scenario one would probably use the ASCII values of the keys. - */ - private double hash(String key) { - return key.hashCode(); - } + jedis = new Jedis(host, port); + jedis.connect(); - //XXX jedis.select(int index) to switch to `table` - - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - if (fields == null) { - StringByteIterator.putAllAsByteIterators(result, jedis.hgetAll(key)); - } - else { - String[] fieldArray = (String[])fields.toArray(new String[fields.size()]); - List<String> values = jedis.hmget(key, fieldArray); - - Iterator<String> fieldIterator = fields.iterator(); - Iterator<String> valueIterator = values.iterator(); - - while (fieldIterator.hasNext() && valueIterator.hasNext()) { - result.put(fieldIterator.next(), - new StringByteIterator(valueIterator.next())); - } - assert !fieldIterator.hasNext() && !valueIterator.hasNext(); - } - return result.isEmpty() ? 1 : 0; + String password = props.getProperty(PASSWORD_PROPERTY); + if (password != null) { + jedis.auth(password); } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - if (jedis.hmset(key, StringByteIterator.getStringMap(values)).equals("OK")) { - jedis.zadd(INDEX_KEY, hash(key), key); - return 0; - } - return 1; + } + + public void cleanup() throws DBException { + jedis.disconnect(); + } + + /* + * Calculate a hash for a key to store it in an index. The actual return value + * of this function is not interesting -- it primarily needs to be fast and + * scattered along the whole space of doubles. In a real world scenario one + * would probably use the ASCII values of the keys. + */ + private double hash(String key) { + return key.hashCode(); + } + + // XXX jedis.select(int index) to switch to `table` + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + if (fields == null) { + StringByteIterator.putAllAsByteIterators(result, jedis.hgetAll(key)); + } else { + String[] fieldArray = + (String[]) fields.toArray(new String[fields.size()]); + List<String> values = jedis.hmget(key, fieldArray); + + Iterator<String> fieldIterator = fields.iterator(); + Iterator<String> valueIterator = values.iterator(); + + while (fieldIterator.hasNext() && valueIterator.hasNext()) { + result.put(fieldIterator.next(), + new StringByteIterator(valueIterator.next())); + } + assert !fieldIterator.hasNext() && !valueIterator.hasNext(); } - - @Override - public int delete(String table, String key) { - return jedis.del(key) == 0 - && jedis.zrem(INDEX_KEY, key) == 0 - ? 1 : 0; + return result.isEmpty() ? Status.ERROR : Status.OK; + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + if (jedis.hmset(key, StringByteIterator.getStringMap(values)) + .equals("OK")) { + jedis.zadd(INDEX_KEY, hash(key), key); + return Status.OK; } - - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - return jedis.hmset(key, StringByteIterator.getStringMap(values)).equals("OK") ? 0 : 1; + return Status.ERROR; + } + + @Override + public Status delete(String table, String key) { + return jedis.del(key) == 0 && jedis.zrem(INDEX_KEY, key) == 0 ? Status.ERROR + : Status.OK; + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + return jedis.hmset(key, StringByteIterator.getStringMap(values)) + .equals("OK") ? Status.OK : Status.ERROR; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + Set<String> keys = jedis.zrangeByScore(INDEX_KEY, hash(startkey), + Double.POSITIVE_INFINITY, 0, recordcount); + + HashMap<String, ByteIterator> values; + for (String key : keys) { + values = new HashMap<String, ByteIterator>(); + read(table, key, fields, values); + result.add(values); } - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - Set<String> keys = jedis.zrangeByScore(INDEX_KEY, hash(startkey), - Double.POSITIVE_INFINITY, 0, recordcount); - - HashMap<String, ByteIterator> values; - for (String key : keys) { - values = new HashMap<String, ByteIterator>(); - read(table, key, fields, values); - result.add(values); - } - - return 0; - } + return Status.OK; + } } diff --git a/redis/src/main/java/com/yahoo/ycsb/db/package-info.java b/redis/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..d000d6c8c0c69cc273e1f2d05a30a80b7119d996 --- /dev/null +++ b/redis/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * 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="http://redis.io/">Redis</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/riak/README.md b/riak/README.md new file mode 100644 index 0000000000000000000000000000000000000000..58bd6d48807793519f84cd5862ea5e730e172adb --- /dev/null +++ b/riak/README.md @@ -0,0 +1,92 @@ +<!-- +Copyright (c) 2016 YCSB contributors. All rights reserved. +Copyright 2014 Basho Technologies, Inc. + +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. +--> + +Riak KV Client for Yahoo! Cloud System Benchmark (YCSB) +======================================================= + +The Riak KV YCSB client is designed to work with the Yahoo! Cloud System Benchmark (YCSB) project (https://github.com/brianfrankcooper/YCSB) to support performance testing for the 2.x.y line of the Riak KV database. + +Creating a <i>bucket-type</i> to use with YCSB +---------------------------- + +Perform the following operations on your Riak cluster to configure it for the benchmarks. + +Set the default backend for Riak to <i>LevelDB</i> in the `riak.conf` file of every node of your cluster. This is required to support <i>secondary indexes</i>, which are used for the `scan` transactions. You can do this by modifying the proper line as shown below. + +``` +storage_backend = leveldb +``` +After this, create a bucket type named "ycsb"<sup id="a1">[1](#f1)</sup> by logging into one of the nodes in your cluster. Now you're ready to set up the cluster to operate using one between strong and eventual consistency model as shown in the next two subsections. + +###Strong consistency model + +To use the <i>strong consistency model</i> (default), you need to follow the next two steps. + +1. In every `riak.conf` file, search for the `##strong_consistency=on` line and uncomment it. It's important that you do this <b>before you start your cluster</b>! +2. Run the following `riak-admin` commands: + + ``` + riak-admin bucket-type create ycsb '{"props":{"consistent":true}}' + riak-admin bucket-type activate ycsb + ``` + +When using this model, you **may want to specify the number of replicas to create for each object**<sup id="a2">[2](#f2)</sup>: the *R* and *W* parameters (see next section) will in fact be ignored. The only information needed by this consistency model is how many nodes the system has to successfully query to consider a transaction completed. To set this parameter, you can add `"n_val":N` to the list of properties shown above (by default `N` is set to 3). + +####A note on the scan transactions +Currently, `scan` transactions are not _directly_ supported, as there is no suitable mean to perform them properly. This will not cause the benchmark to fail, it simply won't perform any scan transaction at all (these will immediately return with a `Status.NOT_IMPLEMENTED` code). + +However, a possible workaround has been provided: considering that Riak doesn't allow strong-consistent bucket-types to use secondary indexes, we can create an eventually consistent one just to store (*key*, *2i indexes*) pairs. This will be later used only to obtain the keys where the objects are located, which will be then used to retrieve the actual objects from the strong-consistent bucket. If you want to use this workaround, then you have to create and activate a "_fake bucket-type_" using the following commands: +``` +riak-admin bucket-type create fakeBucketType '{"props":{"allow_mult":"false","n_val":1,"dvv_enabled":false,"last_write_wins":true}}' +riak-admin bucket-type activate fakeBucketType +``` +A bucket-type so defined isn't allowed to _create siblings_ (`allow_mult":"false"`), it'll have just _one replica_ (`"n_val":1`) which'll store the _last value provided_ (`"last_write_wins":true`) and _vector clocks_ will be used instead of _dotted version vectors_ (`"dvv_enabled":false`). Note that setting `"n_val":1` means that the `scan` transactions won't be much *fault-tolerant*, considering that if a node fails then a lot of them could potentially fail. You may indeed increase this value, but this choice will necessarily load the cluster with more work. So, the choice is yours to make! +Then you have to set the `riak.strong_consistent_scans_bucket_type` property (see next section) equal to the name you gave to the aforementioned "fake bucket-type" (e.g. `fakeBucketType` in this case). + +Please note that this workaround involves a **double store operation for each insert transaction**, one to store the actual object and another one to save the corresponding 2i index. In practice, the client won't notice any difference, as the latter operation is performed asynchronously. However, the cluster will be obviously loaded more, and this is why the proposed "fake bucket-type" to create is as less _resource-demanding_ as possible. + +###Eventual consistency model + +If you want to use the <i>eventual consistency model</i> implemented in Riak, you have just to type: +``` +riak-admin bucket-type create ycsb '{"props":{"allow_mult":"false"}}' +riak-admin bucket-type activate ycsb +``` + +Riak KV configuration parameters +---------------------------- +You can either specify these configuration parameters via command line or set them in the `riak.properties` file. + +* `riak.hosts` - <b>string list</b>, comma separated list of IPs or FQDNs. For example: `riak.hosts=127.0.0.1,127.0.0.2,127.0.0.3` or `riak.hosts=riak1.mydomain.com,riak2.mydomain.com,riak3.mydomain.com`. +* `riak.port` - <b>int</b>, the port on which every node is listening. It must match the one specified in the `riak.conf` file at the line `listener.protobuf.internal`. +* `riak.bucket_type` - <b>string</b>, it must match the name of the bucket type created during setup (see section above). +* `riak.r_val` - <b>int</b>, this value represents the number of Riak nodes that must return results for a read operation before the transaction is considered successfully completed. +* `riak.w_val` - <b>int</b>, this value represents the number of Riak nodes that must report success before an insert/update transaction is considered complete. +* `riak.read_retry_count` - <b>int</b>, the number of times the client will try to read a key from Riak. +* `riak.wait_time_before_retry` - <b>int</b>, the time (in milliseconds) before the client attempts to perform another read if the previous one failed. +* `riak.transaction_time_limit` - <b>int</b>, the time (in seconds) the client waits before aborting the current transaction. +* `riak.strong_consistency` - <b>boolean</b>, indicates whether to use *strong consistency* (true) or *eventual consistency* (false). +* `riak.strong_consistent_scans_bucket_type` - **string**, indicates the bucket-type to use to allow scans transactions when using strong consistency mode. +* `riak.debug` - <b>boolean</b>, enables debug mode. This displays all the properties (specified or defaults) when a benchmark is started. Moreover, it shows error causes whenever these occur. + +<b>Note</b>: For more information on workloads and how to run them please see: https://github.com/brianfrankcooper/YCSB/wiki/Running-a-Workload + +<b id="f1">1</b> As specified in the `riak.properties` file. See parameters configuration section for further info. [↩](#a1) + +<b id="f2">2</b> More info about properly setting up a fault-tolerant cluster can be found at http://docs.basho.com/riak/kv/2.1.4/configuring/strong-consistency/#enabling-strong-consistency.[↩](#a2) + diff --git a/riak/pom.xml b/riak/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..a4b01529bc3acf4eacf33ef6d4761f46ff63029a --- /dev/null +++ b/riak/pom.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2016 YCSB contributors. All rights reserved. +Copyright 2014 Basho Technologies, Inc. + +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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>riak-binding</artifactId> + <name>Riak KV Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.basho.riak</groupId> + <artifactId>riak-client</artifactId> + <version>2.0.5</version> + </dependency> + <dependency> + <groupId>com.yahoo.ycsb</groupId> + <artifactId>core</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.google.collections</groupId> + <artifactId>google-collections</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> + +</project> \ No newline at end of file diff --git a/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakKVClient.java b/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakKVClient.java new file mode 100644 index 0000000000000000000000000000000000000000..42c3e90e4056275cfd6e705132fbff6f9b8bd62b --- /dev/null +++ b/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakKVClient.java @@ -0,0 +1,594 @@ +/** + * Copyright (c) 2016 YCSB contributors All rights reserved. + * Copyright 2014 Basho Technologies, Inc. + * + * 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.riak; + +import com.basho.riak.client.api.commands.buckets.StoreBucketProperties; +import com.basho.riak.client.api.commands.kv.StoreValue; +import com.basho.riak.client.api.commands.kv.UpdateValue; +import com.basho.riak.client.core.RiakFuture; +import com.basho.riak.client.core.query.RiakObject; +import com.basho.riak.client.core.query.indexes.LongIntIndex; +import com.basho.riak.client.core.util.BinaryValue; +import com.yahoo.ycsb.*; + +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import com.basho.riak.client.api.RiakClient; +import com.basho.riak.client.api.cap.Quorum; +import com.basho.riak.client.api.commands.indexes.IntIndexQuery; +import com.basho.riak.client.api.commands.kv.DeleteValue; +import com.basho.riak.client.api.commands.kv.FetchValue; +import com.basho.riak.client.core.RiakCluster; +import com.basho.riak.client.core.RiakNode; +import com.basho.riak.client.core.query.Location; +import com.basho.riak.client.core.query.Namespace; + +import static com.yahoo.ycsb.db.riak.RiakUtils.createResultHashMap; +import static com.yahoo.ycsb.db.riak.RiakUtils.getKeyAsLong; +import static com.yahoo.ycsb.db.riak.RiakUtils.serializeTable; + +/** + * Riak KV 2.x.y client for YCSB framework. + * + */ +public class RiakKVClient extends DB { + private static final String HOST_PROPERTY = "riak.hosts"; + private static final String PORT_PROPERTY = "riak.port"; + private static final String BUCKET_TYPE_PROPERTY = "riak.bucket_type"; + private static final String R_VALUE_PROPERTY = "riak.r_val"; + private static final String W_VALUE_PROPERTY = "riak.w_val"; + private static final String READ_RETRY_COUNT_PROPERTY = "riak.read_retry_count"; + private static final String WAIT_TIME_BEFORE_RETRY_PROPERTY = "riak.wait_time_before_retry"; + private static final String TRANSACTION_TIME_LIMIT_PROPERTY = "riak.transaction_time_limit"; + private static final String STRONG_CONSISTENCY_PROPERTY = "riak.strong_consistency"; + private static final String STRONG_CONSISTENT_SCANS_BUCKET_TYPE_PROPERTY = "riak.strong_consistent_scans_bucket_type"; + private static final String DEBUG_PROPERTY = "riak.debug"; + + private static final Status TIME_OUT = new Status("TIME_OUT", "Cluster didn't respond after maximum wait time."); + + private String[] hosts; + private int port; + private String bucketType; + private String bucketType2i; + private Quorum rvalue; + private Quorum wvalue; + private int readRetryCount; + private int waitTimeBeforeRetry; + private int transactionTimeLimit; + private boolean strongConsistency; + private String strongConsistentScansBucketType; + private boolean performStrongConsistentScans; + private boolean debug; + + private RiakClient riakClient; + private RiakCluster riakCluster; + + private void loadDefaultProperties() { + InputStream propFile = RiakKVClient.class.getClassLoader().getResourceAsStream("riak.properties"); + Properties propsPF = new Properties(System.getProperties()); + + try { + propsPF.load(propFile); + } catch (IOException e) { + e.printStackTrace(); + } + + hosts = propsPF.getProperty(HOST_PROPERTY).split(","); + port = Integer.parseInt(propsPF.getProperty(PORT_PROPERTY)); + bucketType = propsPF.getProperty(BUCKET_TYPE_PROPERTY); + rvalue = new Quorum(Integer.parseInt(propsPF.getProperty(R_VALUE_PROPERTY))); + wvalue = new Quorum(Integer.parseInt(propsPF.getProperty(W_VALUE_PROPERTY))); + readRetryCount = Integer.parseInt(propsPF.getProperty(READ_RETRY_COUNT_PROPERTY)); + waitTimeBeforeRetry = Integer.parseInt(propsPF.getProperty(WAIT_TIME_BEFORE_RETRY_PROPERTY)); + transactionTimeLimit = Integer.parseInt(propsPF.getProperty(TRANSACTION_TIME_LIMIT_PROPERTY)); + strongConsistency = Boolean.parseBoolean(propsPF.getProperty(STRONG_CONSISTENCY_PROPERTY)); + strongConsistentScansBucketType = propsPF.getProperty(STRONG_CONSISTENT_SCANS_BUCKET_TYPE_PROPERTY); + debug = Boolean.parseBoolean(propsPF.getProperty(DEBUG_PROPERTY)); + } + + private void loadProperties() { + // First, load the default properties... + loadDefaultProperties(); + + // ...then, check for some props set at command line! + Properties props = getProperties(); + + String portString = props.getProperty(PORT_PROPERTY); + if (portString != null) { + port = Integer.parseInt(portString); + } + + String hostsString = props.getProperty(HOST_PROPERTY); + if (hostsString != null) { + hosts = hostsString.split(","); + } + + String bucketTypeString = props.getProperty(BUCKET_TYPE_PROPERTY); + if (bucketTypeString != null) { + bucketType = bucketTypeString; + } + + String rValueString = props.getProperty(R_VALUE_PROPERTY); + if (rValueString != null) { + rvalue = new Quorum(Integer.parseInt(rValueString)); + } + + String wValueString = props.getProperty(W_VALUE_PROPERTY); + if (wValueString != null) { + wvalue = new Quorum(Integer.parseInt(wValueString)); + } + + String readRetryCountString = props.getProperty(READ_RETRY_COUNT_PROPERTY); + if (readRetryCountString != null) { + readRetryCount = Integer.parseInt(readRetryCountString); + } + + String waitTimeBeforeRetryString = props.getProperty(WAIT_TIME_BEFORE_RETRY_PROPERTY); + if (waitTimeBeforeRetryString != null) { + waitTimeBeforeRetry = Integer.parseInt(waitTimeBeforeRetryString); + } + + String transactionTimeLimitString = props.getProperty(TRANSACTION_TIME_LIMIT_PROPERTY); + if (transactionTimeLimitString != null) { + transactionTimeLimit = Integer.parseInt(transactionTimeLimitString); + } + + String strongConsistencyString = props.getProperty(STRONG_CONSISTENCY_PROPERTY); + if (strongConsistencyString != null) { + strongConsistency = Boolean.parseBoolean(strongConsistencyString); + } + + String strongConsistentScansBucketTypeString = props.getProperty(STRONG_CONSISTENT_SCANS_BUCKET_TYPE_PROPERTY); + if (strongConsistentScansBucketTypeString != null) { + strongConsistentScansBucketType = strongConsistentScansBucketTypeString; + } + + String debugString = props.getProperty(DEBUG_PROPERTY); + if (debugString != null) { + debug = Boolean.parseBoolean(debugString); + } + } + + public void init() throws DBException { + loadProperties(); + + RiakNode.Builder builder = new RiakNode.Builder().withRemotePort(port); + List<RiakNode> nodes = RiakNode.Builder.buildNodes(builder, Arrays.asList(hosts)); + riakCluster = new RiakCluster.Builder(nodes).build(); + + try { + riakCluster.start(); + riakClient = new RiakClient(riakCluster); + } catch (Exception e) { + System.err.println("Unable to properly start up the cluster. Reason: " + e.toString()); + throw new DBException(e); + } + + // If strong consistency is in use, we need to change the bucket-type where the 2i indexes will be stored. + if (strongConsistency && !strongConsistentScansBucketType.isEmpty()) { + // The 2i indexes have to be stored in the appositely created strongConsistentScansBucketType: this however has + // to be done only if the user actually created it! So, if the latter doesn't exist, then the scan transactions + // will not be performed at all. + bucketType2i = strongConsistentScansBucketType; + performStrongConsistentScans = true; + } else { + // If instead eventual consistency is in use, then the 2i indexes have to be stored in the bucket-type + // indicated with the bucketType variable. + bucketType2i = bucketType; + performStrongConsistentScans = false; + } + + if (debug) { + System.err.println("DEBUG ENABLED. Configuration parameters:"); + System.err.println("-----------------------------------------"); + System.err.println("Hosts: " + Arrays.toString(hosts)); + System.err.println("Port: " + port); + System.err.println("Bucket Type: " + bucketType); + System.err.println("R Val: " + rvalue.toString()); + System.err.println("W Val: " + wvalue.toString()); + System.err.println("Read Retry Count: " + readRetryCount); + System.err.println("Wait Time Before Retry: " + waitTimeBeforeRetry + " ms"); + System.err.println("Transaction Time Limit: " + transactionTimeLimit + " s"); + System.err.println("Consistency model: " + (strongConsistency ? "Strong" : "Eventual")); + + if (strongConsistency) { + System.err.println("Strong Consistent Scan Transactions " + (performStrongConsistentScans ? "" : "NOT ") + + "allowed."); + } + } + } + + /** + * 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 (Riak bucket) + * @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 + */ + @Override + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + Location location = new Location(new Namespace(bucketType, table), key); + FetchValue fv = new FetchValue.Builder(location).withOption(FetchValue.Option.R, rvalue).build(); + FetchValue.Response response; + + try { + response = fetch(fv); + + if (response.isNotFound()) { + if (debug) { + System.err.println("Unable to read key " + key + ". Reason: NOT FOUND"); + } + + return Status.NOT_FOUND; + } + } catch (TimeoutException e) { + if (debug) { + System.err.println("Unable to read key " + key + ". Reason: TIME OUT"); + } + + return TIME_OUT; + } catch (Exception e) { + if (debug) { + System.err.println("Unable to read key " + key + ". Reason: " + e.toString()); + } + + return Status.ERROR; + } + + // Create the result HashMap. + createResultHashMap(fields, response, result); + + return Status.OK; + } + + /** + * 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. + * Note: The scan operation requires the use of secondary indexes (2i) and LevelDB. + * + * @param table The name of the table (Riak bucket) + * @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 + */ + @Override + public Status scan(String table, String startkey, int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { + if (strongConsistency && !performStrongConsistentScans) { + return Status.NOT_IMPLEMENTED; + } + + // The strong consistent bucket-type is not capable of storing 2i indexes. So, we need to read them from the fake + // one (which we use only to store indexes). This is why, when using such a consistency model, the bucketType2i + // variable is set to FAKE_BUCKET_TYPE. + IntIndexQuery iiq = new IntIndexQuery + .Builder(new Namespace(bucketType2i, table), "key", getKeyAsLong(startkey), Long.MAX_VALUE) + .withMaxResults(recordcount) + .withPaginationSort(true) + .build(); + + Location location; + RiakFuture<IntIndexQuery.Response, IntIndexQuery> future = riakClient.executeAsync(iiq); + + try { + IntIndexQuery.Response response = future.get(transactionTimeLimit, TimeUnit.SECONDS); + List<IntIndexQuery.Response.Entry> entries = response.getEntries(); + + // If no entries were retrieved, then something bad happened... + if (entries.size() == 0) { + if (debug) { + System.err.println("Unable to scan any record starting from key " + startkey + ", aborting transaction. " + + "Reason: NOT FOUND"); + } + + return Status.NOT_FOUND; + } + + for (IntIndexQuery.Response.Entry entry : entries) { + // If strong consistency is in use, then the actual location of the object we want to read is obtained by + // fetching the key from the one retrieved with the 2i indexes search operation. + if (strongConsistency) { + location = new Location(new Namespace(bucketType, table), entry.getRiakObjectLocation().getKeyAsString()); + } else { + location = entry.getRiakObjectLocation(); + } + + FetchValue fv = new FetchValue.Builder(location) + .withOption(FetchValue.Option.R, rvalue) + .build(); + + FetchValue.Response keyResponse = fetch(fv); + + if (keyResponse.isNotFound()) { + if (debug) { + System.err.println("Unable to scan all requested records starting from key " + startkey + ", aborting " + + "transaction. Reason: NOT FOUND"); + } + + return Status.NOT_FOUND; + } + + // Create the partial result to add to the result vector. + HashMap<String, ByteIterator> partialResult = new HashMap<>(); + createResultHashMap(fields, keyResponse, partialResult); + result.add(partialResult); + } + } catch (TimeoutException e) { + if (debug) { + System.err.println("Unable to scan all requested records starting from key " + startkey + ", aborting " + + "transaction. Reason: TIME OUT"); + } + + return TIME_OUT; + } catch (Exception e) { + if (debug) { + System.err.println("Unable to scan all records starting from key " + startkey + ", aborting transaction. " + + "Reason: " + e.toString()); + } + + return Status.ERROR; + } + + return Status.OK; + } + + /** + * Tries to perform a read and, whenever it fails, retries to do it. It actually does try as many time as indicated, + * even if the function riakClient.execute(fv) throws an exception. This is needed for those situation in which the + * cluster is unable to respond properly due to overload. Note however that if the cluster doesn't respond after + * transactionTimeLimit, the transaction is discarded immediately. + * + * @param fv The value to fetch from the cluster. + */ + private FetchValue.Response fetch(FetchValue fv) throws TimeoutException { + FetchValue.Response response = null; + + for (int i = 0; i < readRetryCount; i++) { + RiakFuture<FetchValue.Response, Location> future = riakClient.executeAsync(fv); + + try { + response = future.get(transactionTimeLimit, TimeUnit.SECONDS); + + if (!response.isNotFound()) { + break; + } + } catch (TimeoutException e) { + // Let the callee decide how to handle this exception... + throw new TimeoutException(); + } catch (Exception e) { + // Sleep for a few ms before retrying... + try { + Thread.sleep(waitTimeBeforeRetry); + } catch (InterruptedException e1) { + e1.printStackTrace(); + } + } + } + + return response; + } + + /** + * 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. Also creates a secondary index (2i) for each record consisting of the key + * converted to long to be used for the scan operation. + * + * @param table The name of the table (Riak bucket) + * @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 + */ + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + Location location = new Location(new Namespace(bucketType, table), key); + RiakObject object = new RiakObject(); + + // Strong consistency doesn't support secondary indexing, but eventually consistent model does. So, we can mock a + // 2i usage by creating a fake object stored in an eventually consistent bucket-type with the SAME KEY THAT THE + // ACTUAL OBJECT HAS. This latter is obviously stored in the strong consistent bucket-type indicated with the + // riak.bucket_type property. + if (strongConsistency && performStrongConsistentScans) { + // Create a fake object to store in the default bucket-type just to keep track of the 2i indices. + Location fakeLocation = new Location(new Namespace(strongConsistentScansBucketType, table), key); + + // Obviously, we want the fake object to contain as less data as possible. We can't create a void object, so + // we have to choose the minimum data size allowed: it is one byte. + RiakObject fakeObject = new RiakObject(); + fakeObject.setValue(BinaryValue.create(new byte[]{0x00})); + fakeObject.getIndexes().getIndex(LongIntIndex.named("key_int")).add(getKeyAsLong(key)); + + StoreValue fakeStore = new StoreValue.Builder(fakeObject) + .withLocation(fakeLocation) + .build(); + + // We don't mind whether the operation is finished or not, because waiting for it to complete would slow down the + // client and make our solution too heavy to be seen as a valid compromise. This will obviously mean that under + // heavy load conditions a scan operation could fail due to an unfinished "fakeStore". + riakClient.executeAsync(fakeStore); + } else if (!strongConsistency) { + // The next operation is useless when using strong consistency model, so it's ok to perform it only when using + // eventual consistency. + object.getIndexes().getIndex(LongIntIndex.named("key_int")).add(getKeyAsLong(key)); + } + + // Store proper values into the object. + object.setValue(BinaryValue.create(serializeTable(values))); + + StoreValue store = new StoreValue.Builder(object) + .withOption(StoreValue.Option.W, wvalue) + .withLocation(location) + .build(); + + RiakFuture<StoreValue.Response, Location> future = riakClient.executeAsync(store); + + try { + future.get(transactionTimeLimit, TimeUnit.SECONDS); + } catch (TimeoutException e) { + if (debug) { + System.err.println("Unable to insert key " + key + ". Reason: TIME OUT"); + } + + return TIME_OUT; + } catch (Exception e) { + if (debug) { + System.err.println("Unable to insert key " + key + ". Reason: " + e.toString()); + } + + return Status.ERROR; + } + + return Status.OK; + } + + /** + * Auxiliary class needed for object substitution within the update operation. It is a fundamental part of the + * fetch-update (locally)-store cycle described by Basho to properly perform a strong-consistent update. + */ + private static final class UpdateEntity extends UpdateValue.Update<RiakObject> { + private final RiakObject object; + + private UpdateEntity(RiakObject object) { + this.object = object; + } + + //Simply returns the object. + @Override + public RiakObject apply(RiakObject original) { + return object; + } + } + + /** + * 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 (Riak bucket) + * @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 + */ + @Override + public Status update(String table, String key, HashMap<String, ByteIterator> values) { + // If eventual consistency model is in use, then an update operation is pratically equivalent to an insert one. + if (!strongConsistency) { + return insert(table, key, values); + } + + Location location = new Location(new Namespace(bucketType, table), key); + + UpdateValue update = new UpdateValue.Builder(location) + .withUpdate(new UpdateEntity(new RiakObject().setValue(BinaryValue.create(serializeTable(values))))) + .build(); + + RiakFuture<UpdateValue.Response, Location> future = riakClient.executeAsync(update); + + try { + // For some reason, the update transaction doesn't throw any exception when no cluster has been started, so one + // needs to check whether it was done or not. When calling the wasUpdated() function with no nodes available, a + // NullPointerException is thrown. + // Moreover, such exception could be thrown when more threads are trying to update the same key or, more + // generally, when the system is being queried by many clients (i.e. overloaded). This is a known limitation of + // Riak KV's strong consistency implementation. + future.get(transactionTimeLimit, TimeUnit.SECONDS).wasUpdated(); + } catch (TimeoutException e) { + if (debug) { + System.err.println("Unable to update key " + key + ". Reason: TIME OUT"); + } + + return TIME_OUT; + } catch (Exception e) { + if (debug) { + System.err.println("Unable to update key " + key + ". Reason: " + e.toString()); + } + + return Status.ERROR; + } + + return Status.OK; + } + + /** + * Delete a record from the database. + * + * @param table The name of the table (Riak bucket) + * @param key The record key of the record to delete. + * @return Zero on success, a non-zero error code on error + */ + @Override + public Status delete(String table, String key) { + Location location = new Location(new Namespace(bucketType, table), key); + DeleteValue dv = new DeleteValue.Builder(location).build(); + + RiakFuture<Void, Location> future = riakClient.executeAsync(dv); + + try { + future.get(transactionTimeLimit, TimeUnit.SECONDS); + } catch (TimeoutException e) { + if (debug) { + System.err.println("Unable to delete key " + key + ". Reason: TIME OUT"); + } + + return TIME_OUT; + } catch (Exception e) { + if (debug) { + System.err.println("Unable to delete key " + key + ". Reason: " + e.toString()); + } + + return Status.ERROR; + } + + return Status.OK; + } + + public void cleanup() throws DBException { + try { + riakCluster.shutdown(); + } catch (Exception e) { + System.err.println("Unable to properly shutdown the cluster. Reason: " + e.toString()); + throw new DBException(e); + } + } + + /** + * Auxiliary function needed for testing. It configures the default bucket-type to take care of the consistency + * problem by disallowing the siblings creation. Moreover, it disables strong consistency, because we don't have + * the possibility to create a proper bucket-type to use to fake 2i indexes usage. + * + * @param bucket The bucket name. + * @throws Exception Thrown if something bad happens. + */ + void setTestEnvironment(String bucket) throws Exception { + bucketType = "default"; + bucketType2i = bucketType; + strongConsistency = false; + + Namespace ns = new Namespace(bucketType, bucket); + StoreBucketProperties newBucketProperties = new StoreBucketProperties.Builder(ns).withAllowMulti(false).build(); + + riakClient.execute(newBucketProperties); + } +} diff --git a/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakUtils.java b/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..59090fa14b8e670303a93adaa38afa680a9c3062 --- /dev/null +++ b/riak/src/main/java/com/yahoo/ycsb/db/riak/RiakUtils.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) 2016 YCSB contributors All rights reserved. + * Copyright 2014 Basho Technologies, Inc. + * + * 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.riak; + +import java.io.*; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.basho.riak.client.api.commands.kv.FetchValue; +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; + +import static com.google.common.base.Preconditions.checkArgument; + +/** + * Utility class for Riak KV Client. + * + */ +final class RiakUtils { + + private RiakUtils() { + super(); + } + + private static byte[] toBytes(final int anInteger) { + byte[] aResult = new byte[4]; + + aResult[0] = (byte) (anInteger >> 24); + aResult[1] = (byte) (anInteger >> 16); + aResult[2] = (byte) (anInteger >> 8); + aResult[3] = (byte) (anInteger /* >> 0 */); + + return aResult; + } + + private static int fromBytes(final byte[] aByteArray) { + checkArgument(aByteArray.length == 4); + + return (aByteArray[0] << 24) | (aByteArray[1] & 0xFF) << 16 | (aByteArray[2] & 0xFF) << 8 | (aByteArray[3] & 0xFF); + } + + private static void close(final OutputStream anOutputStream) { + try { + anOutputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void close(final InputStream anInputStream) { + try { + anInputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Serializes a Map, transforming the contained list of (String, ByteIterator) couples into a byte array. + * + * @param aTable A Map to serialize. + * @return A byte array containng the serialized table. + */ + static byte[] serializeTable(Map<String, ByteIterator> aTable) { + final ByteArrayOutputStream anOutputStream = new ByteArrayOutputStream(); + final Set<Map.Entry<String, ByteIterator>> theEntries = aTable.entrySet(); + + try { + for (final Map.Entry<String, ByteIterator> anEntry : theEntries) { + final byte[] aColumnName = anEntry.getKey().getBytes(); + + anOutputStream.write(toBytes(aColumnName.length)); + anOutputStream.write(aColumnName); + + final byte[] aColumnValue = anEntry.getValue().toArray(); + + anOutputStream.write(toBytes(aColumnValue.length)); + anOutputStream.write(aColumnValue); + } + return anOutputStream.toByteArray(); + } catch (IOException e) { + throw new IllegalStateException(e); + } finally { + close(anOutputStream); + } + } + + /** + * Deserializes an input byte array, transforming it into a list of (String, ByteIterator) pairs (i.e. a Map). + * + * @param aValue A byte array containing the table to deserialize. + * @param theResult A Map containing the deserialized table. + */ + private static void deserializeTable(final byte[] aValue, final Map<String, ByteIterator> theResult) { + final ByteArrayInputStream anInputStream = new ByteArrayInputStream(aValue); + byte[] aSizeBuffer = new byte[4]; + + try { + while (anInputStream.available() > 0) { + anInputStream.read(aSizeBuffer); + final int aColumnNameLength = fromBytes(aSizeBuffer); + + final byte[] aColumnNameBuffer = new byte[aColumnNameLength]; + anInputStream.read(aColumnNameBuffer); + + anInputStream.read(aSizeBuffer); + final int aColumnValueLength = fromBytes(aSizeBuffer); + + final byte[] aColumnValue = new byte[aColumnValueLength]; + anInputStream.read(aColumnValue); + + theResult.put(new String(aColumnNameBuffer), new ByteArrayByteIterator(aColumnValue)); + } + } catch (Exception e) { + throw new IllegalStateException(e); + } finally { + close(anInputStream); + } + } + + /** + * Obtains a Long number from a key string. This will be the key used by Riak for all the transactions. + * + * @param key The key to convert from String to Long. + * @return A Long number parsed from the key String. + */ + static Long getKeyAsLong(String key) { + String keyString = key.replaceFirst("[a-zA-Z]*", ""); + + return Long.parseLong(keyString); + } + + /** + * Function that retrieves all the fields searched within a read or scan operation and puts them in the result + * HashMap. + * + * @param fields The list of fields to read, or null for all of them. + * @param response A Vector of HashMaps, where each HashMap is a set field/value pairs for one record. + * @param resultHashMap The HashMap to return as result. + */ + static void createResultHashMap(Set<String> fields, FetchValue.Response response, + HashMap<String, ByteIterator>resultHashMap) { + // If everything went fine, then a result must be given. Such an object is a hash table containing the (field, + // value) pairs based on the requested fields. Note that in a read operation, ONLY ONE OBJECT IS RETRIEVED! + // The following line retrieves the previously serialized table which was store with an insert transaction. + byte[] responseFieldsAndValues = response.getValues().get(0).getValue().getValue(); + + // Deserialize the stored response table. + HashMap<String, ByteIterator> deserializedTable = new HashMap<>(); + deserializeTable(responseFieldsAndValues, deserializedTable); + + // If only specific fields are requested, then only these should be put in the result object! + if (fields != null) { + // Populate the HashMap to provide as result. + for (Object field : fields.toArray()) { + // Comparison between a requested field and the ones retrieved. If they're equal (i.e. the get() operation + // DOES NOT return a null value), then proceed to store the pair in the resultHashMap. + ByteIterator value = deserializedTable.get(field); + + if (value != null) { + resultHashMap.put((String) field, value); + } + } + } else { + // If, instead, no field is specified, then all those retrieved must be provided as result. + for (String field : deserializedTable.keySet()) { + resultHashMap.put(field, deserializedTable.get(field)); + } + } + } +} diff --git a/riak/src/main/java/com/yahoo/ycsb/db/riak/package-info.java b/riak/src/main/java/com/yahoo/ycsb/db/riak/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..32d163fdcf7cc0d3b7134e382caf673d593e54b2 --- /dev/null +++ b/riak/src/main/java/com/yahoo/ycsb/db/riak/package-info.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2016 YCSB contributors All rights reserved. + * Copyright 2014 Basho Technologies, Inc. + * + * 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="http://basho.com/products/riak-kv/">Riak KV</a> 2.x.y. + * + */ +package com.yahoo.ycsb.db.riak; \ No newline at end of file diff --git a/riak/src/main/resources/riak.properties b/riak/src/main/resources/riak.properties new file mode 100644 index 0000000000000000000000000000000000000000..46c598fa24a0541afdcca106a7975251d69a3a07 --- /dev/null +++ b/riak/src/main/resources/riak.properties @@ -0,0 +1,61 @@ +## +# Copyright (c) 2016 YCSB contributors All rights reserved. +# Copyright 2014 Basho Technologies, Inc. +# +# 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. +# + +# RiakKVClient - Default Properties +# Note: Change the properties below to set the values to use for your test. You can set them either here or from the +# command line. Note that the latter choice overrides these settings. + +# riak.hosts - string list, comma separated list of IPs or FQDNs. +# EX: 127.0.0.1,127.0.0.2,127.0.0.3 or riak1.mydomain.com,riak2.mydomain.com,riak3.mydomain.com +riak.hosts=127.0.0.1 + +# riak.port - int, the port on which every node is listening. It must match the one specified in the riak.conf file +# at the line "listener.protobuf.internal". +riak.port=8087 + +# riak.bucket_type - string, must match value of bucket type created during setup. See readme.md for more information +riak.bucket_type=ycsb + +# riak.r_val - int, the R value represents the number of Riak nodes that must return results for a read before the read +# is considered successful. +riak.r_val=2 + +# riak.w_val - int, the W value represents the number of Riak nodes that must report success before an update is +# considered complete. +riak.w_val=2 + +# riak.read_retry_count - int, number of times the client will try to read a key from Riak. +riak.read_retry_count=5 + +# riak.wait_time_before_retry - int, time (in milliseconds) the client waits before attempting to perform another +# read if the previous one failed. +riak.wait_time_before_retry=200 + +# riak.transaction_time_limit - int, time (in seconds) the client waits before aborting the current transaction. +riak.transaction_time_limit=10 + +# riak.strong_consistency - boolean, indicates whether to use strong consistency (true) or eventual consistency (false). +riak.strong_consistency=true + +# riak.strong_consistent_scans_bucket_type - string, indicates the bucket-type to use to allow scans transactions +# when using strong consistency mode. Example: fakeBucketType. +riak.strong_consistent_scans_bucket_type= + +# riak.debug - boolean, enables debug mode. This displays all the properties (specified or defaults) when a benchmark +# is started. +riak.debug=false diff --git a/riak/src/test/java/com/yahoo/ycsb/db/riak/RiakKVClientTest.java b/riak/src/test/java/com/yahoo/ycsb/db/riak/RiakKVClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..a571fe43242601a653227f0e1fbc255780e626ef --- /dev/null +++ b/riak/src/test/java/com/yahoo/ycsb/db/riak/RiakKVClientTest.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) 2016 YCSB contributors All rights reserved. + * Copyright 2014 Basho Technologies, Inc. + * + * 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.riak; + +import java.util.*; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeNoException; +import static org.junit.Assume.assumeThat; + +/** + * Integration tests for the Riak KV client. + */ +public class RiakKVClientTest { + private static RiakKVClient riakClient; + + private static final String bucket = "testBucket"; + private static final String keyPrefix = "testKey"; + private static final int recordsToInsert = 20; + private static final int recordsToScan = 7; + private static final String firstField = "Key number"; + private static final String secondField = "Key number doubled"; + private static final String thirdField = "Key number square"; + + private static boolean testStarted = false; + + /** + * Creates a cluster for testing purposes. + */ + @BeforeClass + public static void setUpClass() throws Exception { + riakClient = new RiakKVClient(); + riakClient.init(); + + // Set the test bucket environment with the appropriate parameters. + try { + riakClient.setTestEnvironment(bucket); + } catch(Exception e) { + assumeNoException("Unable to configure Riak KV for test, aborting.", e); + } + + // Just add some records to work on... + for (int i = 0; i < recordsToInsert; i++) { + // Abort the entire test whenever the dataset population operation fails. + assumeThat("Riak KV is NOT RUNNING, aborting test.", + riakClient.insert(bucket, keyPrefix + String.valueOf(i), StringByteIterator.getByteIteratorMap( + createExpectedHashMap(i))), + is(Status.OK)); + } + + // Variable to check to determine whether the test has started or not. + testStarted = true; + } + + /** + * Shuts down the cluster created. + */ + @AfterClass + public static void tearDownClass() throws Exception { + // Delete all added keys before cleanup ONLY IF TEST ACTUALLY STARTED. + if (testStarted) { + for (int i = 0; i <= recordsToInsert; i++) { + delete(keyPrefix + Integer.toString(i)); + } + } + + riakClient.cleanup(); + } + + /** + * Test method for read transaction. It is designed to read two of the three fields stored for each key, to also test + * if the createResultHashMap() function implemented in RiakKVClient.java works as expected. + */ + @Test + public void testRead() { + // Choose a random key to read, among the available ones. + int readKeyNumber = new Random().nextInt(recordsToInsert); + + // Prepare two fields to read. + Set<String> fields = new HashSet<>(); + fields.add(firstField); + fields.add(thirdField); + + // Prepare an expected result. + HashMap<String, String> expectedValue = new HashMap<>(); + expectedValue.put(firstField, Integer.toString(readKeyNumber)); + expectedValue.put(thirdField, Integer.toString(readKeyNumber * readKeyNumber)); + + // Define a HashMap to store the actual result. + HashMap<String, ByteIterator> readValue = new HashMap<>(); + + // If a read transaction has been properly done, then one has to receive a Status.OK return from the read() + // function. Moreover, the actual returned result MUST match the expected one. + assertEquals("Read transaction FAILED.", + Status.OK, + riakClient.read(bucket, keyPrefix + Integer.toString(readKeyNumber), fields, readValue)); + + assertEquals("Read test FAILED. Actual read transaction value is NOT MATCHING the expected one.", + expectedValue.toString(), + readValue.toString()); + } + + /** + * Test method for scan transaction. A scan transaction has to be considered successfully completed only if all the + * requested values are read (i.e. scan transaction returns with Status.OK). Moreover, one has to check if the + * obtained results match the expected ones. + */ + @Test + public void testScan() { + // Choose, among the available ones, a random key as starting point for the scan transaction. + int startScanKeyNumber = new Random().nextInt(recordsToInsert - recordsToScan); + + // Prepare a HashMap vector to store the scan transaction results. + Vector<HashMap<String, ByteIterator>> scannedValues = new Vector<>(); + + // Check whether the scan transaction is correctly performed or not. + assertEquals("Scan transaction FAILED.", + Status.OK, + riakClient.scan(bucket, keyPrefix + Integer.toString(startScanKeyNumber), recordsToScan, null, + scannedValues)); + + // After the scan transaction completes, compare the obtained results with the expected ones. + for (int i = 0; i < recordsToScan; i++) { + assertEquals("Scan test FAILED: the current scanned key is NOT MATCHING the expected one.", + createExpectedHashMap(startScanKeyNumber + i).toString(), + scannedValues.get(i).toString()); + } + } + + /** + * Test method for update transaction. The test is designed to restore the previously read key. It is assumed to be + * correct when, after performing the update transaction, one reads the just provided values. + */ + @Test + public void testUpdate() { + // Choose a random key to read, among the available ones. + int updateKeyNumber = new Random().nextInt(recordsToInsert); + + // Define a HashMap to save the previously stored values for eventually restoring them. + HashMap<String, ByteIterator> readValueBeforeUpdate = new HashMap<>(); + riakClient.read(bucket, keyPrefix + Integer.toString(updateKeyNumber), null, readValueBeforeUpdate); + + // Prepare an update HashMap to store. + HashMap<String, String> updateValue = new HashMap<>(); + updateValue.put(firstField, "UPDATED"); + updateValue.put(secondField, "UPDATED"); + updateValue.put(thirdField, "UPDATED"); + + // First of all, perform the update and check whether it's failed or not. + assertEquals("Update transaction FAILED.", + Status.OK, + riakClient.update(bucket, keyPrefix + Integer.toString(updateKeyNumber), StringByteIterator + .getByteIteratorMap(updateValue))); + + // Then, read the key again and... + HashMap<String, ByteIterator> readValueAfterUpdate = new HashMap<>(); + assertEquals("Update test FAILED. Unable to read key value.", + Status.OK, + riakClient.read(bucket, keyPrefix + Integer.toString(updateKeyNumber), null, readValueAfterUpdate)); + + // ...compare the result with the new one! + assertEquals("Update transaction NOT EXECUTED PROPERLY. Values DID NOT CHANGE.", + updateValue.toString(), + readValueAfterUpdate.toString()); + + // Finally, restore the previously read key. + assertEquals("Update test FAILED. Unable to restore previous key value.", + Status.OK, + riakClient.update(bucket, keyPrefix + Integer.toString(updateKeyNumber), readValueBeforeUpdate)); + } + + /** + * Test method for insert transaction. It is designed to insert a key just after the last key inserted in the setUp() + * phase. + */ + @Test + public void testInsert() { + // Define a HashMap to insert and another one for the comparison operation. + HashMap<String, String> insertValue = createExpectedHashMap(recordsToInsert); + HashMap<String, ByteIterator> readValue = new HashMap<>(); + + // Check whether the insertion transaction was performed or not. + assertEquals("Insert transaction FAILED.", + Status.OK, + riakClient.insert(bucket, keyPrefix + Integer.toString(recordsToInsert), StringByteIterator. + getByteIteratorMap(insertValue))); + + // Finally, compare the insertion performed with the one expected by reading the key. + assertEquals("Insert test FAILED. Unable to read inserted value.", + Status.OK, + riakClient.read(bucket, keyPrefix + Integer.toString(recordsToInsert), null, readValue)); + assertEquals("Insert test FAILED. Actual read transaction value is NOT MATCHING the inserted one.", + insertValue.toString(), + readValue.toString()); + } + + /** + * Test method for delete transaction. The test deletes a key, then performs a read that should give a + * Status.NOT_FOUND response. Finally, it restores the previously read key. + */ + @Test + public void testDelete() { + // Choose a random key to delete, among the available ones. + int deleteKeyNumber = new Random().nextInt(recordsToInsert); + + // Define a HashMap to save the previously stored values for its eventual restore. + HashMap<String, ByteIterator> readValueBeforeDelete = new HashMap<>(); + riakClient.read(bucket, keyPrefix + Integer.toString(deleteKeyNumber), null, readValueBeforeDelete); + + // First of all, delete the key. + assertEquals("Delete transaction FAILED.", + Status.OK, + delete(keyPrefix + Integer.toString(deleteKeyNumber))); + + // Then, check if the deletion was actually achieved. + assertEquals("Delete test FAILED. Key NOT deleted.", + Status.NOT_FOUND, + riakClient.read(bucket, keyPrefix + Integer.toString(deleteKeyNumber), null, null)); + + // Finally, restore the previously deleted key. + assertEquals("Delete test FAILED. Unable to restore previous key value.", + Status.OK, + riakClient.insert(bucket, keyPrefix + Integer.toString(deleteKeyNumber), readValueBeforeDelete)); + } + + private static Status delete(String key) { + return riakClient.delete(bucket, key); + } + + private static HashMap<String, String> createExpectedHashMap(int value) { + HashMap<String, String> values = new HashMap<>(); + + values.put(firstField, Integer.toString(value)); + values.put(secondField, Integer.toString(2 * value)); + values.put(thirdField, Integer.toString(value * value)); + + return values; + } +} diff --git a/s3/README.md b/s3/README.md new file mode 100644 index 0000000000000000000000000000000000000000..347449deed6444b9c4c249458a22f87fb0a76f79 --- /dev/null +++ b/s3/README.md @@ -0,0 +1,79 @@ +<!-- +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. +--> +Quick Start +=============== +### 1. Set Up YCSB + +Download the YCSB from this website: + + https://github.com/brianfrankcooper/YCSB/releases/ + +You can choose to download either the full stable version or just one of the available binding. + +### 2. Configuration of the AWS credentials + +The access key ID and secret access key as well as the endPoint and region and the Client configurations like the maxErrorRetry can be set in a properties file under s3-binding/conf/s3.properties or sent by command line (see below). +It is highly suggested to use the property file instead of to send the credentials through the command line. + + +### 3. Run YCSB + +To execute the benchmark using the S3 storage binding, first files must be uploaded using the "load" option with this command: + + ./bin/ycsb load s3 -p table=theBucket -p s3.endPoint=s3.amazonaws.com -p s3.accessKeyId=yourAccessKeyId -p s3.secretKey=yourSecretKey -p fieldlength=10 -p fieldcount=20 -P workloads/workloada + +With this command, the workload A will be executing with the loading phase. The file size is determined by the number of fields (fieldcount) and by the field size (fieldlength). In this case each file is 200 bytes (10 bytes for each field multiplied by 20 fields). + +Running the command: + + ./bin/ycsb -t s3 -p table=theBucket -p s3.endPoint=s3.amazonaws.com -p s3.accessKeyId=yourAccessKeyId -p s3.secretKey=yourSecretKey -p fieldlength=10 -p fieldcount=20 -P workloads/workloada + +the workload A will be executed with file size 200 bytes. + +#### S3 Storage Configuration Parameters + +The parameters to configure the S3 client can be set using the file "s3-binding/conf/s3.properties". This is highly advisable for the parameters s3.accessKeyId and s3.secretKey. All the other parameters can be set also on the command line. Here the list of all the parameters that is possible to configure: + +- `table` + - This should be a S3 Storage bucket name and it replace the standard table name assigned by YCSB. + +- `s3.endpoint` + - This indicate the endpoint used to connect to the S3 Storage service. + - Default value is `s3.amazonaws.com`. + +- `s3.region` + - This indicate the region where your buckets are. + - Default value is `us-east-1`. + +- `s3.accessKeyId` + - This is the accessKey of your S3 account. + +- `s3.secretKey` + - This is the secret associated with your S3 account. + +- `s3.maxErrorRetry` + - This is the maxErrorRetry parameter for the S3Client. + +- `s3.protocol` + - This is the protocol parameter for the S3Client. The default value is HTTPS. + +- `s3.sse` + - This parameter set to true activates the Server Side Encryption. + +- `s3.ssec` + - This parameter if not null activates the SSE-C client side encryption. The value passed with this parameter is the client key used to encrpyt the files. + diff --git a/s3/pom.xml b/s3/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe65318840a0a744fb2598e9d1f7a6f6c6b77782 --- /dev/null +++ b/s3/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2015-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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>s3-binding</artifactId> + <name>S3 Storage Binding</name> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.amazonaws</groupId> + <artifactId>aws-java-sdk-s3</artifactId> + <version>${s3.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/s3/src/main/conf/s3.properties b/s3/src/main/conf/s3.properties new file mode 100644 index 0000000000000000000000000000000000000000..f36c7745e617e200cd72f170de4a183b548bd92d --- /dev/null +++ b/s3/src/main/conf/s3.properties @@ -0,0 +1,31 @@ +# +# Sample S3 configuration properties +# +# You may either set properties here or via the command line. +# + +# the AWS S3 access key ID +s3.accessKeyId=yourKey + +# the AWS S3 secret access key ID +s3.secretKey=YourSecret + +# the AWS endpoint +s3.endpoint=s3.amazonaws.com + +# activating the SSE server side encryption if true +s3.sse=false + +# activating the SSE-C client side encryption if used +#s3.ssec=U2CccCI40he2mZtg2aCEzofP7nQsfy4nP14VSYu6bFA= + +# set the protocol to use for the Client, default is HTTPS +#s3.protocol=HTTPS + +# set the maxConnections to use for the Client, it should be not less than the +# threads since only one client is created and shared between threads +#s3.maxConnections= + +# set the maxErrorRetry parameter to use for the Client +#s3.maxErrorRetry= + diff --git a/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java new file mode 100644 index 0000000000000000000000000000000000000000..8ef3f5be38c30bf7f342440bab2203c87a585a47 --- /dev/null +++ b/s3/src/main/java/com/yahoo/ycsb/db/S3Client.java @@ -0,0 +1,527 @@ +/** + * 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. + * + * S3 storage client binding for YCSB. + */ +package com.yahoo.ycsb.db; + +import java.util.HashMap; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.net.*; + +import com.yahoo.ycsb.ByteArrayByteIterator; +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; + +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.*; +import com.amazonaws.auth.*; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.PutObjectResult; +import com.amazonaws.services.s3.model.S3Object; +import com.amazonaws.services.s3.model.GetObjectRequest; +import com.amazonaws.ClientConfiguration; +import com.amazonaws.regions.Region; +import com.amazonaws.regions.Regions; +import com.amazonaws.Protocol; +import com.amazonaws.services.s3.model.DeleteObjectRequest; +import com.amazonaws.services.s3.model.ObjectListing; +import com.amazonaws.services.s3.model.S3ObjectSummary; +import com.amazonaws.services.s3.model.SSECustomerKey; +import com.amazonaws.services.s3.model.PutObjectRequest; +import com.amazonaws.services.s3.model.GetObjectMetadataRequest; + +/** + * S3 Storage client for YCSB framework. + * + * Properties to set: + * + * s3.accessKeyId=access key S3 aws + * s3.secretKey=secret key S3 aws + * s3.endPoint=s3.amazonaws.com + * s3.region=us-east-1 + * The parameter table is the name of the Bucket where to upload the files. + * This must be created before to start the benchmark + * The size of the file to upload is determined by two parameters: + * - fieldcount this is the number of fields of a record in YCSB + * - fieldlength this is the size in bytes of a single field in the record + * together these two parameters define the size of the file to upload, + * the size in bytes is given by the fieldlength multiplied by the fieldcount. + * The name of the file is determined by the parameter key. + *This key is automatically generated by YCSB. + * + */ +public class S3Client extends DB { + + private static AmazonS3Client s3Client; + private static String sse; + private static SSECustomerKey ssecKey; + private static final AtomicInteger INIT_COUNT = new AtomicInteger(0); + + /** + * Cleanup any state for this storage. + * Called once per S3 instance; + */ + @Override + public void cleanup() throws DBException { + if (INIT_COUNT.decrementAndGet() == 0) { + try { + s3Client.shutdown(); + System.out.println("The client is shutdown successfully"); + } catch (Exception e){ + System.err.println("Could not shutdown the S3Client: "+e.toString()); + e.printStackTrace(); + } finally { + if (s3Client != null){ + s3Client = null; + } + } + } + } + /** + * Delete a file from S3 Storage. + * + * @param bucket + * The name of the bucket + * @param key + * The record key of the file to delete. + * @return OK on success, otherwise ERROR. See the + * {@link DB} class's description for a discussion of error codes. + */ + @Override + public Status delete(String bucket, String key) { + try { + s3Client.deleteObject(new DeleteObjectRequest(bucket, key)); + } catch (Exception e){ + System.err.println("Not possible to delete the key "+key); + e.printStackTrace(); + return Status.ERROR; + } + return Status.OK; + } + /** + * Initialize any state for the storage. + * Called once per S3 instance; If the client is not null it is re-used. + */ + @Override + public void init() throws DBException { + final int count = INIT_COUNT.incrementAndGet(); + synchronized (S3Client.class){ + Properties propsCL = getProperties(); + int recordcount = Integer.parseInt( + propsCL.getProperty("recordcount")); + int operationcount = Integer.parseInt( + propsCL.getProperty("operationcount")); + int numberOfOperations = 0; + if (recordcount > 0){ + if (recordcount > operationcount){ + numberOfOperations = recordcount; + } else { + numberOfOperations = operationcount; + } + } else { + numberOfOperations = operationcount; + } + if (count <= numberOfOperations) { + String accessKeyId = null; + String secretKey = null; + String endPoint = null; + String region = null; + String maxErrorRetry = null; + String maxConnections = null; + String protocol = null; + BasicAWSCredentials s3Credentials; + ClientConfiguration clientConfig; + if (s3Client != null) { + System.out.println("Reusing the same client"); + return; + } + try { + InputStream propFile = S3Client.class.getClassLoader() + .getResourceAsStream("s3.properties"); + Properties props = new Properties(System.getProperties()); + props.load(propFile); + accessKeyId = props.getProperty("s3.accessKeyId"); + if (accessKeyId == null){ + accessKeyId = propsCL.getProperty("s3.accessKeyId"); + } + System.out.println(accessKeyId); + secretKey = props.getProperty("s3.secretKey"); + if (secretKey == null){ + secretKey = propsCL.getProperty("s3.secretKey"); + } + System.out.println(secretKey); + endPoint = props.getProperty("s3.endPoint"); + if (endPoint == null){ + endPoint = propsCL.getProperty("s3.endPoint", "s3.amazonaws.com"); + } + System.out.println(endPoint); + region = props.getProperty("s3.region"); + if (region == null){ + region = propsCL.getProperty("s3.region", "us-east-1"); + } + System.out.println(region); + maxErrorRetry = props.getProperty("s3.maxErrorRetry"); + if (maxErrorRetry == null){ + maxErrorRetry = propsCL.getProperty("s3.maxErrorRetry", "15"); + } + maxConnections = props.getProperty("s3.maxConnections"); + if (maxConnections == null){ + maxConnections = propsCL.getProperty("s3.maxConnections"); + } + protocol = props.getProperty("s3.protocol"); + if (protocol == null){ + protocol = propsCL.getProperty("s3.protocol", "HTTPS"); + } + sse = props.getProperty("s3.sse"); + if (sse == null){ + sse = propsCL.getProperty("s3.sse", "false"); + } + String ssec = props.getProperty("s3.ssec"); + if (ssec == null){ + ssec = propsCL.getProperty("s3.ssec", null); + } else { + ssecKey = new SSECustomerKey(ssec); + } + } catch (Exception e){ + System.err.println("The file properties doesn't exist "+e.toString()); + e.printStackTrace(); + } + try { + System.out.println("Inizializing the S3 connection"); + s3Credentials = new BasicAWSCredentials(accessKeyId, secretKey); + clientConfig = new ClientConfiguration(); + clientConfig.setMaxErrorRetry(Integer.parseInt(maxErrorRetry)); + if(protocol.equals("HTTP")) { + clientConfig.setProtocol(Protocol.HTTP); + } else { + clientConfig.setProtocol(Protocol.HTTPS); + } + if(maxConnections != null) { + clientConfig.setMaxConnections(Integer.parseInt(maxConnections)); + } + s3Client = new AmazonS3Client(s3Credentials, clientConfig); + s3Client.setRegion(Region.getRegion(Regions.fromName(region))); + s3Client.setEndpoint(endPoint); + System.out.println("Connection successfully initialized"); + } catch (Exception e){ + System.err.println("Could not connect to S3 storage: "+ e.toString()); + e.printStackTrace(); + throw new DBException(e); + } + } else { + System.err.println( + "The number of threads must be less or equal than the operations"); + throw new DBException(new Error( + "The number of threads must be less or equal than the operations")); + } + } + } + /** + * Create a new File in the Bucket. Any field/value pairs in the specified + * values HashMap will be written into the file with the specified record + * key. + * + * @param bucket + * The name of the bucket + * @param key + * The record key of the file to insert. + * @param values + * A HashMap of field/value pairs to insert in the file. + * Only the content of the first field is written to a byteArray + * multiplied by the number of field. In this way the size + * of the file to upload is determined by the fieldlength + * and fieldcount parameters. + * @return OK on success, ERROR otherwise. See the + * {@link DB} class's description for a discussion of error codes. + */ + @Override + public Status insert(String bucket, String key, + HashMap<String, ByteIterator> values) { + return writeToStorage(bucket, key, values, true, sse, ssecKey); + } + /** + * Read a file from the Bucket. Each field/value pair from the result + * will be stored in a HashMap. + * + * @param bucket + * The name of the bucket + * @param key + * The record key of the file to read. + * @param fields + * The list of fields to read, or null for all of them, + * it is null by default + * @param result + * A HashMap of field/value pairs for the result + * @return OK on success, ERROR otherwise. + */ + @Override + public Status read(String bucket, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + return readFromStorage(bucket, key, result, ssecKey); + } + /** + * Update a file in the database. Any field/value pairs in the specified + * values HashMap will be written into the file with the specified file + * key, overwriting any existing values with the same field name. + * + * @param bucket + * The name of the bucket + * @param key + * The file key of the file to write. + * @param values + * A HashMap of field/value pairs to update in the record + * @return OK on success, ERORR otherwise. + */ + @Override + public Status update(String bucket, String key, + HashMap<String, ByteIterator> values) { + return writeToStorage(bucket, key, values, false, sse, ssecKey); + } + /** + * Perform a range scan for a set of files in the bucket. Each + * field/value pair from the result will be stored in a HashMap. + * + * @param bucket + * The name of the bucket + * @param startkey + * The file key of the first file to read. + * @param recordcount + * The number of files 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 file + * @return OK on success, ERROR otherwise. + */ + @Override + public Status scan(String bucket, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + return scanFromStorage(bucket, startkey, recordcount, result, ssecKey); + } + /** + * Upload a new object to S3 or update an object on S3. + * + * @param bucket + * The name of the bucket + * @param key + * The file key of the object to upload/update. + * @param values + * The data to be written on the object + * @param updateMarker + * A boolean value. If true a new object will be uploaded + * to S3. If false an existing object will be re-uploaded + * + */ + protected Status writeToStorage(String bucket, String key, + HashMap<String, ByteIterator> values, Boolean updateMarker, + String sseLocal, SSECustomerKey ssecLocal) { + int totalSize = 0; + int fieldCount = values.size(); //number of fields to concatenate + // getting the first field in the values + Object keyToSearch = values.keySet().toArray()[0]; + // getting the content of just one field + byte[] sourceArray = values.get(keyToSearch).toArray(); + int sizeArray = sourceArray.length; //size of each array + if (updateMarker){ + totalSize = sizeArray*fieldCount; + } else { + try { + Map.Entry<S3Object, ObjectMetadata> objectAndMetadata = getS3ObjectAndMetadata(bucket, key, ssecLocal); + int sizeOfFile = (int)objectAndMetadata.getValue().getContentLength(); + fieldCount = sizeOfFile/sizeArray; + totalSize = sizeOfFile; + objectAndMetadata.getKey().close(); + } catch (Exception e){ + System.err.println("Not possible to get the object :"+key); + e.printStackTrace(); + return Status.ERROR; + } + } + byte[] destinationArray = new byte[totalSize]; + int offset = 0; + for (int i = 0; i < fieldCount; i++) { + System.arraycopy(sourceArray, 0, destinationArray, offset, sizeArray); + offset += sizeArray; + } + try (InputStream input = new ByteArrayInputStream(destinationArray)) { + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentLength(totalSize); + PutObjectRequest putObjectRequest = null; + if (sseLocal.equals("true")) { + metadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); + putObjectRequest = new PutObjectRequest(bucket, key, + input, metadata); + } else if (ssecLocal != null) { + putObjectRequest = new PutObjectRequest(bucket, key, + input, metadata).withSSECustomerKey(ssecLocal); + } else { + putObjectRequest = new PutObjectRequest(bucket, key, + input, metadata); + } + + try { + PutObjectResult res = + s3Client.putObject(putObjectRequest); + if(res.getETag() == null) { + return Status.ERROR; + } else { + if (sseLocal.equals("true")) { + System.out.println("Uploaded object encryption status is " + + res.getSSEAlgorithm()); + } else if (ssecLocal != null) { + System.out.println("Uploaded object encryption status is " + + res.getSSEAlgorithm()); + } + } + } catch (Exception e) { + System.err.println("Not possible to write object :"+key); + e.printStackTrace(); + return Status.ERROR; + } + } catch (Exception e) { + System.err.println("Error in the creation of the stream :"+e.toString()); + e.printStackTrace(); + return Status.ERROR; + } + + return Status.OK; + } + + /** + * Download an object from S3. + * + * @param bucket + * The name of the bucket + * @param key + * The file key of the object to upload/update. + * @param result + * The Hash map where data from the object are written + * + */ + protected Status readFromStorage(String bucket, String key, + HashMap<String, ByteIterator> result, SSECustomerKey ssecLocal) { + try { + Map.Entry<S3Object, ObjectMetadata> objectAndMetadata = getS3ObjectAndMetadata(bucket, key, ssecLocal); + InputStream objectData = objectAndMetadata.getKey().getObjectContent(); //consuming the stream + // writing the stream to bytes and to results + int sizeOfFile = (int)objectAndMetadata.getValue().getContentLength(); + byte[] inputStreamToByte = new byte[sizeOfFile]; + objectData.read(inputStreamToByte, 0, sizeOfFile); + result.put(key, new ByteArrayByteIterator(inputStreamToByte)); + objectData.close(); + objectAndMetadata.getKey().close(); + } catch (Exception e){ + System.err.println("Not possible to get the object "+key); + e.printStackTrace(); + return Status.ERROR; + } + + return Status.OK; + } + + private Map.Entry<S3Object, ObjectMetadata> getS3ObjectAndMetadata(String bucket, + String key, SSECustomerKey ssecLocal) { + GetObjectRequest getObjectRequest; + GetObjectMetadataRequest getObjectMetadataRequest; + if (ssecLocal != null) { + getObjectRequest = new GetObjectRequest(bucket, + key).withSSECustomerKey(ssecLocal); + getObjectMetadataRequest = new GetObjectMetadataRequest(bucket, + key).withSSECustomerKey(ssecLocal); + } else { + getObjectRequest = new GetObjectRequest(bucket, key); + getObjectMetadataRequest = new GetObjectMetadataRequest(bucket, + key); + } + + return new AbstractMap.SimpleEntry<>(s3Client.getObject(getObjectRequest), + s3Client.getObjectMetadata(getObjectMetadataRequest)); + } + + /** + * Perform an emulation of a database scan operation on a S3 bucket. + * + * @param bucket + * The name of the bucket + * @param startkey + * The file key of the first file to read. + * @param recordcount + * The number of files 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 file + * + */ + protected Status scanFromStorage(String bucket, String startkey, + int recordcount, Vector<HashMap<String, ByteIterator>> result, + SSECustomerKey ssecLocal) { + + int counter = 0; + ObjectListing listing = s3Client.listObjects(bucket); + List<S3ObjectSummary> summaries = listing.getObjectSummaries(); + List<String> keyList = new ArrayList(); + int startkeyNumber = 0; + int numberOfIteration = 0; + // getting the list of files in the bucket + while (listing.isTruncated()) { + listing = s3Client.listNextBatchOfObjects(listing); + summaries.addAll(listing.getObjectSummaries()); + } + for (S3ObjectSummary summary : summaries) { + String summaryKey = summary.getKey(); + keyList.add(summaryKey); + } + // Sorting the list of files in Alphabetical order + Collections.sort(keyList); // sorting the list + // Getting the position of the startingfile for the scan + for (String key : keyList) { + if (key.equals(startkey)){ + startkeyNumber = counter; + } else { + counter = counter + 1; + } + } + // Checking if the total number of file is bigger than the file to read, + // if not using the total number of Files + if (recordcount < keyList.size()) { + numberOfIteration = recordcount; + } else { + numberOfIteration = keyList.size(); + } + // Reading the Files starting from the startkey File till the end + // of the Files or Till the recordcount number + for (int i = startkeyNumber; i < numberOfIteration; i++){ + HashMap<String, ByteIterator> resultTemp = + new HashMap<String, ByteIterator>(); + readFromStorage(bucket, keyList.get(i), resultTemp, + ssecLocal); + result.add(resultTemp); + } + return Status.OK; + } +} diff --git a/s3/src/main/java/com/yahoo/ycsb/db/package-info.java b/s3/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..42859b2f62476f5a531cd1327017bd979a27cfd6 --- /dev/null +++ b/s3/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/** + * 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. + * + * S3 storage client binding for YCSB. + */ + +package com.yahoo.ycsb.db; + diff --git a/solr/README.md b/solr/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fc183bb71f3e4fd7e9d89703c3190a7e573ae4f5 --- /dev/null +++ b/solr/README.md @@ -0,0 +1,110 @@ +<!-- +Copyright (c) 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. +--> + +## Quick Start + +This section describes how to run YCSB on Solr running locally. + +### 1. Set Up YCSB + +Clone the YCSB git repository and compile: + + git clone git://github.com/brianfrankcooper/YCSB.git + cd YCSB + mvn -pl com.yahoo.ycsb:solr-binding -am clean package + +### 2. Set Up Solr + +There must be a running Solr instance with a core/collection pre-defined and configured. +- See this [API](https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-CREATE) reference on how to create a core. +- See this [API](https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api1) reference on how to create a collection in SolrCloud mode. + +The `conf/schema.xml` configuration file present in the core/collection just created must be configured to handle the expected field names during benchmarking. +Below illustrates a sample from a schema config file that matches the default field names used by the ycsb client: + + <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/> + <field name="field0" type="text_general" indexed="true" stored="true"/> + <field name="field1" type="text_general" indexed="true" stored="true"/> + <field name="field2" type="text_general" indexed="true" stored="true"/> + <field name="field3" type="text_general" indexed="true" stored="true"/> + <field name="field4" type="text_general" indexed="true" stored="true"/> + <field name="field5" type="text_general" indexed="true" stored="true"/> + <field name="field6" type="text_general" indexed="true" stored="true"/> + <field name="field7" type="text_general" indexed="true" stored="true"/> + <field name="field8" type="text_general" indexed="true" stored="true"/> + <field name="field9" type="text_general" indexed="true" stored="true"/> + +If running in SolrCloud mode ensure there is an external Zookeeper cluster running. +- See [here](https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble) for details on how to set up an external Zookeeper cluster. +- See [here](https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files) for instructions on how to use Zookeeper to manage your core/collection configuration files. + +### 3. Run YCSB + +Now you are ready to run! First, load the data: + + ./bin/ycsb load solr -s -P workloads/workloada -p table=<core/collection name> + +Then, run the workload: + + ./bin/ycsb run solr -s -P workloads/workloada -p table=<core/collection name> + +For further configuration see below: + +### Default Configuration Parameters +The default settings for the Solr node that is created is as follows: + +- `solr.cloud` + - A Boolean value indicating if Solr is running in SolrCloud mode. If so there must be an external Zookeeper cluster running also. + - Default value is `false` and therefore expects solr to be running in stand-alone mode. + +- `solr.base.url` + - The base URL in which to interface with a running Solr instance in stand-alone mode + - Default value is `http://localhost:8983/solr + +- `solr.commit.within.time` + - The max time in ms to wait for a commit when in batch mode, ignored otherwise + - Default value is `1000ms` + +- `solr.batch.mode` + - Indicates if inserts/updates/deletes should be commited in batches (frequency controlled by the `solr.commit.within.time` parameter) or commit 1 document at a time. + - Default value is `false` + +- `solr.zookeeper.hosts` + - A list of comma seperated host:port pairs of Zookeeper nodes used to manage SolrCloud configurations. + - Must be passed when in [SolrCloud](https://cwiki.apache.org/confluence/display/solr/SolrCloud) mode. + - Default value is `localhost:2181` + +### Custom Configuration +If you wish to customize the settings used to create the Solr node +you can created a new property file that contains your desired Solr +node settings and pass it in via the parameter to 'bin/ycsb' script. Note that +the default properties will be kept if you don't explicitly overwrite them. + +Assuming that we have a properties file named "myproperties.data" that contains +custom Solr node configuration you can execute the following to +pass it into the Solr client: + + ./bin/ycsb run solr -P workloads/workloada -P myproperties.data -s + +If you wish to use SolrCloud mode ensure a Solr cluster is running with an +external zookeeper cluster and an appropriate collection has been created. +Make sure to pass the following properties as parameters to 'bin/ycsb' script. + + solr.cloud=true + solr.zookeeper.hosts=<zkHost2>:<zkPort1>,...,<zkHostN>:<zkPortN> + + diff --git a/solr/pom.xml b/solr/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ce44ed160600e642e61ccdac9c391736813ce1f --- /dev/null +++ b/solr/pom.xml @@ -0,0 +1,59 @@ +<?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.12.0-SNAPSHOT</version> + <relativePath>../binding-parent</relativePath> + </parent> + + <artifactId>solr-binding</artifactId> + <name>Solr 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.apache.solr</groupId> + <artifactId>solr-solrj</artifactId> + <version>${solr.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.10</version> + </dependency> + + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-test-framework</artifactId> + <version>${solr.version}</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/solr/src/main/java/com/yahoo/ycsb/db/SolrClient.java b/solr/src/main/java/com/yahoo/ycsb/db/SolrClient.java new file mode 100644 index 0000000000000000000000000000000000000000..bbc90775aebb9a7aa5f3f388a41f319d8b509d4d --- /dev/null +++ b/solr/src/main/java/com/yahoo/ycsb/db/SolrClient.java @@ -0,0 +1,327 @@ +/** + * Copyright (c) 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. + */ + +package com.yahoo.ycsb.db; + +import com.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; + +import org.apache.solr.client.solrj.SolrQuery; +import org.apache.solr.client.solrj.impl.CloudSolrClient; +import org.apache.solr.client.solrj.impl.HttpSolrClient; +import org.apache.solr.client.solrj.response.QueryResponse; +import org.apache.solr.client.solrj.response.UpdateResponse; +import org.apache.solr.client.solrj.SolrServerException; +import org.apache.solr.common.SolrDocument; +import org.apache.solr.common.SolrDocumentList; +import org.apache.solr.common.SolrInputDocument; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; + +/** + * Solr client for YCSB framework. + * + * <p> + * Default properties to set: + * </p> + * <ul> + * See README.md + * </ul> + * + */ +public class SolrClient extends DB { + + public static final String DEFAULT_CLOUD_MODE = "false"; + public static final String DEFAULT_BATCH_MODE = "false"; + public static final String DEFAULT_ZOOKEEPER_HOSTS = "localhost:2181"; + public static final String DEFAULT_SOLR_BASE_URL = "http://localhost:8983/solr"; + public static final String DEFAULT_COMMIT_WITHIN_TIME = "1000"; + + private org.apache.solr.client.solrj.SolrClient client; + private Integer commitTime; + private Boolean batchMode; + + /** + * Initialize any state for this DB. Called once per DB instance; there is one DB instance per + * client thread. + */ + @Override + public void init() throws DBException { + Properties props = getProperties(); + commitTime = Integer + .parseInt(props.getProperty("solr.commit.within.time", DEFAULT_COMMIT_WITHIN_TIME)); + batchMode = Boolean.parseBoolean(props.getProperty("solr.batch.mode", DEFAULT_BATCH_MODE)); + + // Check if Solr cluster is running in SolrCloud or Stand-alone mode + Boolean cloudMode = Boolean.parseBoolean(props.getProperty("solr.cloud", DEFAULT_CLOUD_MODE)); + System.err.println("Solr Cloud Mode = " + cloudMode); + if (cloudMode) { + System.err.println("Solr Zookeeper Remote Hosts = " + + props.getProperty("solr.zookeeper.hosts", DEFAULT_ZOOKEEPER_HOSTS)); + client = new CloudSolrClient( + props.getProperty("solr.zookeeper.hosts", DEFAULT_ZOOKEEPER_HOSTS)); + } else { + client = new HttpSolrClient(props.getProperty("solr.base.url", DEFAULT_SOLR_BASE_URL)); + } + } + + @Override + public void cleanup() throws DBException { + try { + client.close(); + } catch (IOException e) { + throw new DBException(e); + } + } + + /** + * 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 this class's description for a + * discussion of error codes. + */ + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + try { + SolrInputDocument doc = new SolrInputDocument(); + + doc.addField("id", key); + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { + doc.addField(entry.getKey(), entry.getValue()); + } + UpdateResponse response; + if (batchMode) { + response = client.add(table, doc, commitTime); + } else { + response = client.add(table, doc); + client.commit(table); + } + return checkStatus(response.getStatus()); + + } catch (IOException | SolrServerException e) { + e.printStackTrace(); + } + 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 this class's description for a + * discussion of error codes. + */ + @Override + public Status delete(String table, String key) { + try { + UpdateResponse response; + if (batchMode) { + response = client.deleteById(table, key, commitTime); + } else { + response = client.deleteById(table, key); + client.commit(table); + } + return checkStatus(response.getStatus()); + } catch (IOException | SolrServerException e) { + e.printStackTrace(); + } + 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". + */ + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + try { + Boolean returnFields = false; + String[] fieldList = null; + if (fields != null) { + returnFields = true; + fieldList = fields.toArray(new String[fields.size()]); + } + SolrQuery query = new SolrQuery(); + query.setQuery("id:" + key); + if (returnFields) { + query.setFields(fieldList); + } + final QueryResponse response = client.query(table, query); + SolrDocumentList results = response.getResults(); + if ((results != null) && (results.getNumFound() > 0)) { + for (String field : results.get(0).getFieldNames()) { + result.put(field, + new StringByteIterator(String.valueOf(results.get(0).getFirstValue(field)))); + } + } + return checkStatus(response.getStatus()); + } catch (IOException | SolrServerException e) { + e.printStackTrace(); + } + 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, HashMap<String, ByteIterator> values) { + try { + SolrInputDocument updatedDoc = new SolrInputDocument(); + updatedDoc.addField("id", key); + + for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { + updatedDoc.addField(entry.getKey(), Collections.singletonMap("set", entry.getValue())); + } + + UpdateResponse writeResponse; + if (batchMode) { + writeResponse = client.add(table, updatedDoc, commitTime); + } else { + writeResponse = client.add(table, updatedDoc); + client.commit(table); + } + return checkStatus(writeResponse.getStatus()); + } catch (IOException | SolrServerException e) { + e.printStackTrace(); + } + 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 this 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) { + try { + Boolean returnFields = false; + String[] fieldList = null; + if (fields != null) { + returnFields = true; + fieldList = fields.toArray(new String[fields.size()]); + } + SolrQuery query = new SolrQuery(); + query.setQuery("*:*"); + query.setParam("fq", "id:[ " + startkey + " TO * ]"); + if (returnFields) { + query.setFields(fieldList); + } + query.setRows(recordcount); + final QueryResponse response = client.query(table, query); + SolrDocumentList results = response.getResults(); + + HashMap<String, ByteIterator> entry; + + for (SolrDocument hit : results) { + entry = new HashMap<String, ByteIterator>((int) results.getNumFound()); + for (String field : hit.getFieldNames()) { + entry.put(field, new StringByteIterator(String.valueOf(hit.getFirstValue(field)))); + } + result.add(entry); + } + return checkStatus(response.getStatus()); + } catch (IOException | SolrServerException e) { + e.printStackTrace(); + } + return Status.ERROR; + } + + private Status checkStatus(int status) { + Status responseStatus; + switch (status) { + case 0: + responseStatus = Status.OK; + break; + case 400: + responseStatus = Status.BAD_REQUEST; + break; + case 403: + responseStatus = Status.FORBIDDEN; + break; + case 404: + responseStatus = Status.NOT_FOUND; + break; + case 500: + responseStatus = Status.ERROR; + break; + case 503: + responseStatus = Status.SERVICE_UNAVAILABLE; + break; + default: + responseStatus = Status.UNEXPECTED_STATE; + break; + } + return responseStatus; + } + +} diff --git a/solr/src/main/java/com/yahoo/ycsb/db/package-info.java b/solr/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..98fd53e9604309a8ca72e4ecddd39109c7266cf9 --- /dev/null +++ b/solr/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 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. + */ + +/** + * The YCSB binding for + * <a href="http://lucene.apache.org/solr/">Solr</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/solr/src/main/resources/log4j.properties b/solr/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..0ede1d4c141192a2de7e00461b3cb9998a8e8a68 --- /dev/null +++ b/solr/src/main/resources/log4j.properties @@ -0,0 +1,8 @@ +# Root logger option +log4j.rootLogger=INFO, stderr + +# Direct log messages to stderr +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.Target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n diff --git a/solr/src/test/java/com/yahoo/ycsb/db/SolrClientBaseTest.java b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientBaseTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c6bf53a16f2d82ffb5090461e439184c9855ccea --- /dev/null +++ b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientBaseTest.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2016 YCSB contributors. All rights reserved. + * <p/> + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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.yahoo.ycsb.ByteIterator; +import com.yahoo.ycsb.DB; +import com.yahoo.ycsb.Status; +import com.yahoo.ycsb.StringByteIterator; +import org.apache.solr.client.solrj.embedded.JettyConfig; +import org.apache.solr.cloud.MiniSolrCloudCluster; +import org.apache.solr.common.util.NamedList; +import org.junit.*; + +import java.io.File; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Properties; +import java.util.Set; +import java.util.Vector; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public abstract class SolrClientBaseTest { + + protected static MiniSolrCloudCluster miniSolrCloudCluster; + private DB instance; + private final static HashMap<String, ByteIterator> MOCK_DATA; + protected final static String MOCK_TABLE = "ycsb"; + private final static String MOCK_KEY0 = "0"; + private final static String MOCK_KEY1 = "1"; + private final static int NUM_RECORDS = 10; + + static { + MOCK_DATA = new HashMap<>(NUM_RECORDS); + for (int i = 0; i < NUM_RECORDS; i++) { + MOCK_DATA.put("field" + i, new StringByteIterator("value" + i)); + } + } + + @BeforeClass + public static void onlyOnce() throws Exception { + Path miniSolrCloudClusterTempDirectory = Files.createTempDirectory("miniSolrCloudCluster"); + miniSolrCloudClusterTempDirectory.toFile().deleteOnExit(); + miniSolrCloudCluster = new MiniSolrCloudCluster(1, miniSolrCloudClusterTempDirectory, JettyConfig.builder().build()); + + // Upload Solr configuration + URL configDir = SolrClientBaseTest.class.getClassLoader().getResource("solr_config"); + assertNotNull(configDir); + miniSolrCloudCluster.uploadConfigDir(new File(configDir.toURI()), MOCK_TABLE); + } + + @AfterClass + public static void destroy() throws Exception { + if(miniSolrCloudCluster != null) { + miniSolrCloudCluster.shutdown(); + } + } + + @Before + public void setup() throws Exception { + NamedList<Object> namedList = miniSolrCloudCluster.createCollection(MOCK_TABLE, 1, 1, MOCK_TABLE, null); + assertEquals(namedList.indexOf("success", 0), 1); + Thread.sleep(1000); + + instance = getDB(); + } + + @After + public void tearDown() throws Exception { + if(miniSolrCloudCluster != null) { + NamedList<Object> namedList = miniSolrCloudCluster.deleteCollection(MOCK_TABLE); + assertEquals(namedList.indexOf("success", 0), 1); + Thread.sleep(1000); + } + } + + @Test + public void testInsert() throws Exception { + Status result = instance.insert(MOCK_TABLE, MOCK_KEY0, MOCK_DATA); + assertEquals(Status.OK, result); + } + + @Test + public void testDelete() throws Exception { + Status result = instance.delete(MOCK_TABLE, MOCK_KEY1); + assertEquals(Status.OK, result); + } + + @Test + public void testRead() throws Exception { + Set<String> fields = MOCK_DATA.keySet(); + HashMap<String, ByteIterator> resultParam = new HashMap<>(NUM_RECORDS); + Status result = instance.read(MOCK_TABLE, MOCK_KEY1, fields, resultParam); + assertEquals(Status.OK, result); + } + + @Test + public void testUpdate() throws Exception { + HashMap<String, ByteIterator> newValues = new HashMap<>(NUM_RECORDS); + + for (int i = 0; i < NUM_RECORDS; i++) { + newValues.put("field" + i, new StringByteIterator("newvalue" + i)); + } + + Status result = instance.update(MOCK_TABLE, MOCK_KEY1, newValues); + assertEquals(Status.OK, result); + + //validate that the values changed + HashMap<String, ByteIterator> resultParam = new HashMap<>(NUM_RECORDS); + instance.read(MOCK_TABLE, MOCK_KEY1, MOCK_DATA.keySet(), resultParam); + + for (int i = 0; i < NUM_RECORDS; i++) { + assertEquals("newvalue" + i, resultParam.get("field" + i).toString()); + } + } + + @Test + public void testScan() throws Exception { + Set<String> fields = MOCK_DATA.keySet(); + Vector<HashMap<String, ByteIterator>> resultParam = new Vector<>(NUM_RECORDS); + Status result = instance.scan(MOCK_TABLE, MOCK_KEY1, NUM_RECORDS, fields, resultParam); + assertEquals(Status.OK, result); + } + + /** + * Gets the test DB. + * + * @return The test DB. + */ + protected DB getDB() { + return getDB(new Properties()); + } + + /** + * Gets the test DB. + * + * @param props + * Properties to pass to the client. + * @return The test DB. + */ + protected abstract DB getDB(Properties props); +} diff --git a/solr/src/test/java/com/yahoo/ycsb/db/SolrClientCloudTest.java b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientCloudTest.java new file mode 100644 index 0000000000000000000000000000000000000000..379d405a983b022db9a3c9c2030721a5746aa315 --- /dev/null +++ b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientCloudTest.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016 YCSB contributors. All rights reserved. + * <p/> + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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.yahoo.ycsb.DB; +import org.junit.After; + +import java.util.Properties; + +import static org.junit.Assume.assumeNoException; + +public class SolrClientCloudTest extends SolrClientBaseTest { + + private SolrClient instance; + + @After + public void tearDown() throws Exception { + try { + if(instance != null) { + instance.cleanup(); + } + } finally { + super.tearDown(); + } + } + + @Override + protected DB getDB(Properties props) { + instance = new SolrClient(); + + props.setProperty("solr.cloud", "true"); + props.setProperty("solr.zookeeper.hosts", miniSolrCloudCluster.getSolrClient().getZkHost()); + + instance.setProperties(props); + try { + instance.init(); + } catch (Exception error) { + assumeNoException(error); + } + return instance; + } +} diff --git a/solr/src/test/java/com/yahoo/ycsb/db/SolrClientTest.java b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..82fb866c1897d30c10b925962bd64108e8ed19d3 --- /dev/null +++ b/solr/src/test/java/com/yahoo/ycsb/db/SolrClientTest.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2016 YCSB contributors. All rights reserved. + * <p/> + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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.yahoo.ycsb.DB; +import org.apache.solr.client.solrj.embedded.JettySolrRunner; +import org.junit.After; + +import java.net.URL; +import java.util.Properties; +import java.util.Set; + +import static org.junit.Assume.assumeNoException; + +public class SolrClientTest extends SolrClientBaseTest { + + private SolrClient instance; + + @After + public void tearDown() throws Exception { + try { + if(instance != null) { + instance.cleanup(); + } + } finally { + super.tearDown(); + } + } + + @Override + protected DB getDB(Properties props) { + instance = new SolrClient(); + + // Use the first Solr server in the cluster. + // Doesn't matter if there are more since requests will be forwarded properly by Solr. + JettySolrRunner jettySolrRunner = miniSolrCloudCluster.getJettySolrRunners().get(0); + String solrBaseUrl = String.format("http://localhost:%s%s", jettySolrRunner.getLocalPort(), + jettySolrRunner.getBaseUrl()); + + props.setProperty("solr.base.url", solrBaseUrl); + instance.setProperties(props); + + try { + instance.init(); + } catch (Exception error) { + assumeNoException(error); + } + return instance; + } +} diff --git a/solr/src/test/resources/log4j.properties b/solr/src/test/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..599b5051284d3781f23317b26331ebb3c39d1d1b --- /dev/null +++ b/solr/src/test/resources/log4j.properties @@ -0,0 +1,29 @@ +# Copyright (c) 2015-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. +# + +# Root logger option +log4j.rootLogger=INFO, stderr + +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.target=System.err +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.conversionPattern=%d{yyyy/MM/dd HH:mm:ss} %-5p %c %x - %m%n + +# Suppress messages from ZooKeeper +log4j.logger.org.apache.zookeeper=ERROR +# Solr classes are too chatty in test at INFO +log4j.logger.org.apache.solr=ERROR +log4j.logger.org.eclipse.jetty=ERROR diff --git a/solr/src/test/resources/solr_config/schema.xml b/solr/src/test/resources/solr_config/schema.xml new file mode 100644 index 0000000000000000000000000000000000000000..55323ee4c1d40d5ea1d1ca9cfa05666d70929442 --- /dev/null +++ b/solr/src/test/resources/solr_config/schema.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> +<!-- + Copied from Apache Solr 5.4.0 solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml + Modified to only required types and fields for YCSB testing. +--> +<schema name="test" version="1.6"> + <types> + <fieldType name="int" docValues="true" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/> + <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/> + + <fieldtype name="text" class="solr.TextField"> + <analyzer> + <tokenizer class="solr.StandardTokenizerFactory"/> + <filter class="solr.StandardFilterFactory"/> + <filter class="solr.LowerCaseFilterFactory"/> + <filter class="solr.StopFilterFactory"/> + <filter class="solr.PorterStemFilterFactory"/> + </analyzer> + </fieldtype> + </types> + + <fields> + <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/> + <field name="text" type="text" indexed="true" stored="false"/> + + <field name="_version_" type="long" indexed="true" stored="true"/> + + <field name="field0" type="text" indexed="true" stored="true"/> + <field name="field1" type="text" indexed="true" stored="true"/> + <field name="field2" type="text" indexed="true" stored="true"/> + <field name="field3" type="text" indexed="true" stored="true"/> + <field name="field4" type="text" indexed="true" stored="true"/> + <field name="field5" type="text" indexed="true" stored="true"/> + <field name="field6" type="text" indexed="true" stored="true"/> + <field name="field7" type="text" indexed="true" stored="true"/> + <field name="field8" type="text" indexed="true" stored="true"/> + <field name="field9" type="text" indexed="true" stored="true"/> + </fields> + + <defaultSearchField>text</defaultSearchField> + <uniqueKey>id</uniqueKey> +</schema> diff --git a/solr/src/test/resources/solr_config/solrconfig.xml b/solr/src/test/resources/solr_config/solrconfig.xml new file mode 100644 index 0000000000000000000000000000000000000000..7c58457dcdc99064c31b4838e76f2d4d25ae5f69 --- /dev/null +++ b/solr/src/test/resources/solr_config/solrconfig.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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. +--> + +<!-- + Copied from Apache Solr 5.4.0 solr/src/test/resources/solr_config/solrconfig.xml +--> + +<!-- + This is a stripped down config file used for a simple example... + It is *not* a good example to work from. +--> +<config> + <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion> + <indexConfig> + <useCompoundFile>${useCompoundFile:false}</useCompoundFile> + </indexConfig> + <dataDir>${solr.data.dir:}</dataDir> + <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/> + + <updateHandler class="solr.DirectUpdateHandler2"> + <updateLog> + <str name="dir">${solr.data.dir:}</str> + </updateLog> + </updateHandler> + + <requestDispatcher handleSelect="true" > + <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" /> + </requestDispatcher> + + <requestHandler name="standard" class="solr.StandardRequestHandler" default="true" /> + + <requestHandler name="/admin/ping" class="solr.PingRequestHandler"> + <lst name="invariants"> + <str name="q">*:*</str> + </lst> + <lst name="defaults"> + <str name="echoParams">all</str> + </lst> + <str name="healthcheckFile">server-enabled.txt</str> + </requestHandler> + + <!-- config for the admin interface --> + <admin> + <defaultQuery>solr</defaultQuery> + </admin> + +</config> + diff --git a/tarantool/README.md b/tarantool/README.md index 4ad4c9cc499fbfdc95fbfac4740c503ec042d2c1..26854e436a8e0294f6a7e0aa0e58156d78a432df 100644 --- a/tarantool/README.md +++ b/tarantool/README.md @@ -1,3 +1,20 @@ +<!-- +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. +--> + # Tarantool ## Introduction diff --git a/tarantool/pom.xml b/tarantool/pom.xml index 2d2181554e0d9e1d96a1a29dbcf105d305e4e35e..78f81ee688a5f6854b3a236bbc81e1646b6cfcaa 100644 --- a/tarantool/pom.xml +++ b/tarantool/pom.xml @@ -1,11 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2015-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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent/</relativePath> </parent> @@ -13,6 +30,10 @@ <name>Tarantool DB Binding</name> <packaging>jar</packaging> + <properties> + <checkstyle.failOnViolation>false</checkstyle.failOnViolation> + </properties> + <dependencies> <dependency> <groupId>org.tarantool</groupId> @@ -27,12 +48,28 @@ </dependency> </dependencies> - <repositories> - <repository> - <id>dgreenru-repo</id> - <name>dgreenru repository</name> - <url>http://dgreenru.github.com/repo/</url> - </repository> - </repositories> - + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.15</version> + <configuration> + <consoleOutput>true</consoleOutput> + <configLocation>../checkstyle.xml</configLocation> + <failOnViolation>true</failOnViolation> + <failsOnError>true</failsOnError> + </configuration> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> diff --git a/tarantool/src/main/conf/tarantool-hash.lua b/tarantool/src/main/conf/tarantool-hash.lua index 256d93c6ce4ace39d6750daac87622e412796ccd..02c55f71a69e83662e5fb71dafe4198193ccbfab 100644 --- a/tarantool/src/main/conf/tarantool-hash.lua +++ b/tarantool/src/main/conf/tarantool-hash.lua @@ -1,3 +1,18 @@ +-- 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. + box.cfg { listen=3303, logger="tarantool.log", diff --git a/tarantool/src/main/conf/tarantool-tree.lua b/tarantool/src/main/conf/tarantool-tree.lua index 1e2a90e3c44c7b62247b4ada997ecfa95202a6b7..0782bb1891474112355a2babe44d476c4cfd00db 100644 --- a/tarantool/src/main/conf/tarantool-tree.lua +++ b/tarantool/src/main/conf/tarantool-tree.lua @@ -1,3 +1,18 @@ +-- 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. + box.cfg { listen=3303, logger="tarantool.log", diff --git a/tarantool/src/main/java/com/yahoo/ycsb/db/TarantoolClient.java b/tarantool/src/main/java/com/yahoo/ycsb/db/TarantoolClient.java index aa26b13b742929b54265040742602544035cd410..e86120e1cfb10987d25497a01508e860a0a360d0 100644 --- a/tarantool/src/main/java/com/yahoo/ycsb/db/TarantoolClient.java +++ b/tarantool/src/main/java/com/yahoo/ycsb/db/TarantoolClient.java @@ -1,12 +1,12 @@ /** - * Copyright (c) 2014, Yahoo!, Inc. All rights reserved. - * + * Copyright (c) 2014 - 2016 YCSB Contributors. All rights reserved. + * <p> * 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 - * + * <p> * http://www.apache.org/licenses/LICENSE-2.0 - * + * <p> * 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 @@ -16,168 +16,137 @@ */ package com.yahoo.ycsb.db; -import java.util.Map; -import java.util.Set; -import java.util.List; -import java.util.Arrays; -import java.util.Vector; -import java.util.HashMap; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - +import com.yahoo.ycsb.*; import org.tarantool.TarantoolConnection16; import org.tarantool.TarantoolConnection16Impl; import org.tarantool.TarantoolException; -import com.yahoo.ycsb.DB; -import com.yahoo.ycsb.DBException; -import com.yahoo.ycsb.ByteIterator; -import com.yahoo.ycsb.StringByteIterator; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; +/** + * YCSB binding for <a href="http://tarantool.org/">Tarantool</a>. + */ public class TarantoolClient extends DB { - - public static final String HOST_PROPERTY = "tarantool.host"; - public static final String PORT_PROPERTY = "tarantool.port"; - public static final String SPACE_PROPERTY = "tarantool.space"; - - public static final String DEFAULT_HOST = "localhost"; - public static final int DEFAULT_PORT = 3301; - public static final int DEFAULT_SPACE = 1024; - - private static final Logger logger = Logger.getLogger(TarantoolClient.class.getName()); - private TarantoolConnection16 connection; - private int spaceNo; - - public void init() throws DBException { - Properties props = getProperties(); - - int port = DEFAULT_PORT; - String portString = props.getProperty(PORT_PROPERTY); - if (portString != null) { - port = Integer.parseInt(portString); - } - - String host = props.getProperty(HOST_PROPERTY); - if (host == null) { - host = DEFAULT_HOST; - } - - spaceNo = DEFAULT_SPACE; - String spaceString = props.getProperty(SPACE_PROPERTY); - if (spaceString != null) { - spaceNo = Integer.parseInt(spaceString); - } - - try { - this.connection = new TarantoolConnection16Impl(host, port); - } catch (Exception exc) { - logger.log(Level.SEVERE,"Can't initialize Tarantool connection", exc); - return; - } - } - - public void cleanup() throws DBException{ - this.connection.close(); - } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - int j = 0; - String[] tuple = new String[1 + 2 * values.size()]; - tuple[0] = key; - for (Map.Entry<String, ByteIterator> i: values.entrySet()) { - tuple[j + 1] = i.getKey(); - tuple[j + 2] = i.getValue().toString(); - j += 2; - } - try { - this.connection.replace(this.spaceNo, tuple); - } catch (TarantoolException exc) { - logger.log(Level.SEVERE,"Can't insert element", exc); - return 1; - } - return 0; - } - - private HashMap<String, ByteIterator> tuple_convert_filter (List<String> input, - Set<String> fields) { - HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>(); - if (input == null) - return result; - for (int i = 1; i < input.toArray().length; i += 2) - if (fields == null || fields.contains(input.get(i))) - result.put(input.get(i), new StringByteIterator(input.get(i+1))); - return result; - } - - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - try { - List<String> response; - response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); - result = tuple_convert_filter(response, fields); - return 0; - } catch (TarantoolException exc) { - logger.log(Level.SEVERE,"Can't select element", exc); - return 1; - } catch (NullPointerException exc) { - return 1; - } - } - - @Override - public int scan(String table, String startkey, - int recordcount, Set<String> fields, - Vector<HashMap<String, ByteIterator>> result) { - List<List<String>> response; - try { - response = this.connection.select(this.spaceNo, 0, Arrays.asList(startkey), 0, recordcount, 6); - } catch (TarantoolException exc) { - logger.log(Level.SEVERE,"Can't select range elements", exc); - return 1; - } catch (NullPointerException exc) { - return 1; - } - for(List<String> i: response) { - HashMap<String, ByteIterator> temp = tuple_convert_filter(i, fields); - if (!temp.isEmpty()) - result.add((HashMap<String, ByteIterator>) temp.clone()); - } - return 0; - } - - @Override - public int delete(String table, String key) { - try { - this.connection.delete(this.spaceNo, Arrays.asList(key)); - } catch (TarantoolException exc) { - logger.log(Level.SEVERE,"Can't delete element", exc); - return 1; - } catch (NullPointerException e) { - return 1; - } - return 0; - } - @Override - public int update(String table, String key, - HashMap<String, ByteIterator> values) { - int j = 0; - String[] tuple = new String[1 + 2 * values.size()]; - tuple[0] = key; - for (Map.Entry<String, ByteIterator> i: values.entrySet()) { - tuple[j + 1] = i.getKey(); - tuple[j + 2] = i.getValue().toString(); - j += 2; - } - try { - this.connection.replace(this.spaceNo, tuple); - } catch (TarantoolException exc) { - logger.log(Level.SEVERE,"Can't replace element", exc); - return 1; - } - return 0; - - } + private static final Logger LOGGER = Logger.getLogger(TarantoolClient.class.getName()); + + private static final String HOST_PROPERTY = "tarantool.host"; + private static final String PORT_PROPERTY = "tarantool.port"; + private static final String SPACE_PROPERTY = "tarantool.space"; + private static final String DEFAULT_HOST = "localhost"; + private static final String DEFAULT_PORT = "3301"; + private static final String DEFAULT_SPACE = "1024"; + + private TarantoolConnection16 connection; + private int spaceNo; + + public void init() throws DBException { + Properties props = getProperties(); + + int port = Integer.parseInt(props.getProperty(PORT_PROPERTY, DEFAULT_PORT)); + String host = props.getProperty(HOST_PROPERTY, DEFAULT_HOST); + spaceNo = Integer.parseInt(props.getProperty(SPACE_PROPERTY, DEFAULT_SPACE)); + + try { + this.connection = new TarantoolConnection16Impl(host, port); + } catch (Exception exc) { + throw new DBException("Can't initialize Tarantool connection", exc); + } + } + + public void cleanup() throws DBException { + this.connection.close(); + } + + @Override + public Status insert(String table, String key, HashMap<String, ByteIterator> values) { + return replace(key, values, "Can't insert element"); + } + + private HashMap<String, ByteIterator> tupleConvertFilter(List<String> input, Set<String> fields) { + HashMap<String, ByteIterator> result = new HashMap<>(); + if (input == null) { + return result; + } + for (int i = 1; i < input.toArray().length; i += 2) { + if (fields == null || fields.contains(input.get(i))) { + result.put(input.get(i), new StringByteIterator(input.get(i + 1))); + } + } + return result; + } + + @Override + public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { + try { + List<String> response = this.connection.select(this.spaceNo, 0, Arrays.asList(key), 0, 1, 0); + result = tupleConvertFilter(response, fields); + return Status.OK; + } catch (TarantoolException exc) { + LOGGER.log(Level.SEVERE, "Can't select element", exc); + return Status.ERROR; + } catch (NullPointerException exc) { + return Status.ERROR; + } + } + + @Override + public Status scan(String table, String startkey, + int recordcount, Set<String> fields, + Vector<HashMap<String, ByteIterator>> result) { + List<List<String>> response; + try { + response = this.connection.select(this.spaceNo, 0, Arrays.asList(startkey), 0, recordcount, 6); + } catch (TarantoolException exc) { + LOGGER.log(Level.SEVERE, "Can't select range elements", exc); + return Status.ERROR; + } catch (NullPointerException exc) { + return Status.ERROR; + } + for (List<String> i : response) { + HashMap<String, ByteIterator> temp = tupleConvertFilter(i, fields); + if (!temp.isEmpty()) { + result.add((HashMap<String, ByteIterator>) temp.clone()); + } + } + return Status.OK; + } + + @Override + public Status delete(String table, String key) { + try { + this.connection.delete(this.spaceNo, Collections.singletonList(key)); + } catch (TarantoolException exc) { + LOGGER.log(Level.SEVERE, "Can't delete element", exc); + return Status.ERROR; + } catch (NullPointerException e) { + return Status.ERROR; + } + return Status.OK; + } + + @Override + public Status update(String table, String key, HashMap<String, ByteIterator> values) { + return replace(key, values, "Can't replace element"); + } + + private Status replace(String key, HashMap<String, ByteIterator> values, String exceptionDescription) { + int j = 0; + String[] tuple = new String[1 + 2 * values.size()]; + tuple[0] = key; + for (Map.Entry<String, ByteIterator> i : values.entrySet()) { + tuple[j + 1] = i.getKey(); + tuple[j + 2] = i.getValue().toString(); + j += 2; + } + try { + this.connection.replace(this.spaceNo, tuple); + } catch (TarantoolException exc) { + LOGGER.log(Level.SEVERE, exceptionDescription, exc); + return Status.ERROR; + } + return Status.OK; + + } } diff --git a/tarantool/src/main/java/com/yahoo/ycsb/db/package-info.java b/tarantool/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..1f34b7c99cfda4b48d8c10fc01311291705101fb --- /dev/null +++ b/tarantool/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2014 - 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. + */ + +/** + * YCSB binding for <a href="http://tarantool.org/">Tarantool</a>. + */ +package com.yahoo.ycsb.db; + diff --git a/voldemort/pom.xml b/voldemort/pom.xml index 8743f3c4281d985ecf3e929bb6528e88d9f6151c..1ac669956ac22aa96431671ca6d0b1fecd48a583 100644 --- a/voldemort/pom.xml +++ b/voldemort/pom.xml @@ -1,11 +1,28 @@ <?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.3.0-SNAPSHOT</version> + <version>0.12.0-SNAPSHOT</version> <relativePath>../binding-parent</relativePath> </parent> @@ -31,11 +48,4 @@ <scope>provided</scope> </dependency> </dependencies> - - <repositories> - <repository> - <id>clojars.org</id> - <url>http://clojars.org/repo</url> - </repository> - </repositories> </project> diff --git a/voldemort/src/main/conf/cluster.xml b/voldemort/src/main/conf/cluster.xml index 175f69adab9ff03916b1325a912d8d9b8cef9641..a34e5009fd0b587ff2eb03f19781c797ef49aefc 100644 --- a/voldemort/src/main/conf/cluster.xml +++ b/voldemort/src/main/conf/cluster.xml @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2012 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. +--> + <cluster> <name>mycluster</name> <server> diff --git a/voldemort/src/main/conf/server.properties b/voldemort/src/main/conf/server.properties index fce5ee43e6bbd86e2f7b19e17c21734ac32dbf04..783d234b810f1f97d8b7e9fbc631b50d800b24e1 100644 --- a/voldemort/src/main/conf/server.properties +++ b/voldemort/src/main/conf/server.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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 ID of *this* particular cluster node node.id=0 diff --git a/voldemort/src/main/conf/stores.xml b/voldemort/src/main/conf/stores.xml index b2d892d722727de28d7f963df4fc8677dfa5aa2f..87abe52e05e0895e9f6b7cd24a7570e7a1aed4ab 100644 --- a/voldemort/src/main/conf/stores.xml +++ b/voldemort/src/main/conf/stores.xml @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2012 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. +--> + <stores> <store> <name>usertable</name> diff --git a/voldemort/src/main/java/com/yahoo/ycsb/db/VoldemortClient.java b/voldemort/src/main/java/com/yahoo/ycsb/db/VoldemortClient.java index 84093b917ddb5357f6f105667c24c6b1d1398edf..a4132b2f40afa71d9485cca648065b54f04f3e1d 100644 --- a/voldemort/src/main/java/com/yahoo/ycsb/db/VoldemortClient.java +++ b/voldemort/src/main/java/com/yahoo/ycsb/db/VoldemortClient.java @@ -1,3 +1,20 @@ +/** + * Copyright (c) 2012 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 java.util.HashMap; @@ -15,137 +32,141 @@ import voldemort.versioning.Versioned; import com.yahoo.ycsb.DB; import com.yahoo.ycsb.DBException; +import com.yahoo.ycsb.Status; import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.StringByteIterator; - +/** + * YCSB binding for + * <a href="http://www.project-voldemort.com/voldemort/">Voldemort</a>. + */ public class VoldemortClient extends DB { + private static final Logger LOGGER = Logger.getLogger(VoldemortClient.class); + + private StoreClient<String, HashMap<String, String>> storeClient; + private SocketStoreClientFactory socketFactory; + private String storeName; + + /** + * Initialize the DB layer. This accepts all properties allowed by the + * Voldemort client. A store maps to a table. Required : bootstrap_urls + * Additional property : store_name -> to preload once, should be same as -t + * {@link ClientConfig} + */ + public void init() throws DBException { + ClientConfig clientConfig = new ClientConfig(getProperties()); + socketFactory = new SocketStoreClientFactory(clientConfig); + + // Retrieve store name + storeName = getProperties().getProperty("store_name", "usertable"); + + // Use store name to retrieve client + storeClient = socketFactory.getStoreClient(storeName); + if (storeClient == null) { + throw new DBException("Unable to instantiate store client"); + } + } + + public void cleanup() throws DBException { + socketFactory.close(); + } + + @Override + public Status delete(String table, String key) { + if (checkStore(table) == Status.ERROR) { + return Status.ERROR; + } + + if (storeClient.delete(key)) { + return Status.OK; + } + return Status.ERROR; + } + + @Override + public Status insert(String table, String key, + HashMap<String, ByteIterator> values) { + if (checkStore(table) == Status.ERROR) { + return Status.ERROR; + } + storeClient.put(key, + (HashMap<String, String>) StringByteIterator.getStringMap(values)); + return Status.OK; + } + + @Override + public Status read(String table, String key, Set<String> fields, + HashMap<String, ByteIterator> result) { + if (checkStore(table) == Status.ERROR) { + return Status.ERROR; + } + + Versioned<HashMap<String, String>> versionedValue = storeClient.get(key); + + if (versionedValue == null) { + return Status.NOT_FOUND; + } + + if (fields != null) { + for (String field : fields) { + String val = versionedValue.getValue().get(field); + if (val != null) { + result.put(field, new StringByteIterator(val)); + } + } + } else { + StringByteIterator.putAllAsByteIterators(result, + versionedValue.getValue()); + } + return Status.OK; + } + + @Override + public Status scan(String table, String startkey, int recordcount, + Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { + LOGGER.warn("Voldemort does not support Scan semantics"); + return Status.OK; + } + + @Override + public Status update(String table, String key, + HashMap<String, ByteIterator> values) { + if (checkStore(table) == Status.ERROR) { + return Status.ERROR; + } + + Versioned<HashMap<String, String>> versionedValue = storeClient.get(key); + HashMap<String, String> value = new HashMap<String, String>(); + VectorClock version; + if (versionedValue != null) { + version = ((VectorClock) versionedValue.getVersion()).incremented(0, 1); + value = versionedValue.getValue(); + for (Entry<String, ByteIterator> entry : values.entrySet()) { + value.put(entry.getKey(), entry.getValue().toString()); + } + } else { + version = new VectorClock(); + StringByteIterator.putAllAsStrings(value, values); + } + + storeClient.put(key, Versioned.value(value, version)); + return Status.OK; + } - private StoreClient<String, HashMap<String, String>> storeClient; - private SocketStoreClientFactory socketFactory; - private String storeName; - private final Logger logger = Logger.getLogger(VoldemortClient.class); - - public static final int OK = 0; - public static final int ERROR = -1; - public static final int NOT_FOUND = -2; - - /** - * Initialize the DB layer. This accepts all properties allowed by the Voldemort client. - * A store maps to a table. - * Required : bootstrap_urls - * Additional property : store_name -> to preload once, should be same as -t <table> - * - * {@linktourl http://project-voldemort.com/javadoc/client/voldemort/client/ClientConfig.html} - */ - public void init() throws DBException { - ClientConfig clientConfig = new ClientConfig(getProperties()); - socketFactory = new SocketStoreClientFactory(clientConfig); - - // Retrieve store name - storeName = getProperties().getProperty("store_name", "usertable"); - - // Use store name to retrieve client - storeClient = socketFactory.getStoreClient(storeName); - if ( storeClient == null ) - throw new DBException("Unable to instantiate store client"); - - } - - public void cleanup() throws DBException { - socketFactory.close(); - } - - @Override - public int delete(String table, String key) { - if ( checkStore(table) == ERROR ) { - return ERROR; - } - - if ( storeClient.delete(key) ) - return OK; - else - return ERROR; - } - - @Override - public int insert(String table, String key, HashMap<String, ByteIterator> values) { - if ( checkStore(table) == ERROR ) { - return ERROR; - } - storeClient.put(key, (HashMap<String,String>)StringByteIterator.getStringMap(values)); - return OK; - } - - @Override - public int read(String table, String key, Set<String> fields, - HashMap<String, ByteIterator> result) { - if ( checkStore(table) == ERROR ) { - return ERROR; - } - - Versioned<HashMap<String, String>> versionedValue = storeClient.get(key); - - if ( versionedValue == null ) - return NOT_FOUND; - - if ( fields != null ) { - for (String field : fields) { - String val = versionedValue.getValue().get(field); - if ( val != null ) - result.put(field, new StringByteIterator(val)); - } - } else { - StringByteIterator.putAllAsByteIterators(result, versionedValue.getValue()); - } - return OK; - } - - @Override - public int scan(String table, String startkey, int recordcount, - Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { - logger.warn("Voldemort does not support Scan semantics"); - return OK; - } - - @Override - public int update(String table, String key, HashMap<String, ByteIterator> values) { - if ( checkStore(table) == ERROR ) { - return ERROR; - } - - Versioned<HashMap<String, String>> versionedValue = storeClient.get(key); - HashMap<String, String> value = new HashMap<String, String>(); - VectorClock version; - if ( versionedValue != null ) { - version = ((VectorClock) versionedValue.getVersion()).incremented(0, 1); - value = versionedValue.getValue(); - for (Entry<String, ByteIterator> entry : values.entrySet()) { - value.put(entry.getKey(), entry.getValue().toString()); - } - } else { - version = new VectorClock(); - StringByteIterator.putAllAsStrings(value, values); - } - - storeClient.put(key, Versioned.value(value, version)); - return OK; - } - - private int checkStore(String table) { - if ( table.compareTo(storeName) != 0 ) { - try { - storeClient = socketFactory.getStoreClient(table); - if ( storeClient == null ) { - logger.error("Could not instantiate storeclient for " + table); - return ERROR; - } - storeName = table; - } catch ( Exception e ) { - return ERROR; - } - } - return OK; - } + private Status checkStore(String table) { + if (table.compareTo(storeName) != 0) { + try { + storeClient = socketFactory.getStoreClient(table); + if (storeClient == null) { + LOGGER.error("Could not instantiate storeclient for " + table); + return Status.ERROR; + } + storeName = table; + } catch (Exception e) { + return Status.ERROR; + } + } + return Status.OK; + } } diff --git a/voldemort/src/main/java/com/yahoo/ycsb/db/package-info.java b/voldemort/src/main/java/com/yahoo/ycsb/db/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..f965b9ec16cbd89d12941a8a544f244a0fcd149a --- /dev/null +++ b/voldemort/src/main/java/com/yahoo/ycsb/db/package-info.java @@ -0,0 +1,21 @@ +/* + * 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="http://www.project-voldemort.com/voldemort/">Voldemort</a>. + */ +package com.yahoo.ycsb.db; diff --git a/voldemort/src/main/resources/config/cluster.xml b/voldemort/src/main/resources/config/cluster.xml index 175f69adab9ff03916b1325a912d8d9b8cef9641..a34e5009fd0b587ff2eb03f19781c797ef49aefc 100644 --- a/voldemort/src/main/resources/config/cluster.xml +++ b/voldemort/src/main/resources/config/cluster.xml @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2012 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. +--> + <cluster> <name>mycluster</name> <server> diff --git a/voldemort/src/main/resources/config/server.properties b/voldemort/src/main/resources/config/server.properties index fce5ee43e6bbd86e2f7b19e17c21734ac32dbf04..783d234b810f1f97d8b7e9fbc631b50d800b24e1 100644 --- a/voldemort/src/main/resources/config/server.properties +++ b/voldemort/src/main/resources/config/server.properties @@ -1,3 +1,18 @@ +# Copyright (c) 2012 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 ID of *this* particular cluster node node.id=0 diff --git a/voldemort/src/main/resources/config/stores.xml b/voldemort/src/main/resources/config/stores.xml index b2d892d722727de28d7f963df4fc8677dfa5aa2f..87abe52e05e0895e9f6b7cd24a7570e7a1aed4ab 100644 --- a/voldemort/src/main/resources/config/stores.xml +++ b/voldemort/src/main/resources/config/stores.xml @@ -1,3 +1,20 @@ +<!-- +Copyright (c) 2012 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. +--> + <stores> <store> <name>usertable</name> diff --git a/workloads/workload_template b/workloads/workload_template index 1d55cb0ddd4b7e59c80c98339690be6f46b36bf9..b66d3b6ef82ba9378b9d9cf38c00881471aec6ed 100644 --- a/workloads/workload_template +++ b/workloads/workload_template @@ -1,3 +1,18 @@ +# 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. + # Yahoo! Cloud System Benchmark # Workload Template: Default Values # @@ -100,9 +115,89 @@ table=usertable # How the latency measurements are presented measurementtype=histogram #measurementtype=timeseries +#measurementtype=raw +# When measurementtype is set to raw, measurements will be output +# as RAW datapoints in the following csv format: +# "operation, timestamp of the measurement, latency in us" +# +# Raw datapoints are collected in-memory while the test is running. Each +# data point consumes about 50 bytes (including java object overhead). +# For a typical run of 1 million to 10 million operations, this should +# fit into memory most of the time. If you plan to do 100s of millions of +# operations per run, consider provisioning a machine with larger RAM when using +# the RAW measurement type, or split the run into multiple runs. +# +# Optionally, you can specify an output file to save raw datapoints. +# Otherwise, raw datapoints will be written to stdout. +# The output file will be appended to if it already exists, otherwise +# a new output file will be created. +#measurement.raw.output_file = /tmp/your_output_file_for_this_run + +# JVM Reporting. +# +# Measure JVM information over time including GC counts, max and min memory +# used, max and min thread counts, max and min system load and others. This +# setting must be enabled in conjunction with the "-s" flag to run the status +# thread. Every "status.interval", the status thread will capture JVM +# statistics and record the results. At the end of the run, max and mins will +# be recorded. +# measurement.trackjvm = false # The range of latencies to track in the histogram (milliseconds) histogram.buckets=1000 # Granularity for time series (in milliseconds) timeseries.granularity=1000 + +# Latency reporting. +# +# YCSB records latency of failed operations separately from successful ones. +# Latency of all OK operations will be reported under their operation name, +# such as [READ], [UPDATE], etc. +# +# For failed operations: +# By default we don't track latency numbers of specific error status. +# We just report latency of all failed operation under one measurement name +# such as [READ-FAILED]. But optionally, user can configure to have either: +# 1. Record and report latency for each and every error status code by +# setting reportLatencyForEachError to true, or +# 2. Record and report latency for a select set of error status codes by +# providing a CSV list of Status codes via the "latencytrackederrors" +# property. +# reportlatencyforeacherror=false +# latencytrackederrors="<comma separated strings of error codes>" + +# Insertion error retry for the core workload. +# +# By default, the YCSB core workload does not retry any operations. +# However, during the load process, if any insertion fails, the entire +# load process is terminated. +# If a user desires to have more robust behavior during this phase, they can +# enable retry for insertion by setting the following property to a positive +# number. +# core_workload_insertion_retry_limit = 0 +# +# the following number controls the interval between retries (in seconds): +# core_workload_insertion_retry_interval = 3 + +# Distributed Tracing via Apache HTrace (http://htrace.incubator.apache.org/) +# +# Defaults to blank / no tracing +# Below sends to a local file, sampling at 0.1% +# +# htrace.sampler.classes=ProbabilitySampler +# htrace.sampler.fraction=0.001 +# htrace.span.receiver.classes=org.apache.htrace.core.LocalFileSpanReceiver +# htrace.local.file.span.receiver.path=/some/path/to/local/file +# +# To capture all spans, use the AlwaysSampler +# +# htrace.sampler.classes=AlwaysSampler +# +# To send spans to an HTraced receiver, use the below and ensure +# your classpath contains the htrace-htraced jar (i.e. when invoking the ycsb +# command add -cp /path/to/htrace-htraced.jar) +# +# htrace.span.receiver.classes=org.apache.htrace.impl.HTracedSpanReceiver +# htrace.htraced.receiver.address=example.com:9075 +# htrace.htraced.error.log.period.ms=10000