From commits-return-6624-archive-asf-public=cust-asf.ponee.io@quickstep.incubator.apache.org Wed Apr 18 21:41:18 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2140218064E for ; Wed, 18 Apr 2018 21:41:17 +0200 (CEST) Received: (qmail 92044 invoked by uid 500); 18 Apr 2018 19:41:17 -0000 Mailing-List: contact commits-help@quickstep.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@quickstep.incubator.apache.org Delivered-To: mailing list commits@quickstep.incubator.apache.org Received: (qmail 92029 invoked by uid 99); 18 Apr 2018 19:41:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2018 19:41:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 985E2180785 for ; Wed, 18 Apr 2018 19:41:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -11.712 X-Spam-Level: X-Spam-Status: No, score=-11.712 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 70zUymgpfLJP for ; Wed, 18 Apr 2018 19:41:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 560D65F5B3 for ; Wed, 18 Apr 2018 19:41:15 +0000 (UTC) Received: (qmail 92018 invoked by uid 99); 18 Apr 2018 19:41:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2018 19:41:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AC831E08A1; Wed, 18 Apr 2018 19:41:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jianqiao@apache.org To: commits@quickstep.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-quickstep git commit: More informative error for BlockNotFound exception for debugging Date: Wed, 18 Apr 2018 19:41:14 +0000 (UTC) Repository: incubator-quickstep Updated Branches: refs/heads/master 502960d06 -> 571e00907 More informative error for BlockNotFound exception for debugging Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/571e0090 Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/571e0090 Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/571e0090 Branch: refs/heads/master Commit: 571e00907fc416a490e20421853246efa21d80a8 Parents: 502960d Author: Harshad Deshmukh Authored: Tue Apr 17 11:17:58 2018 -0500 Committer: Harshad Deshmukh Committed: Wed Apr 18 11:59:39 2018 -0500 ---------------------------------------------------------------------- storage/CMakeLists.txt | 2 ++ storage/StorageErrors.hpp | 12 +++++++++++- storage/StorageManager.cpp | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/571e0090/storage/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt index fb09e49..e67269f 100644 --- a/storage/CMakeLists.txt +++ b/storage/CMakeLists.txt @@ -997,6 +997,8 @@ target_link_libraries(quickstep_storage_StorageBlockLayout quickstep_storage_SubBlockTypeRegistry quickstep_utility_Macros ${PROTOBUF_LIBRARY}) +target_link_libraries(quickstep_storage_StorageErrors + quickstep_storage_StorageBlockInfo) target_link_libraries(quickstep_storage_StorageBlockLayout_proto ${PROTOBUF_LIBRARY}) target_link_libraries(quickstep_storage_StorageManager http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/571e0090/storage/StorageErrors.hpp ---------------------------------------------------------------------- diff --git a/storage/StorageErrors.hpp b/storage/StorageErrors.hpp index b87f04e..fbd4f76 100644 --- a/storage/StorageErrors.hpp +++ b/storage/StorageErrors.hpp @@ -24,6 +24,8 @@ #include #include +#include "storage/StorageBlockInfo.hpp" + namespace quickstep { /** \addtogroup Storage @@ -61,9 +63,17 @@ class BlockMemoryTooSmall : public std::exception { **/ class BlockNotFoundInMemory : public std::exception { public: + explicit BlockNotFoundInMemory(block_id id) { + message_ = "BlockNotFoundInMemory: The block with ID " + + BlockIdUtil::ToString(id) + " was not found in memory"; + } + virtual const char* what() const throw() { - return "BlockNotFoundInMemory: The specified block was not found in memory"; + return message_.c_str(); } + + private: + std::string message_; }; /** http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/571e0090/storage/StorageManager.cpp ---------------------------------------------------------------------- diff --git a/storage/StorageManager.cpp b/storage/StorageManager.cpp index 8f17455..e2efebf 100644 --- a/storage/StorageManager.cpp +++ b/storage/StorageManager.cpp @@ -428,7 +428,7 @@ void StorageManager::evictBlockOrBlob(const block_id block) { std::unordered_map::iterator block_it = blocks_.find(block); if (block_it == blocks_.end()) { - throw BlockNotFoundInMemory(); + throw BlockNotFoundInMemory(block); } handle = block_it->second; blocks_.erase(block_it);