Skip to content

Commit

Permalink
Add the offset and size to the dump SST footer details (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk authored Oct 15, 2023
1 parent 1058aa6 commit 6511a7d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Fix RepeatableThread to work properly with on thread start callback feature (htt
* Unit Testing: Expose the disallow_trivial_move flag in the MoveFilesToLevel testing utility (#677).
* Static Pinning: Report pinning policy name and parameters to the log (#691).
* LOG Reporting: add reporting capabilities to the WriteController and the WriteBufferManager by saving the Loggers of the dbs which are using them internally and issuing WARN msgs to these Loggers whenever the state of the WC and WBM changes in regards to delaying (#556).
* sst_dump: display metaindex_handle and the index_handle's offset and size in footer information (#404).

### Bug Fixes
* db_bench: fix SeekRandomWriteRandom valid check. Use key and value only after checking iterator is valid.
Expand Down
35 changes: 24 additions & 11 deletions table/format.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// Copyright (C) 2023 Speedb Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
Expand Down Expand Up @@ -328,17 +343,15 @@ std::string Footer::ToString() const {
std::string result;
result.reserve(1024);

bool legacy = IsLegacyFooterFormat(table_magic_number_);
if (legacy) {
result.append("metaindex handle: " + metaindex_handle_.ToString() + "\n ");
result.append("index handle: " + index_handle_.ToString() + "\n ");
result.append("table_magic_number: " + std::to_string(table_magic_number_) +
"\n ");
} else {
result.append("metaindex handle: " + metaindex_handle_.ToString() + "\n ");
result.append("index handle: " + index_handle_.ToString() + "\n ");
result.append("table_magic_number: " + std::to_string(table_magic_number_) +
"\n ");
result.append("metaindex handle: " + metaindex_handle_.ToString() +
" offset: " + std::to_string(metaindex_handle_.offset()) +
" size: " + std::to_string(metaindex_handle_.size()) + "\n ");
result.append("index handle: " + index_handle_.ToString() +
" offset: " + std::to_string(index_handle_.offset()) +
" size: " + std::to_string(index_handle_.size()) + "\n ");
result.append("table_magic_number: " + std::to_string(table_magic_number_) +
"\n ");
if (!IsLegacyFooterFormat(table_magic_number_)) {
result.append("format version: " + std::to_string(format_version_) +
"\n ");
}
Expand Down

0 comments on commit 6511a7d

Please sign in to comment.