SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
ColumnDelete.cc
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
7 namespace SWC { namespace Ranger { namespace Callback {
8 
9 
12  const Comm::Event::Ptr& ev,
13  const cid_t a_cid) noexcept
15  cid(a_cid), col(nullptr), m_mutex(), m_ranges() {
16 }
17 
18 void ColumnDelete::add(const RangePtr& range) {
20  m_ranges.push_back(range);
21 }
22 
23 void ColumnDelete::removed(const RangePtr& range) {
24  col->internal_delete(range->rid);
25  SWC_LOG_OUT(LOG_INFO, range->print(SWC_LOG_OSTREAM << "REMOVED RANGE "); );
26  {
28  auto it = std::find(m_ranges.cbegin(), m_ranges.cend(), range);
29  if(it != m_ranges.cend())
30  m_ranges.erase(it);
31  if(!m_ranges.empty())
32  return;
33  }
34  complete();
35 }
36 
39  response_ok();
40  col->run_mng_queue();
41 }
42 
43 
44 }}}
SWC::Core::Vector::erase
SWC_CAN_INLINE iterator erase(size_type offset) noexcept(_NoExceptMoveAssign &&_NoExceptDestructor)
Definition: Vector.h:464
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC::Ranger::Columns::internal_delete
void internal_delete(cid_t cid)
Definition: Columns.cc:167
SWC::Ranger::Callback::ColumnDelete::removed
void removed(const RangePtr &range)
Definition: ColumnDelete.cc:23
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
SWC::Ranger::Callback::ManageBase
Definition: ManageBase.h:20
SWC::Env::Rgr::columns
static SWC_CAN_INLINE Ranger::Columns * columns() noexcept
Definition: RangerEnv.h:144
SWC::Ranger::Callback::ColumnDelete::complete
void complete()
Definition: ColumnDelete.cc:37
SWC::LOG_INFO
@ LOG_INFO
Definition: Logger.h:35
SWC::Core::MutexSptd::scope
Definition: MutexSptd.h:96
SWC::Ranger::Callback::ColumnDelete::add
void add(const RangePtr &range)
Definition: ColumnDelete.cc:18
SWC::Ranger::Callback::ManageBase::COLUMN_DELETE
@ COLUMN_DELETE
Definition: ManageBase.h:30
SWC::Comm::ResponseCallback::response_ok
virtual void response_ok()
Definition: ResponseCallback.h:32
SWC::Core::Vector::empty
constexpr SWC_CAN_INLINE bool empty() const noexcept
Definition: Vector.h:168
SWC::Ranger::RangePtr
std::shared_ptr< Range > RangePtr
Definition: Columns.h:15
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC::Ranger::Callback::ColumnDelete::m_ranges
Core::Vector< RangePtr > m_ranges
Definition: ColumnDelete.h:34
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::cid_t
uint64_t cid_t
Definition: Identifiers.h:16
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
SWC::Ranger::Callback::ColumnDelete::m_mutex
Core::MutexSptd m_mutex
Definition: ColumnDelete.h:33
SWC::Core::Vector::cend
constexpr SWC_CAN_INLINE const_iterator cend() const noexcept
Definition: Vector.h:232
SWC::Ranger::Callback::ColumnDelete::ColumnDelete
ColumnDelete(const Comm::ConnHandlerPtr &conn, const Comm::Event::Ptr &ev, const cid_t cid) noexcept
Definition: ColumnDelete.cc:11
SWC::Comm::Event::Ptr
std::shared_ptr< Event > Ptr
Definition: Event.h:33
SWC::Core::Vector::push_back
SWC_CAN_INLINE void push_back(ArgsT &&... args)
Definition: Vector.h:331
SWC::Core::Vector::cbegin
constexpr SWC_CAN_INLINE const_iterator cbegin() const noexcept
Definition: Vector.h:216
SWC::Ranger::Callback::ColumnDelete::col
ColumnPtr col
Definition: ColumnDelete.h:19