/* Copyright (C) 2014 InfiniDB, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*************************************************************************** * * $Id: blockrequestprocessor.cpp 725 2008-09-26 16:26:47Z jrodriguez $ * * jrodriguez@calpont.com * * * ***************************************************************************/ #include "blockrequestprocessor.h" #include "rwlock_local.h" #include "dbrm.h" #include #include #include #include #include #include using namespace std; namespace dbbc { BlockRequestProcessor::BlockRequestProcessor(uint32_t numBlcks, int thrCount, int blocksPerRead, uint32_t deleteBlocks, uint32_t blckSz) : fbMgr(numBlcks, blckSz, deleteBlocks), fIOMgr(fbMgr, fBRPRequestQueue, thrCount, blocksPerRead) { } BlockRequestProcessor::~BlockRequestProcessor() { } void BlockRequestProcessor::stop() { fBRPRequestQueue.stop(); fIOMgr.stop(); } int BlockRequestProcessor::check(const BRM::InlineLBIDRange& range, const BRM::VER_t ver, uint32_t& lbidCount) { uint64_t maxLbid = range.start; // highest existent lbid uint64_t rangeLen = range.size; uint64_t idx; uint64_t adjSz; struct timespec start_tm; if (fTrace) clock_gettime(CLOCK_MONOTONIC, &start_tm); for (idx=0; fbMgr.exists(maxLbid, ver)==true&&idx