You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by jd...@apache.org on 2016/02/17 01:42:42 UTC

[3/5] incubator-kudu git commit: Allow to have more chains in linked_list-test

Allow to have more chains in linked_list-test

LinkedListTest is one of our most used tests for correcness, but
it has a small maximum number of chains (256) which means that batches
are also accordingly small. This raises that limit to 65536 so that we
can make these tests submit larger batches.

Change-Id: Ideda1bfd130377792528d8bede1e7c44b4cf938f
Reviewed-on: http://gerrit.cloudera.org:8080/2125
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/1ba70303
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/1ba70303
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/1ba70303

Branch: refs/heads/master
Commit: 1ba703035c8d1b5327321d5b6a3f28d6bb3c1158
Parents: 682c664
Author: David Alves <da...@cloudera.com>
Authored: Thu Feb 11 12:20:16 2016 -0800
Committer: David Ribeiro Alves <da...@cloudera.com>
Committed: Tue Feb 16 20:26:21 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/linked_list-test-util.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/1ba70303/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 854e103..0364d9c 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -177,11 +177,12 @@ class LinkedListChainGenerator {
   // 'chain_idx' is a unique ID for this chain. Chains with different indexes
   // will always generate distinct sets of keys (thus avoiding the possibility of
   // a collision even in a longer run).
-  explicit LinkedListChainGenerator(uint8_t chain_idx)
+  explicit LinkedListChainGenerator(int chain_idx)
     : chain_idx_(chain_idx),
       rand_(chain_idx * 0xDEADBEEF),
       prev_key_(0) {
-    CHECK_LT(chain_idx, 256);
+    CHECK_GE(chain_idx, 0);
+    CHECK_LT(chain_idx, 65536);
   }
 
   ~LinkedListChainGenerator() {
@@ -193,9 +194,9 @@ class LinkedListChainGenerator {
   }
 
   Status GenerateNextInsert(client::KuduTable* table, client::KuduSession* session) {
-    // Encode the chain index in the lowest 8 bits so that different chains never
+    // Encode the chain index in the lowest 16 bits so that different chains never
     // intersect.
-    int64_t this_key = (Rand64() << 8) | chain_idx_;
+    int64_t this_key = (Rand64() << 16) | chain_idx_;
     int64_t ts = GetCurrentTimeMicros();
 
     gscoped_ptr<client::KuduInsert> insert(table->NewInsert());
@@ -214,7 +215,7 @@ class LinkedListChainGenerator {
   }
 
  private:
-  const uint8_t chain_idx_;
+  const int chain_idx_;
 
   // This is a linear congruential random number generator, so it won't repeat until
   // it has exhausted its period (which is quite large)