8000 honor our coding guidelines, remove useless debug log message · davinash/arangodb@6313634 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6313634

Browse files
committed
honor our coding guidelines, remove useless debug log message
1 parent 056ee70 commit 6313634

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

arangod/GeneralServer/GeneralServer.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ using namespace arangodb::rest;
4040
// --SECTION-- public methods
4141
// -----------------------------------------------------------------------------
4242

43-
GeneralServer::GeneralServer(uint64_t numIoThreads) :
44-
_numIoThreads(numIoThreads),
45-
_contexts(numIoThreads)
46-
{}
43+
GeneralServer::GeneralServer(uint64_t numIoThreads)
44+
: _numIoThreads(numIoThreads),
45+
_contexts(numIoThreads) {}
4746

4847
void GeneralServer::setEndpointList(EndpointList const* list) {
4948
_endpointList = list;
@@ -57,7 +56,7 @@ void GeneralServer::startListening() {
5756
<< it.first << "' for requests";
5857

5958
// distribute endpoints across all io contexts
60-
IoContext &ioContext = _contexts[i++ % _numIoThreads];
59+
IoContext& ioContext = _contexts[i++ % _numIoThreads];
6160
bool ok = openEndpoint(ioContext, it.second);
6261

6362
if (ok) {
@@ -75,7 +74,6 @@ void GeneralServer::startListening() {
7574
}
7675

7776
void GeneralServer::stopListening() {
78-
LOG_TOPIC(ERR, Logger::FIXME) << "GeneralServer::stopListening()";
7977
for (auto& context : _contexts) {
8078
context.stop();
8179
}
@@ -110,7 +108,7 @@ GeneralServer::IoThread::~IoThread() {
110108
shutdown();
111109
}
112110

113-
GeneralServer::IoThread::IoThread(IoContext &iocontext) :
111+
GeneralServer::IoThread::IoThread(IoContext& iocontext) :
114112
Thread("Io"), _iocontext(iocontext) {}
115113

116114
void GeneralServer::IoThread::run() {
@@ -123,8 +121,7 @@ GeneralServer::IoContext::IoContext() :
123121
_thread(*this),
124122
_asioIoContext(1), // only a single thread per context
125123
_asioWork(_asioIoContext),
126-
_stopped(false)
127-
{
124+
_stopped(false) {
128125
_thread.start();
129126
}
130127

@@ -137,8 +134,7 @@ void GeneralServer::IoContext::stop() {
137134
}
138135

139136

140-
GeneralServer::IoContext &GeneralServer::selectIoContext()
141-
{
137+
GeneralServer::IoContext& GeneralServer::selectIoContext() {
142138
uint32_t low = _contexts[0]._clients.load();
143139
size_t lowpos = 0;
144140

arangod/GeneralServer/GeneralServer.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ class EndpointList;
3636

3737
namespace rest {
3838

39-
40-
4139
class GeneralServer {
4240

4341
GeneralServer(GeneralServer const&) = delete;
4442
GeneralServer const& operator=(GeneralServer const&) = delete;
4543

4644
public:
47-
GeneralServer(uint64_t numIoThreads);
45+
explicit GeneralServer(uint64_t numIoThreads);
4846

4947
public:
5048
void setEndpointList(EndpointList const* list);
@@ -56,9 +54,9 @@ class GeneralServer {
5654
private:
5755
class IoThread final : public Thread {
5856
public:
59-
IoThread(IoContext &iocontext);
57+
IoThread(IoContext& iocontext);
6058
~IoThread();
61-
void run();
59+
void run() override;
6260
private:
6361
IoContext &_iocontext;
6462
};
@@ -123,19 +121,19 @@ class GeneralServer {
123121
}
124122

125123

126-
void post(std::function<void()> && handler) {
124 E03D +
void post(std::function<void()>&& handler) {
127125
_asioIoContext.post(std::move(handler));
128126
}
129127

130128
void start();
131129
void stop();
132130

133-
bool runningInThisThread() { return _thread.runningInThisThread(); }
131+
bool runningInThisThread() const { return _thread.runningInThisThread(); }
134132
private:
135133

136134
};
137135

138-
GeneralServer::IoContext &selectIoContext();
136+
GeneralServer::IoContext& selectIoContext();
139137

140138
protected:
141139
bool openEndpoint(IoContext &ioContext, Endpoint* endpoint);

lib/Basics/Thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Thread {
9696
/// @brief flags the thread as stopping
9797
virtual void beginShutdown();
9898

99-
bool runningInThisThread() {
99+
bool runningInThisThread() const {
100100
return currentThreadNumber() == this->threadNumber();
101101
}
102102

0 commit comments

Comments
 (0)
0