You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2022/09/11 05:52:21 UTC
[kudu] 01/03: [cfile] style-guide updates on cfile_reader.{h,cc}
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 51d6ed46b7c9526ae396eaa336468bd45ac105b9
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Sep 9 22:16:36 2022 -0700
[cfile] style-guide updates on cfile_reader.{h,cc}
I was looking into the code of the CFileReader::ReadBlock() method while
investigating one compaction issue and took the liberty to update the
code in the corresponding files, making it compliant with the project's
style guide. A follow-up patch makes the code in cfile_reader.{h,cc}
more robust.
There are no functional changes in this patch.
Change-Id: Ib0e900271e7127ea8bbc2c949761f5339740c121
Reviewed-on: http://gerrit.cloudera.org:8080/18964
Reviewed-by: Yingchun Lai <ac...@gmail.com>
Tested-by: Alexey Serbin <al...@apache.org>
---
src/kudu/cfile/cfile_reader.cc | 92 ++++++++++++++++++++----------------------
src/kudu/cfile/cfile_reader.h | 70 ++++++++++++++++----------------
2 files changed, 78 insertions(+), 84 deletions(-)
diff --git a/src/kudu/cfile/cfile_reader.cc b/src/kudu/cfile/cfile_reader.cc
index 0f0e97a13..bbd8779dd 100644
--- a/src/kudu/cfile/cfile_reader.cc
+++ b/src/kudu/cfile/cfile_reader.cc
@@ -47,6 +47,7 @@
#include "kudu/fs/error_manager.h"
#include "kudu/fs/io_context.h"
#include "kudu/gutil/basictypes.h"
+#include "kudu/gutil/port.h"
#include "kudu/gutil/ref_counted.h"
#include "kudu/gutil/stringprintf.h"
#include "kudu/gutil/strings/substitute.h"
@@ -71,7 +72,7 @@
#include "kudu/util/trace.h"
DEFINE_bool(cfile_lazy_open, true,
- "Allow lazily opening of cfiles");
+ "Allow lazily opening of CFiles");
TAG_FLAG(cfile_lazy_open, hidden);
DEFINE_bool(cfile_verify_checksums, true,
@@ -88,8 +89,8 @@ using kudu::fs::ErrorHandlerType;
using kudu::fs::IOContext;
using kudu::fs::ReadableBlock;
using kudu::pb_util::SecureDebugString;
-using std::shared_ptr;
using std::string;
+using std::to_string;
using std::unique_ptr;
using std::vector;
using strings::Substitute;
@@ -104,9 +105,9 @@ const char* CFILE_CACHE_HIT_BYTES_METRIC_NAME = "cfile_cache_hit_bytes";
static const size_t kMagicAndLengthSize = 12;
static const size_t kMaxHeaderFooterPBSize = 64*1024;
-static Status ParseMagicAndLength(const Slice &data,
+static Status ParseMagicAndLength(const Slice& data,
uint8_t* cfile_version,
- uint32_t *parsed_len) {
+ uint32_t* parsed_len) {
if (data.size() != kMagicAndLengthSize) {
return Status::Corruption("Bad size data");
}
@@ -122,8 +123,7 @@ static Status ParseMagicAndLength(const Slice &data,
uint32_t len = DecodeFixed32(data.data() + kMagicLength);
if (len > kMaxHeaderFooterPBSize) {
- return Status::Corruption("invalid data size for header",
- std::to_string(len));
+ return Status::Corruption("invalid data size for header", to_string(len));
}
*cfile_version = version;
@@ -178,12 +178,11 @@ Status CFileReader::InitOnce(const IOContext* io_context) {
// Parse Footer first to find unsupported features.
RETURN_NOT_OK_HANDLE_CORRUPTION(ReadAndParseFooter(), HandleCorruption(io_context));
-
RETURN_NOT_OK_HANDLE_CORRUPTION(ReadAndParseHeader(), HandleCorruption(io_context));
if (PREDICT_FALSE(footer_->incompatible_features() & ~IncompatibleFeatures::SUPPORTED)) {
return Status::NotSupported(Substitute(
- "cfile uses features from an incompatible bitset value $0 vs supported $1 ",
+ "CFile uses features from an incompatible bitset value $0 vs supported $1",
footer_->incompatible_features(),
IncompatibleFeatures::SUPPORTED));
}
@@ -230,7 +229,7 @@ Status CFileReader::ReadAndParseHeader() {
// Quick check to ensure the header size is reasonable.
if (header_size >= file_size_ - kMagicAndLengthSize) {
- return Status::Corruption("invalid CFile header size", std::to_string(header_size));
+ return Status::Corruption("invalid CFile header size", to_string(header_size));
}
// Setup the data slices.
@@ -255,7 +254,7 @@ Status CFileReader::ReadAndParseHeader() {
// Parse the protobuf header.
header_.reset(new CFileHeaderPB());
if (!header_->ParseFromArray(header.data(), header.size())) {
- return Status::Corruption("invalid cfile pb header",
+ return Status::Corruption("invalid CFile pb header",
header.ToDebugString());
}
@@ -268,8 +267,7 @@ Status CFileReader::ReadAndParseFooter() {
TRACE_EVENT1("io", "CFileReader::ReadAndParseFooter",
"cfile", ToString());
DCHECK(!init_once_.init_succeeded());
- CHECK_GT(file_size_, kMagicAndLengthSize) <<
- "file too short: " << file_size_;
+ CHECK_GT(file_size_, kMagicAndLengthSize) << "file too short: " << file_size_;
// First read and parse the "post-footer", which has magic
// and the length of the actual protobuf footer.
@@ -304,7 +302,7 @@ Status CFileReader::ReadAndParseFooter() {
// incompatible_features flag tells us if a checksum exists at all.
footer_.reset(new CFileFooterPB());
if (!footer_->ParseFromArray(footer.data(), footer.size())) {
- return Status::Corruption("invalid cfile pb footer", footer.ToDebugString());
+ return Status::Corruption("invalid CFile pb footer", footer.ToDebugString());
}
// Verify the footer checksum if needed.
@@ -436,10 +434,8 @@ Status CFileReader::ReadBlock(const IOContext* io_context,
CacheControl cache_control,
scoped_refptr<BlockHandle>* ret) const {
DCHECK(init_once_.init_succeeded());
- CHECK(ptr.offset() > 0 &&
- ptr.offset() + ptr.size() < file_size_) <<
- "bad offset " << ptr.ToString() << " in file of size "
- << file_size_;
+ CHECK(ptr.offset() > 0 && ptr.offset() + ptr.size() < file_size_)
+ << Substitute("bad offset $0 in file of size $1", ptr.ToString(), file_size_);
BlockCacheHandle bc_handle;
Cache::CacheBehavior cache_behavior = cache_control == CACHE_BLOCK ?
Cache::EXPECT_IN_CACHE : Cache::NO_EXPECT_IN_CACHE;
@@ -565,19 +561,19 @@ Status CFileReader::ReadBlock(const IOContext* io_context,
return Status::OK();
}
-Status CFileReader::CountRows(rowid_t *count) const {
+Status CFileReader::CountRows(rowid_t* count) const {
*count = footer().num_values();
return Status::OK();
}
-bool CFileReader::GetMetadataEntry(const string &key, string *val) const {
- for (const FileMetadataPairPB &pair : header().metadata()) {
+bool CFileReader::GetMetadataEntry(const string& key, string* val) const {
+ for (const auto& pair : header().metadata()) {
if (pair.key() == key) {
*val = pair.value();
return true;
}
}
- for (const FileMetadataPairPB &pair : footer().metadata()) {
+ for (const auto& pair : footer().metadata()) {
if (pair.key() == key) {
*val = pair.value();
return true;
@@ -626,7 +622,7 @@ Status DefaultColumnValueIterator::SeekToOrdinal(rowid_t ord_idx) {
return Status::OK();
}
-Status DefaultColumnValueIterator::PrepareBatch(size_t *n) {
+Status DefaultColumnValueIterator::PrepareBatch(size_t* n) {
batch_ = *n;
return Status::OK();
}
@@ -648,7 +644,7 @@ Status DefaultColumnValueIterator::Scan(ColumnMaterializationContext* ctx) {
return Status::OK();
}
if (typeinfo_->physical_type() == BINARY) {
- const Slice *src_slice = reinterpret_cast<const Slice *>(value_);
+ const Slice* src_slice = reinterpret_cast<const Slice*>(value_);
Slice dst_slice;
if (PREDICT_FALSE(!dst->arena()->RelocateSlice(*src_slice, &dst_slice))) {
return Status::IOError("out of memory copying slice", src_slice->ToString());
@@ -753,7 +749,7 @@ Status CFileIterator::SeekToOrdinal(rowid_t ord_idx) {
return Status::OK();
}
-void CFileIterator::SeekToPositionInBlock(PreparedBlock *pb, uint32_t idx_in_block) {
+void CFileIterator::SeekToPositionInBlock(PreparedBlock* pb, uint32_t idx_in_block) {
// Since the data block only holds the non-null values,
// we need to translate from 'ord_idx' (the absolute row id)
// to the index within the non-null entries.
@@ -781,7 +777,7 @@ void CFileIterator::SeekToPositionInBlock(PreparedBlock *pb, uint32_t idx_in_blo
Status CFileIterator::SeekToFirst() {
RETURN_NOT_OK(PrepareForNewSeek());
- IndexTreeIterator *idx_iter;
+ IndexTreeIterator* idx_iter = nullptr;
if (PREDICT_TRUE(posidx_iter_ != nullptr)) {
RETURN_NOT_OK(posidx_iter_->SeekToFirst());
idx_iter = posidx_iter_.get();
@@ -793,7 +789,7 @@ Status CFileIterator::SeekToFirst() {
}
pblock_pool_scoped_ptr b = prepared_block_pool_.make_scoped_ptr(
- prepared_block_pool_.Construct());
+ prepared_block_pool_.Construct());
RETURN_NOT_OK(ReadCurrentDataBlock(*idx_iter, b.get()));
b->dblk_->SeekToPositionInBlock(0);
last_prepare_idx_ = 0;
@@ -805,8 +801,7 @@ Status CFileIterator::SeekToFirst() {
return Status::OK();
}
-Status CFileIterator::SeekAtOrAfter(const EncodedKey &key,
- bool *exact_match) {
+Status CFileIterator::SeekAtOrAfter(const EncodedKey& key, bool* exact_match) {
RETURN_NOT_OK(PrepareForNewSeek());
DCHECK_EQ(reader_->is_nullable(), false);
@@ -826,7 +821,7 @@ Status CFileIterator::SeekAtOrAfter(const EncodedKey &key,
RETURN_NOT_OK(s);
pblock_pool_scoped_ptr b = prepared_block_pool_.make_scoped_ptr(
- prepared_block_pool_.Construct());
+ prepared_block_pool_.Construct());
RETURN_NOT_OK(ReadCurrentDataBlock(*validx_iter_, b.get()));
Status dblk_seek_status;
@@ -902,7 +897,7 @@ Status CFileIterator::PrepareForNewSeek() {
}
seeked_ = nullptr;
- for (PreparedBlock *pb : prepared_blocks_) {
+ for (PreparedBlock* pb : prepared_blocks_) {
prepared_block_pool_.Destroy(pb);
}
prepared_blocks_.clear();
@@ -946,8 +941,8 @@ Status DecodeNullInfo(scoped_refptr<BlockHandle>* data_block_handle,
return Status::OK();
}
-Status CFileIterator::ReadCurrentDataBlock(const IndexTreeIterator &idx_iter,
- PreparedBlock *prep_block) {
+Status CFileIterator::ReadCurrentDataBlock(const IndexTreeIterator& idx_iter,
+ PreparedBlock* prep_block) {
prep_block->dblk_ptr_ = idx_iter.GetCurrentBlockPointer();
RETURN_NOT_OK(reader_->ReadBlock(
io_context_, prep_block->dblk_ptr_, cache_control_, &prep_block->dblk_handle_));
@@ -989,7 +984,7 @@ Status CFileIterator::ReadCurrentDataBlock(const IndexTreeIterator &idx_iter,
return Status::OK();
}
-Status CFileIterator::QueueCurrentDataBlock(const IndexTreeIterator &idx_iter) {
+Status CFileIterator::QueueCurrentDataBlock(const IndexTreeIterator& idx_iter) {
pblock_pool_scoped_ptr b = prepared_block_pool_.make_scoped_ptr(
prepared_block_pool_.Construct());
RETURN_NOT_OK(ReadCurrentDataBlock(idx_iter, b.get()));
@@ -1004,7 +999,7 @@ bool CFileIterator::HasNext() const {
return !prepared_blocks_.empty() || seeked_->HasNext();
}
-Status CFileIterator::PrepareBatch(size_t *n) {
+Status CFileIterator::PrepareBatch(size_t* n) {
CHECK(!prepared_) << "Should call FinishBatch() first";
CHECK(seeked_ != nullptr) << "must be seeked";
@@ -1029,7 +1024,7 @@ Status CFileIterator::PrepareBatch(size_t *n) {
// Seek the first block in the queue such that the first value to be read
// corresponds to start_idx
{
- PreparedBlock *front = prepared_blocks_.front();
+ PreparedBlock* front = prepared_blocks_.front();
front->rewind_idx_ = start_idx - front->first_row_idx();
front->needs_rewind_ = true;
}
@@ -1046,7 +1041,7 @@ Status CFileIterator::PrepareBatch(size_t *n) {
if (PREDICT_FALSE(VLOG_IS_ON(1))) {
VLOG(1) << "Prepared for " << (*n) << " rows"
<< " (" << start_idx << "-" << (start_idx + *n - 1) << ")";
- for (PreparedBlock *b : prepared_blocks_) {
+ for (PreparedBlock* b : prepared_blocks_) {
VLOG(1) << " " << b->ToString();
}
VLOG(1) << "-------------";
@@ -1065,11 +1060,11 @@ Status CFileIterator::FinishBatch() {
// Release all blocks except for the last one, which may still contain
// relevent data for the next batch.
for (int i = 0; i < prepared_blocks_.size() - 1; i++) {
- PreparedBlock *b = prepared_blocks_[i];
+ PreparedBlock* b = prepared_blocks_[i];
prepared_block_pool_.Destroy(b);
}
- PreparedBlock *back = prepared_blocks_.back();
+ PreparedBlock* back = prepared_blocks_.back();
DVLOG(1) << "checking last block " << back->ToString() << " vs "
<< last_prepare_idx_ << " + " << last_prepare_count_
<< " (" << (last_prepare_idx_ + last_prepare_count_) << ")";
@@ -1082,15 +1077,15 @@ Status CFileIterator::FinishBatch() {
prepared_blocks_.resize(1);
}
- #ifndef NDEBUG
+#ifndef NDEBUG
if (VLOG_IS_ON(1)) {
VLOG(1) << "Left around following blocks:";
- for (PreparedBlock *b : prepared_blocks_) {
+ for (PreparedBlock* b : prepared_blocks_) {
VLOG(1) << " " << b->ToString();
}
VLOG(1) << "-------------";
}
- #endif
+#endif
last_prepare_idx_ += last_prepare_count_;
last_prepare_count_ = 0;
@@ -1115,13 +1110,13 @@ Status CFileIterator::Scan(ColumnMaterializationContext* ctx) {
codewords_matching_pred_->SetAllFalse();
for (size_t i = 0; i < nwords; i++) {
Slice cur_string = dict_decoder_->string_at_index(i);
- if (ctx->pred()->EvaluateCell<BINARY>(static_cast<const void *>(&cur_string))) {
+ if (ctx->pred()->EvaluateCell<BINARY>(static_cast<const void*>(&cur_string))) {
BitmapSet(codewords_matching_pred_->mutable_bitmap(), i);
}
}
}
}
- for (PreparedBlock *pb : prepared_blocks_) {
+ for (PreparedBlock* pb : prepared_blocks_) {
if (pb->needs_rewind_) {
// Seek back to the saved position.
SeekToPositionInBlock(pb, pb->rewind_idx_);
@@ -1140,9 +1135,9 @@ Status CFileIterator::Scan(ColumnMaterializationContext* ctx) {
size_t nblock = pb->rle_decoder_.GetNextRun(¬_null, count);
DCHECK_LE(nblock, count);
if (PREDICT_FALSE(nblock == 0)) {
- return Status::Corruption(
- Substitute("Unexpected EOF on NULL bitmap read. Expected at least $0 more rows",
- count));
+ return Status::Corruption(Substitute(
+ "unexpected EOF on NULL bitmap read; "
+ "expected at least $0 more rows", count));
}
size_t this_batch = nblock;
if (not_null) {
@@ -1158,7 +1153,7 @@ Status CFileIterator::Scan(ColumnMaterializationContext* ctx) {
pb->needs_rewind_ = true;
} else {
#ifndef NDEBUG
- kudu::OverwriteWithPattern(reinterpret_cast<char *>(remaining_dst.data()),
+ kudu::OverwriteWithPattern(reinterpret_cast<char*>(remaining_dst.data()),
remaining_dst.stride() * nblock,
"NULLNULLNULLNULLNULL");
#endif
@@ -1216,8 +1211,7 @@ Status CFileIterator::Scan(ColumnMaterializationContext* ctx) {
Status CFileIterator::CopyNextValues(size_t* n, ColumnMaterializationContext* ctx) {
RETURN_NOT_OK(PrepareBatch(n));
RETURN_NOT_OK(Scan(ctx));
- RETURN_NOT_OK(FinishBatch());
- return Status::OK();
+ return FinishBatch();
}
} // namespace cfile
diff --git a/src/kudu/cfile/cfile_reader.h b/src/kudu/cfile/cfile_reader.h
index 392d7063a..f0f406c58 100644
--- a/src/kudu/cfile/cfile_reader.h
+++ b/src/kudu/cfile/cfile_reader.h
@@ -33,7 +33,6 @@
#include "kudu/fs/block_id.h"
#include "kudu/fs/block_manager.h"
#include "kudu/gutil/macros.h"
-#include "kudu/gutil/port.h"
#include "kudu/gutil/ref_counted.h"
#include "kudu/util/compression/compression.pb.h"
#include "kudu/util/faststring.h"
@@ -112,14 +111,14 @@ class CFileReader {
// Return the number of rows in this cfile.
// This is assumed to be reasonably fast (i.e does not scan
// the data)
- Status CountRows(rowid_t *count) const;
+ Status CountRows(rowid_t* count) const;
// Retrieve the given metadata entry into 'val'.
// Returns true if the entry was found, otherwise returns false.
//
// Note that this implementation is currently O(n), so should not be used
// in a hot path.
- bool GetMetadataEntry(const std::string &key, std::string *val) const;
+ bool GetMetadataEntry(const std::string& key, std::string* val) const;
// Can be called before Init().
uint64_t file_size() const {
@@ -131,12 +130,12 @@ class CFileReader {
return block_->id();
}
- const TypeInfo *type_info() const {
+ const TypeInfo* type_info() const {
DCHECK(init_once_.init_succeeded());
return type_info_;
}
- const TypeEncodingInfo *type_encoding_info() const {
+ const TypeEncodingInfo* type_encoding_info() const {
DCHECK(init_once_.init_succeeded());
return type_encoding_info_;
}
@@ -145,12 +144,12 @@ class CFileReader {
return footer().is_type_nullable();
}
- const CFileHeaderPB &header() const {
+ const CFileHeaderPB& header() const {
DCHECK(init_once_.init_succeeded());
return *DCHECK_NOTNULL(header_.get());
}
- const CFileFooterPB &footer() const {
+ const CFileFooterPB& footer() const {
DCHECK(init_once_.init_succeeded());
return *DCHECK_NOTNULL(footer_.get());
}
@@ -204,9 +203,6 @@ class CFileReader {
// Returns the memory usage of the object including the object itself.
size_t memory_footprint() const;
-#ifdef __clang__
- __attribute__((__unused__))
-#endif
const std::unique_ptr<fs::ReadableBlock> block_;
const uint64_t file_size_;
@@ -215,8 +211,8 @@ class CFileReader {
std::unique_ptr<CFileHeaderPB> header_;
std::unique_ptr<CFileFooterPB> footer_;
const CompressionCodec* codec_;
- const TypeInfo *type_info_;
- const TypeEncodingInfo *type_encoding_info_;
+ const TypeInfo* type_info_;
+ const TypeEncodingInfo* type_encoding_info_;
KuduOnceLambda init_once_;
@@ -260,7 +256,7 @@ class ColumnIterator {
// If there are at least dst->size() values remaining in the underlying file,
// this will always return *n == dst->size(). In other words, this does not
// ever result in a "short read".
- virtual Status PrepareBatch(size_t *n) = 0;
+ virtual Status PrepareBatch(size_t* n) = 0;
// Copy values into the prepared column block.
// Any indirected values (eg strings) are copied into the ctx's block's
@@ -288,25 +284,27 @@ class ColumnIterator {
// iter.Scan(&column_block);
class DefaultColumnValueIterator : public ColumnIterator {
public:
- DefaultColumnValueIterator(const TypeInfo* typeinfo, const void *value)
- : typeinfo_(typeinfo), value_(value), ordinal_(0) {
+ DefaultColumnValueIterator(const TypeInfo* typeinfo, const void* value)
+ : typeinfo_(typeinfo),
+ value_(value),
+ ordinal_(0) {
}
Status SeekToOrdinal(rowid_t ord_idx) override;
- bool seeked() const OVERRIDE { return true; }
+ bool seeked() const override { return true; }
- rowid_t GetCurrentOrdinal() const OVERRIDE { return ordinal_; }
+ rowid_t GetCurrentOrdinal() const override { return ordinal_; }
- Status PrepareBatch(size_t* n) OVERRIDE;
+ Status PrepareBatch(size_t* n) override;
Status Scan(ColumnMaterializationContext* ctx) override;
- Status FinishBatch() OVERRIDE;
+ Status FinishBatch() override;
- const IteratorStats& io_statistics() const OVERRIDE { return io_stats_; }
+ const IteratorStats& io_statistics() const override { return io_stats_; }
private:
const TypeInfo* typeinfo_;
- const void *value_;
+ const void* value_;
size_t batch_;
rowid_t ordinal_;
@@ -341,13 +339,13 @@ class CFileIterator : public ColumnIterator {
//
// If this iterator was constructed without no value index,
// then this will return a NotSupported status.
- Status SeekAtOrAfter(const EncodedKey &encoded_key,
- bool *exact_match);
+ Status SeekAtOrAfter(const EncodedKey& encoded_key,
+ bool* exact_match);
// Return true if this reader is currently seeked.
// If the iterator is not seeked, it is an error to call any functions except
// for seek (including GetCurrentOrdinal).
- bool seeked() const OVERRIDE { return seeked_; }
+ bool seeked() const override { return seeked_; }
// Get the ordinal index that the iterator is currently pointed to.
//
@@ -355,7 +353,7 @@ class CFileIterator : public ColumnIterator {
// seek. PrepareBatch() and Scan() do not change the position returned by this
// function. FinishBatch() advances the ordinal to the position of the next
// block to be prepared.
- rowid_t GetCurrentOrdinal() const OVERRIDE;
+ rowid_t GetCurrentOrdinal() const override;
// Prepare to read up to *n into the given column block.
// On return sets *n to the number of prepared rows, which is always
@@ -366,7 +364,7 @@ class CFileIterator : public ColumnIterator {
// If there are at least dst->size() values remaining in the underlying file,
// this will always return *n == dst->size(). In other words, this does not
// ever result in a "short read".
- Status PrepareBatch(size_t *n) OVERRIDE;
+ Status PrepareBatch(size_t* n) override;
// Copy values into the prepared column block.
// Any indirected values (eg strings) are copied into the dst block's
@@ -378,7 +376,7 @@ class CFileIterator : public ColumnIterator {
// Finish processing the current batch, advancing the iterators
// such that the next call to PrepareBatch() will start where the previous
// batch left off.
- Status FinishBatch() OVERRIDE;
+ Status FinishBatch() override;
// Return true if the next call to PrepareBatch will return at least one row.
bool HasNext() const;
@@ -386,7 +384,7 @@ class CFileIterator : public ColumnIterator {
// Convenience method to prepare a batch, scan it, and finish it.
Status CopyNextValues(size_t* n, ColumnMaterializationContext* ctx);
- const IteratorStats &io_statistics() const OVERRIDE {
+ const IteratorStats& io_statistics() const override {
return io_stats_;
}
@@ -400,7 +398,9 @@ class CFileIterator : public ColumnIterator {
// is shared among the multiple BinaryDictBlockDecoders in a single cfile,
// the reader must expose an interface for all decoders to access the
// single set of predicate-satisfying codewords.
- SelectionVector* GetCodeWordsMatchingPredicate() { return codewords_matching_pred_.get(); }
+ SelectionVector* GetCodeWordsMatchingPredicate() {
+ return codewords_matching_pred_.get();
+ }
private:
DISALLOW_COPY_AND_ASSIGN(CFileIterator);
@@ -446,18 +446,18 @@ class CFileIterator : public ColumnIterator {
};
// Seek the given PreparedBlock to the given index within it.
- void SeekToPositionInBlock(PreparedBlock *pb, uint32_t idx_in_block);
+ void SeekToPositionInBlock(PreparedBlock* pb, uint32_t idx_in_block);
// Read the data block currently pointed to by idx_iter_
// into the given PreparedBlock structure.
//
// This does not advance the iterator.
- Status ReadCurrentDataBlock(const IndexTreeIterator &idx_iter,
- PreparedBlock *prep_block);
+ Status ReadCurrentDataBlock(const IndexTreeIterator& idx_iter,
+ PreparedBlock* prep_block);
// Read the data block currently pointed to by idx_iter_, and enqueue
// it onto the end of the prepared_blocks_ deque.
- Status QueueCurrentDataBlock(const IndexTreeIterator &idx_iter);
+ Status QueueCurrentDataBlock(const IndexTreeIterator& idx_iter);
// Fully initialize the underlying cfile reader if needed, and clear any
// seek-related state.
@@ -477,12 +477,12 @@ class CFileIterator : public ColumnIterator {
// The currently in-use index iterator. This is equal to either
// posidx_iter_.get(), validx_iter_.get(), or NULL if not seeked.
- IndexTreeIterator *seeked_;
+ IndexTreeIterator* seeked_;
// Data blocks that contain data relevant to the currently Prepared
// batch of rows.
// These pointers are allocated from the prepared_block_pool_ below.
- std::vector<PreparedBlock *> prepared_blocks_;
+ std::vector<PreparedBlock*> prepared_blocks_;
ObjectPool<PreparedBlock> prepared_block_pool_;
typedef ObjectPool<PreparedBlock>::scoped_ptr pblock_pool_scoped_ptr;