GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
admin_rebalance.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __ADMIN_REBALANCE_H__
7 #define __ADMIN_REBALANCE_H__
8 
13 namespace gpudb
14 {
15 
22  struct AdminRebalanceRequest
23  {
24 
30  AdminRebalanceRequest() :
31  tableNames(std::vector<std::string>()),
32  options(std::map<std::string, std::string>())
33  {
34  }
35 
45  AdminRebalanceRequest(const std::vector<std::string>& tableNames_, const std::map<std::string, std::string>& options_):
46  tableNames( tableNames_ ),
47  options( options_ )
48  {
49  }
50 
55  std::vector<std::string> tableNames;
56  std::map<std::string, std::string> options;
57  };
58 }
59 
64 namespace avro
65 {
66  template<> struct codec_traits<gpudb::AdminRebalanceRequest>
67  {
68  static void encode(Encoder& e, const gpudb::AdminRebalanceRequest& v)
69  {
70  ::avro::encode(e, v.tableNames);
71  ::avro::encode(e, v.options);
72  }
73 
74  static void decode(Decoder& d, gpudb::AdminRebalanceRequest& v)
75  {
76  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
77  {
78  const std::vector<size_t> fo = rd->fieldOrder();
79 
80  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
81  {
82  switch (*it)
83  {
84  case 0:
85  ::avro::decode(d, v.tableNames);
86  break;
87 
88  case 1:
89  ::avro::decode(d, v.options);
90  break;
91 
92  default:
93  break;
94  }
95  }
96  }
97  else
98  {
99  ::avro::decode(d, v.tableNames);
100  ::avro::decode(d, v.options);
101  }
102  }
103  };
104 }
105 
110 namespace gpudb
111 {
112 
119  struct AdminRebalanceResponse
120  {
121 
127  AdminRebalanceResponse() :
128  tableNames(std::vector<std::string>()),
129  message(std::vector<std::string>())
130  {
131  }
132 
137  std::vector<std::string> tableNames;
138  std::vector<std::string> message;
139  };
140 }
141 
146 namespace avro
147 {
148  template<> struct codec_traits<gpudb::AdminRebalanceResponse>
149  {
150  static void encode(Encoder& e, const gpudb::AdminRebalanceResponse& v)
151  {
152  ::avro::encode(e, v.tableNames);
153  ::avro::encode(e, v.message);
154  }
155 
156  static void decode(Decoder& d, gpudb::AdminRebalanceResponse& v)
157  {
158  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
159  {
160  const std::vector<size_t> fo = rd->fieldOrder();
161 
162  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
163  {
164  switch (*it)
165  {
166  case 0:
167  ::avro::decode(d, v.tableNames);
168  break;
169 
170  case 1:
171  ::avro::decode(d, v.message);
172  break;
173 
174  default:
175  break;
176  }
177  }
178  }
179  else
180  {
181  ::avro::decode(d, v.tableNames);
182  ::avro::decode(d, v.message);
183  }
184  }
185  };
186 }
187 
188 #endif