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

[1/3] incubator-kudu git commit: [java] Remove the option to test with remote cluster

Repository: incubator-kudu
Updated Branches:
  refs/heads/master 77d101b74 -> 05add04e1


[java] Remove the option to test with remote cluster

I added this option years ago to be able to run the java unit tests
from my MBPr, but it's not needed anymore. Also the last time I tried
it I saw it was broken, usually around the parts where we try to kill
nodes.

Change-Id: I3c0136d6af4f0b4066ef94d603e35cbc4a55e4cb
Reviewed-on: http://gerrit.cloudera.org:8080/1874
Reviewed-by: Dan Burkert <da...@cloudera.com>
Tested-by: Internal Jenkins


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

Branch: refs/heads/master
Commit: 4edf27fd62bfb90469022082b85f25439fd0d809
Parents: 77d101b
Author: Jean-Daniel Cryans <jd...@cloudera.com>
Authored: Fri Jan 22 08:27:11 2016 -0800
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Fri Jan 22 21:14:19 2016 +0000

----------------------------------------------------------------------
 .../java/org/kududb/client/BaseKuduTest.java    | 28 ++++++--------------
 .../org/kududb/client/TestLeaderFailover.java   |  4 ---
 .../test/java/org/kududb/client/TestUtils.java  | 15 -----------
 3 files changed, 8 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
index 3721e27..d1a1410 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
@@ -45,9 +45,6 @@ public class BaseKuduTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(BaseKuduTest.class);
 
-  private static final int DEFAULT_MASTER_RPC_PORT = 7051;
-  private static final String START_CLUSTER = "startCluster";
-
   private static final String NUM_MASTERS_PROP = "NUM_MASTERS";
   private static final int NUM_TABLET_SERVERS = 3;
   private static final int DEFAULT_NUM_MASTERS = 1;
