From c8d316e9e13e0a6e2bf3af6e3375e980892c1752 Mon Sep 17 00:00:00 2001
From: Jean-Daniel Cryans <jdcryans@cloudera.com>
Date: Wed, 28 Oct 2015 13:38:01 -0700
Subject: [PATCH] Make kudu_sync_ops default to true, adjust the doc

---
 kudu/README.md                                           | 5 ++---
 kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java | 8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/kudu/README.md b/kudu/README.md
index e7c4fa01..cd5cffd6 100644
--- a/kudu/README.md
+++ b/kudu/README.md
@@ -34,12 +34,11 @@ Additional configurations:
 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 buffer data before sending it. The default is false. Should
-always be set to true for the run phase.
+* `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 -p kudu_sync_ops=true
+bin/ycsb run kudu -P workloads/workloada
 ```
diff --git a/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java b/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java
index d467f452..9e65407a 100644
--- a/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java
+++ b/kudu/src/main/java/com/yahoo/ycsb/db/KuduYCSBClient.java
@@ -84,13 +84,13 @@ public class KuduYCSBClient extends com.yahoo.ycsb.DB {
     initClient(debug, tableName, getProperties());
     this.session = client.newSession();
     if (getProperties().getProperty(SYNC_OPS_OPT) != null &&
-        getProperties().getProperty(SYNC_OPS_OPT).equals("true")) {
-      this.session.setFlushMode(KuduSession.FlushMode.AUTO_FLUSH_SYNC);
-    } else {
+        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);
     }
 
-    this.session.setMutationBufferSpace(100);
     try {
       this.table = client.openTable(tableName);
     } catch (Exception e) {
-- 
GitLab