Skip to content

Commit

Permalink
fix GetTableProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
levichen94 committed Apr 9, 2020
1 parent 557e5bb commit cf5a54d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ fi

JEMALLOC=0
if [ "$USE_JEMALLOC" == "1" ]; then
cd third-party/jemalloc && bash autogen.sh && ./configure --enable-prof-libunwind && make -j20 && cd ../../
if [ ! -f "third-party/jemalloc/lib/libjemalloc.a" ]; then
cd third-party/jemalloc && bash autogen.sh && ./configure --enable-prof-libunwind && make -j20 && cd ../../
fi
JEMALLOC=1
fi

Expand Down
12 changes: 11 additions & 1 deletion table/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,17 @@ std::shared_ptr<const TableProperties> BlockBasedTable::GetTableProperties()
if (rep_->table_properties) {
return rep_->table_properties;
} else {
//TableReader::ReadTableProperties(rep_->file.get(), rep_->file);
TableProperties* prop = nullptr;
size_t filesize = size_t(-1);
Status s;
s = rep_->ioptions.env->GetFileSize(rep_->file.get()->file_name(),
&filesize);
assert(filesize != size_t(-1));
s = ReadTableProperties(rep_->file.get(), filesize,
kBlockBasedTableMagicNumber, rep_->ioptions, &prop);
assert(prop != nullptr);
rep_->table_properties.reset(prop);
return rep_->table_properties;
}
}

Expand Down

0 comments on commit cf5a54d

Please sign in to comment.