0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Protocol.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 
28 #include <Common/Compat.h>
29 
30 #include "Protocol.h"
31 
33 
34 #include <AsyncComm/CommBuf.h>
35 #include <AsyncComm/CommHeader.h>
36 
37 using namespace Hypertable::Lib::RangeServer;
38 using namespace std;
39 
40 string Protocol::compact_flags_to_string(uint32_t flags) {
41  string str;
42  bool first=true;
43  if ((flags & COMPACT_FLAG_ALL) == COMPACT_FLAG_ALL) {
44  str += "ALL";
45  first=false;
46  }
47  else {
48  if ((flags & COMPACT_FLAG_ROOT) == COMPACT_FLAG_ROOT) {
49  str += "ROOT";
50  first=false;
51  }
52  if ((flags & COMPACT_FLAG_METADATA) == COMPACT_FLAG_METADATA) {
53  if (!first)
54  str += "|";
55  str += "METADATA";
56  first=false;
57  }
58  if ((flags & COMPACT_FLAG_SYSTEM) == COMPACT_FLAG_SYSTEM) {
59  if (!first)
60  str += "|";
61  str += "SYSTEM";
62  first=false;
63  }
64  if ((flags & COMPACT_FLAG_USER) == COMPACT_FLAG_USER) {
65  if (!first)
66  str += "|";
67  str += "USER";
68  first=false;
69  }
70  }
71  if ((flags & COMPACT_FLAG_MINOR) == COMPACT_FLAG_MINOR) {
72  if (!first)
73  str += "|";
74  str += "MINOR";
75  first=false;
76  }
77  if ((flags & COMPACT_FLAG_MAJOR) == COMPACT_FLAG_MAJOR) {
78  if (!first)
79  str += "|";
80  str += "MAJOR";
81  first=false;
82  }
83  if ((flags & COMPACT_FLAG_MERGING) == COMPACT_FLAG_MERGING) {
84  if (!first)
85  str += "|";
86  str += "MERGING";
87  first=false;
88  }
89  if ((flags & COMPACT_FLAG_GC) == COMPACT_FLAG_GC) {
90  if (!first)
91  str += "|";
92  str += "GC";
93  first=false;
94  }
95  return str;
96 }
static string compact_flags_to_string(uint32_t flags)
Definition: Protocol.cc:40
Po::typed_value< String > * str(String *v=0)
Definition: Properties.h:166
STL namespace.
Declarations for RangeServerProtocol.
Compatibility Macros for C/C++.
Declarations for CommBuf.
Declarations for CommHeader.