SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
ColumnCompact.h
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 #ifndef swcdb_manager_Protocol_handlers_ColumnCompact_h
8 #define swcdb_manager_Protocol_handlers_ColumnCompact_h
9 
11 
12 
13 namespace SWC { namespace Comm { namespace Protocol {
14 namespace Mngr { namespace Handler {
15 
16 
17 void column_compact(const ConnHandlerPtr& conn, const Event::Ptr& ev) {
18  Params::ColumnCompactRsp rsp_params;
19  try {
20  const uint8_t *ptr = ev->data.base;
21  size_t remain = ev->data.size;
22 
24  params.decode(&ptr, &remain);
25 
26  auto col = Env::Mngr::mngd_columns()->get_column(
27  rsp_params.err, params.cid);
28  if(!rsp_params.err)
30 
31  } catch(...) {
34  rsp_params.err = e.code();
35  }
36 
37  conn->send_response(Buffers::make(ev, rsp_params));
38 }
39 
40 
41 }}}}}
42 
43 #endif // swcdb_manager_Protocol_handlers_ColumnCompact_h
SWC::Manager::MngdColumns::get_column
Column::Ptr get_column(int &err, cid_t cid)
Definition: MngdColumns.cc:174
SWC::Error::Exception::code
constexpr SWC_CAN_INLINE int code() const noexcept
Definition: Exception.h:51
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
SWC::Manager::Rangers::column_compact
void column_compact(const Column::Ptr &col)
Definition: Rangers.cc:481
SWC::Comm::Protocol::Mngr::Params::ColumnCompactReq::cid
cid_t cid
Definition: ColumnCompact.h:26
SWC::Comm::Protocol::Mngr::Params::ColumnCompactRsp
Definition: ColumnCompact.h:42
SWC_CURRENT_EXCEPTION
#define SWC_CURRENT_EXCEPTION(_msg_)
Definition: Exception.h:119
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Env::Mngr::mngd_columns
static SWC_CAN_INLINE Manager::MngdColumns * mngd_columns() noexcept
Definition: MngrEnv.h:74
SWC::LOG_ERROR
@ LOG_ERROR
Definition: Logger.h:32
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
ColumnCompact.h
SWC::Comm::Protocol::Mngr::Params::ColumnCompactRsp::err
int err
Definition: ColumnCompact.h:52
SWC::Comm::Buffers::make
static SWC_CAN_INLINE Ptr make(uint32_t reserve=0)
Definition: Buffers.h:27
SWC::Comm::Serializable::decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: Serializable.h:59
SWC::Comm::Event::Ptr
std::shared_ptr< Event > Ptr
Definition: Event.h:33
SWC::Error::Exception
Definition: Exception.h:21
SWC::Comm::Protocol::Mngr::Params::ColumnCompactReq
Definition: ColumnCompact.h:18
SWC::Env::Mngr::rangers
static SWC_CAN_INLINE Manager::Rangers * rangers() noexcept
Definition: MngrEnv.h:69
SWC::Comm::Protocol::Mngr::Handler::column_compact
void column_compact(const ConnHandlerPtr &conn, const Event::Ptr &ev)
Definition: ColumnCompact.h:17