http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/compaction.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/compaction.h b/src/kudu/tablet/compaction.h index bead82e..24ea328 100644 --- a/src/kudu/tablet/compaction.h +++ b/src/kudu/tablet/compaction.h @@ -100,11 +100,11 @@ class CompactionInput { // Create an input which merges several other compaction inputs. The inputs are merged // in key-order according to the given schema. All inputs must have matching schemas. - static CompactionInput *Merge(const vector<std::shared_ptr<CompactionInput> > &inputs, + static CompactionInput *Merge(const std::vector<std::shared_ptr<CompactionInput> > &inputs, const Schema *schema); virtual Status Init() = 0; - virtual Status PrepareBlock(vector<CompactionInputRow> *block) = 0; + virtual Status PrepareBlock(std::vector<CompactionInputRow> *block) = 0; // Returns the arena for this compaction input corresponding to the last // prepared block. This must be called *after* PrepareBlock() as if this @@ -150,7 +150,7 @@ class RowSetsInCompaction { private: RowSetVector rowsets_; - vector<std::unique_lock<std::mutex>> locks_; + std::vector<std::unique_lock<std::mutex>> locks_; }; // One row yielded by CompactionInput::PrepareBlock. @@ -223,7 +223,7 @@ Status FlushCompactionInput(CompactionInput *input, // // After return of this function, this CompactionInput object is "used up" and will // yield no further rows. -Status ReupdateMissedDeltas(const string &tablet_name, +Status ReupdateMissedDeltas(const std::string &tablet_name, CompactionInput *input, const HistoryGcOpts& history_gc_opts, const MvccSnapshot &snap_to_exclude, @@ -232,11 +232,13 @@ Status ReupdateMissedDeltas(const string &tablet_name, // Dump the given compaction input to 'lines' or LOG(INFO) if it is NULL. // This consumes all of the input in the compaction input. -Status DebugDumpCompactionInput(CompactionInput *input, vector<string> *lines); +Status DebugDumpCompactionInput(CompactionInput *input, std::vector<std::string> *lines); // Helper methods to print a row with full history. -string RowToString(const RowBlockRow& row, const Mutation* redo_head, const Mutation* undo_head); -string CompactionInputRowToString(const CompactionInputRow& input_row); +std::string RowToString(const RowBlockRow& row, + const Mutation* redo_head, + const Mutation* undo_head); +std::string CompactionInputRowToString(const CompactionInputRow& input_row); } // namespace tablet } // namespace kudu
http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/compaction_policy.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/compaction_policy.cc b/src/kudu/tablet/compaction_policy.cc index 3836d29..93fb7b2 100644 --- a/src/kudu/tablet/compaction_policy.cc +++ b/src/kudu/tablet/compaction_policy.cc @@ -180,7 +180,7 @@ class BoundCalculator { // Compute the lower and upper bounds to the 0-1 knapsack problem with the elements // added so far. - pair<double, double> ComputeLowerAndUpperBound() const { + std::pair<double, double> ComputeLowerAndUpperBound() const { int excess_weight = total_weight_ - max_weight_; if (excess_weight <= 0) { // If we've added less than the budget, our "bounds" are just including @@ -350,7 +350,7 @@ void BudgetedCompactionPolicy::RunExact( // See docs/design-docs/compaction-policy.md for an overview of the compaction // policy implemented in this function. Status BudgetedCompactionPolicy::PickRowSets(const RowSetTree &tree, - unordered_set<RowSet*>* picked, + std::unordered_set<RowSet*>* picked, double* quality, std::vector<std::string>* log) { vector<RowSetInfo> asc_min_key, asc_max_key; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/composite-pushdown-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/composite-pushdown-test.cc b/src/kudu/tablet/composite-pushdown-test.cc index 63b3e68..19fd3da 100644 --- a/src/kudu/tablet/composite-pushdown-test.cc +++ b/src/kudu/tablet/composite-pushdown-test.cc @@ -24,6 +24,9 @@ #include "kudu/util/test_macros.h" #include "kudu/util/test_util.h" +using std::string; +using std::vector; + namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/concurrent_btree.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/concurrent_btree.h b/src/kudu/tablet/concurrent_btree.h index 1a2af12..0e4dfa6 100644 --- a/src/kudu/tablet/concurrent_btree.h +++ b/src/kudu/tablet/concurrent_btree.h @@ -206,7 +206,7 @@ struct VersionField { return v & BTREE_INSERTING_MASK; } - static string Stringify(AtomicVersion v) { + static std::string Stringify(AtomicVersion v) { return StringPrintf("[flags=%c%c%c vins=%" PRIu64 " vsplit=%" PRIu64 "]", (v & BTREE_LOCK_MASK) ? 'L':' ', (v & BTREE_SPLITTING_MASK) ? 'S':' ', @@ -625,8 +625,8 @@ class PACKED InternalNode : public NodeBase<Traits> { #endif } - string ToString() const { - string ret("["); + std::string ToString() const { + std::string ret("["); for (int i = 0; i < num_children_; i++) { if (i > 0) { ret.append(", "); @@ -778,8 +778,8 @@ class LeafNode : public NodeBase<Traits> { num_entries_ = new_num_entries; } - string ToString() const { - string ret; + std::string ToString() const { + std::string ret; for (int i = 0; i < num_entries_; i++) { if (i > 0) { ret.append(", "); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_compaction.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_compaction.cc b/src/kudu/tablet/delta_compaction.cc index af50e98..ee110af 100644 --- a/src/kudu/tablet/delta_compaction.cc +++ b/src/kudu/tablet/delta_compaction.cc @@ -42,6 +42,7 @@ namespace kudu { using fs::CreateBlockOptions; using fs::WritableBlock; +using std::string; using std::unique_ptr; using std::vector; using strings::Substitute; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_iterator_merger.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_iterator_merger.h b/src/kudu/tablet/delta_iterator_merger.h index f1e5cef..139cdd4 100644 --- a/src/kudu/tablet/delta_iterator_merger.h +++ b/src/kudu/tablet/delta_iterator_merger.h @@ -52,16 +52,16 @@ class DeltaIteratorMerger : public DeltaIterator { virtual Status PrepareBatch(size_t nrows, PrepareFlag flag) OVERRIDE; virtual Status ApplyUpdates(size_t col_to_apply, ColumnBlock *dst) OVERRIDE; virtual Status ApplyDeletes(SelectionVector *sel_vec) OVERRIDE; - virtual Status CollectMutations(vector<Mutation *> *dst, Arena *arena) OVERRIDE; + virtual Status CollectMutations(std::vector<Mutation *> *dst, Arena *arena) OVERRIDE; virtual Status FilterColumnIdsAndCollectDeltas(const std::vector<ColumnId>& col_ids, - vector<DeltaKeyAndUpdate>* out, + std::vector<DeltaKeyAndUpdate>* out, Arena* arena) OVERRIDE; virtual bool HasNext() OVERRIDE; bool MayHaveDeltas() override; virtual std::string ToString() const OVERRIDE; private: - explicit DeltaIteratorMerger(vector<std::unique_ptr<DeltaIterator> > iters); + explicit DeltaIteratorMerger(std::vector<std::unique_ptr<DeltaIterator> > iters); std::vector<std::unique_ptr<DeltaIterator> > iters_; }; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_key.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_key.h b/src/kudu/tablet/delta_key.h index 7ad6b0a..68ca198 100644 --- a/src/kudu/tablet/delta_key.h +++ b/src/kudu/tablet/delta_key.h @@ -89,7 +89,7 @@ class DeltaKey { return Status::OK(); } - string ToString() const { + std::string ToString() const { return strings::Substitute("(row $0@tx$1)", row_idx_, timestamp_.ToString()); } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_stats.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_stats.cc b/src/kudu/tablet/delta_stats.cc index 928d6eb..a3ffbee 100644 --- a/src/kudu/tablet/delta_stats.cc +++ b/src/kudu/tablet/delta_stats.cc @@ -28,6 +28,7 @@ using strings::Substitute; namespace kudu { +using std::string; using std::vector; namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_store.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_store.cc b/src/kudu/tablet/delta_store.cc index 137bcda..6eaa307 100644 --- a/src/kudu/tablet/delta_store.cc +++ b/src/kudu/tablet/delta_store.cc @@ -28,6 +28,7 @@ namespace tablet { using std::shared_ptr; using std::string; +using std::vector; using strings::Substitute; string DeltaKeyAndUpdate::Stringify(DeltaType type, const Schema& schema, bool pad_key) const { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_store.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_store.h b/src/kudu/tablet/delta_store.h index b1fce99..564d33f 100644 --- a/src/kudu/tablet/delta_store.h +++ b/src/kudu/tablet/delta_store.h @@ -163,7 +163,7 @@ class DeltaIterator { // // The Mutation objects will be allocated out of the provided Arena, which must be non-NULL. // Must have called PrepareBatch() with flag = PREPARE_FOR_COLLECT. - virtual Status CollectMutations(vector<Mutation *> *dst, Arena *arena) = 0; + virtual Status CollectMutations(std::vector<Mutation *> *dst, Arena *arena) = 0; // Iterate through all deltas, adding deltas for columns not // specified in 'col_ids' to 'out'. @@ -172,7 +172,7 @@ class DeltaIterator { // must be non-NULL. // Must have called PrepareBatch() with flag = PREPARE_FOR_COLLECT. virtual Status FilterColumnIdsAndCollectDeltas(const std::vector<ColumnId>& col_ids, - vector<DeltaKeyAndUpdate>* out, + std::vector<DeltaKeyAndUpdate>* out, Arena* arena) = 0; // Returns true if there are any more rows left in this iterator. @@ -202,7 +202,7 @@ Status DebugDumpDeltaIterator(DeltaType type, DeltaIterator* iter, const Schema& schema, size_t nrows, - vector<std::string>* out); + std::vector<std::string>* out); // Writes the contents of 'iter' to 'out', block by block. Used by // minor delta compaction. http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_tracker.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_tracker.cc b/src/kudu/tablet/delta_tracker.cc index 5e0bdf1..cbaaff2 100644 --- a/src/kudu/tablet/delta_tracker.cc +++ b/src/kudu/tablet/delta_tracker.cc @@ -43,9 +43,11 @@ using fs::CreateBlockOptions; using fs::ReadableBlock; using fs::WritableBlock; using log::LogAnchorRegistry; +using std::set; using std::shared_ptr; using std::string; using std::unique_ptr; +using std::vector; using strings::Substitute; Status DeltaTracker::Open(const shared_ptr<RowSetMetadata>& rowset_metadata, http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/delta_tracker.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/delta_tracker.h b/src/kudu/tablet/delta_tracker.h index 77b86e1..3c66230 100644 --- a/src/kudu/tablet/delta_tracker.h +++ b/src/kudu/tablet/delta_tracker.h @@ -151,7 +151,7 @@ class DeltaTracker { // stores visible before attempting to flush the metadata to disk. Status CommitDeltaStoreMetadataUpdate(const RowSetMetadataUpdate& update, const SharedDeltaStoreVector& to_remove, - const vector<BlockId>& new_delta_blocks, + const std::vector<BlockId>& new_delta_blocks, DeltaType type, MetadataFlushType flush_type); @@ -254,7 +254,7 @@ class DeltaTracker { MetadataFlushType flush_type); // This collects undo and/or redo stores into '*stores'. - void CollectStores(vector<std::shared_ptr<DeltaStore>>* stores, + void CollectStores(std::vector<std::shared_ptr<DeltaStore>>* stores, WhichStores which) const; // Performs the actual compaction. Results of compaction are written to "block", @@ -280,8 +280,8 @@ class DeltaTracker { // race on 'redo_delta_stores_'. Status MakeDeltaIteratorMergerUnlocked(size_t start_idx, size_t end_idx, const Schema* schema, - vector<std::shared_ptr<DeltaStore > > *target_stores, - vector<BlockId> *target_blocks, + std::vector<std::shared_ptr<DeltaStore > > *target_stores, + std::vector<BlockId> *target_blocks, std::unique_ptr<DeltaIterator> *out); std::string LogPrefix() const; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltafile-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltafile-test.cc b/src/kudu/tablet/deltafile-test.cc index e353802..6bedbb1 100644 --- a/src/kudu/tablet/deltafile-test.cc +++ b/src/kudu/tablet/deltafile-test.cc @@ -37,7 +37,9 @@ DEFINE_int32(n_verify, 1, "number of times to verify the updates" using std::is_sorted; using std::shared_ptr; +using std::string; using std::unique_ptr; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltafile.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltafile.cc b/src/kudu/tablet/deltafile.cc index 0572ccf..f96903e 100644 --- a/src/kudu/tablet/deltafile.cc +++ b/src/kudu/tablet/deltafile.cc @@ -49,7 +49,9 @@ DEFINE_string(deltafile_default_compression_codec, "lz4", TAG_FLAG(deltafile_default_compression_codec, experimental); using std::shared_ptr; +using std::string; using std::unique_ptr; +using std::vector; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltafile.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltafile.h b/src/kudu/tablet/deltafile.h index f0db2d5..ada35a5 100644 --- a/src/kudu/tablet/deltafile.h +++ b/src/kudu/tablet/deltafile.h @@ -201,11 +201,11 @@ class DeltaFileIterator : public DeltaIterator { Status PrepareBatch(size_t nrows, PrepareFlag flag) OVERRIDE; Status ApplyUpdates(size_t col_to_apply, ColumnBlock *dst) OVERRIDE; Status ApplyDeletes(SelectionVector *sel_vec) OVERRIDE; - Status CollectMutations(vector<Mutation *> *dst, Arena *arena) OVERRIDE; + Status CollectMutations(std::vector<Mutation *> *dst, Arena *arena) OVERRIDE; Status FilterColumnIdsAndCollectDeltas(const std::vector<ColumnId>& col_ids, - vector<DeltaKeyAndUpdate>* out, + std::vector<DeltaKeyAndUpdate>* out, Arena* arena) OVERRIDE; - string ToString() const OVERRIDE; + std::string ToString() const OVERRIDE; virtual bool HasNext() OVERRIDE; bool MayHaveDeltas() override; @@ -254,7 +254,7 @@ class DeltaFileIterator : public DeltaIterator { rowid_t prepared_block_start_idx_; // Return a string description of this prepared block, for logging. - string ToString() const; + std::string ToString() const; }; @@ -282,7 +282,8 @@ class DeltaFileIterator : public DeltaIterator { Status VisitMutations(Visitor *visitor); // Log a FATAL error message about a bad delta. - void FatalUnexpectedDelta(const DeltaKey &key, const Slice &deltas, const string &msg); + void FatalUnexpectedDelta(const DeltaKey &key, const Slice &deltas, + const std::string &msg); std::shared_ptr<DeltaFileReader> dfr_; @@ -314,7 +315,7 @@ class DeltaFileIterator : public DeltaIterator { // The type of this delta iterator, i.e. UNDO or REDO. const DeltaType delta_type_; - CFileReader::CacheControl cache_blocks_; + cfile::CFileReader::CacheControl cache_blocks_; }; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltamemstore-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltamemstore-test.cc b/src/kudu/tablet/deltamemstore-test.cc index 1471359..a523c31 100644 --- a/src/kudu/tablet/deltamemstore-test.cc +++ b/src/kudu/tablet/deltamemstore-test.cc @@ -37,8 +37,10 @@ DEFINE_int32(benchmark_num_passes, 100, "Number of passes to apply deltas in the benchmark"); using std::shared_ptr; +using std::string; using std::unique_ptr; using std::unordered_set; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltamemstore.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltamemstore.cc b/src/kudu/tablet/deltamemstore.cc index dc52c28..3cd9939 100644 --- a/src/kudu/tablet/deltamemstore.cc +++ b/src/kudu/tablet/deltamemstore.cc @@ -32,7 +32,9 @@ namespace kudu { namespace tablet { using log::LogAnchorRegistry; +using std::string; using std::shared_ptr; +using std::vector; using strings::Substitute; //////////////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/deltamemstore.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/deltamemstore.h b/src/kudu/tablet/deltamemstore.h index f9526e1..240f3c6 100644 --- a/src/kudu/tablet/deltamemstore.h +++ b/src/kudu/tablet/deltamemstore.h @@ -194,13 +194,13 @@ class DMSIterator : public DeltaIterator { Status ApplyDeletes(SelectionVector *sel_vec) OVERRIDE; - Status CollectMutations(vector<Mutation *> *dst, Arena *arena) OVERRIDE; + Status CollectMutations(std::vector<Mutation *> *dst, Arena *arena) OVERRIDE; - Status FilterColumnIdsAndCollectDeltas(const vector<ColumnId>& col_ids, - vector<DeltaKeyAndUpdate>* out, + Status FilterColumnIdsAndCollectDeltas(const std::vector<ColumnId>& col_ids, + std::vector<DeltaKeyAndUpdate>* out, Arena* arena) OVERRIDE; - string ToString() const OVERRIDE; + std::string ToString() const OVERRIDE; virtual bool HasNext() OVERRIDE; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/diskrowset-test-base.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/diskrowset-test-base.h b/src/kudu/tablet/diskrowset-test-base.h index 927cd7c..e654509 100644 --- a/src/kudu/tablet/diskrowset-test-base.h +++ b/src/kudu/tablet/diskrowset-test-base.h @@ -53,8 +53,6 @@ DEFINE_int32(n_read_passes, 10, namespace kudu { namespace tablet { -using std::unordered_set; - class TestRowSet : public KuduRowSetTest { public: TestRowSet() @@ -74,10 +72,10 @@ class TestRowSet : public KuduRowSetTest { } static Schema CreateProjection(const Schema& schema, - const vector<string>& cols) { - vector<ColumnSchema> col_schemas; - vector<ColumnId> col_ids; - for (const string& col : cols) { + const std::vector<std::string>& cols) { + std::vector<ColumnSchema> col_schemas; + std::vector<ColumnId> col_ids; + for (const std::string& col : cols) { int idx = schema.find_column(col); CHECK_GE(idx, 0); col_schemas.push_back(schema.column(idx)); @@ -132,7 +130,7 @@ class TestRowSet : public KuduRowSetTest { // Picks some number of rows from the given rowset and updates // them. Stores the indexes of the updated rows in *updated. void UpdateExistingRows(DiskRowSet *rs, float update_ratio, - unordered_set<uint32_t> *updated) { + std::unordered_set<uint32_t> *updated) { int to_update = static_cast<int>(n_rows_ * update_ratio); faststring update_buf; RowChangeListEncoder update(&update_buf); @@ -205,14 +203,14 @@ class TestRowSet : public KuduRowSetTest { // Updated rows (those whose index is present in 'updated') should have // a 'val' column equal to idx*5. // Other rows should have val column equal to idx. - void VerifyUpdates(const DiskRowSet &rs, const unordered_set<uint32_t> &updated) { + void VerifyUpdates(const DiskRowSet &rs, const std::unordered_set<uint32_t> &updated) { LOG_TIMING(INFO, "Reading updated rows with row iter") { VerifyUpdatesWithRowIter(rs, updated); } } void VerifyUpdatesWithRowIter(const DiskRowSet &rs, - const unordered_set<uint32_t> &updated) { + const std::unordered_set<uint32_t> &updated) { Schema proj_val = CreateProjection(schema_, { "val" }); MvccSnapshot snap = MvccSnapshot::CreateSnapshotIncludingAllTransactions(); gscoped_ptr<RowwiseIterator> row_iter; @@ -233,7 +231,7 @@ class TestRowSet : public KuduRowSetTest { } void VerifyUpdatedBlock(const uint32_t *from_file, int start_row, size_t n_rows, - const unordered_set<uint32_t> &updated) { + const std::unordered_set<uint32_t> &updated) { for (int j = 0; j < n_rows; j++) { uint32_t idx_in_file = start_row + j; int expected; @@ -253,7 +251,7 @@ class TestRowSet : public KuduRowSetTest { // Perform a random read of the given row key, // asserting that the result matches 'expected_val'. void VerifyRandomRead(const DiskRowSet& rs, const Slice& row_key, - const string& expected_val) { + const std::string& expected_val) { Arena arena(256, 1024); AutoReleasePool pool; ScanSpec spec; @@ -265,9 +263,9 @@ class TestRowSet : public KuduRowSetTest { gscoped_ptr<RowwiseIterator> row_iter; CHECK_OK(rs.NewRowIterator(&schema_, snap, UNORDERED, &row_iter)); CHECK_OK(row_iter->Init(&spec)); - vector<string> rows; + std::vector<std::string> rows; IterateToStringList(row_iter.get(), &rows); - string result = JoinStrings(rows, "\n"); + std::string result = JoinStrings(rows, "\n"); ASSERT_EQ(expected_val, result); } @@ -300,7 +298,7 @@ class TestRowSet : public KuduRowSetTest { } void BenchmarkIterationPerformance(const DiskRowSet &rs, - const string &log_message) { + const std::string &log_message) { Schema proj_val = CreateProjection(schema_, { "val" }); LOG_TIMING(INFO, log_message + " (val column only)") { for (int i = 0; i < FLAGS_n_read_passes; i++) { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/diskrowset-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/diskrowset-test.cc b/src/kudu/tablet/diskrowset-test.cc index 71c92b2..4520af0 100644 --- a/src/kudu/tablet/diskrowset-test.cc +++ b/src/kudu/tablet/diskrowset-test.cc @@ -41,8 +41,10 @@ DECLARE_int32(tablet_delta_store_minor_compact_max); using std::is_sorted; using std::shared_ptr; +using std::string; using std::unique_ptr; using std::unordered_set; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/diskrowset.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/diskrowset.cc b/src/kudu/tablet/diskrowset.cc index db6daf6..d63aab2 100644 --- a/src/kudu/tablet/diskrowset.cc +++ b/src/kudu/tablet/diskrowset.cc @@ -72,6 +72,7 @@ using log::LogAnchorRegistry; using std::shared_ptr; using std::string; using std::unique_ptr; +using std::vector; const char *DiskRowSet::kMinKeyMetaEntryName = "min_key"; const char *DiskRowSet::kMaxKeyMetaEntryName = "max_key"; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/key_value_test_schema.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/key_value_test_schema.h b/src/kudu/tablet/key_value_test_schema.h index 479be39..da36990 100644 --- a/src/kudu/tablet/key_value_test_schema.h +++ b/src/kudu/tablet/key_value_test_schema.h @@ -42,8 +42,8 @@ struct ExpectedKeyValueRow { return key == other.key && val == other.val; } - string ToString() const { - string ret = strings::Substitute("{$0,", key); + std::string ToString() const { + std::string ret = strings::Substitute("{$0,", key); if (val == boost::none) { ret.append("NULL}"); } else { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 b92a409..073e46a 100644 --- a/src/kudu/tablet/local_tablet_writer.h +++ b/src/kudu/tablet/local_tablet_writer.h @@ -79,7 +79,7 @@ class LocalTabletWriter { // Returns a bad Status if the applied operation had a per-row error. Status Write(RowOperationsPB::Type type, const KuduPartialRow& row) { - vector<Op> ops; + std::vector<Op> ops; ops.emplace_back(type, &row); return WriteBatch(ops); } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 d505989..e61e127 100644 --- a/src/kudu/tablet/lock_manager-test.cc +++ b/src/kudu/tablet/lock_manager-test.cc @@ -29,8 +29,9 @@ #include "kudu/util/test_util.h" #include "kudu/util/thread.h" -using std::vector; using std::shared_ptr; +using std::string; +using std::vector; DEFINE_int32(num_test_threads, 10, "number of stress test client threads"); DEFINE_int32(num_iterations, 1000, "number of iterations per client thread"); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/lock_manager.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/lock_manager.cc b/src/kudu/tablet/lock_manager.cc index 3c37429..2bd2b88 100644 --- a/src/kudu/tablet/lock_manager.cc +++ b/src/kudu/tablet/lock_manager.cc @@ -31,6 +31,8 @@ #include "kudu/util/semaphore.h" #include "kudu/util/trace.h" +using base::subtle::NoBarrier_Load; + namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/major_delta_compaction-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/major_delta_compaction-test.cc b/src/kudu/tablet/major_delta_compaction-test.cc index c170537..a3e4299 100644 --- a/src/kudu/tablet/major_delta_compaction-test.cc +++ b/src/kudu/tablet/major_delta_compaction-test.cc @@ -34,7 +34,9 @@ #include "kudu/util/test_util.h" using std::shared_ptr; +using std::string; using std::unordered_set; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/memrowset-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/memrowset-test.cc b/src/kudu/tablet/memrowset-test.cc index 8ebb5fa..8df2889 100644 --- a/src/kudu/tablet/memrowset-test.cc +++ b/src/kudu/tablet/memrowset-test.cc @@ -40,6 +40,8 @@ namespace tablet { using consensus::OpId; using log::LogAnchorRegistry; using std::shared_ptr; +using std::string; +using std::vector; class TestMemRowSet : public KuduTest { public: http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/memrowset.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/memrowset.cc b/src/kudu/tablet/memrowset.cc index 82b328e..f113eff 100644 --- a/src/kudu/tablet/memrowset.cc +++ b/src/kudu/tablet/memrowset.cc @@ -43,6 +43,8 @@ TAG_FLAG(mrs_use_codegen, hidden); using std::pair; using std::shared_ptr; +using std::string; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/memrowset.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/memrowset.h b/src/kudu/tablet/memrowset.h index ae953c3..fd827a3 100644 --- a/src/kudu/tablet/memrowset.h +++ b/src/kudu/tablet/memrowset.h @@ -312,10 +312,10 @@ class MemRowSet : public RowSet, // If 'lines' is NULL, dumps to LOG(INFO). // // This dumps every row, so should only be used in tests, etc. - virtual Status DebugDump(vector<string> *lines = NULL) OVERRIDE; + virtual Status DebugDump(std::vector<std::string> *lines = NULL) OVERRIDE; - string ToString() const OVERRIDE { - return string("memrowset"); + std::string ToString() const OVERRIDE { + return "memrowset"; } // Mark the memrowset as frozen. See CBTree::Freeze() @@ -471,7 +471,7 @@ class MemRowSet::Iterator : public RowwiseIterator { return iter_->Next(); } - string ToString() const OVERRIDE { + std::string ToString() const OVERRIDE { return "memrowset iterator"; } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mock-rowsets.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mock-rowsets.h b/src/kudu/tablet/mock-rowsets.h index 37c2c8b..07736e0 100644 --- a/src/kudu/tablet/mock-rowsets.h +++ b/src/kudu/tablet/mock-rowsets.h @@ -67,7 +67,7 @@ class MockRowSet : public RowSet { LOG(FATAL) << "Unimplemented"; return ""; } - virtual Status DebugDump(vector<std::string> *lines = NULL) OVERRIDE { + virtual Status DebugDump(std::vector<std::string> *lines = NULL) OVERRIDE { LOG(FATAL) << "Unimplemented"; return Status::OK(); } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mt-rowset_delta_compaction-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mt-rowset_delta_compaction-test.cc b/src/kudu/tablet/mt-rowset_delta_compaction-test.cc index e159ac0..21d2d80 100644 --- a/src/kudu/tablet/mt-rowset_delta_compaction-test.cc +++ b/src/kudu/tablet/mt-rowset_delta_compaction-test.cc @@ -37,6 +37,7 @@ DEFINE_int32(num_seconds_per_thread, kDefaultNumSecondsPerThread, "Minimum number of seconds each thread should work"); using std::shared_ptr; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/multi_column_writer.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/multi_column_writer.cc b/src/kudu/tablet/multi_column_writer.cc index abcd259..8b01048 100644 --- a/src/kudu/tablet/multi_column_writer.cc +++ b/src/kudu/tablet/multi_column_writer.cc @@ -36,7 +36,7 @@ using std::unique_ptr; MultiColumnWriter::MultiColumnWriter(FsManager* fs, const Schema* schema, - string tablet_id) + std::string tablet_id) : fs_(fs), schema_(schema), finished_(false), http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mutation.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mutation.cc b/src/kudu/tablet/mutation.cc index 79be724..6e24fec 100644 --- a/src/kudu/tablet/mutation.cc +++ b/src/kudu/tablet/mutation.cc @@ -23,8 +23,8 @@ namespace kudu { namespace tablet { -string Mutation::StringifyMutationList(const Schema &schema, const Mutation *head) { - string ret; +std::string Mutation::StringifyMutationList(const Schema &schema, const Mutation *head) { + std::string ret; ret.append("["); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mutation.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mutation.h b/src/kudu/tablet/mutation.h index bb3e464..0b90d76 100644 --- a/src/kudu/tablet/mutation.h +++ b/src/kudu/tablet/mutation.h @@ -69,7 +69,7 @@ class Mutation { // Return a stringified version of the given list of mutations. // This should only be used for debugging/logging. - static string StringifyMutationList(const Schema &schema, const Mutation *head); + static std::string StringifyMutationList(const Schema &schema, const Mutation *head); // Append this mutation to the list at the given pointer. // This operation uses "Release" memory semantics http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mvcc.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mvcc.cc b/src/kudu/tablet/mvcc.cc index e683a4e..d8f25f0 100644 --- a/src/kudu/tablet/mvcc.cc +++ b/src/kudu/tablet/mvcc.cc @@ -32,7 +32,8 @@ #include "kudu/util/debug/trace_event.h" #include "kudu/util/stopwatch.h" -namespace kudu { namespace tablet { +namespace kudu { +namespace tablet { using strings::Substitute; @@ -413,7 +414,7 @@ bool MvccSnapshot::MayHaveUncommittedTransactionsAtOrBefore(const Timestamp& tim } std::string MvccSnapshot::ToString() const { - string ret("MvccSnapshot[committed={T|"); + std::string ret("MvccSnapshot[committed={T|"); if (committed_timestamps_.size() == 0) { StrAppend(&ret, "T < ", all_committed_before_.ToString(),"}]"); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/mvcc.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/mvcc.h b/src/kudu/tablet/mvcc.h index df3a9e9..7b5cdf8 100644 --- a/src/kudu/tablet/mvcc.h +++ b/src/kudu/tablet/mvcc.h @@ -32,8 +32,6 @@ class CountDownLatch; namespace tablet { class MvccManager; -using std::string; - // A snapshot of the current MVCC state, which can determine whether // a transaction ID should be considered visible. class MvccSnapshot { @@ -90,7 +88,7 @@ class MvccSnapshot { // Return a string representation of the set of committed transactions // in this snapshot, suitable for debug printouts. - string ToString() const; + std::string ToString() const; // Return true if the snapshot is considered 'clean'. A clean snapshot is one // which is determined only by a timestamp -- the snapshot considers all http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/row_op.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/row_op.cc b/src/kudu/tablet/row_op.cc index c1e9533..da97e6b 100644 --- a/src/kudu/tablet/row_op.cc +++ b/src/kudu/tablet/row_op.cc @@ -48,7 +48,7 @@ void RowOp::SetMutateSucceeded(gscoped_ptr<OperationResultPB> result) { this->result = std::move(result); } -string RowOp::ToString(const Schema& schema) const { +std::string RowOp::ToString(const Schema& schema) const { return decoded_op.ToString(schema); } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset.cc b/src/kudu/tablet/rowset.cc index 0295f23..b81bb91 100644 --- a/src/kudu/tablet/rowset.cc +++ b/src/kudu/tablet/rowset.cc @@ -29,6 +29,8 @@ #include "kudu/tablet/rowset_metadata.h" using std::shared_ptr; +using std::string; +using std::vector; using strings::Substitute; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset.h b/src/kudu/tablet/rowset.h index b5b7c4b..43bc74d 100644 --- a/src/kudu/tablet/rowset.h +++ b/src/kudu/tablet/rowset.h @@ -108,11 +108,11 @@ class RowSet { std::string* max_encoded_key) const = 0; // Return a displayable string for this rowset. - virtual string ToString() const = 0; + virtual std::string ToString() const = 0; // Dump the full contents of this rowset, for debugging. // This is very verbose so only useful within unit tests. - virtual Status DebugDump(vector<string> *lines = NULL) = 0; + virtual Status DebugDump(std::vector<std::string> *lines = NULL) = 0; // Estimate the number of bytes on-disk virtual uint64_t OnDiskSize() const = 0; @@ -218,7 +218,7 @@ class RowSet { }; // Used often enough, may as well typedef it. -typedef vector<std::shared_ptr<RowSet> > RowSetVector; +typedef std::vector<std::shared_ptr<RowSet> > RowSetVector; // Structure which caches an encoded and hashed key, suitable // for probing against rowsets. class RowSetKeyProbe { @@ -335,9 +335,9 @@ class DuplicatingRowSet : public RowSet { // Return the size of this rowset relevant for merge compactions. uint64_t OnDiskDataSizeNoUndos() const OVERRIDE; - string ToString() const OVERRIDE; + std::string ToString() const OVERRIDE; - virtual Status DebugDump(vector<string> *lines = NULL) OVERRIDE; + virtual Status DebugDump(std::vector<std::string> *lines = NULL) OVERRIDE; std::shared_ptr<RowSetMetadata> metadata() OVERRIDE; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset_info.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset_info.cc b/src/kudu/tablet/rowset_info.cc index 2b85288..f65ca0d 100644 --- a/src/kudu/tablet/rowset_info.cc +++ b/src/kudu/tablet/rowset_info.cc @@ -36,6 +36,7 @@ #include "kudu/util/slice.h" using std::shared_ptr; +using std::string; using std::unordered_map; using std::vector; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset_metadata.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset_metadata.cc b/src/kudu/tablet/rowset_metadata.cc index dd853cb..99b7d68 100644 --- a/src/kudu/tablet/rowset_metadata.cc +++ b/src/kudu/tablet/rowset_metadata.cc @@ -134,7 +134,7 @@ void RowSetMetadata::ToProtobuf(RowSetDataPB *pb) { } } -const string RowSetMetadata::ToString() const { +const std::string RowSetMetadata::ToString() const { return Substitute("RowSet($0)", id_); } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset_metadata.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset_metadata.h b/src/kudu/tablet/rowset_metadata.h index 5652380..edd91aa 100644 --- a/src/kudu/tablet/rowset_metadata.h +++ b/src/kudu/tablet/rowset_metadata.h @@ -132,12 +132,12 @@ class RowSetMetadata { return blocks_by_col_id_; } - vector<BlockId> redo_delta_blocks() const { + std::vector<BlockId> redo_delta_blocks() const { std::lock_guard<LockType> l(lock_); return redo_delta_blocks_; } - vector<BlockId> undo_delta_blocks() const { + std::vector<BlockId> undo_delta_blocks() const { std::lock_guard<LockType> l(lock_); return undo_delta_blocks_; } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset_tree-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset_tree-test.cc b/src/kudu/tablet/rowset_tree-test.cc index 9de20d7..9b9cb8b 100644 --- a/src/kudu/tablet/rowset_tree-test.cc +++ b/src/kudu/tablet/rowset_tree-test.cc @@ -31,6 +31,7 @@ using std::shared_ptr; using std::string; using std::unordered_set; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/rowset_tree.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/rowset_tree.cc b/src/kudu/tablet/rowset_tree.cc index 4c748e6..afffa40 100644 --- a/src/kudu/tablet/rowset_tree.cc +++ b/src/kudu/tablet/rowset_tree.cc @@ -33,6 +33,7 @@ using std::vector; using std::shared_ptr; +using std::string; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/svg_dump.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/svg_dump.cc b/src/kudu/tablet/svg_dump.cc index 1c5f49f..f0e8a74 100644 --- a/src/kudu/tablet/svg_dump.cc +++ b/src/kudu/tablet/svg_dump.cc @@ -50,6 +50,7 @@ DEFINE_string(compaction_policy_dump_svgs_pattern, "", TAG_FLAG(compaction_policy_dump_svgs_pattern, hidden); using std::ostream; +using std::string; using std::unordered_set; using std::vector; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet-harness.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet-harness.h b/src/kudu/tablet/tablet-harness.h index 648adc0..9d61ff2 100644 --- a/src/kudu/tablet/tablet-harness.h +++ b/src/kudu/tablet/tablet-harness.h @@ -33,9 +33,6 @@ #include "kudu/util/metrics.h" #include "kudu/util/status.h" -using std::string; -using std::vector; - namespace kudu { namespace tablet { @@ -52,8 +49,9 @@ static std::pair<PartitionSchema, Partition> CreateDefaultPartition(const Schema CHECK_OK(PartitionSchema::FromPB(PartitionSchemaPB(), schema, &partition_schema)); // Create the tablet partitions. - vector<Partition> partitions; - CHECK_OK(partition_schema.CreatePartitions(vector<KuduPartialRow>(), {}, schema, &partitions)); + std::vector<Partition> partitions; + CHECK_OK(partition_schema.CreatePartitions( + std::vector<KuduPartialRow>(), {}, schema, &partitions)); CHECK_EQ(1, partitions.size()); return std::make_pair(partition_schema, partitions[0]); } @@ -65,7 +63,7 @@ class TabletHarness { HYBRID_CLOCK, LOGICAL_CLOCK }; - explicit Options(string root_dir) + explicit Options(std::string root_dir) : env(Env::Default()), tablet_id("test_tablet_id"), root_dir(std::move(root_dir)), @@ -73,8 +71,8 @@ class TabletHarness { clock_type(LOGICAL_CLOCK) {} Env* env; - string tablet_id; - string root_dir; + std::string tablet_id; + std::string root_dir; bool enable_metrics; ClockType clock_type; }; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet-pushdown-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet-pushdown-test.cc b/src/kudu/tablet/tablet-pushdown-test.cc index 2106a5a..03758bc 100644 --- a/src/kudu/tablet/tablet-pushdown-test.cc +++ b/src/kudu/tablet/tablet-pushdown-test.cc @@ -29,6 +29,9 @@ #include "kudu/util/test_macros.h" #include "kudu/util/test_util.h" +using std::string; +using std::vector; + namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 8b2a659..a066bfc 100644 --- a/src/kudu/tablet/tablet-schema-test.cc +++ b/src/kudu/tablet/tablet-schema-test.cc @@ -29,6 +29,9 @@ #include "kudu/util/test_macros.h" #include "kudu/util/test_util.h" +using std::pair; +using std::string; +using std::vector; using strings::Substitute; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet-test-base.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet-test-base.h b/src/kudu/tablet/tablet-test-base.h index ec80023..3f4df2d 100644 --- a/src/kudu/tablet/tablet-test-base.h +++ b/src/kudu/tablet/tablet-test-base.h @@ -44,9 +44,6 @@ #include "kudu/tablet/tablet-test-util.h" #include "kudu/gutil/strings/numbers.h" -using std::unordered_set; -using strings::Substitute; - namespace kudu { namespace tablet { @@ -85,12 +82,13 @@ struct StringKeyTestSetup { snprintf(buf, buf_size, "hello %" PRId64, key_idx); } - string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + std::string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { char buf[256]; FormatKey(buf, sizeof(buf), key_idx); - return Substitute(R"((string key="$0", int32 key_idx=$1, int32 val=$2))", - buf, key_idx, val); + return strings::Substitute( + R"((string key="$0", int32 key_idx=$1, int32 val=$2))", + buf, key_idx, val); } // Slices can be arbitrarily large @@ -120,10 +118,10 @@ struct CompositeKeyTestSetup { snprintf(buf, buf_size, "hello %" PRId64, key_idx); } - string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + std::string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { char buf[256]; FormatKey(buf, sizeof(buf), key_idx); - return Substitute( + return strings::Substitute( "(string key1=$0, int32 key2=$1, int32 val=$2, int32 val=$3)", buf, key_idx, key_idx, val); } @@ -161,7 +159,7 @@ struct IntKeyTestSetup { CHECK_OK(row->SetInt32(2, val)); } - string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + std::string FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { CHECK(false) << "Unsupported type"; return ""; } @@ -215,29 +213,29 @@ void IntKeyTestSetup<INT64>::BuildRowKeyFromExistingRow(KuduPartialRow *row, } template<> -string IntKeyTestSetup<INT8>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { - return Substitute( +std::string IntKeyTestSetup<INT8>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + return strings::Substitute( "(int8 key=$0, int32 key_idx=$1, int32 val=$2)", (key_idx % 2 == 0) ? -key_idx : key_idx, key_idx, val); } template<> -string IntKeyTestSetup<INT16>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { - return Substitute( +std::string IntKeyTestSetup<INT16>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + return strings::Substitute( "(int16 key=$0, int32 key_idx=$1, int32 val=$2)", (key_idx % 2 == 0) ? -key_idx : key_idx, key_idx, val); } template<> -string IntKeyTestSetup<INT32>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { - return Substitute( +std::string IntKeyTestSetup<INT32>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + return strings::Substitute( "(int32 key=$0, int32 key_idx=$1, int32 val=$2)", (key_idx % 2 == 0) ? -key_idx : key_idx, key_idx, val); } template<> -string IntKeyTestSetup<INT64>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { - return Substitute( +std::string IntKeyTestSetup<INT64>::FormatDebugRow(int64_t key_idx, int32_t val, bool updated) { + return strings::Substitute( "(int64 key=$0, int32 key_idx=$1, int32 val=$2)", (key_idx % 2 == 0) ? -key_idx : key_idx, key_idx, val); } @@ -270,14 +268,14 @@ struct NullableValueTestSetup { } } - string FormatDebugRow(int64_t key_idx, int64_t val, bool updated) { + std::string FormatDebugRow(int64_t key_idx, int64_t val, bool updated) { if (!updated && ShouldInsertAsNull(key_idx)) { - return Substitute( + return strings::Substitute( "(int32 key=$0, int32 key_idx=$1, int32 val=NULL)", (int32_t)key_idx, key_idx); } - return Substitute( + return strings::Substitute( "(int32 key=$0, int32 key_idx=$1, int32 val=$2)", (int32_t)key_idx, key_idx, val); } @@ -489,7 +487,7 @@ class TabletTestBase : public KuduTabletTest { // Iterate through the full table, stringifying the resulting rows // into the given vector. This is only useful in tests which insert // a very small number of rows. - Status IterateToStringList(vector<string> *out) { + Status IterateToStringList(std::vector<std::string> *out) { gscoped_ptr<RowwiseIterator> iter; RETURN_NOT_OK(this->tablet()->NewRowIterator(this->client_schema_, &iter)); RETURN_NOT_OK(iter->Init(NULL)); @@ -507,7 +505,7 @@ class TabletTestBase : public KuduTabletTest { // make sure that we don't overflow the type on inserts // or else we get errors because the key already exists uint64_t ClampRowCount(uint64_t proposal) const { - uint64_t num_rows = min(max_rows_, proposal); + uint64_t num_rows = std::min(max_rows_, proposal); if (num_rows < proposal) { LOG(WARNING) << "Clamping max rows to " << num_rows << " to prevent overflow"; } http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet-test-util.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet-test-util.h b/src/kudu/tablet/tablet-test-util.h index 2a5ee2a..515ff0c 100644 --- a/src/kudu/tablet/tablet-test-util.h +++ b/src/kudu/tablet/tablet-test-util.h @@ -36,10 +36,6 @@ namespace kudu { namespace tablet { -using consensus::RaftConfigPB; -using std::string; -using std::vector; - class KuduTabletTest : public KuduTest { public: explicit KuduTabletTest(const Schema& schema, @@ -56,8 +52,8 @@ class KuduTabletTest : public KuduTest { SetUpTestTablet(); } - void CreateTestTablet(const string& root_dir = "") { - string dir = root_dir.empty() ? GetTestPath("fs_root") : root_dir; + void CreateTestTablet(const std::string& root_dir = "") { + std::string dir = root_dir.empty() ? GetTestPath("fs_root") : root_dir; TabletHarness::Options opts(dir); opts.enable_metrics = true; opts.clock_type = clock_type_; @@ -66,12 +62,12 @@ class KuduTabletTest : public KuduTest { CHECK_OK(harness_->Create(first_time)); } - void SetUpTestTablet(const string& root_dir = "") { + void SetUpTestTablet(const std::string& root_dir = "") { CreateTestTablet(root_dir); CHECK_OK(harness_->Open()); } - void TabletReOpen(const string& root_dir = "") { + void TabletReOpen(const std::string& root_dir = "") { SetUpTestTablet(root_dir); } @@ -157,7 +153,7 @@ static inline Status SilentIterateToStringList(RowwiseIterator* iter, } static inline Status IterateToStringList(RowwiseIterator* iter, - vector<string>* out, + std::vector<std::string>* out, int limit = INT_MAX) { out->clear(); Schema schema = iter->schema(); @@ -178,16 +174,17 @@ static inline Status IterateToStringList(RowwiseIterator* iter, // Performs snapshot reads, under each of the snapshots in 'snaps', and stores // the results in 'collected_rows'. -static inline void CollectRowsForSnapshots(Tablet* tablet, - const Schema& schema, - const vector<MvccSnapshot>& snaps, - vector<vector<string>* >* collected_rows) { +static inline void CollectRowsForSnapshots( + Tablet* tablet, + const Schema& schema, + const std::vector<MvccSnapshot>& snaps, + std::vector<std::vector<std::string>* >* collected_rows) { for (const MvccSnapshot& snapshot : snaps) { DVLOG(1) << "Snapshot: " << snapshot.ToString(); gscoped_ptr<RowwiseIterator> iter; ASSERT_OK(tablet->NewRowIterator(schema, snapshot, UNORDERED, &iter)); ASSERT_OK(iter->Init(NULL)); - auto collector = new vector<string>(); + auto collector = new std::vector<std::string>(); ASSERT_OK(IterateToStringList(iter.get(), collector)); for (const auto& mrs : *collector) { DVLOG(1) << "Got from MRS: " << mrs; @@ -198,10 +195,11 @@ static inline void CollectRowsForSnapshots(Tablet* tablet, // Performs snapshot reads, under each of the snapshots in 'snaps', and verifies that // the results match the ones in 'expected_rows'. -static inline void VerifySnapshotsHaveSameResult(Tablet* tablet, - const Schema& schema, - const vector<MvccSnapshot>& snaps, - const vector<vector<string>* >& expected_rows) { +static inline void VerifySnapshotsHaveSameResult( + Tablet* tablet, + const Schema& schema, + const std::vector<MvccSnapshot>& snaps, + const std::vector<std::vector<std::string>* >& expected_rows) { int idx = 0; // Now iterate again and make sure we get the same thing. for (const MvccSnapshot& snapshot : snaps) { @@ -212,7 +210,7 @@ static inline void VerifySnapshotsHaveSameResult(Tablet* tablet, UNORDERED, &iter)); ASSERT_OK(iter->Init(NULL)); - vector<string> collector; + std::vector<std::string> collector; ASSERT_OK(IterateToStringList(iter.get(), &collector)); ASSERT_EQ(collector.size(), expected_rows[idx]->size()); @@ -231,7 +229,7 @@ static inline void VerifySnapshotsHaveSameResult(Tablet* tablet, static inline Status DumpRowSet(const RowSet &rs, const Schema &projection, const MvccSnapshot &snap, - vector<string> *out, + std::vector<std::string> *out, int limit = INT_MAX) { gscoped_ptr<RowwiseIterator> iter; RETURN_NOT_OK(rs.NewRowIterator(&projection, snap, UNORDERED, &iter)); @@ -242,10 +240,10 @@ static inline Status DumpRowSet(const RowSet &rs, // Take an un-initialized iterator, Init() it, and iterate through all of its rows. // The resulting string contains a line per entry. -static inline string InitAndDumpIterator(gscoped_ptr<RowwiseIterator> iter) { +static inline std::string InitAndDumpIterator(gscoped_ptr<RowwiseIterator> iter) { CHECK_OK(iter->Init(NULL)); - vector<string> out; + std::vector<std::string> out; CHECK_OK(IterateToStringList(iter.get(), &out)); return JoinStrings(out, "\n"); } @@ -253,11 +251,11 @@ static inline string InitAndDumpIterator(gscoped_ptr<RowwiseIterator> iter) { // Dump all of the rows of the tablet into the given vector. static inline Status DumpTablet(const Tablet& tablet, const Schema& projection, - vector<string>* out) { + std::vector<std::string>* out) { gscoped_ptr<RowwiseIterator> iter; RETURN_NOT_OK(tablet.NewRowIterator(projection, &iter)); RETURN_NOT_OK(iter->Init(NULL)); - std::vector<string> rows; + std::vector<std::string> rows; RETURN_NOT_OK(IterateToStringList(iter.get(), &rows)); std::sort(rows.begin(), rows.end()); out->swap(rows); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet-test.cc b/src/kudu/tablet/tablet-test.cc index d20862e..1e257db 100644 --- a/src/kudu/tablet/tablet-test.cc +++ b/src/kudu/tablet/tablet-test.cc @@ -40,7 +40,9 @@ DEFINE_int32(testcompaction_num_rows, 1000, "Number of rows per rowset in TestCompaction"); using std::shared_ptr; +using std::string; using std::unique_ptr; +using std::vector; namespace kudu { namespace tablet { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc index 4304262..6da7ea3 100644 --- a/src/kudu/tablet/tablet.cc +++ b/src/kudu/tablet/tablet.cc @@ -151,6 +151,8 @@ METRIC_DEFINE_gauge_size(tablet, on_disk_size, "Tablet Size On Disk", using kudu::MaintenanceManager; using kudu::clock::HybridClock; using kudu::log::LogAnchorRegistry; +using std::ostream; +using std::pair; using std::shared_ptr; using std::string; using std::unordered_set; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet.h b/src/kudu/tablet/tablet.h index a81fd03..3f3c006 100644 --- a/src/kudu/tablet/tablet.h +++ b/src/kudu/tablet/tablet.h @@ -312,7 +312,7 @@ class Tablet { // Verbosely dump this entire tablet to the logs. This is only // really useful when debugging unit tests failures where the tablet // has a very small number of rows. - Status DebugDump(vector<std::string> *lines = NULL); + Status DebugDump(std::vector<std::string> *lines = NULL); const Schema* schema() const { return &metadata_->schema(); @@ -360,7 +360,7 @@ class Tablet { // Method used by tests to retrieve all rowsets of this table. This // will be removed once code for selecting the appropriate RowSet is // finished and delta files is finished is part of Tablet class. - void GetRowSetsForTests(vector<std::shared_ptr<RowSet> >* out); + void GetRowSetsForTests(std::vector<std::shared_ptr<RowSet> >* out); // Register the maintenance ops associated with this tablet void RegisterMaintenanceOps(MaintenanceManager* maintenance_manager); @@ -462,7 +462,7 @@ class Tablet { const MvccSnapshot &snap, const ScanSpec *spec, OrderMode order, - vector<std::shared_ptr<RowwiseIterator> > *iters) const; + std::vector<std::shared_ptr<RowwiseIterator> > *iters) const; Status PickRowSetsToCompact(RowSetsInCompaction *picked, CompactFlags flags) const; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_bootstrap.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_bootstrap.cc b/src/kudu/tablet/tablet_bootstrap.cc index 1aa78cf..8c91378 100644 --- a/src/kudu/tablet/tablet_bootstrap.cc +++ b/src/kudu/tablet/tablet_bootstrap.cc @@ -104,6 +104,7 @@ using std::shared_ptr; using std::string; using std::unique_ptr; using std::unordered_map; +using std::vector; using strings::Substitute; using tserver::AlterSchemaRequestPB; using tserver::WriteRequestPB; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_history_gc-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_history_gc-test.cc b/src/kudu/tablet/tablet_history_gc-test.cc index 5aae7b5..c8a5f08 100644 --- a/src/kudu/tablet/tablet_history_gc-test.cc +++ b/src/kudu/tablet/tablet_history_gc-test.cc @@ -31,6 +31,9 @@ DECLARE_int32(tablet_history_max_age_sec); DECLARE_string(time_source); using kudu::clock::HybridClock; +using std::string; +using std::vector; +using strings::Substitute; // Specify row regex to match on. Empty string means don't match anything. #define ASSERT_DEBUG_DUMP_ROWS_MATCH(pattern) do { \ http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_metadata.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_metadata.cc b/src/kudu/tablet/tablet_metadata.cc index f7a951d..af7d82d 100644 --- a/src/kudu/tablet/tablet_metadata.cc +++ b/src/kudu/tablet/tablet_metadata.cc @@ -53,6 +53,8 @@ TAG_FLAG(enable_tablet_orphaned_block_deletion, runtime); using std::memory_order_relaxed; using std::shared_ptr; +using std::string; +using std::vector; using base::subtle::Barrier_AtomicIncrement; using strings::Substitute; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_mm_ops-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_mm_ops-test.cc b/src/kudu/tablet/tablet_mm_ops-test.cc index 442d9fd..815242e 100644 --- a/src/kudu/tablet/tablet_mm_ops-test.cc +++ b/src/kudu/tablet/tablet_mm_ops-test.cc @@ -68,7 +68,7 @@ class KuduTabletMmOpsTest : public TabletTestBase<IntKeyTestSetup<INT64>> { } void TestAffectedMetrics(MaintenanceOp* op, - const unordered_set< + const std::unordered_set< scoped_refptr<Histogram>, ScopedRefPtrHashFunctor<Histogram>, ScopedRefPtrEqualToFunctor<Histogram> >& metrics) { @@ -84,7 +84,7 @@ class KuduTabletMmOpsTest : public TabletTestBase<IntKeyTestSetup<INT64>> { MaintenanceOpStats stats_; MonoTime next_time_; - vector<scoped_refptr<Histogram> > all_possible_metrics_; + std::vector<scoped_refptr<Histogram> > all_possible_metrics_; }; TEST_F(KuduTabletMmOpsTest, TestCompactRowSetsOpCacheStats) { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_replica-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_replica-test.cc b/src/kudu/tablet/tablet_replica-test.cc index c8f248b..ada9039 100644 --- a/src/kudu/tablet/tablet_replica-test.cc +++ b/src/kudu/tablet/tablet_replica-test.cc @@ -59,6 +59,7 @@ using consensus::ConsensusBootstrapInfo; using consensus::ConsensusMetadata; using consensus::ConsensusMetadataManager; using consensus::OpId; +using consensus::RaftConfigPB; using consensus::RaftPeerPB; using log::Log; using log::LogOptions; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/tablet_replica.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_replica.cc b/src/kudu/tablet/tablet_replica.cc index 4a67b10..0681ade 100644 --- a/src/kudu/tablet/tablet_replica.cc +++ b/src/kudu/tablet/tablet_replica.cc @@ -100,7 +100,9 @@ using rpc::Messenger; using rpc::ResultTracker; using std::map; using std::shared_ptr; +using std::string; using std::unique_ptr; +using std::vector; using strings::Substitute; TabletReplica::TabletReplica( http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/transactions/alter_schema_transaction.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/transactions/alter_schema_transaction.cc b/src/kudu/tablet/transactions/alter_schema_transaction.cc index 2081966..8ab38d0 100644 --- a/src/kudu/tablet/transactions/alter_schema_transaction.cc +++ b/src/kudu/tablet/transactions/alter_schema_transaction.cc @@ -37,6 +37,7 @@ using consensus::ReplicateMsg; using consensus::CommitMsg; using consensus::ALTER_SCHEMA_OP; using consensus::DriverType; +using std::string; using std::unique_ptr; using strings::Substitute; using tserver::TabletServerErrorPB; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/transactions/transaction_driver.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/transactions/transaction_driver.cc b/src/kudu/tablet/transactions/transaction_driver.cc index ebee430..b90f911 100644 --- a/src/kudu/tablet/transactions/transaction_driver.cc +++ b/src/kudu/tablet/transactions/transaction_driver.cc @@ -43,6 +43,7 @@ using log::Log; using rpc::RequestIdPB; using rpc::ResultTracker; using std::shared_ptr; +using std::string; static const char* kTimestampFieldName = "timestamp"; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/transactions/transaction_tracker.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/transactions/transaction_tracker.cc b/src/kudu/tablet/transactions/transaction_tracker.cc index 603092b..c15b39e 100644 --- a/src/kudu/tablet/transactions/transaction_tracker.cc +++ b/src/kudu/tablet/transactions/transaction_tracker.cc @@ -59,6 +59,7 @@ METRIC_DEFINE_counter(tablet, transaction_memory_pressure_rejections, "transaction memory limit was reached."); using std::shared_ptr; +using std::string; using std::vector; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tablet/transactions/write_transaction.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/transactions/write_transaction.cc b/src/kudu/tablet/transactions/write_transaction.cc index 5707b75..f20717b 100644 --- a/src/kudu/tablet/transactions/write_transaction.cc +++ b/src/kudu/tablet/transactions/write_transaction.cc @@ -53,7 +53,9 @@ using consensus::WRITE_OP; using tserver::TabletServerErrorPB; using tserver::WriteRequestPB; using tserver::WriteResponsePB; +using std::string; using std::unique_ptr; +using std::vector; using strings::Substitute; WriteTransaction::WriteTransaction(unique_ptr<WriteTransactionState> state, DriverType type) http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/color.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/color.cc b/src/kudu/tools/color.cc index e90761d..c99d7fe 100644 --- a/src/kudu/tools/color.cc +++ b/src/kudu/tools/color.cc @@ -30,7 +30,7 @@ DEFINE_string(color, "auto", "valid values are 'always' or 'never'."); TAG_FLAG(color, stable); -static bool ValidateColorFlag(const char* flagname, const string& value) { +static bool ValidateColorFlag(const char* flagname, const std::string& value) { if (value == "always" || value == "auto" || value == "never") { @@ -69,7 +69,7 @@ const char* StringForCode(AnsiCode color) { } } // anonymous namespace -string Color(AnsiCode color, StringPiece s) { +std::string Color(AnsiCode color, StringPiece s) { return strings::Substitute("$0$1$2", StringForCode(color), s, http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/ksck-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/ksck-test.cc b/src/kudu/tools/ksck-test.cc index 517d71c..4b02639 100644 --- a/src/kudu/tools/ksck-test.cc +++ b/src/kudu/tools/ksck-test.cc @@ -37,6 +37,7 @@ using std::shared_ptr; using std::static_pointer_cast; using std::string; using std::unordered_map; +using std::vector; using strings::Substitute; class MockKsckTabletServer : public KsckTabletServer { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/ksck.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc index 766f008..f3376cd 100644 --- a/src/kudu/tools/ksck.cc +++ b/src/kudu/tools/ksck.cc @@ -62,6 +62,7 @@ namespace tools { using std::cout; using std::endl; using std::left; +using std::map; using std::ostream; using std::right; using std::setw; @@ -69,6 +70,7 @@ using std::shared_ptr; using std::string; using std::stringstream; using std::unordered_map; +using std::vector; using strings::Substitute; namespace { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/ksck.h ---------------------------------------------------------------------- diff --git a/src/kudu/tools/ksck.h b/src/kudu/tools/ksck.h index 805bbed..f367914 100644 --- a/src/kudu/tools/ksck.h +++ b/src/kudu/tools/ksck.h @@ -401,12 +401,12 @@ class Ksck { // If tablets is not empty, checks only the specified tablet IDs. // If both are specified, takes the intersection. // If both are empty (unset), all tables and tablets are checked. - void set_table_filters(vector<string> table_names) { + void set_table_filters(std::vector<std::string> table_names) { table_filters_ = std::move(table_names); } // See above. - void set_tablet_id_filters(vector<string> tablet_ids) { + void set_tablet_id_filters(std::vector<std::string> tablet_ids) { tablet_id_filters_ = std::move(tablet_ids); } @@ -451,25 +451,25 @@ class Ksck { int table_num_replicas); // Print an informational message to this instance's output stream. - ostream& Out() { + std::ostream& Out() { return *out_; } // Print an error message to this instance's output stream. - ostream& Error() { + std::ostream& Error() { return (*out_) << Color(AnsiCode::RED, "ERROR: "); } // Print a warning message to this instance's output stream. - ostream& Warn() { + std::ostream& Warn() { return (*out_) << Color(AnsiCode::YELLOW, "WARNING: "); } const std::shared_ptr<KsckCluster> cluster_; bool check_replica_count_ = true; - vector<string> table_filters_; - vector<string> tablet_id_filters_; + std::vector<std::string> table_filters_; + std::vector<std::string> tablet_id_filters_; std::ostream* out_; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/kudu-admin-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/kudu-admin-test.cc b/src/kudu/tools/kudu-admin-test.cc index 7237548..cf67e5c 100644 --- a/src/kudu/tools/kudu-admin-test.cc +++ b/src/kudu/tools/kudu-admin-test.cc @@ -329,7 +329,7 @@ TEST_F(AdminCliTest, TestUnsafeChangeConfigOnSingleFollower) { ASSERT_OK(WaitForOpFromCurrentTerm(followers[0], tablet_id, COMMITTED_OPID, kTimeout, &opid)); active_tablet_servers.clear(); - unordered_set<string> replica_uuids; + std::unordered_set<string> replica_uuids; for (const auto& loc : tablet_locations.replicas()) { const string& uuid = loc.ts_info().permanent_uuid(); InsertOrDie(&active_tablet_servers, uuid, tablet_servers_[uuid]); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/kudu-tool-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/kudu-tool-test.cc b/src/kudu/tools/kudu-tool-test.cc index ba1e085..7d9f3e8 100644 --- a/src/kudu/tools/kudu-tool-test.cc +++ b/src/kudu/tools/kudu-tool-test.cc @@ -102,8 +102,10 @@ using rpc::RpcController; using std::back_inserter; using std::copy; using std::ostringstream; +using std::pair; using std::string; using std::unique_ptr; +using std::unordered_map; using std::vector; using strings::Substitute; using tablet::LocalTabletWriter; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/kudu-ts-cli-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/kudu-ts-cli-test.cc b/src/kudu/tools/kudu-ts-cli-test.cc index a70ea20..a4ecdc5 100644 --- a/src/kudu/tools/kudu-ts-cli-test.cc +++ b/src/kudu/tools/kudu-ts-cli-test.cc @@ -33,6 +33,8 @@ using kudu::itest::TabletServerMap; using kudu::itest::TServerDetails; using strings::Split; using strings::Substitute; +using std::string; +using std::vector; namespace kudu { namespace tools { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/tool_action.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action.cc b/src/kudu/tools/tool_action.cc index 9b7a580..fd824d7 100644 --- a/src/kudu/tools/tool_action.cc +++ b/src/kudu/tools/tool_action.cc @@ -30,6 +30,7 @@ #include "kudu/gutil/strings/substitute.h" #include "kudu/util/url-coding.h" +using std::pair; using std::string; using std::unique_ptr; using std::unordered_map; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/tool_action_local_replica.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_local_replica.cc b/src/kudu/tools/tool_action_local_replica.cc index 82b6e5e..72d24d4 100644 --- a/src/kudu/tools/tool_action_local_replica.cc +++ b/src/kudu/tools/tool_action_local_replica.cc @@ -108,6 +108,8 @@ using rpc::MessengerBuilder; using std::cout; using std::endl; using std::list; +using std::map; +using std::pair; using std::shared_ptr; using std::string; using std::unique_ptr; @@ -452,7 +454,7 @@ Status SummarizeDataSize(const RunnerContext& context) { vector<string> tablets; RETURN_NOT_OK(fs->ListTabletIds(&tablets)); - unordered_map<string, TabletSizeStats> size_stats_by_table_id; + std::unordered_map<string, TabletSizeStats> size_stats_by_table_id; DataTable output_table({ "table id", "tablet id", "rowset id", "block type", "size" }); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/tool_action_master.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_master.cc b/src/kudu/tools/tool_action_master.cc index ef71a24..b6d9c22 100644 --- a/src/kudu/tools/tool_action_master.cc +++ b/src/kudu/tools/tool_action_master.cc @@ -46,6 +46,7 @@ using master::MasterServiceProxy; using std::cout; using std::string; using std::unique_ptr; +using std::vector; namespace tools { namespace { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/tool_action_pbc.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_pbc.cc b/src/kudu/tools/tool_action_pbc.cc index 5b6d8d8..ceda9b8 100644 --- a/src/kudu/tools/tool_action_pbc.cc +++ b/src/kudu/tools/tool_action_pbc.cc @@ -40,6 +40,7 @@ using std::cout; using std::string; using std::unique_ptr; +using std::vector; DEFINE_bool(oneline, false, "print each protobuf on a single line"); TAG_FLAG(oneline, stable); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tools/tool_action_tserver.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_tserver.cc b/src/kudu/tools/tool_action_tserver.cc index 3703103..e396169 100644 --- a/src/kudu/tools/tool_action_tserver.cc +++ b/src/kudu/tools/tool_action_tserver.cc @@ -42,6 +42,7 @@ DECLARE_string(columns); using std::cout; using std::string; using std::unique_ptr; +using std::vector; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/heartbeater.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc index f5695d7..84232e0 100644 --- a/src/kudu/tserver/heartbeater.cc +++ b/src/kudu/tserver/heartbeater.cc @@ -64,6 +64,8 @@ using kudu::master::MasterServiceProxy; using kudu::master::TabletReportPB; using kudu::rpc::RpcController; using std::shared_ptr; +using std::string; +using std::vector; using strings::Substitute; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/scanners.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc index 6dd8295..af35bf0 100644 --- a/src/kudu/tserver/scanners.cc +++ b/src/kudu/tserver/scanners.cc @@ -45,6 +45,8 @@ METRIC_DEFINE_gauge_size(server, active_scanners, kudu::MetricUnit::kScanners, "Number of scanners that are currently active"); +using std::string; +using std::vector; using strings::Substitute; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/scanners.h ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/scanners.h b/src/kudu/tserver/scanners.h index 5e425b2..184f5fc 100644 --- a/src/kudu/tserver/scanners.h +++ b/src/kudu/tserver/scanners.h @@ -118,7 +118,7 @@ class ScannerManager { // Periodically call RemoveExpiredScanners(). void RunRemovalThread(); - ScannerMapStripe& GetStripeByScannerId(const string& scanner_id); + ScannerMapStripe& GetStripeByScannerId(const std::string& scanner_id); // (Optional) scanner metrics for this instance. gscoped_ptr<ScannerMetrics> metrics_; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy-test-base.h ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy-test-base.h b/src/kudu/tserver/tablet_copy-test-base.h index 83cd554..0c2ff2e 100644 --- a/src/kudu/tserver/tablet_copy-test-base.h +++ b/src/kudu/tserver/tablet_copy-test-base.h @@ -69,8 +69,8 @@ class TabletCopyTest : public TabletServerTestBase { // Return a vector of the blocks contained in the specified superblock (not // including orphaned blocks). - static vector<BlockId> ListBlocks(const tablet::TabletSuperBlockPB& superblock) { - vector<BlockId> block_ids; + static std::vector<BlockId> ListBlocks(const tablet::TabletSuperBlockPB& superblock) { + std::vector<BlockId> block_ids; for (const auto& rowset : superblock.rowsets()) { for (const auto& col : rowset.columns()) { block_ids.emplace_back(col.block().id()); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_client-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_client-test.cc b/src/kudu/tserver/tablet_copy_client-test.cc index 8e70a79..fcde4ec 100644 --- a/src/kudu/tserver/tablet_copy_client-test.cc +++ b/src/kudu/tserver/tablet_copy_client-test.cc @@ -29,6 +29,8 @@ #include "kudu/util/env_util.h" using std::shared_ptr; +using std::string; +using std::vector; namespace kudu { namespace tserver { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_service-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_service-test.cc b/src/kudu/tserver/tablet_copy_service-test.cc index ffa35bb..ef3cf64 100644 --- a/src/kudu/tserver/tablet_copy_service-test.cc +++ b/src/kudu/tserver/tablet_copy_service-test.cc @@ -43,6 +43,8 @@ DECLARE_uint64(tablet_copy_idle_timeout_ms); DECLARE_uint64(tablet_copy_timeout_poll_period_ms); +using std::string; + namespace kudu { namespace tserver { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_service.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_service.cc b/src/kudu/tserver/tablet_copy_service.cc index ef11ecc..ed4feca 100644 --- a/src/kudu/tserver/tablet_copy_service.cc +++ b/src/kudu/tserver/tablet_copy_service.cc @@ -68,6 +68,8 @@ DEFINE_double(tablet_copy_early_session_timeout_prob, 0, "resulting in tablet copy failure. (For testing only!)"); TAG_FLAG(tablet_copy_early_session_timeout_prob, unsafe); +using std::string; +using std::vector; using strings::Substitute; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_service.h ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_service.h b/src/kudu/tserver/tablet_copy_service.h index c4f701e..2eeab40 100644 --- a/src/kudu/tserver/tablet_copy_service.h +++ b/src/kudu/tserver/tablet_copy_service.h @@ -107,7 +107,7 @@ class TabletCopyServiceImpl : public TabletCopyServiceIf { void SetupErrorAndRespond(rpc::RpcContext* context, TabletCopyErrorPB::Code code, - const string& message, + const std::string& message, const Status& s); server::ServerBase* server_; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_source_session-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_source_session-test.cc b/src/kudu/tserver/tablet_copy_source_session-test.cc index e8ff1c6..1655a2b 100644 --- a/src/kudu/tserver/tablet_copy_source_session-test.cc +++ b/src/kudu/tserver/tablet_copy_source_session-test.cc @@ -47,6 +47,7 @@ METRIC_DECLARE_entity(tablet); using std::shared_ptr; using std::string; using std::unique_ptr; +using std::vector; namespace kudu { namespace tserver { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_copy_source_session.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_copy_source_session.cc b/src/kudu/tserver/tablet_copy_source_session.cc index f470647..ba18e54 100644 --- a/src/kudu/tserver/tablet_copy_source_session.cc +++ b/src/kudu/tserver/tablet_copy_source_session.cc @@ -47,7 +47,9 @@ using consensus::OpId; using fs::ReadableBlock; using log::ReadableLogSegment; using std::shared_ptr; +using std::string; using std::unique_ptr; +using std::vector; using strings::Substitute; using tablet::TabletMetadata; using tablet::TabletReplica; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 e174e4a..4d37a15 100644 --- a/src/kudu/tserver/tablet_server-test-base.h +++ b/src/kudu/tserver/tablet_server-test-base.h @@ -68,7 +68,7 @@ namespace tserver { class TabletServerTestBase : public KuduTest { public: - typedef pair<int32_t, int32_t> KeyValue; + typedef std::pair<int32_t, int32_t> KeyValue; TabletServerTestBase() : schema_(GetSimpleTestSchema()), @@ -141,7 +141,7 @@ class TabletServerTestBase : public KuduTest { WriteResponsePB resp; rpc::RpcController controller; controller.set_timeout(MonoDelta::FromSeconds(FLAGS_rpc_timeout)); - string new_string_val(strings::Substitute("mutated$0", row_idx)); + std::string new_string_val(strings::Substitute("mutated$0", row_idx)); AddTestRowToPB(RowOperationsPB::UPDATE, schema_, row_idx, new_val, new_string_val, req.mutable_row_operations()); @@ -179,8 +179,8 @@ class TabletServerTestBase : public KuduTest { uint64_t count, uint64_t num_batches = -1, TabletServerServiceProxy* proxy = NULL, - string tablet_id = kTabletId, - vector<uint64_t>* write_timestamps_collector = NULL, + std::string tablet_id = kTabletId, + std::vector<uint64_t>* write_timestamps_collector = NULL, TimeSeries *ts = NULL, bool string_field_defined = true) { @@ -214,7 +214,7 @@ class TabletServerTestBase : public KuduTest { uint64_t last_row_in_batch = first_row_in_batch + count / num_batches; for (int j = first_row_in_batch; j < last_row_in_batch; j++) { - string str_val = strings::Substitute("original$0", j); + std::string str_val = strings::Substitute("original$0", j); const char* cstr_val = str_val.c_str(); if (!string_field_defined) { cstr_val = NULL; @@ -249,7 +249,7 @@ class TabletServerTestBase : public KuduTest { void DeleteTestRowsRemote(int64_t first_row, uint64_t count, TabletServerServiceProxy* proxy = NULL, - string tablet_id = kTabletId) { + std::string tablet_id = kTabletId) { if (!proxy) { proxy = proxy_.get(); } @@ -278,9 +278,9 @@ class TabletServerTestBase : public KuduTest { ASSERT_OK(row->SetStringCopy(2, StringPrintf("hello %d", index))); } - void DrainScannerToStrings(const string& scanner_id, + void DrainScannerToStrings(const std::string& scanner_id, const Schema& projection, - vector<string>* results, + std::vector<std::string>* results, TabletServerServiceProxy* proxy = NULL, uint32_t call_seq_id = 1) { @@ -314,7 +314,7 @@ class TabletServerTestBase : public KuduTest { void StringifyRowsFromResponse(const Schema& projection, const rpc::RpcController& rpc, ScanResponsePB& resp, - vector<string>* results) { + std::vector<std::string>* results) { RowwiseRowBlockPB* rrpb = resp.mutable_data(); Slice direct, indirect; // sidecar data buffers ASSERT_OK(rpc.GetInboundSidecar(rrpb->rows_sidecar(), &direct)); @@ -322,7 +322,7 @@ class TabletServerTestBase : public KuduTest { ASSERT_OK(rpc.GetInboundSidecar(rrpb->indirect_data_sidecar(), &indirect)); } - vector<const uint8_t*> rows; + std::vector<const uint8_t*> rows; ASSERT_OK(ExtractRowsFromRowBlockPB(projection, *rrpb, indirect, &direct, &rows)); VLOG(1) << "Round trip got " << rows.size() << " rows"; @@ -372,7 +372,7 @@ class TabletServerTestBase : public KuduTest { } // Verifies that a set of expected rows (key, value) is present in the tablet. - void VerifyRows(const Schema& schema, const vector<KeyValue>& expected) { + void VerifyRows(const Schema& schema, const std::vector<KeyValue>& expected) { gscoped_ptr<RowwiseIterator> iter; ASSERT_OK(tablet_replica_->tablet()->NewRowIterator(schema, &iter)); ASSERT_OK(iter->Init(NULL)); http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 9fe3a3c..f4c3e6b 100644 --- a/src/kudu/tserver/tablet_server-test.cc +++ b/src/kudu/tserver/tablet_server-test.cc @@ -49,6 +49,7 @@ using kudu::tablet::TabletSuperBlockPB; using std::shared_ptr; using std::string; using std::unique_ptr; +using std::vector; using strings::Substitute; DEFINE_int32(single_threaded_insert_latency_bench_warmup_rows, 100, http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_server.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_server.cc b/src/kudu/tserver/tablet_server.cc index 818b57f..f922b5e 100644 --- a/src/kudu/tserver/tablet_server.cc +++ b/src/kudu/tserver/tablet_server.cc @@ -36,6 +36,7 @@ #include "kudu/util/net/sockaddr.h" #include "kudu/util/status.h" +using std::string; using kudu::rpc::ServiceIf; namespace kudu { http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/src/kudu/tserver/tablet_service.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc index 3c1c101..21a99cc 100644 --- a/src/kudu/tserver/tablet_service.cc +++ b/src/kudu/tserver/tablet_service.cc @@ -131,6 +131,7 @@ using kudu::tablet::TabletStatusPB; using kudu::tablet::TransactionCompletionCallback; using kudu::tablet::WriteTransactionState; using std::shared_ptr; +using std::string; using std::unique_ptr; using std::unordered_set; using std::vector; http://git-wip-us.apache.org/repos/asf/kudu/blob/154b07de/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 c65abdc..6d3f110 100644 --- a/src/kudu/tserver/ts_tablet_manager-test.cc +++ b/src/kudu/tserver/ts_tablet_manager-test.cc @@ -39,6 +39,9 @@ #define ASSERT_MONOTONIC_REPORT_SEQNO(report_seqno, tablet_report) \ ASSERT_NO_FATAL_FAILURE(AssertMonotonicReportSeqno(report_seqno, tablet_report)) +using std::string; +using std::vector; + namespace kudu { namespace tserver {