0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationWaitForServers.cc
Go to the documentation of this file.
1 /* -*- c++ -*-
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 
22 #include "Common/Compat.h"
23 #include "Common/Error.h"
24 
26 
27 using namespace Hypertable;
28 
30  : OperationEphemeral(context, MetaLog::EntityType::OPERATION_WAIT_FOR_SERVERS) {
32 }
33 
35 
36  HT_INFOF("Entering WaitForServers-%lld (state=%s)",
38 
39  if (m_context->rsc_manager->connection_count() == 0) {
40  block();
41  return;
42  }
43 
44  complete_ok();
45 
46  HT_INFOF("Leaving WaitForServers-%lld (state=%s)",
48 }
49 
51  return "OperationWaitForServers";
52 }
53 
55  return String("WaitForServers");
56 }
57 
ContextPtr m_context
Pointer to Master context.
Definition: Operation.h:553
virtual const String name()
Name of operation used for exclusivity.
Abstract base class for ephemeral operations.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
const char * SERVERS
Definition: Operation.cc:46
int64_t id
Unique ID of entity.
EntityHeader header
Entity header
virtual const String label()
Human readable label for operation.
const char * get_text(int32_t state)
Definition: Operation.cc:609
virtual void execute()
Executes (carries out) the operation.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Compatibility Macros for C/C++.
Hypertable definitions
long long int Lld
Shortcut for printf formats.
Definition: String.h:53
DependencySet m_obstructions
Set of obstructions.
Definition: Operation.h:598
#define HT_INFOF(msg,...)
Definition: Logger.h:272
void complete_ok(std::vector< MetaLog::EntityPtr > &additional)
Definition: Operation.cc:436
Error codes, Exception handling, error logging.