@@ -70,7 +67,6 @@ public class BaseKuduTest {
   protected static KuduClient syncClient;
   protected static Schema basicSchema = getBasicSchema();
   protected static Schema allTypesSchema = getSchemaWithAllTypes();
-  protected static boolean startCluster;
 
   private static List<String> tableNames = new ArrayList<>();
 
@@ -78,19 +74,13 @@ public class BaseKuduTest {
   public static void setUpBeforeClass() throws Exception {
     LOG.info("Setting up before class...");
 
-    startCluster = Boolean.parseBoolean(System.getProperty(START_CLUSTER, "true"));
-
-    if (startCluster) {
-      miniCluster = new MiniKuduCluster.MiniKuduClusterBuilder()
-          .numMasters(NUM_MASTERS)
-          .numTservers(NUM_TABLET_SERVERS)
-          .build();
-      masterAddresses = miniCluster.getMasterAddresses();
-      masterHostPorts = miniCluster.getMasterHostPorts();
-    } else {
-      masterAddresses = TestUtils.getMasterAddresses();
-      masterHostPorts = NetUtil.parseStrings(masterAddresses, DEFAULT_MASTER_RPC_PORT);
-    }
+    miniCluster = new MiniKuduCluster.MiniKuduClusterBuilder()
+        .numMasters(NUM_MASTERS)
+        .numTservers(NUM_TABLET_SERVERS)
+        .build();
+    masterAddresses = miniCluster.getMasterAddresses();
+    masterHostPorts = miniCluster.getMasterHostPorts();
+
     LOG.info("Creating new Kudu client...");
     client = new AsyncKuduClient.AsyncKuduClientBuilder(masterAddresses).build();
     syncClient = new KuduClient(client);
@@ -128,9 +118,7 @@ public class BaseKuduTest {
         // shutting down the async client effectively does that.
       }
     } finally {
-      if (startCluster) {
-        miniCluster.shutdown();
-      }
+      miniCluster.shutdown();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
index 1be3652..544feab 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
@@ -45,10 +45,6 @@ public class TestLeaderFailover extends BaseKuduTest {
    */
   @Test(timeout = 100000)
   public void testFailover() throws Exception {
-    if (!startCluster) {
-      return;
-    }
-
     KuduSession session = syncClient.newSession();
     session.setIgnoreAllDuplicateRows(true);
     for (int i = 0; i < 3; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java b/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
index 39f8518..f4866b8 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
@@ -49,10 +49,6 @@ public class TestUtils {
   private static String UNIX_PROCESS_CLS_NAME =  "java.lang.UNIXProcess";
   private static Set<String> VALID_SIGNALS =  ImmutableSet.of("STOP", "CONT", "TERM", "KILL");
 
-  private static final String MASTER_ADDRESSES_PROP = "masterAddresses";
-  private static final String MASTER_ADDRESS_PROP = "masterAddress";
-  private static final String DEFAULT_MASTER_ADDRESS = "127.0.0.1";
-
   private static final String BIN_DIR_PROP = "binDir";
 
   /**
@@ -83,17 +79,6 @@ public class TestUtils {
   }
 
   /**
-   * @return the comma-separated list of addresses for the master(s)
-   */
-  public static String getMasterAddresses() {
-    String addr = System.getProperty(MASTER_ADDRESSES_PROP);
-    if (addr == null) {
-      addr = System.getProperty(MASTER_ADDRESS_PROP, DEFAULT_MASTER_ADDRESS);
-    }
-    return addr;
-  }
-
-  /**
    * Return the path portion of a file URL, after decoding the escaped
    * components. This fixes issues when trying to build within a
    * working directory with special characters.


[3/3] incubator-kudu git commit: Support move construction and assignment for Status

Posted by to...@apache.org.
Support move construction and assignment for Status

This ought to avoid some extra allocations and copies in
the common case of returning Status from a function.

The new support is enabled only in C++11, since status.h
is also sometimes included by non-C++11 client users.

Change-Id: Id91aff98764d6df4857c0123687dc417c3d97281
Reviewed-on: http://gerrit.cloudera.org:8080/1871
Reviewed-by: Dan Burkert <da...@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: 05add04e1b560c537ccb759f3ea272dfef7bf2d0
Parents: 0e88646
Author: Todd Lipcon <to...@apache.org>
Authored: Thu Jan 21 19:13:14 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Fri Jan 22 23:05:01 2016 +0000

----------------------------------------------------------------------
 src/kudu/util/status-test.cc | 51 +++++++++++++++++++++++++++++++++++++++
 src/kudu/util/status.h       | 20 +++++++++++++++
 2 files changed, 71 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/05add04e/src/kudu/util/status-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/status-test.cc b/src/kudu/util/status-test.cc
index 109767a..afbecd2 100644
--- a/src/kudu/util/status-test.cc
+++ b/src/kudu/util/status-test.cc
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <vector>
 #include "kudu/util/status.h"
+#include "kudu/util/test_util.h"
 
 using std::string;
 
@@ -61,4 +62,54 @@ TEST(StatusTest, TestMemoryUsage) {
       "file error", "some other thing", ENOTDIR).memory_footprint_excluding_this(), 0);
 }
 
+TEST(StatusTest, TestMoveConstructor) {
+  // OK->OK move should do nothing.
+  {
+    Status src = Status::OK();
+    Status dst = std::move(src);
+    ASSERT_OK(src);
+    ASSERT_OK(dst);
+  }
+
+  // Moving a not-OK status into a new one should make the moved status
+  // "OK".
+  {
+    Status src = Status::NotFound("foo");
+    Status dst = std::move(src);
+    ASSERT_OK(src);
+    ASSERT_EQ("Not found: foo", dst.ToString());
+  }
+}
+
+TEST(StatusTest, TestMoveAssignment) {
+  // OK->Bad move should clear the source status and also make the
+  // destination status OK.
+  {
+    Status src = Status::OK();
+    Status dst = Status::NotFound("orig dst");
+    dst = std::move(src);
+    ASSERT_OK(src);
+    ASSERT_OK(dst);
+  }
+
+  // Bad->Bad move.
+  {
+    Status src = Status::NotFound("orig src");
+    Status dst = Status::NotFound("orig dst");
+    dst = std::move(src);
+    ASSERT_OK(src);
+    ASSERT_EQ("Not found: orig src", dst.ToString());
+  }
+
+  // Bad->OK move
+  {
+    Status src = Status::NotFound("orig src");
+    Status dst = Status::OK();
+    dst = std::move(src);
+    ASSERT_OK(src);
+    ASSERT_EQ("Not found: orig src", dst.ToString());
+  }
+}
+
+
 }  // namespace kudu

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/05add04e/src/kudu/util/status.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/status.h b/src/kudu/util/status.h
index d4f5755..5003be3 100644
--- a/src/kudu/util/status.h
+++ b/src/kudu/util/status.h
@@ -110,6 +110,12 @@ class KUDU_EXPORT Status {
   Status(const Status& s);
   void operator=(const Status& s);
 
+#if __cplusplus >= 201103L
+  // Move the specified status.
+  Status(Status&& s);
+  void operator=(Status&& s);
+#endif
+
   // Return a success status.
   static Status OK() { return Status(); }
 
@@ -334,6 +340,20 @@ inline void Status::operator=(const Status& s) {
   }
 }
 
+#if __cplusplus >= 201103L
+inline Status::Status(Status&& s) : state_(s.state_) {
+  s.state_ = nullptr;
+}
+
+inline void Status::operator=(Status&& s) {
+  if (state_ != s.state_) {
+    delete[] state_;
+    state_ = s.state_;
+    s.state_ = nullptr;
+  }
+}
+#endif
+
 }  // namespace kudu
 
 #endif  // KUDU_UTIL_STATUS_H_


[2/3] incubator-kudu git commit: docs: add el7 and wheezy to the list of supported distros

Posted by to...@apache.org.
docs: add el7 and wheezy to the list of supported distros

Lucky for me, the existing documentation for RHEL and "Ubuntu or Debian"
didn't need any changes.

Note that I didn't add links to the "Kudu Package Locations" section as any
new links would be broken right now.

Change-Id: I2cfa080f3b3759d4998dead9484fa960ea19f2eb
Reviewed-on: http://gerrit.cloudera.org:8080/1877
Reviewed-by: Jean-Daniel Cryans
Tested-by: Internal Jenkins


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

Branch: refs/heads/master
Commit: 0e8864632e9a31d1c1d4c297266622046717ef6d
Parents: 4edf27f
Author: Adar Dembo <ad...@cloudera.com>
Authored: Thu Jan 21 19:05:33 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Fri Jan 22 22:52:07 2016 +0000

----------------------------------------------------------------------
 docs/installation.adoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0e886463/docs/installation.adoc
----------------------------------------------------------------------
diff --git a/docs/installation.adoc b/docs/installation.adoc
index 23577ec..bb14dff 100644
--- a/docs/installation.adoc
+++ b/docs/installation.adoc
@@ -46,7 +46,7 @@ three tablet servers is necessary.
 
 .Operating System Requirements
 Linux::
-    - RHEL 6, Ubuntu 14.04 Trusty, or SLES 12.
+    - RHEL 6, RHEL 7, Debian 7 (Wheezy), Ubuntu 14.04 (Trusty), or SLES 12.
     - A kernel and fileystem that support _hole punching_. Hole punching is the use of the
       `fallocate(2)` system call with the `FALLOC_FL_PUNCH_HOLE` option set. See
       link:troubleshooting.html#req_hole_punching[troubleshooting hole punching] for more
@@ -115,7 +115,7 @@ sudo apt-get install kudu                     # Base Kudu files
 sudo apt-get install kudu-master              # Service scripts for managing kudu-master
 sudo apt-get install kudu-tserver             # Service scripts for managing kudu-tserver
 sudo apt-get install libkuduclient0           # Kudu C++ client shared library
-sudo apt-get install libkuduclient-dev       # Kudu C++ client SDK
+sudo apt-get install libkuduclient-dev        # Kudu C++ client SDK
 ----
 
 . To manually install individual DEBs, first download them, then use the command
@@ -669,7 +669,7 @@ $ sudo service kudu-tserver stop
 ----
 
 . Upgrade the packages.
- - On RHEL hosts:
+ - On RHEL or CentOS hosts:
 +
 [source,bash]
 ----