You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2016/06/01 00:02:02 UTC
[1/3] incubator-kudu git commit: Kudu 0.9.0 release notes edit
Repository: incubator-kudu
Updated Branches:
refs/heads/master 975eeff46 -> 5bec538a5
Kudu 0.9.0 release notes edit
Change-Id: I6242089b099a7e220ce4094f3ba0377859338b97
Reviewed-on: http://gerrit.cloudera.org:8080/3176
Reviewed-by: Misty Stanley-Jones <mi...@apache.org>
Tested-by: Misty Stanley-Jones <mi...@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/5805fb71
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/5805fb71
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/5805fb71
Branch: refs/heads/master
Commit: 5805fb71cf07634edcad1096d1616a8a729268bc
Parents: 975eeff
Author: Misty Stanley-Jones <mi...@apache.org>
Authored: Mon May 23 12:30:12 2016 -0700
Committer: Misty Stanley-Jones <mi...@apache.org>
Committed: Tue May 31 22:39:09 2016 +0000
----------------------------------------------------------------------
docs/installation.adoc | 12 ++++++-----
docs/release_notes.adoc | 51 ++++++++++++++++++++++++++++++--------------
2 files changed, 42 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5805fb71/docs/installation.adoc
----------------------------------------------------------------------
diff --git a/docs/installation.adoc b/docs/installation.adoc
index f70cded..a827a5d 100644
--- a/docs/installation.adoc
+++ b/docs/installation.adoc
@@ -623,14 +623,14 @@ in `java/kudu-client/target/apidocs/index.html`.
// end::view_api[]
[[upgrade]]
-== Upgrade from 0.7.1 to 0.8.0
+== Upgrade from 0.8.0 to 0.9.0
Before upgrading, see <<client_compatibility>> and <<api_compatibility>>.
-To upgrade from Kudu 0.7.1 to 0.8.0, perform the following high-level steps, which
+To upgrade from Kudu 0.8.0 to 0.9.0, perform the following high-level steps, which
are detailed in <<upgrade_procedure>>:
. Shut down all Kudu services.
-. Install the new Kudu packages or parcels, or install Kudu 0.8.0 from source.
+. Install the new Kudu packages or parcels, or install Kudu 0.9.0 from source.
. Restart all Kudu services.
It is technically possible to upgrade Kudu using rolling restarts, but it has not
@@ -644,14 +644,16 @@ from the previous latest version to the newest.
Masters and tablet servers should be upgraded before clients are upgraded. For specific
information about client compatibility, see the
-link:release_notes.html#rn_0.8.0_incompatible_changes[Incompatible Changes] section
+link:release_notes.html#rn_0.9.0_incompatible_changes[Incompatible Changes] section
of the release notes.
[[api_compatibility]]
=== API Compatibility
-The Kudu 0.8.0 client API is compatible with Kudu 0.7.1.
+In Kudu 0.9 and higher, you must set partitioning options explicitly when
+creating a new table. If you do not specify partitioning options, the table
+creation will fail. This behavior change does not affect existing tables.
[[upgrade_procedure]]
=== Upgrade procedure
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5805fb71/docs/release_notes.adoc
----------------------------------------------------------------------
diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc
index 826d911..e912455 100644
--- a/docs/release_notes.adoc
+++ b/docs/release_notes.adoc
@@ -56,15 +56,25 @@ Hadoop storage technologies.
[[rn_0.9.0]]
=== Release notes specific to 0.9.0
+Kudu 0.9.0 delivers incremental features, improvements, and bug fixes over the previous versions.
+
+See also +++<a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20KUDU%20AND%20status%20%3D%20Resolved
+%20AND%20fixVersion%20%3D%200.9.0">JIRAs resolved
+for Kudu 0.9.0</a>+++ and +++<a href="https://github.com/apache/incubator-kudu/compare/0.8.0...0.9.0">Git
+changes between 0.8.0 and 0.9.0</a>+++.
+
+To upgrade to Kudu 0.9.0, see link:installation.html#upgrade[Upgrade from 0.8.0 to 0.9.0].
+
[[rn_0.9.0_incompatible_changes]]
==== Incompatible changes
-- The KuduTableInputFormat has changed how it handles scan predicates, including
- how it serializes predicates to the job configuration object. The new
- configuration key is "kudu.mapreduce.encoded.predicate". Clients using the
- TableInputFormatConfigurator should not be affected.
+- The `KuduTableInputFormat` command has changed the way in which it handles
+ scan predicates, including how it serializes predicates to the job configuration
+ object. The new configuration key is `kudu.mapreduce.encoded.predicate`. Clients
+ using the `TableInputFormatConfigurator` are not affected.
-- The kudu-spark subproject was been renamed to follow naming conventions for scala kudu-spark_2.10
+- The `kudu-spark` sub-project has been renamed to follow naming conventions for
+ Scala. The new name is `kudu-spark_2.10`.
- Default table partitioning has been removed. All tables must now be created
with explicit partitioning. Existing tables are unaffected. See the
@@ -75,23 +85,32 @@ Hadoop storage technologies.
==== New features
- link:https://issues.apache.org/jira/browse/KUDU-1306[KUDU-1306] Scan token API
- for creating partition-aware scan descriptors. Can be used by clients and
- query engines to more easily execute parallel scans.
+ for creating partition-aware scan descriptors. This API simplifies executing
+ parallel scans for clients and query engines.
-- link:http://gerrit.cloudera.org:8080/#/c/2848/[Gerrit 2848] Added a kudu datasource for spark which uses the kudu client directly instead of
- using mapreduce api. Includes predicate pushdowns for spark-sql and spark filters.
- Parallel retrieval for multiple tablets and column projections. link:developing.html#_kudu_integration_with_spark[Kudu integration with Spark Example]
+- link:http://gerrit.cloudera.org:8080/#/c/2848/[Gerrit 2848] Added a kudu datasource
+ for Spark. This datasource uses the Kudu client directly instead of
+ using the MapReduce API. Predicate pushdowns for `spark-sql` and Spark filters are
+ included, as well as parallel retrieval for multiple tablets and column projections.
+ See an example of link:developing.html#_kudu_integration_with_spark[Kudu integration with Spark].
-- link:http://gerrit.cloudera.org:8080/#/c/2992/ Added ability to update and insert from spark using kudu datasource
+- link:http://gerrit.cloudera.org:8080/#/c/2992/[Gerrit 2992] Added the ability
+ to update and insert from Spark using a Kudu datasource.
[[rn_0.9.0_changes]]
==== Other noteworthy changes
-- The clients have longer default timeouts. For Java, the default operation timeout and the default
- admin operation timeout are now set to 30 seconds instead of 10. The default socket read timeout
- is now 10 seconds instead of 5. For the C++ client, the default admin timeout is now 30 seconds
- instead of 10, the default RPC timeout is now 10 seconds instead of 5, and the default scan
- timeout is now 30 seconds instead of 15.
+All Kudu clients have longer default timeout values, as listed below.
+
+.Java
+- The default operation timeout and the default admin operation timeout
+ are now set to 30 seconds instead of 10.
+- The default socket read timeout is now 10 seconds instead of 5.
+
+.C++
+- The default admin timeout is now 30 seconds instead of 10.
+- The default RPC timeout is now 10 seconds instead of 5.
+- The default scan timeout is now 30 seconds instead of 15.
- Some default settings related to I/O behavior during flushes and compactions have been changed:
The default for `flush_threshold_mb` has been increased from 64MB to 1000MB. The default
[2/3] incubator-kudu git commit: Document advice about max columns
and record size
Posted by da...@apache.org.
Document advice about max columns and record size
Change-Id: I70a82d59c431f69246128acc19227af3194fa15a
Reviewed-on: http://gerrit.cloudera.org:8080/2778
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <da...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/e5600027
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/e5600027
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/e5600027
Branch: refs/heads/master
Commit: e5600027ab0100fcb8d3d95bd4c5810f0c810d4e
Parents: 5805fb7
Author: Misty Stanley-Jones <mi...@apache.org>
Authored: Wed Apr 13 08:27:02 2016 -0700
Committer: Misty Stanley-Jones <mi...@apache.org>
Committed: Tue May 31 22:42:19 2016 +0000
----------------------------------------------------------------------
docs/schema_design.adoc | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/e5600027/docs/schema_design.adoc
----------------------------------------------------------------------
diff --git a/docs/schema_design.adoc b/docs/schema_design.adoc
index e6a7f44..0ba5734 100644
--- a/docs/schema_design.adoc
+++ b/docs/schema_design.adoc
@@ -275,7 +275,20 @@ You cannot modify the partition schema after table creation.
[[known-limitations]]
== Known Limitations
-Kudu currently has some known limitations that may factor into schema design:
+Kudu currently has some known limitations that may factor into schema design. When
+designing your schema, consider these limitations together, not in isolation. If you
+test these limitations and your findings are different from these, please share your
+test cases and results.
+
+Number of Columns:: Kudu has not been thoroughly tested with more than 200 columns
+and we recommend schemas with fewer than 50 columns per table.
+
+Size of Rows:: Kudu has not been thoroughly tested with rows larger than 10 kb. Most
+testing has been on rows at 1 kb.
+
+Size of Cells:: There is no hard limit imposed by Kudu, but large values (10s of
+ kilobytes and above) are likely to perform poorly and may cause stability issues
+ in current Kudu releases.
Immutable Primary Keys:: Kudu does not allow you to update the primary key of a
row after insertion.
[3/3] incubator-kudu git commit: Replace uses of boost::thread with
std::thread
Posted by da...@apache.org.
Replace uses of boost::thread with std::thread
Change-Id: I27e14c505cbfacf791f9730dc343196ea720134b
Reviewed-on: http://gerrit.cloudera.org:8080/1868
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/5bec538a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/5bec538a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/5bec538a
Branch: refs/heads/master
Commit: 5bec538a5d915460d266af0e5a523359f39fa900
Parents: e560002
Author: Dan Burkert <da...@cloudera.com>
Authored: Thu Jan 14 13:52:08 2016 -0800
Committer: Dan Burkert <da...@cloudera.com>
Committed: Wed Jun 1 00:01:22 2016 +0000
----------------------------------------------------------------------
src/kudu/consensus/mt-log-test.cc | 1 -
src/kudu/experiments/rwlock-perf.cc | 43 ++++++--------
.../create-table-stress-test.cc | 2 -
src/kudu/rpc/rpc-bench.cc | 28 +++++-----
src/kudu/rpc/sasl_rpc-test.cc | 7 ++-
src/kudu/tablet/cbtree-test.cc | 59 ++++++++++----------
src/kudu/tablet/lock_manager-test.cc | 3 +-
src/kudu/tablet/mt-diskrowset-test.cc | 27 ++++-----
.../tablet/mt-rowset_delta_compaction-test.cc | 1 -
src/kudu/tablet/mvcc-test.cc | 19 +++----
src/kudu/tablet/tablet-test-base.h | 1 -
src/kudu/twitter-demo/ingest_firehose.cc | 1 -
src/kudu/twitter-demo/twitter_streamer.cc | 6 +-
src/kudu/twitter-demo/twitter_streamer.h | 6 +-
src/kudu/util/blocking_queue-test.cc | 29 ++++------
src/kudu/util/memory/arena-test.cc | 14 ++---
src/kudu/util/rw_semaphore-test.cc | 6 +-
src/kudu/util/rwc_lock-test.cc | 16 +++---
18 files changed, 121 insertions(+), 148 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/consensus/mt-log-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/mt-log-test.cc b/src/kudu/consensus/mt-log-test.cc
index b204c70..94921e7 100644
--- a/src/kudu/consensus/mt-log-test.cc
+++ b/src/kudu/consensus/mt-log-test.cc
@@ -19,7 +19,6 @@
#include <boost/thread/locks.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
#include <algorithm>
#include <memory>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/experiments/rwlock-perf.cc
----------------------------------------------------------------------
diff --git a/src/kudu/experiments/rwlock-perf.cc b/src/kudu/experiments/rwlock-perf.cc
index 31118cc..175aaa3 100644
--- a/src/kudu/experiments/rwlock-perf.cc
+++ b/src/kudu/experiments/rwlock-perf.cc
@@ -15,15 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/smart_ptr/detail/spinlock.hpp>
-#include <boost/smart_ptr/detail/yield_k.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
-#include <boost/thread/thread.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <stdio.h>
+#include <thread>
#include <unistd.h>
#include "kudu/gutil/atomicops.h"
@@ -35,6 +33,9 @@
DEFINE_int32(num_threads, 8, "Number of threads to test");
+using std::thread;
+using std::vector;
+
class my_spinlock : public boost::detail::spinlock {
public:
my_spinlock() {
@@ -177,41 +178,32 @@ enum TestMethod {
RW_SPINLOCK
};
-void test_shared_lock(int num_threads,
- TestMethod method,
- const char *name) {
- boost::ptr_vector<boost::thread> threads;
+void test_shared_lock(int num_threads, TestMethod method, const char *name) {
+ vector<thread> threads;
shared_data shared;
for (int i = 0; i < num_threads; i++) {
switch (method) {
case SHARED_RWLOCK:
- threads.push_back(new boost::thread(
- shared_rwlock_entry, &shared));
+ threads.emplace_back(shared_rwlock_entry, &shared);
break;
case SHARED_MUTEX:
- threads.push_back(new boost::thread(
- shared_mutex_entry, &shared));
+ threads.emplace_back(shared_mutex_entry, &shared);
break;
case OWN_MUTEX:
- threads.push_back(new boost::thread(
- own_mutex_entry<boost::mutex>));
+ threads.emplace_back(own_mutex_entry<boost::mutex>);
break;
case OWN_SPINLOCK:
- threads.push_back(new boost::thread(
- own_mutex_entry<my_spinlock>));
+ threads.emplace_back(own_mutex_entry<my_spinlock>);
break;
case NO_LOCK:
- threads.push_back(new boost::thread(
- own_mutex_entry<noop_lock>));
+ threads.emplace_back(own_mutex_entry<noop_lock>);
break;
case PERCPU_RWLOCK:
- threads.push_back(new boost::thread(
- percpu_rwlock_entry, &shared));
+ threads.emplace_back(percpu_rwlock_entry, &shared);
break;
case RW_SPINLOCK:
- threads.push_back(new boost::thread(
- shared_rw_spinlock_entry, &shared));
+ threads.emplace_back(shared_rw_spinlock_entry, &shared);
break;
default:
CHECK(0) << "bad method: " << method;
@@ -219,22 +211,19 @@ void test_shared_lock(int num_threads,
}
int64_t start = CycleClock::Now();
- for (boost::thread &thr : threads) {
+ for (thread& thr : threads) {
thr.join();
}
int64_t end = CycleClock::Now();
- printf("%13s % 7d %ldM\n",
- name, num_threads, (end-start)/1000000);
+ printf("%13s % 7d %" PRId64 "M\n", name, num_threads, (end-start)/1000000);
}
int main(int argc, char **argv) {
printf(" Test Threads Cycles\n");
printf("------------------------------\n");
- for (int num_threads = 1;
- num_threads < FLAGS_num_threads;
- num_threads++) {
+ for (int num_threads = 1; num_threads < FLAGS_num_threads; num_threads++) {
test_shared_lock(num_threads, SHARED_RWLOCK, "shared_rwlock");
test_shared_lock(num_threads, SHARED_MUTEX, "shared_mutex");
test_shared_lock(num_threads, OWN_MUTEX, "own_mutex");
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/integration-tests/create-table-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-stress-test.cc b/src/kudu/integration-tests/create-table-stress-test.cc
index 5db9fa8..31313f4 100644
--- a/src/kudu/integration-tests/create-table-stress-test.cc
+++ b/src/kudu/integration-tests/create-table-stress-test.cc
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/bind.hpp>
-#include <boost/thread/thread.hpp>
#include <glog/stl_logging.h>
#include <gtest/gtest.h>
#include <memory>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/rpc/rpc-bench.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc-bench.cc b/src/kudu/rpc/rpc-bench.cc
index 457539e..c4a051a 100644
--- a/src/kudu/rpc/rpc-bench.cc
+++ b/src/kudu/rpc/rpc-bench.cc
@@ -15,13 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/bind.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/thread/thread.hpp>
+#include <functional>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <memory>
#include <string>
+#include <thread>
#include "kudu/gutil/atomicops.h"
#include "kudu/rpc/rpc-test-base.h"
@@ -29,8 +28,10 @@
#include "kudu/util/countdown_latch.h"
#include "kudu/util/test_util.h"
-using std::string;
+using std::bind;
using std::shared_ptr;
+using std::string;
+using std::thread;
using std::unique_ptr;
using std::vector;
@@ -113,7 +114,7 @@ class ClientThread {
}
void Start() {
- thread_.reset(new boost::thread(&ClientThread::Run, this));
+ thread_.reset(new thread(&ClientThread::Run, this));
}
void Join() {
@@ -138,7 +139,7 @@ class ClientThread {
}
}
- gscoped_ptr<boost::thread> thread_;
+ unique_ptr<thread> thread_;
RpcBench *bench_;
int request_count_;
};
@@ -149,11 +150,10 @@ TEST_F(RpcBench, BenchmarkCalls) {
Stopwatch sw(Stopwatch::ALL_THREADS);
sw.start();
- boost::ptr_vector<ClientThread> threads;
+ vector<unique_ptr<ClientThread>> threads;
for (int i = 0; i < FLAGS_client_threads; i++) {
- auto thr = new ClientThread(this);
- thr->Start();
- threads.push_back(thr);
+ threads.emplace_back(new ClientThread(this));
+ threads.back()->Start();
}
SleepFor(MonoDelta::FromSeconds(FLAGS_run_seconds));
@@ -161,9 +161,9 @@ TEST_F(RpcBench, BenchmarkCalls) {
int total_reqs = 0;
- for (ClientThread &thr : threads) {
- thr.Join();
- total_reqs += thr.request_count_;
+ for (auto& thr : threads) {
+ thr->Join();
+ total_reqs += thr->request_count_;
}
sw.stop();
@@ -196,7 +196,7 @@ class ClientAsyncWorkload {
proxy_->AddAsync(req_,
&resp_,
&controller_,
- boost::bind(&ClientAsyncWorkload::CallOneRpc, this));
+ bind(&ClientAsyncWorkload::CallOneRpc, this));
}
void Start() {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/rpc/sasl_rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_rpc-test.cc b/src/kudu/rpc/sasl_rpc-test.cc
index 1a2d2e8..ce588a5 100644
--- a/src/kudu/rpc/sasl_rpc-test.cc
+++ b/src/kudu/rpc/sasl_rpc-test.cc
@@ -18,8 +18,8 @@
#include "kudu/rpc/rpc-test-base.h"
#include <string>
+#include <thread>
-#include <boost/thread/thread.hpp>
#include <gtest/gtest.h>
#include <sasl/sasl.h>
@@ -35,6 +35,7 @@
#include "kudu/util/net/socket.h"
using std::string;
+using std::thread;
namespace kudu {
namespace rpc {
@@ -74,12 +75,12 @@ static void RunNegotiationTest(socket_callable_t server_runner, socket_callable_
ASSERT_OK(server_sock.BindAndListen(Sockaddr(), 1));
Sockaddr server_bind_addr;
ASSERT_OK(server_sock.GetSocketAddress(&server_bind_addr));
- boost::thread server(RunAcceptingDelegator, &server_sock, server_runner);
+ thread server(RunAcceptingDelegator, &server_sock, server_runner);
Socket client_sock;
CHECK_OK(client_sock.Init(0));
ASSERT_OK(client_sock.Connect(server_bind_addr));
- boost::thread client(client_runner, &client_sock);
+ thread client(client_runner, &client_sock);
LOG(INFO) << "Waiting for test threads to terminate...";
client.join();
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/cbtree-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/cbtree-test.cc b/src/kudu/tablet/cbtree-test.cc
index 58346c3..c29a57f 100644
--- a/src/kudu/tablet/cbtree-test.cc
+++ b/src/kudu/tablet/cbtree-test.cc
@@ -15,12 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/thread/thread.hpp>
#include <boost/thread/barrier.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
-#include <boost/unordered_set.hpp>
+#include <thread>
+#include <unordered_set>
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/tablet/concurrent_btree.h"
@@ -35,7 +34,9 @@ namespace kudu {
namespace tablet {
namespace btree {
-using boost::unordered_set;
+using std::thread;
+using std::unordered_set;
+using std::vector;
class TestCBTree : public KuduTest {
protected:
@@ -384,7 +385,7 @@ TEST_F(TestCBTree, TestVersionLockSimple) {
// locks and unlocks a version field a predetermined number of times.
// Verifies that the counters are correct at the end.
TEST_F(TestCBTree, TestVersionLockConcurrent) {
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
int num_threads = 4;
int split_per_thread = 2348;
int insert_per_thread = 8327;
@@ -392,11 +393,10 @@ TEST_F(TestCBTree, TestVersionLockConcurrent) {
AtomicVersion v = 0;
for (int i = 0; i < num_threads; i++) {
- threads.push_back(new boost::thread(
- LockCycleThread, &v, split_per_thread, insert_per_thread));
+ threads.emplace_back(LockCycleThread, &v, split_per_thread, insert_per_thread);
}
- for (boost::thread &thr : threads) {
+ for (thread& thr : threads) {
thr.join();
}
@@ -431,19 +431,18 @@ void TestCBTree::DoTestConcurrentInsert() {
int n_trials = 30;
#endif
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
boost::barrier go_barrier(num_threads + 1);
boost::barrier done_barrier(num_threads + 1);
for (int i = 0; i < num_threads; i++) {
- threads.push_back(new boost::thread(
- InsertAndVerify<TraitsClass>,
- &go_barrier,
- &done_barrier,
- &tree,
- ins_per_thread * i,
- ins_per_thread * (i + 1)));
+ threads.emplace_back(InsertAndVerify<TraitsClass>,
+ &go_barrier,
+ &done_barrier,
+ &tree,
+ ins_per_thread * i,
+ ins_per_thread * (i + 1));
}
@@ -467,7 +466,7 @@ void TestCBTree::DoTestConcurrentInsert() {
tree.reset(nullptr);
go_barrier.wait();
- for (boost::thread &thr : threads) {
+ for (thread &thr : threads) {
thr.join();
}
}
@@ -693,25 +692,23 @@ TEST_F(TestCBTree, TestConcurrentIterateAndInsert) {
ins_per_thread = 30000;
}
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
boost::barrier go_barrier(num_threads + 1);
boost::barrier done_barrier(num_threads + 1);
for (int i = 0; i < num_ins_threads; i++) {
- threads.push_back(new boost::thread(
- InsertAndVerify<SmallFanoutTraits>,
- &go_barrier,
- &done_barrier,
- &tree,
- ins_per_thread * i,
- ins_per_thread * (i + 1)));
+ threads.emplace_back(InsertAndVerify<SmallFanoutTraits>,
+ &go_barrier,
+ &done_barrier,
+ &tree,
+ ins_per_thread * i,
+ ins_per_thread * (i + 1));
}
for (int i = 0; i < num_scan_threads; i++) {
- threads.push_back(new boost::thread(
- ScanThread<SmallFanoutTraits>,
- &go_barrier,
- &done_barrier,
- &tree));
+ threads.emplace_back(ScanThread<SmallFanoutTraits>,
+ &go_barrier,
+ &done_barrier,
+ &tree);
}
@@ -734,7 +731,7 @@ TEST_F(TestCBTree, TestConcurrentIterateAndInsert) {
tree.reset(nullptr);
go_barrier.wait();
- for (boost::thread &thr : threads) {
+ for (thread& thr : threads) {
thr.join();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/lock_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/lock_manager-test.cc b/src/kudu/tablet/lock_manager-test.cc
index 4fa098c..ea0edf7 100644
--- a/src/kudu/tablet/lock_manager-test.cc
+++ b/src/kudu/tablet/lock_manager-test.cc
@@ -16,7 +16,8 @@
// under the License.
#include <algorithm>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/mutex.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <memory>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/mt-diskrowset-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mt-diskrowset-test.cc b/src/kudu/tablet/mt-diskrowset-test.cc
index 98b3dc4..348f004 100644
--- a/src/kudu/tablet/mt-diskrowset-test.cc
+++ b/src/kudu/tablet/mt-diskrowset-test.cc
@@ -15,16 +15,17 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/thread/thread.hpp>
#include <memory>
+#include <thread>
#include "kudu/tablet/diskrowset-test-base.h"
DEFINE_int32(num_threads, 2, "Number of threads to test");
using std::shared_ptr;
+using std::thread;
using std::unordered_set;
+using std::vector;
namespace kudu {
namespace tablet {
@@ -42,24 +43,18 @@ class TestMultiThreadedRowSet : public TestRowSet {
}
}
- void StartUpdaterThreads(boost::ptr_vector<boost::thread> *threads,
- DiskRowSet *rs,
- int n_threads) {
+ void StartUpdaterThreads(vector<thread>* threads, DiskRowSet *rs, int n_threads) {
for (int i = 0; i < n_threads; i++) {
- threads->push_back(new boost::thread(
- &TestMultiThreadedRowSet::RowSetUpdateThread, this,
- rs));
+ threads->emplace_back(&TestMultiThreadedRowSet::RowSetUpdateThread, this, rs);
}
}
- void StartFlushThread(boost::ptr_vector<boost::thread> *threads,
- DiskRowSet *rs) {
- threads->push_back(new boost::thread(
- &TestMultiThreadedRowSet::FlushThread, this, rs));
+ void StartFlushThread(vector<thread>* threads, DiskRowSet *rs) {
+ threads->emplace_back(&TestMultiThreadedRowSet::FlushThread, this, rs);
}
- void JoinThreads(boost::ptr_vector<boost::thread> *threads) {
- for (boost::thread &thr : *threads) {
+ void JoinThreads(vector<thread>* threads) {
+ for (thread &thr : *threads) {
thr.join();
}
}
@@ -80,7 +75,7 @@ TEST_F(TestMultiThreadedRowSet, TestMTUpdate) {
ASSERT_OK(OpenTestRowSet(&rs));
// Spawn a bunch of threads, each of which will do updates.
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
StartUpdaterThreads(&threads, rs.get(), FLAGS_num_threads);
JoinThreads(&threads);
@@ -100,7 +95,7 @@ TEST_F(TestMultiThreadedRowSet, TestMTUpdateAndFlush) {
ASSERT_OK(OpenTestRowSet(&rs));
// Spawn a bunch of threads, each of which will do updates.
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
StartUpdaterThreads(&threads, rs.get(), FLAGS_num_threads);
StartFlushThread(&threads, rs.get());
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/mt-rowset_delta_compaction-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mt-rowset_delta_compaction-test.cc b/src/kudu/tablet/mt-rowset_delta_compaction-test.cc
index c9e8004..ac710a9 100644
--- a/src/kudu/tablet/mt-rowset_delta_compaction-test.cc
+++ b/src/kudu/tablet/mt-rowset_delta_compaction-test.cc
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/thread/thread.hpp>
#include <memory>
#include "kudu/gutil/atomicops.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/mvcc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mvcc-test.cc b/src/kudu/tablet/mvcc-test.cc
index 13504ea..d54a10a 100644
--- a/src/kudu/tablet/mvcc-test.cc
+++ b/src/kudu/tablet/mvcc-test.cc
@@ -15,9 +15,10 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/thread/thread.hpp>
-#include <gtest/gtest.h>
+#include <boost/thread/locks.hpp>
#include <glog/logging.h>
+#include <gtest/gtest.h>
+#include <thread>
#include "kudu/server/hybrid_clock.h"
#include "kudu/server/logical_clock.h"
@@ -25,6 +26,8 @@
#include "kudu/util/monotime.h"
#include "kudu/util/test_util.h"
+using std::thread;
+
namespace kudu {
namespace tablet {
@@ -396,8 +399,7 @@ TEST_F(MvccTest, TestAreAllTransactionsCommitted) {
TEST_F(MvccTest, TestWaitForCleanSnapshot_SnapWithNoInflights) {
MvccManager mgr(clock_.get());
- boost::thread waiting_thread = boost::thread(
- &MvccTest::WaitForSnapshotAtTSThread, this, &mgr, clock_->Now());
+ thread waiting_thread = thread(&MvccTest::WaitForSnapshotAtTSThread, this, &mgr, clock_->Now());
// join immediately.
waiting_thread.join();
@@ -411,8 +413,7 @@ TEST_F(MvccTest, TestWaitForCleanSnapshot_SnapWithInFlights) {
Timestamp tx1 = mgr.StartTransaction();
Timestamp tx2 = mgr.StartTransaction();
- boost::thread waiting_thread = boost::thread(
- &MvccTest::WaitForSnapshotAtTSThread, this, &mgr, clock_->Now());
+ thread waiting_thread = thread(&MvccTest::WaitForSnapshotAtTSThread, this, &mgr, clock_->Now());
ASSERT_FALSE(HasResultSnapshot());
mgr.StartApplyingTransaction(tx1);
@@ -436,8 +437,7 @@ TEST_F(MvccTest, TestWaitForApplyingTransactionsToCommit) {
mgr.StartApplyingTransaction(tx1);
- boost::thread waiting_thread = boost::thread(
- &MvccManager::WaitForApplyingTransactionsToCommit, &mgr);
+ thread waiting_thread = thread(&MvccManager::WaitForApplyingTransactionsToCommit, &mgr);
while (mgr.GetNumWaitersForTests() == 0) {
SleepFor(MonoDelta::FromMilliseconds(5));
}
@@ -463,8 +463,7 @@ TEST_F(MvccTest, TestWaitForCleanSnapshot_SnapAtTimestampWithInFlights) {
Timestamp tx3 = mgr.StartTransaction();
// Start a thread waiting for transactions with ts <= 2 to commit
- boost::thread waiting_thread = boost::thread(
- &MvccTest::WaitForSnapshotAtTSThread, this, &mgr, tx2);
+ thread waiting_thread = thread(&MvccTest::WaitForSnapshotAtTSThread, this, &mgr, tx2);
ASSERT_FALSE(HasResultSnapshot());
// Commit tx 1 - thread should still wait.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/tablet/tablet-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-test-base.h b/src/kudu/tablet/tablet-test-base.h
index d1172bb..78d2916 100644
--- a/src/kudu/tablet/tablet-test-base.h
+++ b/src/kudu/tablet/tablet-test-base.h
@@ -18,7 +18,6 @@
#define KUDU_TABLET_TABLET_TEST_BASE_H
#include <algorithm>
-#include <boost/thread/thread.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <limits>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/twitter-demo/ingest_firehose.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/ingest_firehose.cc b/src/kudu/twitter-demo/ingest_firehose.cc
index b13344c..686f9d3 100644
--- a/src/kudu/twitter-demo/ingest_firehose.cc
+++ b/src/kudu/twitter-demo/ingest_firehose.cc
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/thread/thread.hpp>
#include <curl/curl.h>
#include <fstream>
#include <gflags/gflags.h>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/twitter-demo/twitter_streamer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter_streamer.cc b/src/kudu/twitter-demo/twitter_streamer.cc
index 3d0c14b..d9bfcee 100644
--- a/src/kudu/twitter-demo/twitter_streamer.cc
+++ b/src/kudu/twitter-demo/twitter_streamer.cc
@@ -18,12 +18,12 @@
#include "kudu/twitter-demo/twitter_streamer.h"
#include <boost/thread/locks.hpp>
-#include <boost/thread/thread.hpp>
#include <curl/curl.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
-#include <string>
#include <string.h>
+#include <string>
+#include <thread>
#include "kudu/twitter-demo/oauth.h"
#include "kudu/gutil/macros.h"
@@ -111,7 +111,7 @@ Status TwitterStreamer::Init() {
Status TwitterStreamer::Start() {
CHECK(!thread_.joinable());
- thread_ = boost::thread(&TwitterStreamer::StreamThread, this);
+ thread_ = thread(&TwitterStreamer::StreamThread, this);
return Status::OK();
}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/twitter-demo/twitter_streamer.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter_streamer.h b/src/kudu/twitter-demo/twitter_streamer.h
index 7a1b3b5..6412fa5 100644
--- a/src/kudu/twitter-demo/twitter_streamer.h
+++ b/src/kudu/twitter-demo/twitter_streamer.h
@@ -18,12 +18,14 @@
#define KUDU_TWITTER_DEMO_TWITTER_STREAMER_H
#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
+#include <thread>
#include "kudu/util/faststring.h"
#include "kudu/util/slice.h"
#include "kudu/util/status.h"
+using std::thread;
+
namespace kudu {
namespace twitter_demo {
@@ -49,7 +51,7 @@ class TwitterStreamer {
Status DoStreaming();
size_t DataReceived(const Slice& data);
- boost::thread thread_;
+ thread thread_;
boost::mutex lock_;
Status stream_status_;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/util/blocking_queue-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/blocking_queue-test.cc b/src/kudu/util/blocking_queue-test.cc
index 876b451..cce21bf 100644
--- a/src/kudu/util/blocking_queue-test.cc
+++ b/src/kudu/util/blocking_queue-test.cc
@@ -15,11 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/thread/thread.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
+#include <map>
#include <memory>
#include <string>
+#include <thread>
#include <vector>
#include "kudu/util/countdown_latch.h"
@@ -27,20 +28,21 @@
using std::shared_ptr;
using std::string;
+using std::thread;
using std::vector;
namespace kudu {
BlockingQueue<int32_t> test1_queue(5);
-void InsertSomeThings(void) {
+void InsertSomeThings() {
ASSERT_EQ(test1_queue.Put(1), QUEUE_SUCCESS);
ASSERT_EQ(test1_queue.Put(2), QUEUE_SUCCESS);
ASSERT_EQ(test1_queue.Put(3), QUEUE_SUCCESS);
}
TEST(BlockingQueueTest, Test1) {
- boost::thread inserter_thread(InsertSomeThings);
+ thread inserter_thread(InsertSomeThings);
int32_t i;
ASSERT_TRUE(test1_queue.BlockingGet(&i));
ASSERT_EQ(1, i);
@@ -48,6 +50,7 @@ TEST(BlockingQueueTest, Test1) {
ASSERT_EQ(2, i);
ASSERT_TRUE(test1_queue.BlockingGet(&i));
ASSERT_EQ(3, i);
+ inserter_thread.join();
}
TEST(BlockingQueueTest, TestBlockingDrainTo) {
@@ -128,8 +131,6 @@ TEST(BlockingQueueTest, TestGscopedPtrMethods) {
class MultiThreadTest {
public:
- typedef vector<shared_ptr<boost::thread> > thread_vec_t;
-
MultiThreadTest()
: puts_(4),
blocking_puts_(4),
@@ -168,20 +169,14 @@ class MultiThreadTest {
void Run() {
for (int i = 0; i < nthreads_; i++) {
- threads_.push_back(shared_ptr<boost::thread>(
- new boost::thread(boost::bind(
- &MultiThreadTest::InserterThread, this, i))));
- threads_.push_back(shared_ptr<boost::thread>(
- new boost::thread(boost::bind(
- &MultiThreadTest::RemoverThread, this))));
+ threads_.emplace_back(&MultiThreadTest::InserterThread, this, i);
+ threads_.emplace_back(&MultiThreadTest::RemoverThread, this);
}
// We add an extra thread to ensure that there aren't enough elements in
// the queue to go around. This way, we test removal after Shutdown.
- threads_.push_back(shared_ptr<boost::thread>(
- new boost::thread(boost::bind(
- &MultiThreadTest::RemoverThread, this))));
- for (const auto& thread : threads_) {
- thread->join();
+ threads_.emplace_back(&MultiThreadTest::RemoverThread, this);
+ for (auto& thread : threads_) {
+ thread.join();
}
// Let's check to make sure we got what we should have.
MutexLock guard(lock_);
@@ -201,7 +196,7 @@ class MultiThreadTest {
BlockingQueue<int32_t> queue_;
Mutex lock_;
std::map<int32_t, int> gotten_;
- thread_vec_t threads_;
+ vector<thread> threads_;
int num_inserters_;
CountDownLatch sync_latch_;
};
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/util/memory/arena-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/arena-test.cc b/src/kudu/util/memory/arena-test.cc
index a14e1f2..c39b73a 100644
--- a/src/kudu/util/memory/arena-test.cc
+++ b/src/kudu/util/memory/arena-test.cc
@@ -15,12 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/thread/thread.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <memory>
+#include <thread>
#include <vector>
#include "kudu/gutil/stringprintf.h"
@@ -35,6 +34,8 @@ DEFINE_int32(alloc_size, 4, "number of bytes in each allocation");
namespace kudu {
using std::shared_ptr;
+using std::thread;
+using std::vector;
template<class ArenaType>
static void AllocateThread(ArenaType *arena, uint8_t thread_index) {
@@ -58,8 +59,7 @@ static void AllocateThread(ArenaType *arena, uint8_t thread_index) {
}
}
-// Non-templated function to forward to above -- simplifies
-// boost::thread creation
+// Non-templated function to forward to above -- simplifies thread creation
static void AllocateThreadTSArena(ThreadSafeArena *arena, uint8_t thread_index) {
AllocateThread(arena, thread_index);
}
@@ -78,12 +78,12 @@ TEST(TestArena, TestMultiThreaded) {
ThreadSafeArena arena(1024, 1024);
- boost::ptr_vector<boost::thread> threads;
+ vector<thread> threads;
for (uint8_t i = 0; i < FLAGS_num_threads; i++) {
- threads.push_back(new boost::thread(AllocateThreadTSArena, &arena, (uint8_t)i));
+ threads.emplace_back(AllocateThreadTSArena, &arena, (uint8_t)i);
}
- for (boost::thread &thr : threads) {
+ for (thread& thr : threads) {
thr.join();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/util/rw_semaphore-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rw_semaphore-test.cc b/src/kudu/util/rw_semaphore-test.cc
index 16a08e3..19324e9 100644
--- a/src/kudu/util/rw_semaphore-test.cc
+++ b/src/kudu/util/rw_semaphore-test.cc
@@ -15,15 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-#include <gtest/gtest.h>
-#include <boost/thread/thread.hpp>
#include <boost/thread/locks.hpp>
+#include <gtest/gtest.h>
+#include <thread>
#include <vector>
#include "kudu/util/monotime.h"
#include "kudu/util/rw_semaphore.h"
-using boost::thread;
+using std::thread;
using std::vector;
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5bec538a/src/kudu/util/rwc_lock-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rwc_lock-test.cc b/src/kudu/util/rwc_lock-test.cc
index af825d8..e3959c0 100644
--- a/src/kudu/util/rwc_lock-test.cc
+++ b/src/kudu/util/rwc_lock-test.cc
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/thread/thread.hpp>
+#include <boost/thread/locks.hpp>
#include <string>
+#include <thread>
#include <vector>
#include "kudu/gutil/atomicops.h"
@@ -29,6 +30,7 @@ namespace kudu {
using base::subtle::NoBarrier_Load;
using base::subtle::Release_Store;
using std::string;
+using std::thread;
using std::vector;
class RWCLockTest : public KuduTest {};
@@ -113,16 +115,16 @@ TEST_F(RWCLockTest, TestCorrectBehavior) {
SharedState state;
Release_Store(&state.stop, 0);
- vector<boost::thread*> threads;
+ vector<thread> threads;
const int kNumWriters = 5;
const int kNumReaders = 5;
for (int i = 0; i < kNumWriters; i++) {
- threads.push_back(new boost::thread(WriterThread, &state));
+ threads.emplace_back(WriterThread, &state);
}
for (int i = 0; i < kNumReaders; i++) {
- threads.push_back(new boost::thread(ReaderThread, &state));
+ threads.emplace_back(ReaderThread, &state);
}
if (AllowSlowTests()) {
@@ -133,11 +135,9 @@ TEST_F(RWCLockTest, TestCorrectBehavior) {
Release_Store(&state.stop, 1);
- for (boost::thread* t : threads) {
- t->join();
- delete t;
+ for (thread& t : threads) {
+ t.join();
}
-
}
} // namespace kudu