From a3cf980f930ee8f23e9cce2a6d1797195d890d9f Mon Sep 17 00:00:00 2001 From: Sean Busbey <busbey@cloudera.com> Date: Wed, 30 Apr 2014 11:04:59 -0500 Subject: [PATCH] Include an example Accumulo configuration file. Make the batchwriter's number of threads configurable. --- accumulo/src/main/conf/accumulo.properties | 44 +++++++++++++++++++ .../com/yahoo/ycsb/db/AccumuloClient.java | 3 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 accumulo/src/main/conf/accumulo.properties diff --git a/accumulo/src/main/conf/accumulo.properties b/accumulo/src/main/conf/accumulo.properties new file mode 100644 index 00000000..191ad416 --- /dev/null +++ b/accumulo/src/main/conf/accumulo.properties @@ -0,0 +1,44 @@ +# Copyright 2014 Cloudera, Inc. or its affiliates. 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 Accumulo configuration properties +# +# You may either set properties here or via the command line. +# + +# This will influence the keys we write +accumulo.columnFamily=YCSB + +# This should be set based on your Accumulo cluster +#accumulo.instanceName=ExampleInstance + +# Comma separated list of host:port tuples for the ZooKeeper quorum used +# by your Accumulo cluster +#accumulo.zooKeepers=zoo1.example.com:2181,zoo2.example.com:2181,zoo3.example.com:2181 + +# This user will need permissions on the table YCSB works against +#accumulo.username=ycsb +#accumulo.password=protectyaneck + +# Controls how long our client writer will wait to buffer more data +# measured in milliseconds +accumulo.batchWriterMaxLatency=30000 + +# Controls how much data our client will attempt to buffer before sending +# measured in bytes +accumulo.batchWriterSize=100000 + +# Controls how many worker threads our client will use to parallelize writes +accumulo.batchWriterThreads=1 diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java b/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java index 9867ca4b..c397573b 100644 --- a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java +++ b/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java @@ -137,7 +137,8 @@ public class AccumuloClient extends DB { long bwSize = Long.parseLong(getProperties().getProperty("accumulo.batchWriterSize", "100000")); long bwMaxLatency = Long.parseLong(getProperties().getProperty("accumulo.batchWriterMaxLatency", "30000")); - _bw = _connector.createBatchWriter(table, bwSize, bwMaxLatency, 1); + int bwThreads = Integer.parseInt(getProperties().getProperty("accumulo.batchWriterThreads", "1")); + _bw = _connector.createBatchWriter(table, bwSize, bwMaxLatency, bwThreads); // Create our scanners _singleScanner = _connector.createScanner(table, Constants.NO_AUTHS); _scanScanner = _connector.createScanner(table, Constants.NO_AUTHS); -- GitLab