You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2017/06/13 16:10:22 UTC
[4/5] kudu git commit: tidy: add and fix modernize-use-emplace and
shrink-to-fit
tidy: add and fix modernize-use-emplace and shrink-to-fit
No fixes for shrink-to-fit. emplace found a bunch.
Change-Id: Ie5a9569e335e11e110336dbc4800441a61bc375c
Reviewed-on: http://gerrit.cloudera.org:8080/7162
Reviewed-by: Dan Burkert <da...@apache.org>
Tested-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/3ff6c9ba
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3ff6c9ba
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3ff6c9ba
Branch: refs/heads/master
Commit: 3ff6c9bac3071fa478984900a544c50002ae537c
Parents: 6b4284d
Author: Todd Lipcon <to...@cloudera.com>
Authored: Mon Jun 12 17:14:39 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Jun 13 16:04:38 2017 +0000
----------------------------------------------------------------------
src/kudu/.clang-tidy | 2 +-
src/kudu/benchmarks/tpch/tpch_real_world.cc | 12 ++--
src/kudu/cfile/bloomfile.cc | 2 +-
src/kudu/cfile/cfile-test.cc | 10 ++--
src/kudu/cfile/cfile_writer.cc | 12 ++--
src/kudu/cfile/encoding-test.cc | 2 +-
src/kudu/client/meta_cache.cc | 2 +-
src/kudu/client/predicate-test.cc | 6 +-
src/kudu/codegen/codegen-test.cc | 8 +--
src/kudu/common/partition.cc | 2 +-
src/kudu/common/row.h | 2 +-
src/kudu/common/schema.cc | 4 +-
src/kudu/common/wire_protocol.cc | 2 +-
src/kudu/consensus/quorum_util.cc | 2 +-
src/kudu/fs/block_manager-stress-test.cc | 2 +-
src/kudu/gutil/strings/join.cc | 2 +-
src/kudu/integration-tests/all_types-itest.cc | 4 +-
.../alter_table-randomized-test.cc | 4 +-
.../integration-tests/client-stress-test.cc | 3 +-
.../integration-tests/create-table-itest.cc | 2 +-
.../integration-tests/delete_table-itest.cc | 33 ++++++-----
.../integration-tests/disk_reservation-itest.cc | 10 ++--
.../exactly_once_writes-itest.cc | 16 +++---
.../integration-tests/external_mini_cluster.cc | 32 +++++------
.../flex_partitioning-itest.cc | 4 +-
.../integration-tests/linked_list-test-util.h | 25 ++++----
src/kudu/integration-tests/linked_list-test.cc | 12 ++--
.../integration-tests/master-stress-test.cc | 12 ++--
.../integration-tests/master_failover-itest.cc | 8 +--
src/kudu/integration-tests/mini_cluster.cc | 2 +-
.../integration-tests/open-readonly-fs-itest.cc | 6 +-
.../integration-tests/raft_consensus-itest.cc | 60 ++++++++++----------
src/kudu/integration-tests/security-itest.cc | 16 +++---
src/kudu/integration-tests/tablet_copy-itest.cc | 34 +++++------
.../tablet_copy_client_session-itest.cc | 2 +-
.../tablet_replacement-itest.cc | 12 ++--
src/kudu/integration-tests/ts_itest-base.h | 2 +-
.../integration-tests/version_migration-test.cc | 4 +-
src/kudu/master/ts_descriptor.cc | 2 +-
src/kudu/rpc/rpc_stub-test.cc | 4 +-
src/kudu/server/default-path-handlers.cc | 2 +-
src/kudu/server/server_base.cc | 2 +-
src/kudu/server/webserver.cc | 24 ++++----
src/kudu/tablet/deltamemstore.cc | 2 +-
src/kudu/tablet/diskrowset-test.cc | 4 +-
src/kudu/tablet/local_tablet_writer.h | 2 +-
src/kudu/tablet/lock_manager-test.cc | 2 +-
src/kudu/tablet/memrowset-test.cc | 6 +-
src/kudu/tablet/metadata-test.cc | 18 +++---
src/kudu/tablet/rowset_tree.cc | 4 +-
src/kudu/tablet/tablet-schema-test.cc | 24 ++++----
src/kudu/tools/ksck.cc | 12 ++--
src/kudu/tools/tool_main.cc | 2 +-
src/kudu/tserver/tablet_copy_service-test.cc | 2 +-
src/kudu/tserver/tablet_server-test-base.h | 4 +-
src/kudu/util/compression/compression-test.cc | 4 +-
src/kudu/util/debug/trace_event_impl.cc | 2 +-
src/kudu/util/interval_tree-test.cc | 8 +--
src/kudu/util/knapsack_solver-test.cc | 8 +--
src/kudu/util/path_util.cc | 2 +-
src/kudu/util/pstack_watcher.cc | 28 ++++-----
src/kudu/util/trace-test.cc | 4 +-
62 files changed, 274 insertions(+), 273 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/.clang-tidy
----------------------------------------------------------------------
diff --git a/src/kudu/.clang-tidy b/src/kudu/.clang-tidy
index 0815904..fff398a 100644
--- a/src/kudu/.clang-tidy
+++ b/src/kudu/.clang-tidy
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,-*,readability-*,-readability-braces-around-statements,llvm-include-order,misc-*,-modernize-*,performance-*,-readability-implicit-bool-cast,google-*,-google-readability-braces-around-statements,-readability-redundant-string-init,modernize-make-shared'
+Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,-*,readability-*,-readability-braces-around-statements,llvm-include-order,misc-*,-modernize-*,performance-*,-readability-implicit-bool-cast,google-*,-google-readability-braces-around-statements,-readability-redundant-string-init,modernize-make-shared,modernize-shrink-to-fit,modernize-use-emplace'
HeaderFilterRegex: '.*,-*.pb.h'
CheckOptions:
- key: readability-identifier-naming.ClassCase
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/benchmarks/tpch/tpch_real_world.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/tpch_real_world.cc b/src/kudu/benchmarks/tpch/tpch_real_world.cc
index de47fbc..6374132 100644
--- a/src/kudu/benchmarks/tpch/tpch_real_world.cc
+++ b/src/kudu/benchmarks/tpch/tpch_real_world.cc
@@ -224,15 +224,15 @@ Status TpchRealWorld::StartDbgens() {
setenv("DSS_CONFIG", FLAGS_tpch_path_to_dbgen_dir.c_str(), 1);
vector<string> argv;
argv.push_back(Substitute("$0/dbgen", FLAGS_tpch_path_to_dbgen_dir));
- argv.push_back("-q");
- argv.push_back("-T");
- argv.push_back("L");
- argv.push_back("-s");
+ argv.emplace_back("-q");
+ argv.emplace_back("-T");
+ argv.emplace_back("L");
+ argv.emplace_back("-s");
argv.push_back(Substitute("$0", FLAGS_tpch_scaling_factor));
if (FLAGS_tpch_num_inserters > 1) {
- argv.push_back("-C");
+ argv.emplace_back("-C");
argv.push_back(Substitute("$0", FLAGS_tpch_num_inserters));
- argv.push_back("-S");
+ argv.emplace_back("-S");
argv.push_back(Substitute("$0", i));
}
gscoped_ptr<Subprocess> dbgen_proc(new Subprocess(argv));
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/cfile/bloomfile.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/bloomfile.cc b/src/kudu/cfile/bloomfile.cc
index 23c143c..7d69ac1 100644
--- a/src/kudu/cfile/bloomfile.cc
+++ b/src/kudu/cfile/bloomfile.cc
@@ -152,7 +152,7 @@ Status BloomFileWriter::FinishCurrentBloomBlock() {
// The data is the concatenation of the header and the bloom itself.
vector<Slice> slices;
- slices.push_back(Slice(hdr_str));
+ slices.emplace_back(hdr_str);
slices.push_back(bloom_builder_.slice());
// Append to the file.
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/cfile/cfile-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile-test.cc b/src/kudu/cfile/cfile-test.cc
index 2ab6b2b..e21d96e 100644
--- a/src/kudu/cfile/cfile-test.cc
+++ b/src/kudu/cfile/cfile-test.cc
@@ -226,10 +226,10 @@ class TestCFile : public CFileTestBase {
ASSERT_OK(w.Start());
for (uint32_t i = 0; i < num_entries; i++) {
vector<Slice> slices;
- slices.push_back(Slice("Head"));
- slices.push_back(Slice("Body"));
- slices.push_back(Slice("Tail"));
- slices.push_back(Slice(reinterpret_cast<uint8_t *>(&i), 4));
+ slices.emplace_back("Head");
+ slices.emplace_back("Body");
+ slices.emplace_back("Tail");
+ slices.emplace_back(reinterpret_cast<uint8_t *>(&i), 4);
ASSERT_OK(w.AppendRawBlock(slices, i, nullptr, Slice(), "raw-data"));
}
ASSERT_OK(w.Finish());
@@ -834,7 +834,7 @@ TEST_P(TestCFileBothCacheTypes, TestDataCorruption) {
w.AddMetadataPair("header_key", "header_value");
ASSERT_OK(w.Start());
vector<Slice> slices;
- slices.push_back(Slice("HelloWorld"));
+ slices.emplace_back("HelloWorld");
ASSERT_OK(w.AppendRawBlock(slices, 1, nullptr, Slice(), "raw-data"));
ASSERT_OK(w.Finish());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/cfile/cfile_writer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_writer.cc b/src/kudu/cfile/cfile_writer.cc
index a8819ff..dbc47e9 100644
--- a/src/kudu/cfile/cfile_writer.cc
+++ b/src/kudu/cfile/cfile_writer.cc
@@ -181,14 +181,14 @@ Status CFileWriter::Start() {
pb_util::AppendToString(header, &header_str);
vector<Slice> header_slices;
- header_slices.push_back(Slice(header_str));
+ header_slices.emplace_back(header_str);
// Append header checksum.
uint8_t checksum_buf[kChecksumSize];
if (FLAGS_cfile_write_checksums) {
uint32_t header_checksum = crc::Crc32c(header_str.data(), header_str.size());
InlineEncodeFixed32(checksum_buf, header_checksum);
- header_slices.push_back(Slice(checksum_buf, kChecksumSize));
+ header_slices.emplace_back(checksum_buf, kChecksumSize);
}
RETURN_NOT_OK_PREPEND(WriteRawData(header_slices), "Couldn't write header");
@@ -272,10 +272,10 @@ Status CFileWriter::FinishAndReleaseBlock(ScopedWritableBlockCloser* closer) {
if (FLAGS_cfile_write_checksums) {
uint32_t footer_checksum = crc::Crc32c(footer_str.data(), footer_str.size());
InlineEncodeFixed32(checksum_buf, footer_checksum);
- footer_slices.push_back(Slice(checksum_buf, kChecksumSize));
+ footer_slices.emplace_back(checksum_buf, kChecksumSize);
}
- footer_slices.push_back(Slice(footer_str));
+ footer_slices.emplace_back(footer_str);
RETURN_NOT_OK_PREPEND(WriteRawData(footer_slices), "Couldn't write footer");
// Done with this block.
@@ -414,7 +414,7 @@ Status CFileWriter::FinishCurDataBlock() {
Slice null_bitmap = null_bitmap_builder_->Finish();
PutVarint32(&null_headers, num_elems_in_block);
PutVarint32(&null_headers, null_bitmap.size());
- v.push_back(Slice(null_headers.data(), null_headers.size()));
+ v.emplace_back(null_headers.data(), null_headers.size());
v.push_back(null_bitmap);
}
v.push_back(data);
@@ -504,7 +504,7 @@ Status CFileWriter::AddBlock(const vector<Slice> &data_slices,
checksum = crc::Crc32c(data.data(), data.size(), checksum);
}
InlineEncodeFixed32(checksum_buf, checksum);
- out_slices.push_back(Slice(checksum_buf, kChecksumSize));
+ out_slices.emplace_back(checksum_buf, kChecksumSize);
}
RETURN_NOT_OK(WriteRawData(out_slices));
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/cfile/encoding-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/encoding-test.cc b/src/kudu/cfile/encoding-test.cc
index 6f5d7e1..db59936 100644
--- a/src/kudu/cfile/encoding-test.cc
+++ b/src/kudu/cfile/encoding-test.cc
@@ -80,7 +80,7 @@ class TestEncoding : public KuduTest {
std::vector<Slice> slices;
for (uint i = 0; i < num_items; i++) {
to_insert.emplace_back(new string(StringPrintf(fmt_str, i)));
- slices.push_back(Slice(to_insert.back()->data()));
+ slices.emplace_back(to_insert.back()->data());
}
int rem = slices.size();
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/client/meta_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index 398a395..de9698e 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -142,7 +142,7 @@ void RemoteTabletServer::Update(const master::TSInfoPB& pb) {
rpc_hostports_.clear();
for (const HostPortPB& hostport_pb : pb.rpc_addresses()) {
- rpc_hostports_.push_back(HostPort(hostport_pb.host(), hostport_pb.port()));
+ rpc_hostports_.emplace_back(hostport_pb.host(), hostport_pb.port());
}
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/client/predicate-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/predicate-test.cc b/src/kudu/client/predicate-test.cc
index ac38511..44c83b3 100644
--- a/src/kudu/client/predicate-test.cc
+++ b/src/kudu/client/predicate-test.cc
@@ -350,9 +350,9 @@ class PredicateTest : public KuduTest {
// Add some additional values to check against.
vector<string> test_values = values;
- test_values.push_back("aa");
- test_values.push_back(string("\1", 1));
- test_values.push_back(string("a\1", 1));
+ test_values.emplace_back("aa");
+ test_values.emplace_back("\1", 1);
+ test_values.emplace_back("a\1", 1);
for (const string& v : test_values) {
SCOPED_TRACE(strings::Substitute("test value: '$0'", strings::CHexEscape(v)));
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/codegen/codegen-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/codegen/codegen-test.cc b/src/kudu/codegen/codegen-test.cc
index a63b064..b90bc70 100644
--- a/src/kudu/codegen/codegen-test.cc
+++ b/src/kudu/codegen/codegen-test.cc
@@ -69,10 +69,10 @@ class CodegenTest : public KuduTest {
base_ = SchemaBuilder(base_).Build(); // add IDs
// Create an extended default schema
- cols.push_back(ColumnSchema("int32-R ", INT32, false, kI32R, nullptr));
- cols.push_back(ColumnSchema("int32-RW", INT32, false, kI32R, kI32W));
- cols.push_back(ColumnSchema("str32-R ", STRING, false, kStrR, nullptr));
- cols.push_back(ColumnSchema("str32-RW", STRING, false, kStrR, kStrW));
+ cols.emplace_back("int32-R ", INT32, false, kI32R, nullptr);
+ cols.emplace_back("int32-RW", INT32, false, kI32R, kI32W);
+ cols.emplace_back("str32-R ", STRING, false, kStrR, nullptr);
+ cols.emplace_back("str32-RW", STRING, false, kStrR, kStrW);
defaults_.Reset(cols, 1);
defaults_ = SchemaBuilder(defaults_).Build(); // add IDs
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/common/partition.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partition.cc b/src/kudu/common/partition.cc
index bbb6343..6d4b6f6 100644
--- a/src/kudu/common/partition.cc
+++ b/src/kudu/common/partition.cc
@@ -751,7 +751,7 @@ string PartitionSchema::RangeKeyDebugString(const ConstContiguousRow& key) const
string column;
int32_t column_idx = key.schema()->find_column_by_id(column_id);
if (column_idx == Schema::kColumnNotFound) {
- components.push_back("<unknown-column>");
+ components.emplace_back("<unknown-column>");
break;
}
key.schema()->column(column_idx).DebugCellAppend(key.cell(column_idx), &column);
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/common/row.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/row.h b/src/kudu/common/row.h
index 88b5d55..cb68bb9 100644
--- a/src/kudu/common/row.h
+++ b/src/kudu/common/row.h
@@ -199,7 +199,7 @@ class RowProjector {
friend class Schema;
Status ProjectBaseColumn(size_t proj_col_idx, size_t base_col_idx) {
- base_cols_mapping_.push_back(ProjectionIdxMapping(proj_col_idx, base_col_idx));
+ base_cols_mapping_.emplace_back(proj_col_idx, base_col_idx);
return Status::OK();
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/common/schema.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/schema.cc b/src/kudu/common/schema.cc
index 94fcf87..c17ac31 100644
--- a/src/kudu/common/schema.cc
+++ b/src/kudu/common/schema.cc
@@ -265,7 +265,7 @@ Schema Schema::CopyWithColumnIds() const {
CHECK(!has_column_ids());
vector<ColumnId> ids;
for (int32_t i = 0; i < num_columns(); i++) {
- ids.push_back(ColumnId(kFirstColumnId + i));
+ ids.emplace_back(kFirstColumnId + i);
}
return Schema(cols_, ids, num_key_columns_);
}
@@ -430,7 +430,7 @@ void SchemaBuilder::Reset(const Schema& schema) {
if (col_ids_.empty()) {
for (int32_t i = 0; i < cols_.size(); ++i) {
- col_ids_.push_back(ColumnId(kFirstColumnId + i));
+ col_ids_.emplace_back(kFirstColumnId + i);
}
}
if (col_ids_.empty()) {
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/common/wire_protocol.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol.cc b/src/kudu/common/wire_protocol.cc
index 6b4d078..33850a9 100644
--- a/src/kudu/common/wire_protocol.cc
+++ b/src/kudu/common/wire_protocol.cc
@@ -324,7 +324,7 @@ Status ColumnPBsToSchema(const RepeatedPtrField<ColumnSchemaPB>& column_pbs,
is_handling_key = false;
}
if (pb.has_id()) {
- column_ids.push_back(ColumnId(pb.id()));
+ column_ids.emplace_back(pb.id());
}
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/consensus/quorum_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/quorum_util.cc b/src/kudu/consensus/quorum_util.cc
index a0c4a41..d4b39f4 100644
--- a/src/kudu/consensus/quorum_util.cc
+++ b/src/kudu/consensus/quorum_util.cc
@@ -351,7 +351,7 @@ string DiffConsensusStates(const ConsensusStatePB& old_state,
vector<string> pending_change_strs;
if (DiffPeers(pending_peer_infos, &pending_change_strs)) {
- change_strs.push_back("pending config changed");
+ change_strs.emplace_back("pending config changed");
change_strs.insert(change_strs.end(), pending_change_strs.cbegin(),
pending_change_strs.cend());
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/fs/block_manager-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/block_manager-stress-test.cc b/src/kudu/fs/block_manager-stress-test.cc
index 30cc6a9..55de36c 100644
--- a/src/kudu/fs/block_manager-stress-test.cc
+++ b/src/kudu/fs/block_manager-stress-test.cc
@@ -271,7 +271,7 @@ void BlockManagerStressTest<T>::WriterThread() {
CHECK_OK(block->Append(seed_slice));
dirty_blocks.push_back(block.release());
- dirty_block_rands.push_back(Random(seed));
+ dirty_block_rands.emplace_back(seed);
}
// Write a large amount of data to the group of blocks.
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/gutil/strings/join.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/join.cc b/src/kudu/gutil/strings/join.cc
index 8907792..4c289f2 100644
--- a/src/kudu/gutil/strings/join.cc
+++ b/src/kudu/gutil/strings/join.cc
@@ -192,7 +192,7 @@ void JoinCSVLineWithDelimiter(const vector<string>& cols, char delimiter,
*buf.get() = '"';
*((buf.get() + 1) + escaped_size) = '"';
*((buf.get() + 1) + escaped_size + 1) = '\0';
- quoted_cols.push_back(string(buf.get(), buf.get() + escaped_size + 2));
+ quoted_cols.emplace_back(buf.get(), buf.get() + escaped_size + 2);
} else {
quoted_cols.push_back(col);
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/all_types-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/all_types-itest.cc b/src/kudu/integration-tests/all_types-itest.cc
index b5e5ac7..6dd1830 100644
--- a/src/kudu/integration-tests/all_types-itest.cc
+++ b/src/kudu/integration-tests/all_types-itest.cc
@@ -114,7 +114,7 @@ struct SliceKeysTestSetup {
vector<string> GetKeyColumns() const {
vector<string> key_col;
- key_col.push_back("key");
+ key_col.emplace_back("key");
return key_col;
}
@@ -192,7 +192,7 @@ struct IntKeysTestSetup {
vector<string> GetKeyColumns() const {
vector<string> key_col;
- key_col.push_back("key");
+ key_col.emplace_back("key");
return key_col;
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/alter_table-randomized-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-randomized-test.cc b/src/kudu/integration-tests/alter_table-randomized-test.cc
index c9af5e2..4852141 100644
--- a/src/kudu/integration-tests/alter_table-randomized-test.cc
+++ b/src/kudu/integration-tests/alter_table-randomized-test.cc
@@ -82,7 +82,7 @@ class AlterTableRandomized : public KuduTest {
opts.num_tablet_servers = 3;
// This test produces tables with lots of columns. With container preallocation,
// we end up using quite a bit of disk space. So, we disable it.
- opts.extra_tserver_flags.push_back("--log_container_preallocate_bytes=0");
+ opts.extra_tserver_flags.emplace_back("--log_container_preallocate_bytes=0");
cluster_.reset(new ExternalMiniCluster(std::move(opts)));
ASSERT_OK(cluster_->Start());
@@ -150,7 +150,7 @@ struct RowState {
struct TableState {
TableState()
: rand_(SeedRandom()) {
- col_names_.push_back("key");
+ col_names_.emplace_back("key");
col_nullable_.push_back(false);
col_defaults_.push_back(0);
AddRangePartition();
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/client-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/client-stress-test.cc b/src/kudu/integration-tests/client-stress-test.cc
index 2718889..91ac4d3 100644
--- a/src/kudu/integration-tests/client-stress-test.cc
+++ b/src/kudu/integration-tests/client-stress-test.cc
@@ -214,8 +214,7 @@ class ClientStressTest_LowMemory : public ClientStressTest {
ExternalMiniClusterOptions opts;
opts.extra_tserver_flags.push_back(Substitute(
"--memory_limit_hard_bytes=$0", kMemLimitBytes));
- opts.extra_tserver_flags.push_back(
- "--memory_limit_soft_percentage=0");
+ opts.extra_tserver_flags.emplace_back("--memory_limit_soft_percentage=0");
return opts;
}
};
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/create-table-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/create-table-itest.cc b/src/kudu/integration-tests/create-table-itest.cc
index 8267dff..5854476 100644
--- a/src/kudu/integration-tests/create-table-itest.cc
+++ b/src/kudu/integration-tests/create-table-itest.cc
@@ -55,7 +55,7 @@ TEST_F(CreateTableITest, TestCreateWhenMajorityOfReplicasFailCreation) {
const int kNumReplicas = 3;
vector<string> ts_flags;
vector<string> master_flags;
- master_flags.push_back("--tablet_creation_timeout_ms=1000");
+ master_flags.emplace_back("--tablet_creation_timeout_ms=1000");
NO_FATALS(StartCluster(ts_flags, master_flags, kNumReplicas));
// Shut down 2/3 of the tablet servers.
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/delete_table-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/delete_table-itest.cc b/src/kudu/integration-tests/delete_table-itest.cc
index 9419aa7..3d64fc0 100644
--- a/src/kudu/integration-tests/delete_table-itest.cc
+++ b/src/kudu/integration-tests/delete_table-itest.cc
@@ -692,8 +692,8 @@ TEST_F(DeleteTableITest, TestAutoTombstoneAfterTabletCopyRemoteFails) {
TEST_F(DeleteTableITest, TestMergeConsensusMetadata) {
// Enable manual leader selection.
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
const MonoDelta timeout = MonoDelta::FromSeconds(10);
const int kTsIndex = 0;
@@ -812,10 +812,10 @@ TEST_F(DeleteTableITest, TestDeleteFollowerWithReplicatingTransaction) {
const int kNumTabletServers = 5;
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- ts_flags.push_back("--flush_threshold_mb=0"); // Always be flushing.
- ts_flags.push_back("--maintenance_manager_polling_interval_ms=100");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ ts_flags.emplace_back("--flush_threshold_mb=0"); // Always be flushing.
+ ts_flags.emplace_back("--maintenance_manager_polling_interval_ms=100");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags, kNumTabletServers));
const int kTsIndex = 0; // We'll test with the first TS.
@@ -872,11 +872,14 @@ TEST_F(DeleteTableITest, TestDeleteFollowerWithReplicatingTransaction) {
// tombstoned.
TEST_F(DeleteTableITest, TestOrphanedBlocksClearedOnDelete) {
const MonoDelta timeout = MonoDelta::FromSeconds(30);
- vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- ts_flags.push_back("--flush_threshold_mb=0"); // Flush quickly since we wait for a flush to occur.
- ts_flags.push_back("--maintenance_manager_polling_interval_ms=100");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ vector<string> ts_flags = {
+ "--enable_leader_failure_detection=false",
+ "--flush_threshold_mb=0", // Flush quickly since we wait for a flush to occur.
+ "--maintenance_manager_polling_interval_ms=100"
+ };
+ vector<string> master_flags = {
+ "--catalog_manager_wait_for_new_tablets_to_elect_leader=false"
+ };
NO_FATALS(StartCluster(ts_flags, master_flags));
const int kFollowerIndex = 0;
@@ -1173,10 +1176,10 @@ TEST_P(DeleteTableTombstonedParamTest, TestTabletTombstone) {
vector<string> flags;
// We want fast log rolls and deterministic preallocation, since we wait for
// a certain number of logs at the beginning of the test.
- flags.push_back("--log_segment_size_mb=1");
- flags.push_back("--log_async_preallocate_segments=false");
- flags.push_back("--log_min_segments_to_retain=3");
- flags.push_back("--log_compression_codec=NO_COMPRESSION");
+ flags.emplace_back("--log_segment_size_mb=1");
+ flags.emplace_back("--log_async_preallocate_segments=false");
+ flags.emplace_back("--log_min_segments_to_retain=3");
+ flags.emplace_back("--log_compression_codec=NO_COMPRESSION");
NO_FATALS(StartCluster(flags));
const string fault_flag = GetParam();
LOG(INFO) << "Running with fault flag: " << fault_flag;
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/disk_reservation-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/disk_reservation-itest.cc b/src/kudu/integration-tests/disk_reservation-itest.cc
index b19ffa4..b5b589f 100644
--- a/src/kudu/integration-tests/disk_reservation-itest.cc
+++ b/src/kudu/integration-tests/disk_reservation-itest.cc
@@ -51,14 +51,14 @@ class DiskReservationITest : public ExternalMiniClusterITestBase {
TEST_F(DiskReservationITest, TestFillMultipleDisks) {
vector<string> ts_flags;
// Don't preallocate very many bytes so we run the "full disk" check often.
- ts_flags.push_back("--log_container_preallocate_bytes=100000");
+ ts_flags.emplace_back("--log_container_preallocate_bytes=100000");
// Set up the tablet so that flushes are constantly occurring.
- ts_flags.push_back("--flush_threshold_mb=0");
- ts_flags.push_back("--maintenance_manager_polling_interval_ms=50");
- ts_flags.push_back("--disable_core_dumps");
+ ts_flags.emplace_back("--flush_threshold_mb=0");
+ ts_flags.emplace_back("--maintenance_manager_polling_interval_ms=50");
+ ts_flags.emplace_back("--disable_core_dumps");
// Reserve one byte so that when we simulate 0 bytes free below, we'll start
// failing requests.
- ts_flags.push_back("--fs_data_dirs_reserved_bytes=1");
+ ts_flags.emplace_back("--fs_data_dirs_reserved_bytes=1");
NO_FATALS(StartCluster(ts_flags, {}, /* num_tablet_servers= */ 1, /* num_data_dirs= */ 2));
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/exactly_once_writes-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/exactly_once_writes-itest.cc b/src/kudu/integration-tests/exactly_once_writes-itest.cc
index b05c537..b2d88b0 100644
--- a/src/kudu/integration-tests/exactly_once_writes-itest.cc
+++ b/src/kudu/integration-tests/exactly_once_writes-itest.cc
@@ -246,17 +246,17 @@ TEST_F(ExactlyOnceSemanticsITest, TestWritesWithExactlyOnceSemanticsWithCrashyNo
// Crash 2.5% of the time right after sending an RPC. This makes sure we stress the path
// where there are duplicate handlers for a transaction as a leader crashes right
// after sending requests to followers.
- ts_flags.push_back("--fault_crash_after_leader_request_fraction=0.025");
+ ts_flags.emplace_back("--fault_crash_after_leader_request_fraction=0.025");
// Make leader elections faster so we get through more cycles of leaders.
- ts_flags.push_back("--raft_heartbeat_interval_ms=200");
- ts_flags.push_back("--leader_failure_monitor_check_mean_ms=100");
- ts_flags.push_back("--leader_failure_monitor_check_stddev_ms=50");
+ ts_flags.emplace_back("--raft_heartbeat_interval_ms=200");
+ ts_flags.emplace_back("--leader_failure_monitor_check_mean_ms=100");
+ ts_flags.emplace_back("--leader_failure_monitor_check_stddev_ms=50");
// Avoid preallocating segments since bootstrap is a little bit
// faster if it doesn't have to scan forward through the preallocated
// log area.
- ts_flags.push_back("--log_preallocate_segments=false");
+ ts_flags.emplace_back("--log_preallocate_segments=false");
int num_batches = 10;
if (AllowSlowTests()) {
@@ -280,10 +280,10 @@ TEST_F(ExactlyOnceSemanticsITest, TestWritesWithExactlyOnceSemanticsWithChurnyEl
// any progress at all.
ts_flags.push_back("--raft_heartbeat_interval_ms=5");
#else
- ts_flags.push_back("--raft_heartbeat_interval_ms=2");
+ ts_flags.emplace_back("--raft_heartbeat_interval_ms=2");
#endif
- ts_flags.push_back("--leader_failure_monitor_check_mean_ms=2");
- ts_flags.push_back("--leader_failure_monitor_check_stddev_ms=1");
+ ts_flags.emplace_back("--leader_failure_monitor_check_mean_ms=2");
+ ts_flags.emplace_back("--leader_failure_monitor_check_stddev_ms=1");
int num_batches = 200;
if (AllowSlowTests()) {
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/external_mini_cluster.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/external_mini_cluster.cc b/src/kudu/integration-tests/external_mini_cluster.cc
index 3b1ac96..ef15ab9 100644
--- a/src/kudu/integration-tests/external_mini_cluster.cc
+++ b/src/kudu/integration-tests/external_mini_cluster.cc
@@ -667,9 +667,9 @@ Status ExternalDaemon::EnableKerberos(MiniKdc* kdc, const string& bind_host) {
extra_env_ = kdc->GetEnvVars();
extra_flags_.push_back(Substitute("--keytab_file=$0", ktpath));
extra_flags_.push_back(Substitute("--principal=$0", spn));
- extra_flags_.push_back("--rpc_authentication=required");
- extra_flags_.push_back("--superuser_acl=test-admin");
- extra_flags_.push_back("--user_acl=test-user");
+ extra_flags_.emplace_back("--rpc_authentication=required");
+ extra_flags_.emplace_back("--superuser_acl=test-admin");
+ extra_flags_.emplace_back("--user_acl=test-user");
return Status::OK();
}
@@ -686,7 +686,7 @@ Status ExternalDaemon::StartProcess(const vector<string>& user_flags) {
// Disable fsync to dramatically speed up runtime. This is safe as no tests
// rely on forcefully cutting power to a machine or equivalent.
- argv.push_back("--never_fsync");
+ argv.emplace_back("--never_fsync");
// Generate smaller RSA keys -- generating a 1024-bit key is faster
// than generating the default 2048-bit key, and we don't care about
@@ -697,21 +697,21 @@ Status ExternalDaemon::StartProcess(const vector<string>& user_flags) {
// the ECDHE-RSA-AES256-GCM-SHA384 suite). However, to work with Java
// client it's necessary to have at least 1024 bits for certificate RSA key
// due to Java security policies.
- argv.push_back("--ipki_server_key_size=1024");
+ argv.emplace_back("--ipki_server_key_size=1024");
// Disable minidumps by default since many tests purposely inject faults.
- argv.push_back("--enable_minidumps=false");
+ argv.emplace_back("--enable_minidumps=false");
// Disable log redaction.
- argv.push_back("--redact=flag");
+ argv.emplace_back("--redact=flag");
// Enable metrics logging.
- argv.push_back("--metrics_log_interval_ms=1000");
+ argv.emplace_back("--metrics_log_interval_ms=1000");
if (logtostderr_) {
// Ensure that logging goes to the test output and doesn't get buffered.
- argv.push_back("--logtostderr");
- argv.push_back("--logbuflevel=-1");
+ argv.emplace_back("--logtostderr");
+ argv.emplace_back("--logbuflevel=-1");
}
// Even if we are logging to stderr, metrics logs and minidumps end up being
@@ -722,16 +722,16 @@ Status ExternalDaemon::StartProcess(const vector<string>& user_flags) {
// Tell the server to dump its port information so we can pick it up.
string info_path = JoinPathSegments(data_dirs_[0], "info.pb");
argv.push_back("--server_dump_info_path=" + info_path);
- argv.push_back("--server_dump_info_format=pb");
+ argv.emplace_back("--server_dump_info_format=pb");
// We use ephemeral ports in many tests. They don't work for production, but are OK
// in unit tests.
- argv.push_back("--rpc_server_allow_ephemeral_ports");
+ argv.emplace_back("--rpc_server_allow_ephemeral_ports");
// Allow unsafe and experimental flags from tests, since we often use
// fault injection, etc.
- argv.push_back("--unlock_experimental_flags");
- argv.push_back("--unlock_unsafe_flags");
+ argv.emplace_back("--unlock_experimental_flags");
+ argv.emplace_back("--unlock_unsafe_flags");
// Then the "extra flags" passed into the ctor (from the ExternalMiniCluster
// options struct). These come at the end so they can override things like
@@ -1129,7 +1129,7 @@ ExternalMaster::~ExternalMaster() {
Status ExternalMaster::Start() {
vector<string> flags(GetCommonFlags());
- flags.push_back("--webserver_port=0");
+ flags.emplace_back("--webserver_port=0");
flags.push_back("--rpc_bind_addresses=" + get_rpc_bind_address());
return StartProcess(flags);
}
@@ -1233,7 +1233,7 @@ Status ExternalTabletServer::Start() {
get_rpc_bind_address()));
flags.push_back(Substitute("--webserver_interface=$0",
get_rpc_bind_address()));
- flags.push_back("--webserver_port=0");
+ flags.emplace_back("--webserver_port=0");
flags.push_back("--tserver_master_addrs=" + master_addrs_);
RETURN_NOT_OK(StartProcess(flags));
return Status::OK();
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/flex_partitioning-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/flex_partitioning-itest.cc b/src/kudu/integration-tests/flex_partitioning-itest.cc
index 7f90511..deb5831 100644
--- a/src/kudu/integration-tests/flex_partitioning-itest.cc
+++ b/src/kudu/integration-tests/flex_partitioning-itest.cc
@@ -158,8 +158,8 @@ class FlexPartitioningITest : public KuduTest,
opts.num_tablet_servers = 1;
// This test produces lots of tablets. With container and log preallocation,
// we end up using quite a bit of disk space. So, we disable them.
- opts.extra_tserver_flags.push_back("--log_container_preallocate_bytes=0");
- opts.extra_tserver_flags.push_back("--log_preallocate_segments=false");
+ opts.extra_tserver_flags.emplace_back("--log_container_preallocate_bytes=0");
+ opts.extra_tserver_flags.emplace_back("--log_preallocate_segments=false");
cluster_.reset(new ExternalMiniCluster(std::move(opts)));
ASSERT_OK(cluster_->Start());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/linked_list-test-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test-util.h b/src/kudu/integration-tests/linked_list-test-util.h
index 8d3d559..0ce6de1 100644
--- a/src/kudu/integration-tests/linked_list-test-util.h
+++ b/src/kudu/integration-tests/linked_list-test-util.h
@@ -308,21 +308,21 @@ class PeriodicWebUIChecker {
// List of master and ts web pages to fetch
vector<std::string> master_pages, ts_pages;
- master_pages.push_back("/metrics");
- master_pages.push_back("/masters");
- master_pages.push_back("/tables");
- master_pages.push_back("/dump-entities");
- master_pages.push_back("/tablet-servers");
- master_pages.push_back("/mem-trackers");
-
- ts_pages.push_back("/metrics");
- ts_pages.push_back("/tablets");
+ master_pages.emplace_back("/metrics");
+ master_pages.emplace_back("/masters");
+ master_pages.emplace_back("/tables");
+ master_pages.emplace_back("/dump-entities");
+ master_pages.emplace_back("/tablet-servers");
+ master_pages.emplace_back("/mem-trackers");
+
+ ts_pages.emplace_back("/metrics");
+ ts_pages.emplace_back("/tablets");
if (!tablet_id.empty()) {
ts_pages.push_back(strings::Substitute("/transactions?tablet_id=$0",
tablet_id));
}
- ts_pages.push_back("/maintenance-manager");
- ts_pages.push_back("/mem-trackers");
+ ts_pages.emplace_back("/maintenance-manager");
+ ts_pages.emplace_back("/mem-trackers");
// Generate list of urls for each master and tablet server
for (int i = 0; i < cluster.num_masters(); i++) {
@@ -495,8 +495,7 @@ Status LinkedListTester::LoadLinkedList(
MonoTime now = MonoTime::Now();
if (next_sample < now) {
Timestamp now(client_->GetLatestObservedTimestamp());
- sampled_timestamps_and_counts_.push_back(
- pair<uint64_t,int64_t>(now.ToUint64() + 1, *written_count));
+ sampled_timestamps_and_counts_.emplace_back(now.ToUint64() + 1, *written_count);
next_sample += sample_interval;
LOG(INFO) << "Sample at HT timestamp: " << now.ToString()
<< " Inserted count: " << *written_count;
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/linked_list-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/linked_list-test.cc b/src/kudu/integration-tests/linked_list-test.cc
index a41846d..16e8d60 100644
--- a/src/kudu/integration-tests/linked_list-test.cc
+++ b/src/kudu/integration-tests/linked_list-test.cc
@@ -87,27 +87,27 @@ class LinkedListTest : public tserver::TabletServerIntegrationTestBase {
void BuildAndStart() {
vector<string> common_flags;
- common_flags.push_back("--skip_remove_old_recovery_dir");
+ common_flags.emplace_back("--skip_remove_old_recovery_dir");
// Set history retention to one day, so that we don't GC history in this test.
// We rely on verifying "back in time" with snapshot scans.
- common_flags.push_back("--tablet_history_max_age_sec=86400");
+ common_flags.emplace_back("--tablet_history_max_age_sec=86400");
vector<string> ts_flags(common_flags);
if (FLAGS_stress_flush_compact) {
// Set the flush threshold low so that we have a mix of flushed and unflushed
// operations in the WAL, when we bootstrap.
- ts_flags.push_back("--flush_threshold_mb=1");
+ ts_flags.emplace_back("--flush_threshold_mb=1");
// Set the compaction budget to be low so that we get multiple passes of compaction
// instead of selecting all of the rowsets in a single compaction of the whole
// tablet.
- ts_flags.push_back("--tablet_compaction_budget_mb=4");
+ ts_flags.emplace_back("--tablet_compaction_budget_mb=4");
// Set the major delta compaction ratio low enough that we trigger a lot of them.
- ts_flags.push_back("--tablet_delta_store_major_compact_min_ratio=0.001");
+ ts_flags.emplace_back("--tablet_delta_store_major_compact_min_ratio=0.001");
}
if (FLAGS_stress_wal_gc) {
// Set the size of the WAL segments low so that some can be GC'd.
- ts_flags.push_back("--log_segment_size_mb=1");
+ ts_flags.emplace_back("--log_segment_size_mb=1");
}
CreateCluster("linked-list-cluster", ts_flags, common_flags);
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/master-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master-stress-test.cc b/src/kudu/integration-tests/master-stress-test.cc
index 1c13054..5715ba0 100644
--- a/src/kudu/integration-tests/master-stress-test.cc
+++ b/src/kudu/integration-tests/master-stress-test.cc
@@ -95,24 +95,24 @@ class MasterStressTest : public KuduTest {
// Don't preallocate log segments, since we're creating many tablets here.
// If each preallocates 64M or so, we use a ton of disk space in this
// test, and it fails on normal sized /tmp dirs.
- opts.extra_master_flags.push_back("--log_preallocate_segments=false");
- opts.extra_tserver_flags.push_back("--log_preallocate_segments=false");
+ opts.extra_master_flags.emplace_back("--log_preallocate_segments=false");
+ opts.extra_tserver_flags.emplace_back("--log_preallocate_segments=false");
// Reduce various timeouts below as to make the detection of leader master
// failures (specifically, failures as result of long pauses) more rapid.
// Set max missed heartbeats periods to 1.0 (down from 3.0).
- opts.extra_master_flags.push_back("--leader_failure_max_missed_heartbeat_periods=1.0");
+ opts.extra_master_flags.emplace_back("--leader_failure_max_missed_heartbeat_periods=1.0");
// Set the TS->master heartbeat timeout to 1 second (down from 15 seconds).
- opts.extra_tserver_flags.push_back("--heartbeat_rpc_timeout_ms=1000");
+ opts.extra_tserver_flags.emplace_back("--heartbeat_rpc_timeout_ms=1000");
// Allow one TS heartbeat failure before retrying with back-off (down from 3).
- opts.extra_tserver_flags.push_back("--heartbeat_max_failures_before_backoff=1");
+ opts.extra_tserver_flags.emplace_back("--heartbeat_max_failures_before_backoff=1");
// Wait for 500 ms after 'max_consecutive_failed_heartbeats' before trying
// again (down from 1 second).
- opts.extra_tserver_flags.push_back("--heartbeat_interval_ms=500");
+ opts.extra_tserver_flags.emplace_back("--heartbeat_interval_ms=500");
cluster_.reset(new ExternalMiniCluster(std::move(opts)));
ASSERT_OK(cluster_->Start());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/master_failover-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_failover-itest.cc b/src/kudu/integration-tests/master_failover-itest.cc
index 5026e75..e02e5ca 100644
--- a/src/kudu/integration-tests/master_failover-itest.cc
+++ b/src/kudu/integration-tests/master_failover-itest.cc
@@ -71,15 +71,15 @@ class MasterFailoverTest : public KuduTest {
// long pauses) more rapid.
// Set max missed heartbeats periods to 1.0 (down from 3.0).
- opts_.extra_master_flags.push_back("--leader_failure_max_missed_heartbeat_periods=1.0");
+ opts_.extra_master_flags.emplace_back("--leader_failure_max_missed_heartbeat_periods=1.0");
// Set the TS->master heartbeat timeout to 1 second (down from 15 seconds).
- opts_.extra_tserver_flags.push_back("--heartbeat_rpc_timeout_ms=1000");
+ opts_.extra_tserver_flags.emplace_back("--heartbeat_rpc_timeout_ms=1000");
// Allow one TS heartbeat failure before retrying with back-off (down from 3).
- opts_.extra_tserver_flags.push_back("--heartbeat_max_failures_before_backoff=1");
+ opts_.extra_tserver_flags.emplace_back("--heartbeat_max_failures_before_backoff=1");
// Wait for 500 ms after 'max_consecutive_failed_heartbeats'
// before trying again (down from 1 second).
- opts_.extra_tserver_flags.push_back("--heartbeat_interval_ms=500");
+ opts_.extra_tserver_flags.emplace_back("--heartbeat_interval_ms=500");
}
virtual void SetUp() OVERRIDE {
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/mini_cluster.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/mini_cluster.cc b/src/kudu/integration-tests/mini_cluster.cc
index 60ac484..3139dc5 100644
--- a/src/kudu/integration-tests/mini_cluster.cc
+++ b/src/kudu/integration-tests/mini_cluster.cc
@@ -177,7 +177,7 @@ Status MiniCluster::AddTabletServer() {
// set the master addresses
tablet_server->options()->master_addresses.clear();
for (const shared_ptr<MiniMaster>& master : mini_masters_) {
- tablet_server->options()->master_addresses.push_back(HostPort(master->bound_rpc_addr()));
+ tablet_server->options()->master_addresses.emplace_back(master->bound_rpc_addr());
}
RETURN_NOT_OK(tablet_server->Start())
mini_tablet_servers_.push_back(shared_ptr<MiniTabletServer>(tablet_server.release()));
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/open-readonly-fs-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/open-readonly-fs-itest.cc b/src/kudu/integration-tests/open-readonly-fs-itest.cc
index e17902d..7277e54 100644
--- a/src/kudu/integration-tests/open-readonly-fs-itest.cc
+++ b/src/kudu/integration-tests/open-readonly-fs-itest.cc
@@ -59,9 +59,9 @@ class OpenReadonlyFsITest : public KuduTest {
// threads to encourage frequent compactions. The net effect of both of
// these changes: more blocks are written to disk. Turning off container
// file preallocation forces every append to increase the file size.
- opts.extra_tserver_flags.push_back("--log_container_preallocate_bytes=0");
- opts.extra_tserver_flags.push_back("--maintenance_manager_num_threads=16");
- opts.extra_tserver_flags.push_back("--flush_threshold_mb=1");
+ opts.extra_tserver_flags.emplace_back("--log_container_preallocate_bytes=0");
+ opts.extra_tserver_flags.emplace_back("--maintenance_manager_num_threads=16");
+ opts.extra_tserver_flags.emplace_back("--flush_threshold_mb=1");
cluster_.reset(new ExternalMiniCluster(std::move(opts)));
ASSERT_OK(cluster_->Start());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 1e48a65..4f7d543 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -836,23 +836,23 @@ void RaftConsensusITest::CreateClusterForCrashyNodesTests() {
// Crash 5% of the time just before sending an RPC. With 7 servers,
// this means we crash about 30% of the time before we've fully
// replicated the NO_OP at the start of the term.
- ts_flags.push_back("--fault_crash_on_leader_request_fraction=0.05");
+ ts_flags.emplace_back("--fault_crash_on_leader_request_fraction=0.05");
// Inject latency to encourage the replicas to fall out of sync
// with each other.
- ts_flags.push_back("--log_inject_latency");
- ts_flags.push_back("--log_inject_latency_ms_mean=30");
- ts_flags.push_back("--log_inject_latency_ms_stddev=60");
+ ts_flags.emplace_back("--log_inject_latency");
+ ts_flags.emplace_back("--log_inject_latency_ms_mean=30");
+ ts_flags.emplace_back("--log_inject_latency_ms_stddev=60");
// Make leader elections faster so we get through more cycles of leaders.
- ts_flags.push_back("--raft_heartbeat_interval_ms=100");
- ts_flags.push_back("--leader_failure_monitor_check_mean_ms=50");
- ts_flags.push_back("--leader_failure_monitor_check_stddev_ms=25");
+ ts_flags.emplace_back("--raft_heartbeat_interval_ms=100");
+ ts_flags.emplace_back("--leader_failure_monitor_check_mean_ms=50");
+ ts_flags.emplace_back("--leader_failure_monitor_check_stddev_ms=25");
// Avoid preallocating segments since bootstrap is a little bit
// faster if it doesn't have to scan forward through the preallocated
// log area.
- ts_flags.push_back("--log_preallocate_segments=false");
+ ts_flags.emplace_back("--log_preallocate_segments=false");
CreateCluster("raft_consensus-itest-crashy-nodes-cluster", ts_flags, {});
}
@@ -950,10 +950,10 @@ void RaftConsensusITest::CreateClusterForChurnyElectionsTests(
// any progress at all.
ts_flags.push_back("--raft_heartbeat_interval_ms=5");
#else
- ts_flags.push_back("--raft_heartbeat_interval_ms=1");
+ ts_flags.emplace_back("--raft_heartbeat_interval_ms=1");
#endif
- ts_flags.push_back("--leader_failure_monitor_check_mean_ms=1");
- ts_flags.push_back("--leader_failure_monitor_check_stddev_ms=1");
+ ts_flags.emplace_back("--leader_failure_monitor_check_mean_ms=1");
+ ts_flags.emplace_back("--leader_failure_monitor_check_stddev_ms=1");
ts_flags.insert(ts_flags.end(), extra_ts_flags.cbegin(), extra_ts_flags.cend());
@@ -1244,9 +1244,9 @@ void RaftConsensusITest::SetupSingleReplicaTest(TServerDetails** replica_ts) {
FLAGS_num_tablet_servers = 3;
vector<string> ts_flags, master_flags;
// Don't use the hybrid clock as we set logical timestamps on ops.
- ts_flags.push_back("--use_hybrid_clock=false");
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--use_hybrid_clock=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
BuildAndStart(ts_flags, master_flags);
// Kill all the servers but one.
@@ -1585,8 +1585,8 @@ TEST_F(RaftConsensusITest, TestLeaderStepDown) {
FLAGS_num_tablet_servers = 3;
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
BuildAndStart(ts_flags, master_flags);
vector<TServerDetails*> tservers;
@@ -1726,7 +1726,7 @@ TEST_F(RaftConsensusITest, TestAddRemoveServer) {
FLAGS_num_replicas = 3;
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(BuildAndStart(ts_flags, master_flags));
vector<TServerDetails*> tservers;
@@ -1807,7 +1807,7 @@ TEST_F(RaftConsensusITest, TestReplaceChangeConfigOperation) {
FLAGS_num_replicas = 3;
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(BuildAndStart(ts_flags, master_flags));
vector<TServerDetails*> tservers;
@@ -1873,7 +1873,7 @@ TEST_F(RaftConsensusITest, TestAtomicAddRemoveServer) {
FLAGS_num_replicas = 3;
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(BuildAndStart(ts_flags, master_flags));
vector<TServerDetails*> tservers;
@@ -1957,8 +1957,8 @@ TEST_F(RaftConsensusITest, TestElectPendingVoter) {
FLAGS_num_tablet_servers = 5;
FLAGS_num_replicas = 5;
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
BuildAndStart(ts_flags, master_flags);
vector<TServerDetails*> tservers;
@@ -2070,7 +2070,7 @@ TEST_F(RaftConsensusITest, TestConfigChangeUnderLoad) {
FLAGS_num_replicas = 3;
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
BuildAndStart(ts_flags, master_flags);
vector<TServerDetails*> tservers;
@@ -2242,20 +2242,20 @@ TEST_F(RaftConsensusITest, TestEarlyCommitDespiteMemoryPressure) {
// If failure detection were on, a follower could be elected as leader after
// we kill the leader below.
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
// Very low memory limit to ease testing.
// When using tcmalloc, we set it to 30MB, since we can get accurate process memory
// usage statistics. Otherwise, set to only 4MB, since we'll only be throttling based
// on our tracked memory.
#ifdef TCMALLOC_ENABLED
- ts_flags.push_back("--memory_limit_hard_bytes=30000000");
+ ts_flags.emplace_back("--memory_limit_hard_bytes=30000000");
#else
ts_flags.push_back("--memory_limit_hard_bytes=4194304");
#endif
// Don't let transaction memory tracking get in the way.
- ts_flags.push_back("--tablet_transaction_memory_limit_mb=-1");
+ ts_flags.emplace_back("--tablet_transaction_memory_limit_mb=-1");
BuildAndStart(ts_flags, master_flags);
@@ -2421,7 +2421,7 @@ TEST_F(RaftConsensusITest, TestMemoryRemainsConstantDespiteTwoDeadFollowers) {
// Start the cluster with a low per-tablet transaction memory limit, so that
// the test can complete faster.
vector<string> flags;
- flags.push_back("--tablet_transaction_memory_limit_mb=2");
+ flags.emplace_back("--tablet_transaction_memory_limit_mb=2");
BuildAndStart(flags);
// Kill both followers.
@@ -2868,8 +2868,8 @@ TEST_F(RaftConsensusITest, TestUpdateConsensusErrorNonePrepared) {
const int kNumOps = 10;
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
BuildAndStart(ts_flags, master_flags);
vector<TServerDetails*> tservers;
@@ -2958,7 +2958,7 @@ TEST_F(RaftConsensusITest, TestLogIOErrorIsFatal) {
// Disable core dumps since we will inject FATAL errors, and dumping
// core can take a long time.
"--disable_core_dumps"};
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(BuildAndStart(ts_flags, master_flags));
vector<TServerDetails*> tservers;
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/security-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/security-itest.cc b/src/kudu/integration-tests/security-itest.cc
index 6cd5d36..9688afc 100644
--- a/src/kudu/integration-tests/security-itest.cc
+++ b/src/kudu/integration-tests/security-itest.cc
@@ -42,8 +42,8 @@ class SecurityITest : public KuduTest {
SecurityITest() {
cluster_opts_.enable_kerberos = true;
cluster_opts_.num_tablet_servers = 3;
- cluster_opts_.extra_master_flags.push_back("--rpc_trace_negotiation");
- cluster_opts_.extra_tserver_flags.push_back("--rpc_trace_negotiation");
+ cluster_opts_.extra_master_flags.emplace_back("--rpc_trace_negotiation");
+ cluster_opts_.extra_tserver_flags.emplace_back("--rpc_trace_negotiation");
}
Status StartCluster() {
cluster_.reset(new ExternalMiniCluster(cluster_opts_));
@@ -202,18 +202,18 @@ TEST_F(SecurityITest, TestAuthorizedSuperuser) {
// Test that the web UIs can be entirely disabled, for users who feel they
// are a security risk.
TEST_F(SecurityITest, TestDisableWebUI) {
- cluster_opts_.extra_master_flags.push_back("--webserver_enabled=0");
- cluster_opts_.extra_tserver_flags.push_back("--webserver_enabled=0");
+ cluster_opts_.extra_master_flags.emplace_back("--webserver_enabled=0");
+ cluster_opts_.extra_tserver_flags.emplace_back("--webserver_enabled=0");
ASSERT_OK(StartCluster());
NO_FATALS(SmokeTestCluster());
}
// Test disabling authentication and encryption.
TEST_F(SecurityITest, TestDisableAuthenticationEncryption) {
- cluster_opts_.extra_master_flags.push_back("--rpc_authentication=disabled");
- cluster_opts_.extra_tserver_flags.push_back("--rpc_authentication=disabled");
- cluster_opts_.extra_master_flags.push_back("--rpc_encryption=disabled");
- cluster_opts_.extra_tserver_flags.push_back("--rpc_encryption=disabled");
+ cluster_opts_.extra_master_flags.emplace_back("--rpc_authentication=disabled");
+ cluster_opts_.extra_tserver_flags.emplace_back("--rpc_authentication=disabled");
+ cluster_opts_.extra_master_flags.emplace_back("--rpc_encryption=disabled");
+ cluster_opts_.extra_tserver_flags.emplace_back("--rpc_encryption=disabled");
cluster_opts_.enable_kerberos = false;
ASSERT_OK(StartCluster());
NO_FATALS(SmokeTestCluster());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/tablet_copy-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/tablet_copy-itest.cc b/src/kudu/integration-tests/tablet_copy-itest.cc
index 2f747c5..7b64dd6 100644
--- a/src/kudu/integration-tests/tablet_copy-itest.cc
+++ b/src/kudu/integration-tests/tablet_copy-itest.cc
@@ -96,8 +96,8 @@ TEST_F(TabletCopyITest, TestRejectRogueLeader) {
}
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
const MonoDelta timeout = MonoDelta::FromSeconds(30);
@@ -448,14 +448,14 @@ TEST_F(TabletCopyITest, TestConcurrentTabletCopys) {
}
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- ts_flags.push_back("--log_cache_size_limit_mb=1");
- ts_flags.push_back("--log_segment_size_mb=1");
- ts_flags.push_back("--log_async_preallocate_segments=false");
- ts_flags.push_back("--log_min_segments_to_retain=100");
- ts_flags.push_back("--flush_threshold_mb=0"); // Constantly flush.
- ts_flags.push_back("--maintenance_manager_polling_interval_ms=10");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ ts_flags.emplace_back("--log_cache_size_limit_mb=1");
+ ts_flags.emplace_back("--log_segment_size_mb=1");
+ ts_flags.emplace_back("--log_async_preallocate_segments=false");
+ ts_flags.emplace_back("--log_min_segments_to_retain=100");
+ ts_flags.emplace_back("--flush_threshold_mb=0"); // Constantly flush.
+ ts_flags.emplace_back("--maintenance_manager_polling_interval_ms=10");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
const MonoDelta timeout = MonoDelta::FromSeconds(60);
@@ -692,9 +692,9 @@ int64_t CountLogMessages(ExternalTabletServer* ets) {
TEST_F(TabletCopyITest, TestDisableTabletCopy_NoTightLoopWhenTabletDeleted) {
MonoDelta timeout = MonoDelta::FromSeconds(10);
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- ts_flags.push_back("--enable_tablet_copy=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ ts_flags.emplace_back("--enable_tablet_copy=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
TestWorkload workload(cluster_.get());
@@ -755,10 +755,10 @@ TEST_F(TabletCopyITest, TestDisableTabletCopy_NoTightLoopWhenTabletDeleted) {
TEST_F(TabletCopyITest, TestSlowCopyDoesntFail) {
MonoDelta timeout = MonoDelta::FromSeconds(30);
vector<string> ts_flags, master_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
- ts_flags.push_back("--tablet_copy_dowload_file_inject_latency_ms=5000");
- ts_flags.push_back("--follower_unavailable_considered_failed_sec=2");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
+ ts_flags.emplace_back("--tablet_copy_dowload_file_inject_latency_ms=5000");
+ ts_flags.emplace_back("--follower_unavailable_considered_failed_sec=2");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
TestWorkload workload(cluster_.get());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/tablet_copy_client_session-itest.cc b/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
index 304c9b5..5442cd5 100644
--- a/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
+++ b/src/kudu/integration-tests/tablet_copy_client_session-itest.cc
@@ -57,7 +57,7 @@ void TabletCopyClientSessionITest::PrepareClusterForTabletCopy(
const int kNumTabletServers = 2;
// We don't want the master to interfere when we manually make copies of
// tablets onto servers it doesn't know about.
- extra_master_flags.push_back("--master_tombstone_evicted_tablet_replicas=false");
+ extra_master_flags.emplace_back("--master_tombstone_evicted_tablet_replicas=false");
NO_FATALS(StartCluster(extra_tserver_flags, extra_master_flags, kNumTabletServers));
// Shut down the 2nd tablet server; we'll create tablets on the first one.
cluster_->tablet_server(1)->Shutdown();
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/tablet_replacement-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/tablet_replacement-itest.cc b/src/kudu/integration-tests/tablet_replacement-itest.cc
index bdf386d..a2d9bbf 100644
--- a/src/kudu/integration-tests/tablet_replacement-itest.cc
+++ b/src/kudu/integration-tests/tablet_replacement-itest.cc
@@ -55,7 +55,7 @@ TEST_F(TabletReplacementITest, TestMasterTombstoneEvictedReplica) {
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
int num_tservers = 5;
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags, num_tservers));
TestWorkload workload(cluster_.get());
@@ -128,7 +128,7 @@ TEST_F(TabletReplacementITest, TestMasterTombstoneOldReplicaOnReport) {
MonoDelta timeout = MonoDelta::FromSeconds(30);
vector<string> ts_flags = { "--enable_leader_failure_detection=false" };
vector<string> master_flags = { "--master_add_server_when_underreplicated=false" };
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
TestWorkload workload(cluster_.get());
@@ -240,13 +240,13 @@ TEST_F(TabletReplacementITest, TestRemoteBoostrapWithPendingConfigChangeCommits)
MonoDelta timeout = MonoDelta::FromSeconds(30);
vector<string> ts_flags;
- ts_flags.push_back("--enable_leader_failure_detection=false");
+ ts_flags.emplace_back("--enable_leader_failure_detection=false");
vector<string> master_flags;
// We will manage doing the AddServer() manually, in order to make this test
// more deterministic.
- master_flags.push_back("--master_add_server_when_underreplicated=false");
- master_flags.push_back("--master_tombstone_evicted_tablet_replicas=false");
- master_flags.push_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
+ master_flags.emplace_back("--master_add_server_when_underreplicated=false");
+ master_flags.emplace_back("--master_tombstone_evicted_tablet_replicas=false");
+ master_flags.emplace_back("--catalog_manager_wait_for_new_tablets_to_elect_leader=false");
NO_FATALS(StartCluster(ts_flags, master_flags));
TestWorkload workload(cluster_.get());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/ts_itest-base.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/ts_itest-base.h b/src/kudu/integration-tests/ts_itest-base.h
index 7c96bdd..8b3f457 100644
--- a/src/kudu/integration-tests/ts_itest-base.h
+++ b/src/kudu/integration-tests/ts_itest-base.h
@@ -105,7 +105,7 @@ class TabletServerIntegrationTestBase : public TabletServerTestBase {
// If the caller passed no flags use the default ones, where we stress consensus by setting
// low timeouts and frequent cache misses.
if (non_default_ts_flags.empty()) {
- opts.extra_tserver_flags.push_back("--log_cache_size_limit_mb=10");
+ opts.extra_tserver_flags.emplace_back("--log_cache_size_limit_mb=10");
opts.extra_tserver_flags.push_back(strings::Substitute("--consensus_rpc_timeout_ms=$0",
FLAGS_consensus_rpc_timeout_ms));
} else {
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/integration-tests/version_migration-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/version_migration-test.cc b/src/kudu/integration-tests/version_migration-test.cc
index a31eed8..2a70e8a 100644
--- a/src/kudu/integration-tests/version_migration-test.cc
+++ b/src/kudu/integration-tests/version_migration-test.cc
@@ -79,9 +79,9 @@ void VersionMigrationTest::StartCluster(const vector<string>& extra_ts_flags,
if (!bin_path.empty()) opts.daemon_bin_path = bin_path;
opts.num_tablet_servers = num_tablet_servers;
opts.extra_master_flags = extra_master_flags;
- opts.extra_master_flags.push_back("--undefok=unlock_experimental_flags,unlock_unsafe_flags");
+ opts.extra_master_flags.emplace_back("--undefok=unlock_experimental_flags,unlock_unsafe_flags");
opts.extra_tserver_flags = extra_ts_flags;
- opts.extra_tserver_flags.push_back("--undefok=unlock_experimental_flags,unlock_unsafe_flags");
+ opts.extra_tserver_flags.emplace_back("--undefok=unlock_experimental_flags,unlock_unsafe_flags");
cluster_.reset(new ExternalMiniCluster(std::move(opts)));
verifier_.reset(new LogVerifier(cluster_.get()));
ASSERT_OK(cluster_->Start());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/master/ts_descriptor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_descriptor.cc b/src/kudu/master/ts_descriptor.cc
index 6f93bb3..82c4961 100644
--- a/src/kudu/master/ts_descriptor.cc
+++ b/src/kudu/master/ts_descriptor.cc
@@ -197,7 +197,7 @@ Status TSDescriptor::ResolveSockaddr(Sockaddr* addr) const {
{
std::lock_guard<simple_spinlock> l(lock_);
for (const HostPortPB& addr : registration_->rpc_addresses()) {
- hostports.push_back(HostPort(addr.host(), addr.port()));
+ hostports.emplace_back(addr.host(), addr.port());
}
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/rpc/rpc_stub-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_stub-test.cc b/src/kudu/rpc/rpc_stub-test.cc
index 2fe0708..9ee59b0 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -340,8 +340,8 @@ TEST_F(RpcStubTest, TestRpcPanic) {
string executable_path;
CHECK_OK(env_->GetExecutablePath(&executable_path));
argv.push_back(executable_path);
- argv.push_back("--is_panic_test_child");
- argv.push_back("--gtest_filter=RpcStubTest.TestRpcPanic");
+ argv.emplace_back("--is_panic_test_child");
+ argv.emplace_back("--gtest_filter=RpcStubTest.TestRpcPanic");
Subprocess subp(argv);
subp.ShareParentStderr(false);
CHECK_OK(subp.Start());
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/server/default-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/default-path-handlers.cc b/src/kudu/server/default-path-handlers.cc
index f4b3f27..7f32e26 100644
--- a/src/kudu/server/default-path-handlers.cc
+++ b/src/kudu/server/default-path-handlers.cc
@@ -227,7 +227,7 @@ static void WriteMetricsAsJson(const MetricRegistry* const metrics,
SplitStringUsing(*requested_metrics_param, ",", &requested_metrics);
} else {
// Default to including all metrics.
- requested_metrics.push_back("*");
+ requested_metrics.emplace_back("*");
}
WARN_NOT_OK(metrics->WriteAsJson(&writer, requested_metrics, opts),
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/server/server_base.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc
index ed036ad..eba74ae 100644
--- a/src/kudu/server/server_base.cc
+++ b/src/kudu/server/server_base.cc
@@ -391,7 +391,7 @@ void ServerBase::MetricsLoggingThread() {
// Collect the metrics JSON string.
vector<string> metrics;
- metrics.push_back("*");
+ metrics.emplace_back("*");
MetricJsonOptions opts;
opts.include_raw_histograms = true;
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/server/webserver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/webserver.cc b/src/kudu/server/webserver.cc
index 2c35402..2a22b5b 100644
--- a/src/kudu/server/webserver.cc
+++ b/src/kudu/server/webserver.cc
@@ -144,10 +144,10 @@ Status Webserver::Start() {
if (static_pages_available()) {
LOG(INFO) << "Document root: " << opts_.doc_root;
- options.push_back("document_root");
+ options.emplace_back("document_root");
options.push_back(opts_.doc_root);
- options.push_back("enable_directory_listing");
- options.push_back("no");
+ options.emplace_back("enable_directory_listing");
+ options.emplace_back("no");
} else {
LOG(INFO)<< "Document root disabled";
}
@@ -158,14 +158,14 @@ Status Webserver::Start() {
// Initialize OpenSSL, and prevent Squeasel from also performing global OpenSSL
// initialization.
security::InitializeOpenSSL();
- options.push_back("ssl_global_init");
- options.push_back("false");
+ options.emplace_back("ssl_global_init");
+ options.emplace_back("false");
- options.push_back("ssl_certificate");
+ options.emplace_back("ssl_certificate");
options.push_back(opts_.certificate_file);
if (!opts_.private_key_file.empty()) {
- options.push_back("ssl_private_key");
+ options.emplace_back("ssl_private_key");
options.push_back(opts_.private_key_file);
string key_password;
@@ -182,13 +182,13 @@ Status Webserver::Start() {
}
StripTrailingWhitespace(&key_password);
}
- options.push_back("ssl_private_key_password");
+ options.emplace_back("ssl_private_key_password");
options.push_back(key_password); // maybe empty if not configured.
}
}
if (!opts_.authentication_domain.empty()) {
- options.push_back("authentication_domain");
+ options.emplace_back("authentication_domain");
options.push_back(opts_.authentication_domain);
}
@@ -201,11 +201,11 @@ Status Webserver::Start() {
return Status::InvalidArgument(ss.str());
}
LOG(INFO) << "Webserver: Password file is " << opts_.password_file;
- options.push_back("global_auth_file");
+ options.emplace_back("global_auth_file");
options.push_back(opts_.password_file);
}
- options.push_back("listening_ports");
+ options.emplace_back("listening_ports");
string listening_str;
RETURN_NOT_OK(BuildListenSpec(&listening_str));
options.push_back(listening_str);
@@ -224,7 +224,7 @@ Status Webserver::Start() {
}
// Num threads
- options.push_back("num_threads");
+ options.emplace_back("num_threads");
options.push_back(std::to_string(opts_.num_worker_threads));
// mongoose ignores SIGCHLD and we need it to run kinit. This means that since
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/deltamemstore.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/deltamemstore.cc b/src/kudu/tablet/deltamemstore.cc
index 204efba..dc52c28 100644
--- a/src/kudu/tablet/deltamemstore.cc
+++ b/src/kudu/tablet/deltamemstore.cc
@@ -278,7 +278,7 @@ Status DMSIterator::PrepareBatch(size_t nrows, PrepareFlag flag) {
// just overwrite that one.
if (updates_by_col_[col_idx].empty() ||
updates_by_col_[col_idx].back().row_id != key.row_idx()) {
- updates_by_col_[col_idx].push_back(ColumnUpdate());
+ updates_by_col_[col_idx].emplace_back();
}
ColumnUpdate& cu = updates_by_col_[col_idx].back();
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/diskrowset-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/diskrowset-test.cc b/src/kudu/tablet/diskrowset-test.cc
index 6b9ee3b..71c92b2 100644
--- a/src/kudu/tablet/diskrowset-test.cc
+++ b/src/kudu/tablet/diskrowset-test.cc
@@ -318,7 +318,7 @@ TEST_F(TestRowSet, TestFlushedUpdatesRespectMVCC) {
// Take a snapshot of the pre-update state.
vector<MvccSnapshot> snaps;
- snaps.push_back(MvccSnapshot(mvcc_));
+ snaps.emplace_back(mvcc_);
// Update the single row multiple times, taking an MVCC snapshot
@@ -347,7 +347,7 @@ TEST_F(TestRowSet, TestFlushedUpdatesRespectMVCC) {
ASSERT_EQ(0L, result.mutated_stores(0).dms_id());
tx.Commit();
}
- snaps.push_back(MvccSnapshot(mvcc_));
+ snaps.emplace_back(mvcc_);
}
// Ensure that MVCC is respected by reading the value at each of the stored
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/local_tablet_writer.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/local_tablet_writer.h b/src/kudu/tablet/local_tablet_writer.h
index 6bc3f6e..b92a409 100644
--- a/src/kudu/tablet/local_tablet_writer.h
+++ b/src/kudu/tablet/local_tablet_writer.h
@@ -80,7 +80,7 @@ class LocalTabletWriter {
Status Write(RowOperationsPB::Type type,
const KuduPartialRow& row) {
vector<Op> ops;
- ops.push_back(Op(type, &row));
+ ops.emplace_back(type, &row);
return WriteBatch(ops);
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/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 fd55f2b..d505989 100644
--- a/src/kudu/tablet/lock_manager-test.cc
+++ b/src/kudu/tablet/lock_manager-test.cc
@@ -263,7 +263,7 @@ TEST_F(LockManagerTest, TestUncontended) {
}
vector<Slice> slices;
for (int i = 0; i < FLAGS_num_test_threads; i++) {
- slices.push_back(Slice(slice_strings[i]));
+ slices.emplace_back(slice_strings[i]);
}
vector<shared_ptr<LmTestResource> > resources;
for (int i = 0; i < FLAGS_num_test_threads; i++) {
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/memrowset-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/memrowset-test.cc b/src/kudu/tablet/memrowset-test.cc
index 2b223b6..c8dab7e 100644
--- a/src/kudu/tablet/memrowset-test.cc
+++ b/src/kudu/tablet/memrowset-test.cc
@@ -474,7 +474,7 @@ TEST_F(TestMemRowSet, TestInsertionMVCC) {
}
// Transaction is committed. Save the snapshot after this commit.
- snapshots.push_back(MvccSnapshot(mvcc_));
+ snapshots.emplace_back(mvcc_);
}
LOG(INFO) << "MemRowSet after inserts:";
ASSERT_OK(mrs->DebugDump());
@@ -503,7 +503,7 @@ TEST_F(TestMemRowSet, TestUpdateMVCC) {
vector<MvccSnapshot> snapshots;
// First snapshot is after insertion
- snapshots.push_back(MvccSnapshot(mvcc_));
+ snapshots.emplace_back(mvcc_);
// Update the row 5 times (setting its int column to increasing ints 1-5)
for (uint32_t i = 1; i <= 5; i++) {
@@ -513,7 +513,7 @@ TEST_F(TestMemRowSet, TestUpdateMVCC) {
ASSERT_EQ(0L, result.mutated_stores(0).mrs_id());
// Transaction is committed. Save the snapshot after this commit.
- snapshots.push_back(MvccSnapshot(mvcc_));
+ snapshots.emplace_back(mvcc_);
}
LOG(INFO) << "MemRowSet after updates:";
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/metadata-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/metadata-test.cc b/src/kudu/tablet/metadata-test.cc
index a404e6d..6ec3901 100644
--- a/src/kudu/tablet/metadata-test.cc
+++ b/src/kudu/tablet/metadata-test.cc
@@ -56,8 +56,8 @@ class MetadataTest : public KuduTest {
// Swap out some deltas from the middle of the list
TEST_F(MetadataTest, RSMD_TestReplaceDeltas_1) {
vector<BlockId> to_replace;
- to_replace.push_back(BlockId(2));
- to_replace.push_back(BlockId(3));
+ to_replace.emplace_back(2);
+ to_replace.emplace_back(3);
ASSERT_OK(meta_->CommitUpdate(
RowSetMetadataUpdate()
@@ -69,8 +69,8 @@ TEST_F(MetadataTest, RSMD_TestReplaceDeltas_1) {
// Swap out some deltas from the beginning of the list
TEST_F(MetadataTest, RSMD_TestReplaceDeltas_2) {
vector<BlockId> to_replace;
- to_replace.push_back(BlockId(1));
- to_replace.push_back(BlockId(2));
+ to_replace.emplace_back(1);
+ to_replace.emplace_back(2);
ASSERT_OK(meta_->CommitUpdate(
RowSetMetadataUpdate()
@@ -82,8 +82,8 @@ TEST_F(MetadataTest, RSMD_TestReplaceDeltas_2) {
// Swap out some deltas from the end of the list
TEST_F(MetadataTest, RSMD_TestReplaceDeltas_3) {
vector<BlockId> to_replace;
- to_replace.push_back(BlockId(3));
- to_replace.push_back(BlockId(4));
+ to_replace.emplace_back(3);
+ to_replace.emplace_back(4);
ASSERT_OK(meta_->CommitUpdate(
RowSetMetadataUpdate()
@@ -95,8 +95,8 @@ TEST_F(MetadataTest, RSMD_TestReplaceDeltas_3) {
// Swap out a non-contiguous list, check error.
TEST_F(MetadataTest, RSMD_TestReplaceDeltas_Bad_NonContiguous) {
vector<BlockId> to_replace;
- to_replace.push_back(BlockId(2));
- to_replace.push_back(BlockId(4));
+ to_replace.emplace_back(2);
+ to_replace.emplace_back(4);
Status s = meta_->CommitUpdate(
RowSetMetadataUpdate()
@@ -113,7 +113,7 @@ TEST_F(MetadataTest, RSMD_TestReplaceDeltas_Bad_NonContiguous) {
// Swap out a list which contains an invalid element, check error.
TEST_F(MetadataTest, RSMD_TestReplaceDeltas_Bad_DoesntExist) {
vector<BlockId> to_replace;
- to_replace.push_back(BlockId(555));
+ to_replace.emplace_back(555);
Status s = meta_->CommitUpdate(
RowSetMetadataUpdate()
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/rowset_tree.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/rowset_tree.cc b/src/kudu/tablet/rowset_tree.cc
index 272468a..4c748e6 100644
--- a/src/kudu/tablet/rowset_tree.cc
+++ b/src/kudu/tablet/rowset_tree.cc
@@ -135,8 +135,8 @@ Status RowSetTree::Reset(const RowSetVector &rowsets) {
rsit->max_key = std::move(max_key);
// Load into key endpoints.
- endpoints.push_back(RSEndpoint(rsit->rowset, START, rsit->min_key));
- endpoints.push_back(RSEndpoint(rsit->rowset, STOP, rsit->max_key));
+ endpoints.emplace_back(rsit->rowset, START, rsit->min_key);
+ endpoints.emplace_back(rsit->rowset, STOP, rsit->max_key);
entries.push_back(rsit.release());
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tablet/tablet-schema-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet-schema-test.cc b/src/kudu/tablet/tablet-schema-test.cc
index 0b95271..8b2a659 100644
--- a/src/kudu/tablet/tablet-schema-test.cc
+++ b/src/kudu/tablet/tablet-schema-test.cc
@@ -144,9 +144,9 @@ TEST_F(TestTabletSchema, TestWrite) {
// Verify the default value
std::vector<std::pair<string, string> > keys;
- keys.push_back(std::pair<string, string>(Substitute("key=$0", s2Key),
- Substitute("c2=$0", c2_write_default)));
- keys.push_back(std::pair<string, string>("", Substitute("c2=$0", c2_read_default)));
+ keys.emplace_back(Substitute("key=$0", s2Key),
+ Substitute("c2=$0", c2_write_default));
+ keys.emplace_back("", Substitute("c2=$0", c2_read_default));
VerifyTabletRows(s2, keys);
// Delete the row
@@ -187,10 +187,10 @@ TEST_F(TestTabletSchema, TestReInsert) {
// Verify the default value
std::vector<std::pair<string, string> > keys;
- keys.push_back(std::pair<string, string>(Substitute("key=$0", s1Key),
- Substitute("c2=$0", c2_read_default)));
- keys.push_back(std::pair<string, string>(Substitute("key=$0", s2Key),
- Substitute("c2=$0", c2_write_default)));
+ keys.emplace_back(Substitute("key=$0", s1Key),
+ Substitute("c2=$0", c2_read_default));
+ keys.emplace_back(Substitute("key=$0", s2Key),
+ Substitute("c2=$0", c2_write_default));
VerifyTabletRows(s2, keys);
// Try compact all (different schemas)
@@ -217,8 +217,8 @@ TEST_F(TestTabletSchema, TestRenameProjection) {
// Read and verify using the s2 schema
keys.clear();
for (int i = 1; i <= 4; ++i) {
- keys.push_back(std::pair<string, string>(Substitute("key=$0", i),
- Substitute("c1_renamed=$0", i)));
+ keys.emplace_back(Substitute("key=$0", i),
+ Substitute("c1_renamed=$0", i));
}
VerifyTabletRows(s2, keys);
@@ -230,7 +230,7 @@ TEST_F(TestTabletSchema, TestRenameProjection) {
// Read and verify using the s2 schema
keys.clear();
- keys.push_back(std::pair<string, string>("key=2", "c1_renamed=6"));
+ keys.emplace_back("key=2", "c1_renamed=6");
VerifyTabletRows(s2, keys);
}
@@ -243,7 +243,7 @@ TEST_F(TestTabletSchema, TestDeleteAndReAddColumn) {
MutateRow(client_schema_, /* key= */ 1, /* col_idx= */ 1, /* new_val= */ 2);
keys.clear();
- keys.push_back(std::pair<string, string>("key=1", "c1=2"));
+ keys.emplace_back("key=1", "c1=2");
VerifyTabletRows(client_schema_, keys);
// Switch schema to s2
@@ -257,7 +257,7 @@ TEST_F(TestTabletSchema, TestDeleteAndReAddColumn) {
// Verify that the new 'c1' have the default value
keys.clear();
- keys.push_back(std::pair<string, string>("key=1", "c1=NULL"));
+ keys.emplace_back("key=1", "c1=NULL");
VerifyTabletRows(s2, keys);
}
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index a99d4c1..7505b67 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -845,12 +845,12 @@ Ksck::CheckResult Ksck::VerifyTablet(const shared_ptr<KsckTablet>& tablet, int t
// Fill out the columns with info from the replicas.
for (const auto& replica : replica_infos) {
char label = FindOrDie(peer_uuid_mapping, replica.ts->uuid());
- sources.push_back(string(1, label));
+ sources.emplace_back(1, label);
if (!replica.consensus_state) {
- voters.push_back("[config not available]");
- terms.push_back("");
- indexes.push_back("");
- committed.push_back("");
+ voters.emplace_back("[config not available]");
+ terms.emplace_back("");
+ indexes.emplace_back("");
+ committed.emplace_back("");
continue;
}
voters.push_back(format_peers(peer_uuid_mapping, replica.consensus_state.get()));
@@ -858,7 +858,7 @@ Ksck::CheckResult Ksck::VerifyTablet(const shared_ptr<KsckTablet>& tablet, int t
std::to_string(replica.consensus_state->term.get()) : "");
indexes.push_back(replica.consensus_state->opid_index ?
std::to_string(replica.consensus_state->opid_index.get()) : "");
- committed.push_back(replica.consensus_state->type == KsckConsensusConfigType::PENDING ?
+ committed.emplace_back(replica.consensus_state->type == KsckConsensusConfigType::PENDING ?
"No" : "Yes");
}
vector<vector<string>> columns{ sources, voters, terms, indexes, committed };
http://git-wip-us.apache.org/repos/asf/kudu/blob/3ff6c9ba/src/kudu/tools/tool_main.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/tool_main.cc b/src/kudu/tools/tool_main.cc
index e3be7ed..4cc10c7 100644
--- a/src/kudu/tools/tool_main.cc
+++ b/src/kudu/tools/tool_main.cc
@@ -190,7 +190,7 @@ int RunTool(int argc, char** argv, bool show_help) {
// Invoke the action with whatever arguments remain, skipping this one.
deque<string> remaining_args;
for (int j = i + 1; j < argc; j++) {
- remaining_args.push_back(argv[j]);
+ remaining_args.emplace_back(argv[j]);
}
return DispatchCommand(chain, next_action, remaining_args);
}