Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ constexpr char const* kConnectorName = "connector.name";

protocol::NodeState convertNodeState(presto::NodeState nodeState) {
switch (nodeState) {
case presto::NodeState::ACTIVE:
case presto::NodeState::kActive:
return protocol::NodeState::ACTIVE;
case presto::NodeState::INACTIVE:
case presto::NodeState::kInActive:
return protocol::NodeState::INACTIVE;
case presto::NodeState::SHUTTING_DOWN:
case presto::NodeState::kShuttingDown:
return protocol::NodeState::SHUTTING_DOWN;
}
return protocol::NodeState::ACTIVE; // For gcc build.
Expand Down Expand Up @@ -698,7 +698,7 @@ void PrestoServer::stop() {
if (!shuttingDown_.exchange(true)) {
PRESTO_SHUTDOWN_LOG(INFO) << "Shutdown has been requested. "
"Setting node state to 'shutting down'.";
setNodeState(NodeState::SHUTTING_DOWN);
setNodeState(NodeState::kShuttingDown);
PRESTO_SHUTDOWN_LOG(INFO)
<< "Waiting for " << shutdownOnsetSec
<< " second(s) before proceeding with the shutdown...";
Expand Down
4 changes: 2 additions & 2 deletions presto-native-execution/presto_cpp/main/PrestoServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct MemoryInfo;
namespace facebook::presto {

/// Three states server can be in.
enum class NodeState { ACTIVE, INACTIVE, SHUTTING_DOWN };
enum class NodeState : int8_t { kActive, kInActive, kShuttingDown };

class Announcer;
class SignalHandler;
Expand Down Expand Up @@ -204,7 +204,7 @@ class PrestoServer {
std::shared_ptr<velox::memory::MemoryPool> pool_;
std::unique_ptr<TaskManager> taskManager_;
std::unique_ptr<TaskResource> taskResource_;
std::atomic<NodeState> nodeState_{NodeState::ACTIVE};
std::atomic<NodeState> nodeState_{NodeState::kActive};
std::atomic_bool shuttingDown_{false};
std::chrono::steady_clock::time_point start_;
std::unique_ptr<PeriodicTaskManager> periodicTaskManager_;
Expand Down