mirror of https://gitee.com/bigwinds/arangodb
added server states
This commit is contained in:
parent
c3f004dd3f
commit
57d77094d6
|
@ -74,6 +74,7 @@ bin_arangod_SOURCES = \
|
|||
arangod/RestServer/ArangoServer.cpp \
|
||||
arangod/RestServer/VocbaseContext.cpp \
|
||||
arangod/RestServer/arango.cpp \
|
||||
arangod/Sharding/server-state.cpp \
|
||||
arangod/SkipLists/skiplistIndex.c \
|
||||
arangod/Utils/DocumentHelper.cpp \
|
||||
arangod/V8Server/ApplicationV8.cpp \
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief single-server states
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Jan Steemann
|
||||
/// @author Copyright 2013, triagens GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "server-state.h"
|
||||
|
||||
using namespace triagens::arango::serverstate;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- server states
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get the string representation of a state
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string stateToString (StateEnum state) {
|
||||
switch (state) {
|
||||
case STATE_OFFLINE:
|
||||
return "offline";
|
||||
case STATE_STARTUP:
|
||||
return "startup";
|
||||
case STATE_CONNECTED:
|
||||
return "connected";
|
||||
case STATE_STOPPING:
|
||||
return "stopping";
|
||||
case STATE_STOPPED:
|
||||
return "stopped";
|
||||
case STATE_PROBLEM:
|
||||
return "problem";
|
||||
case STATE_RECOVERING:
|
||||
return "recovering";
|
||||
case STATE_RECOVERED:
|
||||
return "recovered";
|
||||
case STATE_SHUTDOWN:
|
||||
return "shutdown";
|
||||
}
|
||||
|
||||
assert(false);
|
||||
return "";
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
|
||||
// End:
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief single-server states
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Jan Steemann
|
||||
/// @author Copyright 2013, triagens GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TRIAGENS_SHARDING_SERVER_STATE_H
|
||||
#define TRIAGENS_SHARDING_SERVER_STATE_H 1
|
||||
|
||||
#include "Basics/Common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
namespace triagens {
|
||||
namespace arango {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- server states
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace serverstate {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief an enum describing the possible states a server can have
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum StateEnum {
|
||||
STATE_OFFLINE = 0,
|
||||
STATE_STARTUP = 1,
|
||||
STATE_CONNECTED = 2,
|
||||
STATE_STOPPING = 3,
|
||||
STATE_STOPPED = 4,
|
||||
STATE_PROBLEM = 5,
|
||||
STATE_RECOVERING = 6,
|
||||
STATE_RECOVERED = 7,
|
||||
STATE_SHUTDOWN = 8
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get the string representation of a state
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string stateToString (StateEnum);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
|
||||
// End:
|
||||
|
Loading…
Reference in New Issue