0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GetStatistics.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
27 
28 #include <Common/Compat.h>
29 
30 #include "GetStatistics.h"
31 
34 
36 
38 
39 using namespace Hypertable;
40 using namespace Hypertable::RangeServer;
42 
45 
46  try {
47  const uint8_t *ptr = m_event->payload;
48  size_t remain = m_event->payload_len;
50  params.decode(&ptr, &remain);
52  params.generation());
53  }
54  catch (Exception &e) {
55  HT_ERROR_OUT << e << HT_END;
56  cb.error(e.code(), "Error handling GetStatistics message");
57  }
58 }
Declarations for RangeServer.
const vector< SystemVariable::Spec > & system_variables()
Gets system variables.
Definition: GetStatistics.h:66
Compatibility Macros for C/C++.
#define HT_END
Definition: Logger.h:220
#define HT_ERROR_OUT
Definition: Logger.h:301
virtual void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
Definition: Serializable.cc:70
Declarations for GetStatistics request parameters.
Hypertable definitions
virtual void run()
Decodes request and calls RangeServer::get_statistics().
int64_t generation() const
Gets system variable generation.
Definition: GetStatistics.h:72
virtual int error(int error, const String &msg)
Sends a standard error response back to the client.
Request parameters for get statistics function.
Definition: GetStatistics.h:49
This is a generic exception class for Hypertable.
Definition: Error.h:314
void get_statistics(Response::Callback::GetStatistics *cb, const std::vector< SystemVariable::Spec > &specs, uint64_t generation)
EventPtr m_event
MESSAGE Event from which handler was initialized.
Apps::RangeServer * m_range_server
Pointer to RangeServer object.
Definition: GetStatistics.h:73
Declarations for ResponseCallback.
int code() const
Returns the error code.
Definition: Error.h:391