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/01/13 18:18:17 UTC
[2/9] incubator-kudu git commit: Enable C++11
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/remote_bootstrap_client.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_client.h b/src/kudu/tserver/remote_bootstrap_client.h
index c5253ad..83a0c8a 100644
--- a/src/kudu/tserver/remote_bootstrap_client.h
+++ b/src/kudu/tserver/remote_bootstrap_client.h
@@ -18,7 +18,7 @@
#define KUDU_TSERVER_REMOTE_BOOTSTRAP_CLIENT_H
#include <string>
-#include <tr1/memory>
+#include <memory>
#include <vector>
#include <gtest/gtest_prod.h>
@@ -74,7 +74,7 @@ class RemoteBootstrapClient {
// 'client_permanent_uuid' is the permanent UUID of the caller server.
RemoteBootstrapClient(const std::string& tablet_id,
FsManager* fs_manager,
- const std::tr1::shared_ptr<rpc::Messenger>& messenger,
+ const std::shared_ptr<rpc::Messenger>& messenger,
const std::string& client_permanent_uuid);
// Attempt to clean up resources on the remote end by sending an
@@ -180,7 +180,7 @@ class RemoteBootstrapClient {
// Set-once members.
const std::string tablet_id_;
FsManager* const fs_manager_;
- const std::tr1::shared_ptr<rpc::Messenger> messenger_;
+ const std::shared_ptr<rpc::Messenger> messenger_;
const std::string permanent_uuid_;
// State flags that enforce the progress of remote bootstrap.
@@ -199,7 +199,7 @@ class RemoteBootstrapClient {
gscoped_ptr<consensus::ConsensusMetadata> cmeta_;
tablet::TabletStatusListener* status_listener_;
- std::tr1::shared_ptr<RemoteBootstrapServiceProxy> proxy_;
+ std::shared_ptr<RemoteBootstrapServiceProxy> proxy_;
std::string session_id_;
uint64_t session_idle_timeout_millis_;
gscoped_ptr<tablet::TabletSuperBlockPB> superblock_;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/remote_bootstrap_service.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_service.h b/src/kudu/tserver/remote_bootstrap_service.h
index ee8928e..897b221 100644
--- a/src/kudu/tserver/remote_bootstrap_service.h
+++ b/src/kudu/tserver/remote_bootstrap_service.h
@@ -17,8 +17,8 @@
#ifndef KUDU_TSERVER_REMOTE_BOOTSTRAP_SERVICE_H_
#define KUDU_TSERVER_REMOTE_BOOTSTRAP_SERVICE_H_
-#include <tr1/unordered_map>
#include <string>
+#include <unordered_map>
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/ref_counted.h"
@@ -67,8 +67,8 @@ class RemoteBootstrapServiceImpl : public RemoteBootstrapServiceIf {
virtual void Shutdown() OVERRIDE;
private:
- typedef std::tr1::unordered_map<std::string, scoped_refptr<RemoteBootstrapSession> > SessionMap;
- typedef std::tr1::unordered_map<std::string, MonoTime> MonoTimeMap;
+ typedef std::unordered_map<std::string, scoped_refptr<RemoteBootstrapSession> > SessionMap;
+ typedef std::unordered_map<std::string, MonoTime> MonoTimeMap;
// Look up session in session map.
Status FindSessionUnlocked(const std::string& session_id,
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/remote_bootstrap_session-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session-test.cc b/src/kudu/tserver/remote_bootstrap_session-test.cc
index 750f7d5..4852020 100644
--- a/src/kudu/tserver/remote_bootstrap_session-test.cc
+++ b/src/kudu/tserver/remote_bootstrap_session-test.cc
@@ -16,11 +16,10 @@
// under the License.
#include "kudu/tablet/tablet-test-util.h"
-#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
-#include <tr1/memory>
+#include <memory>
#include "kudu/common/partial_row.h"
#include "kudu/common/row_operations.h"
@@ -44,8 +43,8 @@
METRIC_DECLARE_entity(tablet);
+using std::shared_ptr;
using std::string;
-using std::tr1::shared_ptr;
namespace kudu {
namespace tserver {
@@ -72,10 +71,8 @@ using tablet::WriteTransactionState;
class RemoteBootstrapTest : public KuduTabletTest {
public:
RemoteBootstrapTest()
- : KuduTabletTest(Schema(boost::assign::list_of
- (ColumnSchema("key", STRING))
- (ColumnSchema("val", INT32)),
- 1)) {
+ : KuduTabletTest(Schema({ ColumnSchema("key", STRING),
+ ColumnSchema("val", INT32) }, 1)) {
CHECK_OK(ThreadPoolBuilder("test-exec").Build(&apply_pool_));
}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/remote_bootstrap_session.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.cc b/src/kudu/tserver/remote_bootstrap_session.cc
index 113c92c..7a80f93 100644
--- a/src/kudu/tserver/remote_bootstrap_session.cc
+++ b/src/kudu/tserver/remote_bootstrap_session.cc
@@ -33,19 +33,19 @@
namespace kudu {
namespace tserver {
-using consensus::OpId;
using consensus::MinimumOpId;
+using consensus::OpId;
using fs::ReadableBlock;
using log::LogAnchorRegistry;
using log::ReadableLogSegment;
-using tablet::DeltaDataPB;
+using std::shared_ptr;
+using strings::Substitute;
using tablet::ColumnDataPB;
+using tablet::DeltaDataPB;
using tablet::RowSetDataPB;
using tablet::TabletMetadata;
-using tablet::TabletSuperBlockPB;
-using std::tr1::shared_ptr;
-using strings::Substitute;
using tablet::TabletPeer;
+using tablet::TabletSuperBlockPB;
RemoteBootstrapSession::RemoteBootstrapSession(const scoped_refptr<TabletPeer>& tablet_peer,
const std::string& session_id,
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/remote_bootstrap_session.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/remote_bootstrap_session.h b/src/kudu/tserver/remote_bootstrap_session.h
index 7d59e0a..78aa2b6 100644
--- a/src/kudu/tserver/remote_bootstrap_session.h
+++ b/src/kudu/tserver/remote_bootstrap_session.h
@@ -17,9 +17,9 @@
#ifndef KUDU_TSERVER_REMOTE_BOOTSTRAP_SESSION_H_
#define KUDU_TSERVER_REMOTE_BOOTSTRAP_SESSION_H_
+#include <memory>
#include <string>
-#include <tr1/memory>
-#include <tr1/unordered_map>
+#include <unordered_map>
#include <vector>
#include "kudu/consensus/log_anchor_registry.h"
@@ -51,10 +51,10 @@ class TabletPeerLookupIf;
// Caches file size and holds a shared_ptr reference to a RandomAccessFile.
// Assumes that the file underlying the RandomAccessFile is immutable.
struct ImmutableRandomAccessFileInfo {
- std::tr1::shared_ptr<RandomAccessFile> readable;
+ std::shared_ptr<RandomAccessFile> readable;
int64_t size;
- ImmutableRandomAccessFileInfo(const std::tr1::shared_ptr<RandomAccessFile>& readable,
+ ImmutableRandomAccessFileInfo(const std::shared_ptr<RandomAccessFile>& readable,
int64_t size)
: readable(readable),
size(size) {
@@ -138,9 +138,8 @@ class RemoteBootstrapSession : public RefCountedThreadSafe<RemoteBootstrapSessio
private:
friend class RefCountedThreadSafe<RemoteBootstrapSession>;
- typedef std::tr1::unordered_map<BlockId, ImmutableReadableBlockInfo*,
- BlockIdHash> BlockMap;
- typedef std::tr1::unordered_map<uint64_t, ImmutableRandomAccessFileInfo*> LogMap;
+ typedef std::unordered_map<BlockId, ImmutableReadableBlockInfo*, BlockIdHash> BlockMap;
+ typedef std::unordered_map<uint64_t, ImmutableRandomAccessFileInfo*> LogMap;
~RemoteBootstrapSession();
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index fffcea8..684e8ac 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -19,7 +19,6 @@
#include <boost/bind.hpp>
#include <boost/thread/locks.hpp>
#include <gflags/gflags.h>
-#include <tr1/memory>
#include "kudu/common/iterator.h"
#include "kudu/common/scan_spec.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/scanners.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.h b/src/kudu/tserver/scanners.h
index 35c2dc3..6db1125 100644
--- a/src/kudu/tserver/scanners.h
+++ b/src/kudu/tserver/scanners.h
@@ -17,14 +17,13 @@
#ifndef KUDU_TSERVER_SCANNERS_H
#define KUDU_TSERVER_SCANNERS_H
+#include <boost/thread/shared_mutex.hpp>
+#include <memory>
#include <string>
-#include <tr1/memory>
-#include <tr1/unordered_map>
+#include <unordered_map>
#include <utility>
#include <vector>
-#include <boost/thread/shared_mutex.hpp>
-
#include "kudu/common/iterator_stats.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/macros.h"
@@ -51,7 +50,7 @@ namespace tserver {
class Scanner;
struct ScannerMetrics;
-typedef std::tr1::shared_ptr<Scanner> SharedScanner;
+typedef std::shared_ptr<Scanner> SharedScanner;
// Manages the live scanners within a Tablet Server.
//
@@ -102,7 +101,7 @@ class ScannerManager {
kNumScannerMapStripes = 32
};
- typedef std::tr1::unordered_map<std::string, SharedScanner> ScannerMap;
+ typedef std::unordered_map<std::string, SharedScanner> ScannerMap;
typedef std::pair<std::string, SharedScanner> ScannerMapEntry;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_peer_lookup.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_peer_lookup.h b/src/kudu/tserver/tablet_peer_lookup.h
index 08d397a..ceb087c 100644
--- a/src/kudu/tserver/tablet_peer_lookup.h
+++ b/src/kudu/tserver/tablet_peer_lookup.h
@@ -17,8 +17,8 @@
#ifndef KUDU_TSERVER_TABLET_PEER_LOOKUP_H_
#define KUDU_TSERVER_TABLET_PEER_LOOKUP_H_
+#include <memory>
#include <string>
-#include <tr1/memory>
#include "kudu/gutil/ref_counted.h"
#include "kudu/util/status.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server-test-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test-base.h b/src/kudu/tserver/tablet_server-test-base.h
index a22f38d..b3e3394 100644
--- a/src/kudu/tserver/tablet_server-test-base.h
+++ b/src/kudu/tserver/tablet_server-test-base.h
@@ -18,21 +18,19 @@
#ifndef KUDU_TSERVER_TABLET_SERVER_TEST_BASE_H_
#define KUDU_TSERVER_TABLET_SERVER_TEST_BASE_H_
-#include <boost/assign/list_of.hpp>
-#include <boost/foreach.hpp>
-#include <gtest/gtest.h>
-
#include <algorithm>
-#include <tr1/memory>
-#include <vector>
-#include <string>
#include <assert.h>
+#include <boost/foreach.hpp>
+#include <gtest/gtest.h>
+#include <iostream>
+#include <memory>
+#include <signal.h>
#include <stdint.h>
+#include <string>
#include <sys/mman.h>
-#include <iostream>
#include <sys/types.h>
-#include <signal.h>
#include <utility>
+#include <vector>
#include "kudu/common/wire_protocol-test-util.h"
#include "kudu/consensus/consensus.proxy.h"
@@ -453,7 +451,7 @@ class TabletServerTestBase : public KuduTest {
Schema key_schema_;
gscoped_ptr<RowBuilder> rb_;
- std::tr1::shared_ptr<rpc::Messenger> client_messenger_;
+ std::shared_ptr<rpc::Messenger> client_messenger_;
gscoped_ptr<MiniTabletServer> mini_server_;
scoped_refptr<tablet::TabletPeer> tablet_peer_;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc
index ddbb855..b582b63 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -27,8 +27,6 @@
#include "kudu/util/curl_util.h"
#include "kudu/util/url-coding.h"
-using std::string;
-using std::tr1::shared_ptr;
using kudu::consensus::RaftConfigPB;
using kudu::consensus::RaftPeerPB;
using kudu::rpc::Messenger;
@@ -38,6 +36,8 @@ using kudu::server::Clock;
using kudu::server::HybridClock;
using kudu::tablet::Tablet;
using kudu::tablet::TabletPeer;
+using std::shared_ptr;
+using std::string;
using strings::Substitute;
DEFINE_int32(single_threaded_insert_latency_bench_warmup_rows, 100,
@@ -325,9 +325,7 @@ TEST_F(TabletServerTest, TestInsert) {
rows_inserted = NULL;
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 1))
- (KeyValue(2, 1))
- (KeyValue(1234, 5678)));
+ VerifyRows(schema_, { KeyValue(1, 1), KeyValue(2, 1), KeyValue(1234, 5678) });
// get the clock's timestamp after replay
Timestamp now_after = mini_server_->server()->clock()->Now();
@@ -572,8 +570,7 @@ TEST_F(TabletServerTest, TestInsertAndMutate) {
ASSERT_EQ(3, rows_updated->value());
// At this point, we have two rows left (row key 2 and 3).
- VerifyRows(schema_, boost::assign::list_of(KeyValue(2, 3))
- (KeyValue(3, 4)));
+ VerifyRows(schema_, { KeyValue(2, 3), KeyValue(3, 4) });
// Do a mixed operation (some insert, update, and delete, some of which fail)
{
@@ -610,10 +607,7 @@ TEST_F(TabletServerTest, TestInsertAndMutate) {
rows_inserted = NULL;
rows_updated = NULL;
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(2, 3))
- (KeyValue(3, 4))
- (KeyValue(4, 4))
- (KeyValue(6, 6)));
+ VerifyRows(schema_, { KeyValue(2, 3), KeyValue(3, 4), KeyValue(4, 4), KeyValue(6, 6) });
// get the clock's timestamp after replay
Timestamp now_after = mini_server_->server()->clock()->Now();
@@ -753,26 +747,26 @@ TEST_F(TabletServerTest, TestRecoveryWithMutationsWhileFlushing) {
// produced on recovery (recovery flushed no state, but produced a new
// log).
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 10))
- (KeyValue(2, 20))
- (KeyValue(3, 30))
- (KeyValue(4, 40))
- (KeyValue(5, 50))
- (KeyValue(6, 60))
- // the last hook only fires on compaction
- // so this isn't mutated
- (KeyValue(7, 7)));
+ VerifyRows(schema_, { KeyValue(1, 10),
+ KeyValue(2, 20),
+ KeyValue(3, 30),
+ KeyValue(4, 40),
+ KeyValue(5, 50),
+ KeyValue(6, 60),
+ // the last hook only fires on compaction
+ // so this isn't mutated
+ KeyValue(7, 7) });
// Shutdown and rebuild again to test that the log generated during
// the previous recovery allows to perform recovery again.
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 10))
- (KeyValue(2, 20))
- (KeyValue(3, 30))
- (KeyValue(4, 40))
- (KeyValue(5, 50))
- (KeyValue(6, 60))
- (KeyValue(7, 7)));
+ VerifyRows(schema_, { KeyValue(1, 10),
+ KeyValue(2, 20),
+ KeyValue(3, 30),
+ KeyValue(4, 40),
+ KeyValue(5, 50),
+ KeyValue(6, 60),
+ KeyValue(7, 7) });
}
// Tests performing mutations that are going to a DMS or to the following
@@ -791,13 +785,13 @@ TEST_F(TabletServerTest, TestRecoveryWithMutationsWhileFlushingAndCompacting) {
ASSERT_OK(tablet_peer_->tablet()->Flush());
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 10))
- (KeyValue(2, 20))
- (KeyValue(3, 30))
- (KeyValue(4, 40))
- (KeyValue(5, 50))
- (KeyValue(6, 60))
- (KeyValue(7, 7)));
+ VerifyRows(schema_, { KeyValue(1, 10),
+ KeyValue(2, 20),
+ KeyValue(3, 30),
+ KeyValue(4, 40),
+ KeyValue(5, 50),
+ KeyValue(6, 60),
+ KeyValue(7, 7) });
hooks->increment_iteration();
// set the hooks on the new tablet
@@ -812,14 +806,14 @@ TEST_F(TabletServerTest, TestRecoveryWithMutationsWhileFlushingAndCompacting) {
// them making sure that mutations executed mid compaction are replayed as
// expected
ASSERT_OK(tablet_peer_->tablet()->Flush());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 11))
- (KeyValue(2, 21))
- (KeyValue(3, 31))
- (KeyValue(4, 41))
- (KeyValue(5, 51))
- (KeyValue(6, 61))
- (KeyValue(7, 7))
- (KeyValue(8, 8)));
+ VerifyRows(schema_, { KeyValue(1, 11),
+ KeyValue(2, 21),
+ KeyValue(3, 31),
+ KeyValue(4, 41),
+ KeyValue(5, 51),
+ KeyValue(6, 61),
+ KeyValue(7, 7),
+ KeyValue(8, 8) });
hooks->increment_iteration();
ASSERT_OK(tablet_peer_->tablet()->Compact(Tablet::FORCE_COMPACT_ALL));
@@ -831,14 +825,14 @@ TEST_F(TabletServerTest, TestRecoveryWithMutationsWhileFlushingAndCompacting) {
// produced on recovery (recovery flushed no state, but produced a new
// log).
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 11))
- (KeyValue(2, 22))
- (KeyValue(3, 32))
- (KeyValue(4, 42))
- (KeyValue(5, 52))
- (KeyValue(6, 62))
- (KeyValue(7, 72))
- (KeyValue(8, 8)));
+ VerifyRows(schema_, { KeyValue(1, 11),
+ KeyValue(2, 22),
+ KeyValue(3, 32),
+ KeyValue(4, 42),
+ KeyValue(5, 52),
+ KeyValue(6, 62),
+ KeyValue(7, 72),
+ KeyValue(8, 8) });
// get the clock's timestamp after replay
Timestamp now_after = mini_server_->server()->clock()->Now();
@@ -856,29 +850,28 @@ TEST_F(TabletServerTest, TestKUDU_176_RecoveryAfterMajorDeltaCompaction) {
// Flush a DRS with 1 rows.
ASSERT_NO_FATAL_FAILURE(InsertTestRowsRemote(0, 1, 1));
ASSERT_OK(tablet_peer_->tablet()->Flush());
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 1))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 1) }));
// Update it, flush deltas.
ANFF(UpdateTestRowRemote(0, 1, 2));
ASSERT_OK(tablet_peer_->tablet()->FlushBiggestDMS());
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 2))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 2) }));
// Major compact deltas.
{
vector<shared_ptr<tablet::RowSet> > rsets;
tablet_peer_->tablet()->GetRowSetsForTests(&rsets);
- vector<ColumnId> col_ids = boost::assign::list_of
- (tablet_peer_->tablet()->schema()->column_id(1))
- (tablet_peer_->tablet()->schema()->column_id(2));
+ vector<ColumnId> col_ids = { tablet_peer_->tablet()->schema()->column_id(1),
+ tablet_peer_->tablet()->schema()->column_id(2) };
ASSERT_OK(tablet_peer_->tablet()->DoMajorDeltaCompaction(col_ids, rsets[0]))
}
// Verify that data is still the same.
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 2))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 2) }));
// Verify that data remains after a restart.
ASSERT_OK(ShutdownAndRebuildTablet());
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 2))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 2) }));
}
// Regression test for KUDU-177. Ensures that after a major delta compaction,
@@ -887,7 +880,7 @@ TEST_F(TabletServerTest, TestKUDU_177_RecoveryOfDMSEditsAfterMajorDeltaCompactio
// Flush a DRS with 1 rows.
ANFF(InsertTestRowsRemote(0, 1, 1));
ASSERT_OK(tablet_peer_->tablet()->Flush());
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 1))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 1) }));
// Update it, flush deltas.
ANFF(UpdateTestRowRemote(0, 1, 2));
@@ -895,24 +888,23 @@ TEST_F(TabletServerTest, TestKUDU_177_RecoveryOfDMSEditsAfterMajorDeltaCompactio
// Update it again, so this last update is in the DMS.
ANFF(UpdateTestRowRemote(0, 1, 3));
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 3))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 3) }));
// Major compact deltas. This doesn't include the DMS, but the old
// DMS should "move over" to the output of the delta compaction.
{
vector<shared_ptr<tablet::RowSet> > rsets;
tablet_peer_->tablet()->GetRowSetsForTests(&rsets);
- vector<ColumnId> col_ids = boost::assign::list_of
- (tablet_peer_->tablet()->schema()->column_id(1))
- (tablet_peer_->tablet()->schema()->column_id(2));
+ vector<ColumnId> col_ids = { tablet_peer_->tablet()->schema()->column_id(1),
+ tablet_peer_->tablet()->schema()->column_id(2) };
ASSERT_OK(tablet_peer_->tablet()->DoMajorDeltaCompaction(col_ids, rsets[0]));
}
// Verify that data is still the same.
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 3))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 3) }));
// Verify that the update remains after a restart.
ASSERT_OK(ShutdownAndRebuildTablet());
- ANFF(VerifyRows(schema_, boost::assign::list_of(KeyValue(1, 3))));
+ ANFF(VerifyRows(schema_, { KeyValue(1, 3) }));
}
TEST_F(TabletServerTest, TestClientGetsErrorBackWhenRecoveryFailed) {
@@ -1518,9 +1510,7 @@ TEST_F(TabletServerTest, TestInvalidScanRequest_NewScanAndScannerID) {
// Test that passing a projection with fields not present in the tablet schema
// throws an exception.
TEST_F(TabletServerTest, TestInvalidScanRequest_BadProjection) {
- const Schema projection(boost::assign::list_of
- (ColumnSchema("col_doesnt_exist", INT32)),
- 0);
+ const Schema projection({ ColumnSchema("col_doesnt_exist", INT32) }, 0);
VerifyScanRequestFailure(projection,
TabletServerErrorPB::MISMATCHED_SCHEMA,
"Some columns are not present in the current schema: col_doesnt_exist");
@@ -1532,9 +1522,8 @@ TEST_F(TabletServerTest, TestInvalidScanRequest_BadProjectionTypes) {
// Verify mismatched nullability for the not-null int field
ASSERT_OK(
- projection.Reset(boost::assign::list_of
- (ColumnSchema("int_val", INT32, true)), // should be NOT NULL
- 0));
+ projection.Reset({ ColumnSchema("int_val", INT32, true) }, // should be NOT NULL
+ 0));
VerifyScanRequestFailure(projection,
TabletServerErrorPB::MISMATCHED_SCHEMA,
"The column 'int_val' must have type int32 NOT "
@@ -1542,9 +1531,8 @@ TEST_F(TabletServerTest, TestInvalidScanRequest_BadProjectionTypes) {
// Verify mismatched nullability for the nullable string field
ASSERT_OK(
- projection.Reset(boost::assign::list_of
- (ColumnSchema("string_val", STRING, false)), // should be NULLABLE
- 0));
+ projection.Reset({ ColumnSchema("string_val", STRING, false) }, // should be NULLABLE
+ 0));
VerifyScanRequestFailure(projection,
TabletServerErrorPB::MISMATCHED_SCHEMA,
"The column 'string_val' must have type string "
@@ -1552,19 +1540,17 @@ TEST_F(TabletServerTest, TestInvalidScanRequest_BadProjectionTypes) {
// Verify mismatched type for the not-null int field
ASSERT_OK(
- projection.Reset(boost::assign::list_of
- (ColumnSchema("int_val", INT16, false)), // should be INT32 NOT NULL
- 0));
+ projection.Reset({ ColumnSchema("int_val", INT16, false) }, // should be INT32 NOT NULL
+ 0));
VerifyScanRequestFailure(projection,
TabletServerErrorPB::MISMATCHED_SCHEMA,
"The column 'int_val' must have type int32 NOT "
"NULL found int16 NOT NULL");
// Verify mismatched type for the nullable string field
- ASSERT_OK(
- projection.Reset(boost::assign::list_of
- (ColumnSchema("string_val", INT32, true)), // should be STRING NULLABLE
- 0));
+ ASSERT_OK(projection.Reset(
+ { ColumnSchema("string_val", INT32, true) }, // should be STRING NULLABLE
+ 0));
VerifyScanRequestFailure(projection,
TabletServerErrorPB::MISMATCHED_SCHEMA,
"The column 'string_val' must have type string "
@@ -1758,24 +1744,21 @@ TEST_F(TabletServerTest, TestAlterSchema) {
ASSERT_OK(tablet->tablet()->Flush());
}
- const Schema projection(boost::assign::list_of
- (ColumnSchema("key", INT32))
- (ColumnSchema("c2", INT32)),
- 1);
+ const Schema projection({ ColumnSchema("key", INT32), (ColumnSchema("c2", INT32)) }, 1);
// Try recovering from the original log
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(projection, boost::assign::list_of(KeyValue(0, 7))
- (KeyValue(1, 7))
- (KeyValue(2, 5))
- (KeyValue(3, 5)));
+ VerifyRows(projection, { KeyValue(0, 7),
+ KeyValue(1, 7),
+ KeyValue(2, 5),
+ KeyValue(3, 5) });
// Try recovering from the log generated on recovery
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(projection, boost::assign::list_of(KeyValue(0, 7))
- (KeyValue(1, 7))
- (KeyValue(2, 5))
- (KeyValue(3, 5)));
+ VerifyRows(projection, { KeyValue(0, 7),
+ KeyValue(1, 7),
+ KeyValue(2, 5),
+ KeyValue(3, 5) });
}
// Adds a new column with no "write default", and then restarts the tablet
@@ -1811,22 +1794,16 @@ TEST_F(TabletServerTest, TestAlterSchema_AddColWithoutWriteDefault) {
// Verify that the old data picked up the read default.
- const Schema projection(boost::assign::list_of
- (ColumnSchema("key", INT32))
- (ColumnSchema("c2", INT32)),
- 1);
- VerifyRows(projection, boost::assign::list_of(KeyValue(0, 7))
- (KeyValue(1, 7)));
+ const Schema projection({ ColumnSchema("key", INT32), ColumnSchema("c2", INT32) }, 1);
+ VerifyRows(projection, { KeyValue(0, 7), KeyValue(1, 7) });
// Try recovering from the original log
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(projection, boost::assign::list_of(KeyValue(0, 7))
- (KeyValue(1, 7)));
+ VerifyRows(projection, { KeyValue(0, 7), KeyValue(1, 7) });
// Try recovering from the log generated on recovery
ASSERT_NO_FATAL_FAILURE(ShutdownAndRebuildTablet());
- VerifyRows(projection, boost::assign::list_of(KeyValue(0, 7))
- (KeyValue(1, 7)));
+ VerifyRows(projection, { KeyValue(0, 7), KeyValue(1, 7) });
}
TEST_F(TabletServerTest, TestCreateTablet_TabletExists) {
@@ -2061,8 +2038,7 @@ TEST_F(TabletServerTest, TestWriteOutOfBounds) {
ASSERT_OK(end_row.SetInt32("key", 20));
vector<Partition> partitions;
- ASSERT_OK(partition_schema.CreatePartitions(boost::assign::list_of(start_row)(end_row),
- schema, &partitions));
+ ASSERT_OK(partition_schema.CreatePartitions({ start_row, end_row }, schema, &partitions));
ASSERT_EQ(3, partitions.size());
@@ -2080,8 +2056,7 @@ TEST_F(TabletServerTest, TestWriteOutOfBounds) {
req.set_tablet_id(tabletId);
ASSERT_OK(SchemaToPB(schema_, req.mutable_schema()));
- vector<RowOperationsPB::Type> ops =
- boost::assign::list_of(RowOperationsPB::INSERT)(RowOperationsPB::UPDATE);
+ vector<RowOperationsPB::Type> ops = { RowOperationsPB::INSERT, RowOperationsPB::UPDATE };
BOOST_FOREACH(const RowOperationsPB::Type &op, ops) {
RowOperationsPB* data = req.mutable_row_operations();
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server.cc b/src/kudu/tserver/tablet_server.cc
index a38e3fe..d30ed1d 100644
--- a/src/kudu/tserver/tablet_server.cc
+++ b/src/kudu/tserver/tablet_server.cc
@@ -39,10 +39,10 @@
#include "kudu/util/net/sockaddr.h"
#include "kudu/util/status.h"
-using std::tr1::shared_ptr;
-using std::vector;
using kudu::rpc::ServiceIf;
using kudu::tablet::TabletPeer;
+using std::shared_ptr;
+using std::vector;
namespace kudu {
namespace tserver {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server.h b/src/kudu/tserver/tablet_server.h
index 17dd2a1..b8f3b77 100644
--- a/src/kudu/tserver/tablet_server.h
+++ b/src/kudu/tserver/tablet_server.h
@@ -17,16 +17,16 @@
#ifndef KUDU_TSERVER_TABLET_SERVER_H
#define KUDU_TSERVER_TABLET_SERVER_H
+#include <memory>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/consensus/metadata.pb.h"
#include "kudu/gutil/atomicops.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/macros.h"
-#include "kudu/server/webserver_options.h"
#include "kudu/server/server_base.h"
+#include "kudu/server/webserver_options.h"
#include "kudu/tserver/tablet_server_options.h"
#include "kudu/tserver/tserver.pb.h"
#include "kudu/util/net/net_util.h"
@@ -115,7 +115,7 @@ class TabletServer : public server::ServerBase {
gscoped_ptr<TabletServerPathHandlers> path_handlers_;
// The maintenance manager for this tablet server
- std::tr1::shared_ptr<MaintenanceManager> maintenance_manager_;
+ std::shared_ptr<MaintenanceManager> maintenance_manager_;
DISALLOW_COPY_AND_ASSIGN(TabletServer);
};
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server_test_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server_test_util.cc b/src/kudu/tserver/tablet_server_test_util.cc
index 99ae6f1..5caf507 100644
--- a/src/kudu/tserver/tablet_server_test_util.cc
+++ b/src/kudu/tserver/tablet_server_test_util.cc
@@ -28,7 +28,7 @@ namespace tserver {
using consensus::ConsensusServiceProxy;
using rpc::Messenger;
-using std::tr1::shared_ptr;
+using std::shared_ptr;
void CreateTsClientProxies(const Sockaddr& addr,
const shared_ptr<Messenger>& messenger,
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_server_test_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server_test_util.h b/src/kudu/tserver/tablet_server_test_util.h
index cd20ca9..b6cefa2 100644
--- a/src/kudu/tserver/tablet_server_test_util.h
+++ b/src/kudu/tserver/tablet_server_test_util.h
@@ -17,7 +17,8 @@
#ifndef KUDU_TSERVER_TABLET_SERVER_TEST_UTIL_H_
#define KUDU_TSERVER_TABLET_SERVER_TEST_UTIL_H_
-#include <tr1/memory>
+#include <memory>
+
#include "kudu/gutil/gscoped_ptr.h"
namespace kudu {
@@ -41,7 +42,7 @@ class TabletServerServiceProxy;
// Create tablet server client proxies for tests.
void CreateTsClientProxies(const Sockaddr& addr,
- const std::tr1::shared_ptr<rpc::Messenger>& messenger,
+ const std::shared_ptr<rpc::Messenger>& messenger,
gscoped_ptr<TabletServerServiceProxy>* proxy,
gscoped_ptr<TabletServerAdminServiceProxy>* admin_proxy,
gscoped_ptr<consensus::ConsensusServiceProxy>* consensus_proxy,
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index bbc9887..5241d2b 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -19,8 +19,8 @@
#include <algorithm>
#include <boost/optional.hpp>
+#include <memory>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/common/iterator.h"
@@ -106,7 +106,7 @@ using consensus::VoteResponsePB;
using google::protobuf::RepeatedPtrField;
using rpc::RpcContext;
-using std::tr1::shared_ptr;
+using std::shared_ptr;
using std::vector;
using strings::Substitute;
using tablet::AlterSchemaTransactionState;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tablet_service.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.h b/src/kudu/tserver/tablet_service.h
index 92ee444..8f5846e 100644
--- a/src/kudu/tserver/tablet_service.h
+++ b/src/kudu/tserver/tablet_service.h
@@ -17,14 +17,14 @@
#ifndef KUDU_TSERVER_TABLET_SERVICE_H
#define KUDU_TSERVER_TABLET_SERVICE_H
+#include <memory>
#include <string>
-#include <tr1/memory>
#include <vector>
+#include "kudu/consensus/consensus.service.h"
#include "kudu/gutil/ref_counted.h"
-#include "kudu/tserver/tserver_service.service.h"
#include "kudu/tserver/tserver_admin.service.h"
-#include "kudu/consensus/consensus.service.h"
+#include "kudu/tserver/tserver_service.service.h"
namespace kudu {
class RowwiseIterator;
@@ -91,7 +91,7 @@ class TabletServiceImpl : public TabletServerServiceIf {
Status HandleScanAtSnapshot(const NewScanRequestPB& scan_pb,
const rpc::RpcContext* rpc_context,
const Schema& projection,
- const std::tr1::shared_ptr<tablet::Tablet>& tablet,
+ const std::shared_ptr<tablet::Tablet>& tablet,
gscoped_ptr<RowwiseIterator>* iter,
Timestamp* snap_timestamp);
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/ts_tablet_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager-test.cc b/src/kudu/tserver/ts_tablet_manager-test.cc
index 2562726..c99f3aa 100644
--- a/src/kudu/tserver/ts_tablet_manager-test.cc
+++ b/src/kudu/tserver/ts_tablet_manager-test.cc
@@ -17,10 +17,8 @@
#include "kudu/tserver/ts_tablet_manager.h"
-#include <boost/assign/list_of.hpp>
#include <gtest/gtest.h>
#include <string>
-#include <tr1/memory>
#include "kudu/common/partition.h"
#include "kudu/common/schema.h"
@@ -46,7 +44,6 @@ using consensus::kInvalidOpIdIndex;
using consensus::RaftConfigPB;
using master::ReportedTabletPB;
using master::TabletReportPB;
-using std::tr1::shared_ptr;
using tablet::TabletPeer;
static const char* const kTabletId = "my-tablet-id";
@@ -55,9 +52,7 @@ static const char* const kTabletId = "my-tablet-id";
class TsTabletManagerTest : public KuduTest {
public:
TsTabletManagerTest()
- : schema_(boost::assign::list_of
- (ColumnSchema("key", UINT32)),
- 1) {
+ : schema_({ ColumnSchema("key", UINT32) }, 1) {
}
virtual void SetUp() OVERRIDE {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index 9668d76..409d8af 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -23,8 +23,8 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <glog/logging.h>
+#include <memory>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/common/wire_protocol.h"
@@ -38,8 +38,8 @@
#include "kudu/gutil/strings/util.h"
#include "kudu/master/master.pb.h"
#include "kudu/tablet/metadata.pb.h"
-#include "kudu/tablet/tablet.pb.h"
#include "kudu/tablet/tablet.h"
+#include "kudu/tablet/tablet.pb.h"
#include "kudu/tablet/tablet_bootstrap.h"
#include "kudu/tablet/tablet_metadata.h"
#include "kudu/tablet/tablet_peer.h"
@@ -127,15 +127,15 @@ using consensus::StartRemoteBootstrapRequestPB;
using log::Log;
using master::ReportedTabletPB;
using master::TabletReportPB;
+using std::shared_ptr;
using std::string;
-using std::tr1::shared_ptr;
using std::vector;
using strings::Substitute;
+using tablet::Tablet;
using tablet::TABLET_DATA_COPYING;
using tablet::TABLET_DATA_DELETED;
using tablet::TABLET_DATA_READY;
using tablet::TABLET_DATA_TOMBSTONED;
-using tablet::Tablet;
using tablet::TabletDataState;
using tablet::TabletMetadata;
using tablet::TabletPeer;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/ts_tablet_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.h b/src/kudu/tserver/ts_tablet_manager.h
index f0b77d2..c271132 100644
--- a/src/kudu/tserver/ts_tablet_manager.h
+++ b/src/kudu/tserver/ts_tablet_manager.h
@@ -20,10 +20,10 @@
#include <boost/optional/optional_fwd.hpp>
#include <boost/thread/locks.hpp>
#include <gtest/gtest_prod.h>
+#include <memory>
#include <string>
-#include <tr1/memory>
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
+#include <unordered_map>
+#include <unordered_set>
#include <vector>
#include "kudu/gutil/macros.h"
@@ -64,7 +64,7 @@ namespace tserver {
class TabletServer;
// Map of tablet id -> transition reason string.
-typedef std::tr1::unordered_map<std::string, std::string> TransitionInProgressMap;
+typedef std::unordered_map<std::string, std::string> TransitionInProgressMap;
class TransitionInProgressDeleter;
@@ -196,7 +196,7 @@ class TSTabletManager : public tserver::TabletPeerLookupIf {
struct TabletReportState {
uint32_t change_seq;
};
- typedef std::tr1::unordered_map<std::string, TabletReportState> DirtyMap;
+ typedef std::unordered_map<std::string, TabletReportState> DirtyMap;
// Standard log prefix, given a tablet id.
std::string LogPrefix(const std::string& tablet_id) const;
@@ -308,7 +308,7 @@ class TSTabletManager : public tserver::TabletPeerLookupIf {
consensus::RaftPeerPB local_peer_pb_;
- typedef std::tr1::unordered_map<std::string, scoped_refptr<tablet::TabletPeer> > TabletMap;
+ typedef std::unordered_map<std::string, scoped_refptr<tablet::TabletPeer> > TabletMap;
// Lock protecting tablet_map_, dirty_tablets_, state_, and
// transition_in_progress_.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/tserver/tserver-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tserver-path-handlers.cc b/src/kudu/tserver/tserver-path-handlers.cc
index 7b056b5..a66d0e7 100644
--- a/src/kudu/tserver/tserver-path-handlers.cc
+++ b/src/kudu/tserver/tserver-path-handlers.cc
@@ -18,9 +18,9 @@
#include "kudu/tserver/tserver-path-handlers.h"
#include <algorithm>
+#include <memory>
#include <sstream>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/consensus/log_anchor_registry.h"
@@ -52,8 +52,8 @@ using kudu::tablet::Tablet;
using kudu::tablet::TabletPeer;
using kudu::tablet::TabletStatusPB;
using kudu::tablet::Transaction;
-using std::tr1::shared_ptr;
using std::endl;
+using std::shared_ptr;
using std::vector;
using strings::Substitute;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/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 9f590fc..9fb4c42 100644
--- a/src/kudu/twitter-demo/ingest_firehose.cc
+++ b/src/kudu/twitter-demo/ingest_firehose.cc
@@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-#include <stdint.h>
#include <boost/thread/thread.hpp>
-#include <gflags/gflags.h>
-#include <glog/logging.h>
#include <curl/curl.h>
#include <fstream>
+#include <gflags/gflags.h>
+#include <glog/logging.h>
#include <iostream>
+#include <stdint.h>
#include "kudu/client/client.h"
#include "kudu/gutil/macros.h"
@@ -52,11 +52,11 @@ DEFINE_string(twitter_firehose_file, "/dev/fd/0",
using std::string;
-using std::tr1::shared_ptr;
namespace kudu {
namespace twitter_demo {
+using client::sp::shared_ptr;
using tserver::TabletServerServiceProxy;
// Consumer which simply logs messages to the console.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/twitter-demo/insert_consumer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/insert_consumer.cc b/src/kudu/twitter-demo/insert_consumer.cc
index 4fac6ff..7f001c3 100644
--- a/src/kudu/twitter-demo/insert_consumer.cc
+++ b/src/kudu/twitter-demo/insert_consumer.cc
@@ -17,13 +17,11 @@
#include "kudu/twitter-demo/insert_consumer.h"
-#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <boost/thread/locks.hpp>
#include <glog/logging.h>
#include <string>
#include <time.h>
-#include <tr1/memory>
#include <vector>
#include "kudu/common/wire_protocol.h"
@@ -41,7 +39,6 @@
namespace kudu {
namespace twitter_demo {
-using std::tr1::shared_ptr;
using tserver::TabletServerServiceProxy;
using tserver::WriteRequestPB;
using tserver::WriteResponsePB;
@@ -64,7 +61,7 @@ void FlushCB::Run(const Status& status) {
consumer_->BatchFinished(status);
}
-InsertConsumer::InsertConsumer(const shared_ptr<KuduClient> &client)
+InsertConsumer::InsertConsumer(const client::sp::shared_ptr<KuduClient> &client)
: initted_(false),
schema_(CreateTwitterSchema()),
flush_cb_(this),
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/twitter-demo/insert_consumer.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/insert_consumer.h b/src/kudu/twitter-demo/insert_consumer.h
index ded4698..826ca11 100644
--- a/src/kudu/twitter-demo/insert_consumer.h
+++ b/src/kudu/twitter-demo/insert_consumer.h
@@ -20,10 +20,10 @@
#include "kudu/twitter-demo/twitter_streamer.h"
#include <string>
-#include <tr1/memory>
#include "kudu/client/callbacks.h"
#include "kudu/client/schema.h"
+#include "kudu/client/shared_ptr.h"
#include "kudu/rpc/rpc_controller.h"
#include "kudu/tserver/tserver_service.proxy.h"
#include "kudu/twitter-demo/parser.h"
@@ -42,7 +42,7 @@ namespace twitter_demo {
class InsertConsumer;
-class FlushCB : public kudu::client::KuduStatusCallback {
+class FlushCB : public client::KuduStatusCallback {
public:
explicit FlushCB(InsertConsumer* consumer);
@@ -58,7 +58,7 @@ class FlushCB : public kudu::client::KuduStatusCallback {
class InsertConsumer : public TwitterConsumer {
public:
explicit InsertConsumer(
- const std::tr1::shared_ptr<kudu::client::KuduClient> &client);
+ const client::sp::shared_ptr<client::KuduClient> &client);
~InsertConsumer();
Status Init();
@@ -79,9 +79,9 @@ class InsertConsumer : public TwitterConsumer {
// Reusable object for latest event.
TwitterEvent event_;
- std::tr1::shared_ptr<client::KuduClient> client_;
- std::tr1::shared_ptr<client::KuduSession> session_;
- std::tr1::shared_ptr<client::KuduTable> table_;
+ client::sp::shared_ptr<client::KuduClient> client_;
+ client::sp::shared_ptr<client::KuduSession> session_;
+ client::sp::shared_ptr<client::KuduTable> table_;
simple_spinlock lock_;
bool request_pending_;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/twitter-demo/twitter-schema.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter-schema.h b/src/kudu/twitter-demo/twitter-schema.h
index 5f2b408..acfc851 100644
--- a/src/kudu/twitter-demo/twitter-schema.h
+++ b/src/kudu/twitter-demo/twitter-schema.h
@@ -19,8 +19,6 @@
#ifndef KUDU_TWITTER_DEMO_TWITTER_SCHEMA_H
#define KUDU_TWITTER_DEMO_TWITTER_SCHEMA_H
-#include <boost/assign/list_of.hpp>
-
#include "kudu/client/schema.h"
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/atomic-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/atomic-test.cc b/src/kudu/util/atomic-test.cc
index 3477bc6..fe5fbbf 100644
--- a/src/kudu/util/atomic-test.cc
+++ b/src/kudu/util/atomic-test.cc
@@ -17,7 +17,6 @@
#include "kudu/util/atomic.h"
-#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <gtest/gtest.h>
#include <limits>
@@ -27,7 +26,6 @@ namespace kudu {
using std::numeric_limits;
using std::vector;
-using boost::assign::list_of;
// TODO Add some multi-threaded tests; currently AtomicInt is just a
// wrapper around 'atomicops.h', but should the underlying
@@ -41,8 +39,8 @@ class AtomicIntTest : public ::testing::Test {
AtomicIntTest()
: max_(numeric_limits<T>::max()),
min_(numeric_limits<T>::min()) {
- acquire_release_ = list_of(kMemOrderNoBarrier)(kMemOrderAcquire)(kMemOrderRelease);
- barrier_ = list_of(kMemOrderNoBarrier)(kMemOrderBarrier);
+ acquire_release_ = { kMemOrderNoBarrier, kMemOrderAcquire, kMemOrderRelease };
+ barrier_ = { kMemOrderNoBarrier, kMemOrderBarrier };
}
vector<MemoryOrder> acquire_release_;
@@ -115,9 +113,7 @@ TYPED_TEST(AtomicIntTest, Increment) {
}
TEST(Atomic, AtomicBool) {
- vector<MemoryOrder> memory_orders =
- list_of(kMemOrderNoBarrier)(kMemOrderRelease)(kMemOrderAcquire);
-
+ vector<MemoryOrder> memory_orders = { kMemOrderNoBarrier, kMemOrderRelease, kMemOrderAcquire };
BOOST_FOREACH(const MemoryOrder mem_order, memory_orders) {
AtomicBool b(false);
EXPECT_FALSE(b.Load(mem_order));
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/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 6dc98e0..7aa3c96 100644
--- a/src/kudu/util/blocking_queue-test.cc
+++ b/src/kudu/util/blocking_queue-test.cc
@@ -18,15 +18,16 @@
#include <boost/thread/thread.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
+#include <memory>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/util/countdown_latch.h"
#include "kudu/util/blocking_queue.h"
-using std::tr1::shared_ptr;
+using std::shared_ptr;
using std::string;
+using std::vector;
namespace kudu {
@@ -54,7 +55,7 @@ TEST(BlockingQueueTest, TestBlockingDrainTo) {
ASSERT_EQ(test_queue.Put(1), QUEUE_SUCCESS);
ASSERT_EQ(test_queue.Put(2), QUEUE_SUCCESS);
ASSERT_EQ(test_queue.Put(3), QUEUE_SUCCESS);
- std::vector<int32_t> out;
+ vector<int32_t> out;
ASSERT_TRUE(test_queue.BlockingDrainTo(&out));
ASSERT_EQ(1, out[0]);
ASSERT_EQ(2, out[1]);
@@ -127,7 +128,7 @@ TEST(BlockingQueueTest, TestGscopedPtrMethods) {
class MultiThreadTest {
public:
- typedef std::vector<std::tr1::shared_ptr<boost::thread> > thread_vec_t;
+ typedef vector<shared_ptr<boost::thread> > thread_vec_t;
MultiThreadTest()
: puts_(4),
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/blocking_queue.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/blocking_queue.h b/src/kudu/util/blocking_queue.h
index 22e62c1..a9d4459 100644
--- a/src/kudu/util/blocking_queue.h
+++ b/src/kudu/util/blocking_queue.h
@@ -19,10 +19,10 @@
#include <boost/foreach.hpp>
#include <boost/type_traits/remove_pointer.hpp>
-#include <unistd.h>
#include <list>
#include <string>
-#include <tr1/type_traits>
+#include <type_traits>
+#include <unistd.h>
#include <vector>
#include "kudu/gutil/basictypes.h"
@@ -66,7 +66,7 @@ class BlockingQueue {
// If the queue holds a bare pointer, it must be empty on destruction, since
// it may have ownership of the pointer.
~BlockingQueue() {
- DCHECK(list_.empty() || !std::tr1::is_pointer<T>::value)
+ DCHECK(list_.empty() || !std::is_pointer<T>::value)
<< "BlockingQueue holds bare pointers at destruction time";
}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/cache-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache-test.cc b/src/kudu/util/cache-test.cc
index c3bb635..5b68efe 100644
--- a/src/kudu/util/cache-test.cc
+++ b/src/kudu/util/cache-test.cc
@@ -22,6 +22,7 @@
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
+#include <memory>
#include <vector>
#include "kudu/util/cache.h"
@@ -61,7 +62,7 @@ class CacheTest : public KuduTest,
}
std::vector<int> deleted_keys_;
std::vector<int> deleted_values_;
- std::tr1::shared_ptr<MemTracker> mem_tracker_;
+ std::shared_ptr<MemTracker> mem_tracker_;
gscoped_ptr<Cache> cache_;
MetricRegistry metric_registry_;
@@ -82,7 +83,7 @@ class CacheTest : public KuduTest,
// Since nvm cache does not have memtracker due to the use of
// tcmalloc for this we only check for it in the DRAM case.
if (GetParam() == DRAM_CACHE) {
- ASSERT_TRUE(mem_tracker_);
+ ASSERT_TRUE(mem_tracker_.get());
}
scoped_refptr<MetricEntity> entity = METRIC_ENTITY_server.Instantiate(
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache.cc b/src/kudu/util/cache.cc
index 4e2823f..a86fb8a 100644
--- a/src/kudu/util/cache.cc
+++ b/src/kudu/util/cache.cc
@@ -21,9 +21,9 @@
#include <boost/foreach.hpp>
#include <glog/logging.h>
+#include <memory>
#include <stdlib.h>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/gutil/atomic_refcount.h"
@@ -50,7 +50,7 @@ Cache::~Cache() {
namespace {
-using std::tr1::shared_ptr;
+using std::shared_ptr;
using std::vector;
typedef simple_spinlock MutexType;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/debug/trace_event_impl.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_impl.cc b/src/kudu/util/debug/trace_event_impl.cc
index 97f4af5..412650d 100644
--- a/src/kudu/util/debug/trace_event_impl.cc
+++ b/src/kudu/util/debug/trace_event_impl.cc
@@ -1831,7 +1831,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
SpinLockHolder thread_info_lock(&thread_info_lock_);
- std::tr1::unordered_map<int, std::string>::iterator existing_name =
+ std::unordered_map<int, std::string>::iterator existing_name =
thread_names_.find(thread_id);
if (existing_name == thread_names_.end()) {
// This is a new thread id, and a new name.
@@ -2081,7 +2081,7 @@ void TraceLog::AddMetadataEventsWhileLocked() {
if (process_labels_.size() > 0) {
std::vector<std::string> labels;
- for(std::tr1::unordered_map<int, std::string>::iterator it = process_labels_.begin();
+ for(std::unordered_map<int, std::string>::iterator it = process_labels_.begin();
it != process_labels_.end();
it++) {
labels.push_back(it->second);
@@ -2093,7 +2093,7 @@ void TraceLog::AddMetadataEventsWhileLocked() {
}
// Thread sort indices.
- for(std::tr1::unordered_map<int, int>::iterator it = thread_sort_indices_.begin();
+ for(std::unordered_map<int, int>::iterator it = thread_sort_indices_.begin();
it != thread_sort_indices_.end();
it++) {
if (it->second == 0)
@@ -2106,7 +2106,7 @@ void TraceLog::AddMetadataEventsWhileLocked() {
// Thread names.
SpinLockHolder thread_info_lock(&thread_info_lock_);
- for(std::tr1::unordered_map<int, std::string>::iterator it = thread_names_.begin();
+ for(std::unordered_map<int, std::string>::iterator it = thread_names_.begin();
it != thread_names_.end();
it++) {
if (it->second.empty())
@@ -2190,7 +2190,7 @@ void TraceLog::UpdateProcessLabel(
void TraceLog::RemoveProcessLabel(int label_id) {
SpinLockHolder lock(&lock_);
- std::tr1::unordered_map<int, std::string>::iterator it = process_labels_.find(
+ std::unordered_map<int, std::string>::iterator it = process_labels_.find(
label_id);
if (it == process_labels_.end())
return;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/debug/trace_event_impl.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_impl.h b/src/kudu/util/debug/trace_event_impl.h
index d0a5ad0..73d2251 100644
--- a/src/kudu/util/debug/trace_event_impl.h
+++ b/src/kudu/util/debug/trace_event_impl.h
@@ -8,8 +8,8 @@
#include <gtest/gtest_prod.h>
#include <stack>
#include <string>
-#include <tr1/unordered_set>
-#include <tr1/unordered_map>
+#include <unordered_map>
+#include <unordered_set>
#include <vector>
@@ -651,14 +651,14 @@ class BASE_EXPORT TraceLog {
std::vector<EnabledStateObserver*> enabled_state_observer_list_;
std::string process_name_;
- std::tr1::unordered_map<int, std::string> process_labels_;
+ std::unordered_map<int, std::string> process_labels_;
int process_sort_index_;
- std::tr1::unordered_map<int, int> thread_sort_indices_;
- std::tr1::unordered_map<int, std::string> thread_names_;
+ std::unordered_map<int, int> thread_sort_indices_;
+ std::unordered_map<int, std::string> thread_names_;
// The following two maps are used only when ECHO_TO_CONSOLE.
- std::tr1::unordered_map<int, std::stack<MicrosecondsInt64> > thread_event_start_times_;
- std::tr1::unordered_map<std::string, int> thread_colors_;
+ std::unordered_map<int, std::stack<MicrosecondsInt64> > thread_event_start_times_;
+ std::unordered_map<std::string, int> thread_colors_;
// XORed with TraceID to make it unlikely to collide with other processes.
uint64_t process_id_hash_;
@@ -694,7 +694,7 @@ class BASE_EXPORT TraceLog {
Mutex active_threads_lock_;
// Map of PID -> PerThreadInfo
// Protected by active_threads_lock_.
- typedef std::tr1::unordered_map<int64_t, PerThreadInfo*> ActiveThreadMap;
+ typedef std::unordered_map<int64_t, PerThreadInfo*> ActiveThreadMap;
ActiveThreadMap active_threads_;
// For events which can't be added into the thread local buffer, e.g. events
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/env-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env-test.cc b/src/kudu/util/env-test.cc
index 0ffb23f..6c56193 100644
--- a/src/kudu/util/env-test.cc
+++ b/src/kudu/util/env-test.cc
@@ -16,26 +16,25 @@
// under the License.
#include <fcntl.h>
+#include <memory>
#include <string>
#include <sys/types.h>
-#include <tr1/memory>
#include <glog/logging.h>
#include <gtest/gtest.h>
-#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include "kudu/gutil/bind.h"
-#include "kudu/gutil/strings/util.h"
#include "kudu/gutil/strings/substitute.h"
-#include "kudu/util/path_util.h"
-#include "kudu/util/stopwatch.h"
-#include "kudu/util/status.h"
-#include "kudu/util/test_util.h"
+#include "kudu/gutil/strings/util.h"
#include "kudu/util/env.h"
#include "kudu/util/env_util.h"
#include "kudu/util/malloc.h"
#include "kudu/util/memenv/memenv.h"
+#include "kudu/util/path_util.h"
+#include "kudu/util/status.h"
+#include "kudu/util/stopwatch.h"
+#include "kudu/util/test_util.h"
#if !defined(__APPLE__)
#include <linux/falloc.h>
@@ -51,8 +50,8 @@
namespace kudu {
+using std::shared_ptr;
using std::string;
-using std::tr1::shared_ptr;
using std::vector;
static const uint64_t kOneMb = 1024 * 1024;
@@ -667,10 +666,7 @@ TEST_F(TestEnv, TestRWFile) {
}
TEST_F(TestEnv, TestCanonicalize) {
- vector<string> synonyms = boost::assign::list_of
- (GetTestPath("."))
- (GetTestPath("./."))
- (GetTestPath(".//./"));
+ vector<string> synonyms = { GetTestPath("."), GetTestPath("./."), GetTestPath(".//./") };
BOOST_FOREACH(const string& synonym, synonyms) {
string result;
ASSERT_OK(env_->Canonicalize(synonym, &result));
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/env_posix.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_posix.cc b/src/kudu/util/env_posix.cc
index 005b4d5..38d276d 100644
--- a/src/kudu/util/env_posix.cc
+++ b/src/kudu/util/env_posix.cc
@@ -8,6 +8,7 @@
#include <fcntl.h>
#include <fts.h>
#include <glog/logging.h>
+#include <limits.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -19,10 +20,6 @@
#include <sys/uio.h>
#include <time.h>
#include <unistd.h>
-#include <limits.h>
-
-#include <deque>
-#include <tr1/unordered_set>
#include <vector>
#include "kudu/gutil/atomicops.h"
@@ -43,6 +40,7 @@
#include "kudu/util/thread_restrictions.h"
#if defined(__APPLE__)
+#include <mach-o/dyld.h>
#include <sys/sysctl.h>
#else
#include <linux/falloc.h>
@@ -86,8 +84,6 @@ TAG_FLAG(never_fsync, unsafe);
using base::subtle::Atomic64;
using base::subtle::Barrier_AtomicIncrement;
-using std::tr1::unordered_set;
-using std::deque;
using std::vector;
using strings::Substitute;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/env_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_util.cc b/src/kudu/util/env_util.cc
index 43bc761..caf0bfb 100644
--- a/src/kudu/util/env_util.cc
+++ b/src/kudu/util/env_util.cc
@@ -16,7 +16,7 @@
// under the License.
#include <algorithm>
-#include <tr1/memory>
+#include <memory>
#include <glog/logging.h>
#include <string>
@@ -27,7 +27,7 @@
#include "kudu/util/status.h"
using strings::Substitute;
-using std::tr1::shared_ptr;
+using std::shared_ptr;
namespace kudu {
namespace env_util {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/env_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/env_util.h b/src/kudu/util/env_util.h
index da1d78d..483ce29 100644
--- a/src/kudu/util/env_util.h
+++ b/src/kudu/util/env_util.h
@@ -17,7 +17,7 @@
#ifndef KUDU_UTIL_ENV_UTIL_H
#define KUDU_UTIL_ENV_UTIL_H
-#include <tr1/memory>
+#include <memory>
#include <string>
#include "kudu/gutil/macros.h"
@@ -27,17 +27,17 @@ namespace kudu {
namespace env_util {
Status OpenFileForWrite(Env *env, const std::string &path,
- std::tr1::shared_ptr<WritableFile> *file);
+ std::shared_ptr<WritableFile> *file);
Status OpenFileForWrite(const WritableFileOptions& opts,
Env *env, const std::string &path,
- std::tr1::shared_ptr<WritableFile> *file);
+ std::shared_ptr<WritableFile> *file);
Status OpenFileForRandom(Env *env, const std::string &path,
- std::tr1::shared_ptr<RandomAccessFile> *file);
+ std::shared_ptr<RandomAccessFile> *file);
Status OpenFileForSequential(Env *env, const std::string &path,
- std::tr1::shared_ptr<SequentialFile> *file);
+ std::shared_ptr<SequentialFile> *file);
// Read exactly 'n' bytes from the given file. If fewer than 'n' bytes
// are read, returns an IOError. This differs from the underlying
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/failure_detector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.cc b/src/kudu/util/failure_detector.cc
index dcd269e..a6dc022 100644
--- a/src/kudu/util/failure_detector.cc
+++ b/src/kudu/util/failure_detector.cc
@@ -19,7 +19,7 @@
#include <boost/foreach.hpp>
#include <glog/logging.h>
-#include <tr1/unordered_map>
+#include <unordered_map>
#include "kudu/gutil/map-util.h"
#include "kudu/gutil/stl_util.h"
@@ -31,7 +31,7 @@
namespace kudu {
-using std::tr1::unordered_map;
+using std::unordered_map;
using strings::Substitute;
const int64_t RandomizedFailureMonitor::kMinWakeUpTimeMillis = 10;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/failure_detector.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.h b/src/kudu/util/failure_detector.h
index 03b018d..0290011 100644
--- a/src/kudu/util/failure_detector.h
+++ b/src/kudu/util/failure_detector.h
@@ -18,8 +18,8 @@
#ifndef KUDU_UTIL_FAILURE_DETECTOR_H_
#define KUDU_UTIL_FAILURE_DETECTOR_H_
-#include <tr1/unordered_map>
#include <string>
+#include <unordered_map>
#include "kudu/gutil/callback.h"
#include "kudu/gutil/gscoped_ptr.h"
@@ -45,7 +45,7 @@ class FailureDetector : public RefCountedThreadSafe<FailureDetector> {
DEAD,
ALIVE
};
- typedef std::tr1::unordered_map<std::string, NodeStatus> StatusMap;
+ typedef std::unordered_map<std::string, NodeStatus> StatusMap;
typedef Callback<void(const std::string& name,
const Status& status)> FailureDetectedCallback;
@@ -106,7 +106,7 @@ class TimedFailureDetector : public FailureDetector {
virtual void CheckForFailures(const MonoTime& now) OVERRIDE;
private:
- typedef std::tr1::unordered_map<std::string, Node*> NodeMap;
+ typedef std::unordered_map<std::string, Node*> NodeMap;
// Check if the named failure detector has failed.
// Does not invoke the callback.
@@ -153,7 +153,7 @@ class RandomizedFailureMonitor {
Status UnmonitorFailureDetector(const std::string& name);
private:
- typedef std::tr1::unordered_map<std::string, scoped_refptr<FailureDetector> > FDMap;
+ typedef std::unordered_map<std::string, scoped_refptr<FailureDetector> > FDMap;
// Runs the monitor thread.
void RunThread();
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/flag_tags-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/flag_tags-test.cc b/src/kudu/util/flag_tags-test.cc
index 5274f3b..ea16b1c 100644
--- a/src/kudu/util/flag_tags-test.cc
+++ b/src/kudu/util/flag_tags-test.cc
@@ -17,7 +17,7 @@
#include <gtest/gtest.h>
#include <gflags/gflags.h>
-#include <tr1/unordered_set>
+#include <unordered_set>
#include "kudu/gutil/map-util.h"
#include "kudu/util/flag_tags.h"
@@ -33,7 +33,7 @@ TAG_FLAG(flag_with_two_tags, evolving);
TAG_FLAG(flag_with_two_tags, unsafe);
using std::string;
-using std::tr1::unordered_set;
+using std::unordered_set;
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/flag_tags.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/flag_tags.cc b/src/kudu/util/flag_tags.cc
index 8e252b9..698621d 100644
--- a/src/kudu/util/flag_tags.cc
+++ b/src/kudu/util/flag_tags.cc
@@ -21,15 +21,15 @@
#include "kudu/gutil/singleton.h"
#include <map>
-#include <tr1/unordered_set>
#include <string>
+#include <unordered_set>
#include <utility>
#include <vector>
using std::multimap;
using std::pair;
using std::string;
-using std::tr1::unordered_set;
+using std::unordered_set;
using std::vector;
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/flag_tags.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/flag_tags.h b/src/kudu/util/flag_tags.h
index 4588e28..ed2dbfd 100644
--- a/src/kudu/util/flag_tags.h
+++ b/src/kudu/util/flag_tags.h
@@ -108,7 +108,7 @@
#include "kudu/gutil/macros.h"
#include <string>
-#include <tr1/unordered_set>
+#include <unordered_set>
#include <vector>
namespace kudu {
@@ -144,7 +144,7 @@ struct FlagTags {
//
// If the flag is invalid or has no tags, sets 'tags' to be empty.
void GetFlagTags(const std::string& flag_name,
- std::tr1::unordered_set<std::string>* tags);
+ std::unordered_set<std::string>* tags);
// ------------------------------------------------------------
// Internal implementation details
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/flags.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/flags.cc b/src/kudu/util/flags.cc
index 4426537..dbaec62 100644
--- a/src/kudu/util/flags.cc
+++ b/src/kudu/util/flags.cc
@@ -19,7 +19,7 @@
#include <iostream>
#include <string>
-#include <tr1/unordered_set>
+#include <unordered_set>
#include <vector>
#include <boost/foreach.hpp>
@@ -38,7 +38,7 @@ using google::CommandLineFlagInfo;
using std::cout;
using std::endl;
using std::string;
-using std::tr1::unordered_set;
+using std::unordered_set;
// Because every binary initializes its flags here, we use it as a convenient place
// to offer some global flags as well.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/kernel_stack_watchdog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/kernel_stack_watchdog.cc b/src/kudu/util/kernel_stack_watchdog.cc
index ee6814c..21817a4 100644
--- a/src/kudu/util/kernel_stack_watchdog.cc
+++ b/src/kudu/util/kernel_stack_watchdog.cc
@@ -21,7 +21,6 @@
#include <boost/foreach.hpp>
#include <glog/logging.h>
#include <gflags/gflags.h>
-#include <tr1/unordered_set>
#include <string>
#include "kudu/util/debug-util.h"
@@ -36,7 +35,6 @@ DEFINE_int32(hung_task_check_interval_ms, 200,
"Number of milliseconds in between checks for hung threads");
TAG_FLAG(hung_task_check_interval_ms, hidden);
-using std::tr1::unordered_set;
using strings::Substitute;
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/kernel_stack_watchdog.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/kernel_stack_watchdog.h b/src/kudu/util/kernel_stack_watchdog.h
index ced5c55..1a98aff 100644
--- a/src/kudu/util/kernel_stack_watchdog.h
+++ b/src/kudu/util/kernel_stack_watchdog.h
@@ -53,8 +53,8 @@
#ifndef KUDU_UTIL_KERNEL_STACK_WATCHDOG_H
#define KUDU_UTIL_KERNEL_STACK_WATCHDOG_H
-#include <tr1/unordered_map>
#include <string>
+#include <unordered_map>
#include <vector>
#include "kudu/gutil/gscoped_ptr.h"
@@ -174,7 +174,7 @@ class KernelStackWatchdog {
DECLARE_STATIC_THREAD_LOCAL(TLS, tls_);
- typedef std::tr1::unordered_map<pid_t, TLS*> TLSMap;
+ typedef std::unordered_map<pid_t, TLS*> TLSMap;
TLSMap tls_by_tid_;
// If non-NULL, warnings will be emitted into this vector instead of glog.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/locks.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/locks.h b/src/kudu/util/locks.h
index b47e0a4..769143f 100644
--- a/src/kudu/util/locks.h
+++ b/src/kudu/util/locks.h
@@ -297,18 +297,28 @@ class unique_lock {
DISALLOW_COPY_AND_ASSIGN(unique_lock<Mutex>);
};
-// Simpler version of boost::shared_lock. Only supports the basic object
-// lifecycle and defers any error checking to the underlying mutex.
+// Simpler version of boost::shared_lock. Defers error checking to the
+// underlying mutex.
template <typename Mutex>
class shared_lock {
public:
+ explicit shared_lock()
+ : m_(NULL) {
+ }
+
explicit shared_lock(Mutex* m)
: m_(DCHECK_NOTNULL(m)) {
m_->lock_shared();
}
+ void swap(shared_lock& other) {
+ std::swap(m_,other.m_);
+ }
+
~shared_lock() {
- m_->unlock_shared();
+ if (m_ != NULL) {
+ m_->unlock_shared();
+ }
}
private:
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/logging-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging-test.cc b/src/kudu/util/logging-test.cc
index 9402e7b..82ce90d 100644
--- a/src/kudu/util/logging-test.cc
+++ b/src/kudu/util/logging-test.cc
@@ -20,6 +20,7 @@
#include <string>
#include <vector>
+#include "kudu/util/logging_test_util.h"
#include "kudu/util/logging.h"
#include "kudu/util/monotime.h"
@@ -28,37 +29,6 @@ using std::vector;
namespace kudu {
-// GLog sink that keeps an internal buffer of messages that have been logged.
-class StringVectorSink : public google::LogSink {
- public:
- virtual void send(google::LogSeverity severity, const char* full_filename,
- const char* base_filename, int line,
- const struct ::tm* tm_time,
- const char* message, size_t message_len) OVERRIDE {
- logged_msgs_.push_back(ToString(severity, base_filename, line,
- tm_time, message, message_len));
- }
-
- const std::vector<string>& logged_msgs() const {
- return logged_msgs_;
- }
-
- private:
- vector<string> logged_msgs_;
-};
-
-// RAII wrapper around registering a LogSink with GLog.
-struct ScopedRegisterSink {
- explicit ScopedRegisterSink(google::LogSink* s) : s_(s) {
- google::AddLogSink(s_);
- }
- ~ScopedRegisterSink() {
- google::RemoveLogSink(s_);
- }
-
- google::LogSink* s_;
-};
-
// Test the KLOG_EVERY_N_SECS(...) macro.
TEST(LoggingTest, TestThrottledLogging) {
StringVectorSink sink;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/logging_test_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging_test_util.h b/src/kudu/util/logging_test_util.h
new file mode 100644
index 0000000..fb26ece
--- /dev/null
+++ b/src/kudu/util/logging_test_util.h
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you 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.
+
+#ifndef KUDU_LOGGING_TEST_UTIL_H
+#define KUDU_LOGGING_TEST_UTIL_H
+
+#include <glog/logging.h>
+#include <string>
+#include <vector>
+
+namespace kudu {
+
+// GLog sink that keeps an internal buffer of messages that have been logged.
+class StringVectorSink : public google::LogSink {
+ public:
+ virtual void send(google::LogSeverity severity, const char* full_filename,
+ const char* base_filename, int line,
+ const struct ::tm* tm_time,
+ const char* message, size_t message_len) override {
+ logged_msgs_.push_back(ToString(severity, base_filename, line,
+ tm_time, message, message_len));
+ }
+
+ const std::vector<std::string>& logged_msgs() const {
+ return logged_msgs_;
+ }
+
+ private:
+ std::vector<std::string> logged_msgs_;
+};
+
+// RAII wrapper around registering a LogSink with GLog.
+struct ScopedRegisterSink {
+ explicit ScopedRegisterSink(google::LogSink* s) : s_(s) {
+ google::AddLogSink(s_);
+ }
+ ~ScopedRegisterSink() {
+ google::RemoveLogSink(s_);
+ }
+
+ google::LogSink* s_;
+};
+
+} // namespace kudu
+
+#endif
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/mem_tracker-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker-test.cc b/src/kudu/util/mem_tracker-test.cc
index 86b8fad..f961feb 100644
--- a/src/kudu/util/mem_tracker-test.cc
+++ b/src/kudu/util/mem_tracker-test.cc
@@ -18,7 +18,8 @@
#include "kudu/util/mem_tracker.h"
#include <string>
-#include <tr1/unordered_map>
+#include <unordered_map>
+#include <utility>
#include <vector>
#include <boost/bind.hpp>
@@ -32,10 +33,11 @@ DECLARE_int32(memory_limit_soft_percentage);
namespace kudu {
using std::equal_to;
+using std::hash;
+using std::pair;
+using std::shared_ptr;
using std::string;
-using std::tr1::hash;
-using std::tr1::shared_ptr;
-using std::tr1::unordered_map;
+using std::unordered_map;
using std::vector;
TEST(MemTrackerTest, SingleTrackerNoLimit) {
@@ -172,11 +174,12 @@ TEST(MemTrackerTest, GcFunctions) {
TEST(MemTrackerTest, STLContainerAllocator) {
shared_ptr<MemTracker> t = MemTracker::CreateTracker(-1, "t");
- MemTrackerAllocator<int> alloc(t);
+ MemTrackerAllocator<int> vec_alloc(t);
+ MemTrackerAllocator<pair<const int, int>> map_alloc(t);
// Simple test: use the allocator in a vector.
{
- vector<int, MemTrackerAllocator<int> > v(alloc);
+ vector<int, MemTrackerAllocator<int> > v(vec_alloc);
ASSERT_EQ(0, t->consumption());
v.reserve(5);
ASSERT_EQ(5 * sizeof(int), t->consumption());
@@ -188,11 +191,11 @@ TEST(MemTrackerTest, STLContainerAllocator) {
// Complex test: use it in an unordered_map, where it must be rebound in
// order to allocate the map's buckets.
{
- unordered_map<int, int, equal_to<int>, hash<int>, MemTrackerAllocator<int> > um(
+ unordered_map<int, int, hash<int>, equal_to<int>, MemTrackerAllocator<pair<const int, int>>> um(
10,
- equal_to<int>(),
hash<int>(),
- alloc);
+ equal_to<int>(),
+ map_alloc);
// Don't care about the value (it depends on map internals).
ASSERT_GT(t->consumption(), 0);
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/mem_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.cc b/src/kudu/util/mem_tracker.cc
index 9206a2b..e892a72 100644
--- a/src/kudu/util/mem_tracker.cc
+++ b/src/kudu/util/mem_tracker.cc
@@ -23,6 +23,7 @@
#include <gperftools/malloc_extension.h>
#include <limits>
#include <list>
+#include <memory>
#include "kudu/gutil/map-util.h"
#include "kudu/gutil/once.h"
@@ -72,7 +73,7 @@ using std::deque;
using std::list;
using std::string;
using std::stringstream;
-using std::tr1::shared_ptr;
+using std::shared_ptr;
using std::vector;
using strings::Substitute;
@@ -246,7 +247,7 @@ shared_ptr<MemTracker> MemTracker::FindOrCreateTracker(int64_t byte_limit,
return CreateTrackerUnlocked(byte_limit, id, real_parent);
}
-void MemTracker::ListTrackers(vector<shared_ptr<MemTracker> >* trackers) {
+void MemTracker::ListTrackers(vector<shared_ptr<MemTracker>>* trackers) {
trackers->clear();
deque<shared_ptr<MemTracker> > to_process;
to_process.push_front(GetRootTracker());
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/mem_tracker.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/mem_tracker.h b/src/kudu/util/mem_tracker.h
index e3b8274..ed85c05 100644
--- a/src/kudu/util/mem_tracker.h
+++ b/src/kudu/util/mem_tracker.h
@@ -22,7 +22,6 @@
#include <memory>
#include <stdint.h>
#include <string>
-#include <tr1/memory>
#include <vector>
#include "kudu/gutil/ref_counted.h"
@@ -88,7 +87,7 @@ class MemTracker;
// 'registry' of trackers to a separate class, but it's better to
// start using the 'class' *first* and then change this functionality,
// depending on how MemTracker ends up being used in Kudu.
-class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
+class MemTracker : public std::enable_shared_from_this<MemTracker> {
public:
// Signature for function that can be called to free some memory after limit is reached.
@@ -117,33 +116,33 @@ class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
// byte_limit < 0 means no limit; 'id' is a used as a label for LogUsage()
// and web UI and must be unique for the given parent. Use the two-argument
// form if there is no parent.
- static std::tr1::shared_ptr<MemTracker> CreateTracker(
+ static std::shared_ptr<MemTracker> CreateTracker(
int64_t byte_limit,
const std::string& id,
- const std::tr1::shared_ptr<MemTracker>& parent = std::tr1::shared_ptr<MemTracker>());
+ const std::shared_ptr<MemTracker>& parent = std::shared_ptr<MemTracker>());
// If a tracker with the specified 'id' and 'parent' exists in the tree, sets
// 'tracker' to reference that instance. Use the two-argument form if there
// is no parent. Returns false if no such tracker exists.
static bool FindTracker(
const std::string& id,
- std::tr1::shared_ptr<MemTracker>* tracker,
- const std::tr1::shared_ptr<MemTracker>& parent = std::tr1::shared_ptr<MemTracker>());
+ std::shared_ptr<MemTracker>* tracker,
+ const std::shared_ptr<MemTracker>& parent = std::shared_ptr<MemTracker>());
// If a tracker with the specified 'id' and 'parent' exists in the tree,
// returns a shared_ptr to that instance. Otherwise, creates a new
// MemTracker with the specified byte_limit, id, and parent. Use the two
// argument form if there is no parent.
- static std::tr1::shared_ptr<MemTracker> FindOrCreateTracker(
+ static std::shared_ptr<MemTracker> FindOrCreateTracker(
int64_t byte_limit,
const std::string& id,
- const std::tr1::shared_ptr<MemTracker>& parent = std::tr1::shared_ptr<MemTracker>());
+ const std::shared_ptr<MemTracker>& parent = std::shared_ptr<MemTracker>());
// Returns a list of all the valid trackers.
- static void ListTrackers(std::vector<std::tr1::shared_ptr<MemTracker> >* trackers);
+ static void ListTrackers(std::vector<std::shared_ptr<MemTracker> >* trackers);
// Gets a shared_ptr to the "root" tracker, creating it if necessary.
- static std::tr1::shared_ptr<MemTracker> GetRootTracker();
+ static std::shared_ptr<MemTracker> GetRootTracker();
// Updates consumption from the consumption function specified in the constructor.
// NOTE: this method will crash if 'consumption_func_' is not set.
@@ -212,7 +211,7 @@ class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
int64_t peak_consumption() const { return consumption_.max_value(); }
// Retrieve the parent tracker, or NULL If one is not set.
- std::tr1::shared_ptr<MemTracker> parent() const { return parent_; }
+ std::shared_ptr<MemTracker> parent() const { return parent_; }
// Add a function 'f' to be called if the limit is reached.
// 'f' does not need to be thread-safe as long as it is added to only one MemTracker.
@@ -247,7 +246,7 @@ class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
MemTracker(const ConsumptionFunction& consumption_func,
int64_t byte_limit,
const std::string& id,
- const std::tr1::shared_ptr<MemTracker>& parent);
+ const std::shared_ptr<MemTracker>& parent);
bool CheckLimitExceeded() const {
return limit_ >= 0 && limit_ < consumption();
@@ -281,18 +280,18 @@ class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
// Variant of CreateTracker() that:
// 1. Must be called with a non-NULL parent, and
// 2. Must be called with parent->child_trackers_lock_ held.
- static std::tr1::shared_ptr<MemTracker> CreateTrackerUnlocked(
+ static std::shared_ptr<MemTracker> CreateTrackerUnlocked(
int64_t byte_limit,
const std::string& id,
- const std::tr1::shared_ptr<MemTracker>& parent);
+ const std::shared_ptr<MemTracker>& parent);
// Variant of FindTracker() that:
// 1. Must be called with a non-NULL parent, and
// 2. Must be called with parent->child_trackers_lock_ held.
static bool FindTrackerUnlocked(
const std::string& id,
- std::tr1::shared_ptr<MemTracker>* tracker,
- const std::tr1::shared_ptr<MemTracker>& parent);
+ std::shared_ptr<MemTracker>* tracker,
+ const std::shared_ptr<MemTracker>& parent);
// Creates the root tracker.
static void CreateRootTracker();
@@ -310,7 +309,7 @@ class MemTracker : public std::tr1::enable_shared_from_this<MemTracker> {
int64_t soft_limit_;
const std::string id_;
const std::string descr_;
- std::tr1::shared_ptr<MemTracker> parent_;
+ std::shared_ptr<MemTracker> parent_;
HighWaterMark consumption_;
@@ -352,13 +351,13 @@ class MemTrackerAllocator : public Alloc {
typedef typename Alloc::const_pointer const_pointer;
typedef typename Alloc::size_type size_type;
- explicit MemTrackerAllocator(const std::tr1::shared_ptr<MemTracker>& mem_tracker)
+ explicit MemTrackerAllocator(const std::shared_ptr<MemTracker>& mem_tracker)
: mem_tracker_(mem_tracker) {
}
// This constructor is used for rebinding.
template <typename U>
- explicit MemTrackerAllocator(const MemTrackerAllocator<U>& allocator)
+ MemTrackerAllocator(const MemTrackerAllocator<U>& allocator)
: Alloc(allocator),
mem_tracker_(allocator.mem_tracker()) {
}
@@ -385,17 +384,17 @@ class MemTrackerAllocator : public Alloc {
typedef MemTrackerAllocator<U, typename Alloc::template rebind<U>::other> other;
};
- const std::tr1::shared_ptr<MemTracker>& mem_tracker() const { return mem_tracker_; }
+ const std::shared_ptr<MemTracker>& mem_tracker() const { return mem_tracker_; }
private:
- std::tr1::shared_ptr<MemTracker> mem_tracker_;
+ std::shared_ptr<MemTracker> mem_tracker_;
};
// Convenience class that adds memory consumption to a tracker when declared,
// releasing it when the end of scope is reached.
class ScopedTrackedConsumption {
public:
- ScopedTrackedConsumption(const std::tr1::shared_ptr<MemTracker>& tracker,
+ ScopedTrackedConsumption(const std::shared_ptr<MemTracker>& tracker,
int64_t to_consume)
: tracker_(tracker),
consumption_(to_consume) {
@@ -416,7 +415,7 @@ class ScopedTrackedConsumption {
int64_t consumption() const { return consumption_; }
private:
- std::tr1::shared_ptr<MemTracker> tracker_;
+ std::shared_ptr<MemTracker> tracker_;
int64_t consumption_;
};
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/memcmpable_varint-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memcmpable_varint-test.cc b/src/kudu/util/memcmpable_varint-test.cc
index 747907f..8c9d581 100644
--- a/src/kudu/util/memcmpable_varint-test.cc
+++ b/src/kudu/util/memcmpable_varint-test.cc
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <glog/logging.h>
#include <gtest/gtest.h>
@@ -121,13 +120,11 @@ TEST_F(TestMemcmpableVarint, TestCompositeKeys) {
// tests "interesting" values -- i.e values around the boundaries of where
// the encoding changes its number of bytes.
TEST_F(TestMemcmpableVarint, TestInterestingCompositeKeys) {
- vector<uint64_t> interesting_values =
- boost::assign::list_of
- (0)(1)(240) // 1 byte
- (241)(2000)(2287) // 2 bytes
- (2288)(40000)(67823) // 3 bytes
- (67824)(1ULL << 23)((1ULL << 24) - 1) // 4 bytes
- (1ULL << 24)(1ULL << 30)((1ULL << 32) - 1); // 5 bytes
+ vector<uint64_t> interesting_values = { 0, 1, 240, // 1 byte
+ 241, 2000, 2287, // 2 bytes
+ 2288, 40000, 67823, // 3 bytes
+ 67824, 1ULL << 23, (1ULL << 24) - 1, // 4 bytes
+ 1ULL << 24, 1ULL << 30, (1ULL << 32) - 1 }; // 5 bytes
faststring buf1;
faststring buf2;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/src/kudu/util/memenv/memenv-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memenv/memenv-test.cc b/src/kudu/util/memenv/memenv-test.cc
index 00b1f79..9ba145e 100644
--- a/src/kudu/util/memenv/memenv-test.cc
+++ b/src/kudu/util/memenv/memenv-test.cc
@@ -8,8 +8,8 @@
#include <boost/foreach.hpp>
#include <gtest/gtest.h>
#include <string>
-#include <tr1/memory>
-#include <tr1/unordered_set>
+#include <memory>
+#include <unordered_set>
#include <vector>
#include "kudu/gutil/map-util.h"
@@ -18,9 +18,10 @@
#include "kudu/util/memenv/memenv.h"
#include "kudu/util/test_macros.h"
+using std::shared_ptr;
using std::string;
-using std::tr1::shared_ptr;
-using std::tr1::unordered_set;
+using std::unordered_set;
+using std::vector;
namespace kudu {
@@ -39,7 +40,7 @@ class MemEnvTest : public ::testing::Test {
TEST_F(MemEnvTest, Basics) {
uint64_t file_size;
gscoped_ptr<WritableFile> writable_file;
- std::vector<std::string> children;
+ vector<string> children;
// Create the directory.
ASSERT_FALSE(env_->FileExists("/dir"));
@@ -153,7 +154,7 @@ TEST_F(MemEnvTest, Locks) {
}
TEST_F(MemEnvTest, Misc) {
- std::string test_dir;
+ string test_dir;
ASSERT_OK(env_->GetTestDirectory(&test_dir));
ASSERT_TRUE(!test_dir.empty());
@@ -171,7 +172,7 @@ TEST_F(MemEnvTest, LargeWrite) {
const size_t kWriteSize = 300 * 1024;
gscoped_ptr<uint8_t[]> scratch(new uint8_t[kWriteSize * 2]);
- std::string write_data;
+ string write_data;
for (size_t i = 0; i < kWriteSize; ++i) {
write_data.append(1, static_cast<char>(i));
}
@@ -189,7 +190,7 @@ TEST_F(MemEnvTest, LargeWrite) {
ASSERT_EQ(0, result.compare("foo"));
size_t read = 0;
- std::string read_data;
+ string read_data;
while (read < kWriteSize) {
ASSERT_OK(seq_file->Read(kWriteSize - read, &result, scratch.get()));
read_data.append(reinterpret_cast<const char *>(result.data()),
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/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 9cb8422..667a667 100644
--- a/src/kudu/util/memory/arena-test.cc
+++ b/src/kudu/util/memory/arena-test.cc
@@ -19,9 +19,9 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/thread/thread.hpp>
#include <gflags/gflags.h>
-#include <gtest/gtest.h>
#include <glog/logging.h>
-#include <tr1/memory>
+#include <gtest/gtest.h>
+#include <memory>
#include <vector>
#include "kudu/gutil/stringprintf.h"
@@ -35,7 +35,7 @@ DEFINE_int32(alloc_size, 4, "number of bytes in each allocation");
namespace kudu {
-using std::tr1::shared_ptr;
+using std::shared_ptr;
template<class ArenaType>
static void AllocateThread(ArenaType *arena, uint8_t thread_index) {