GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
admin_get_shard_assignments.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_GET_SHARD_ASSIGNMENTS_H__
7 #define __ADMIN_GET_SHARD_ASSIGNMENTS_H__
8 
13 namespace gpudb
14 {
15 
22  struct AdminGetShardAssignmentsRequest
23  {
24 
30  AdminGetShardAssignmentsRequest() :
31  options(std::map<std::string, std::string>())
32  {
33  }
34 
43  AdminGetShardAssignmentsRequest(const std::map<std::string, std::string>& options_):
44  options( options_ )
45  {
46  }
47 
52  std::map<std::string, std::string> options;
53  };
54 }
55 
60 namespace avro
61 {
62  template<> struct codec_traits<gpudb::AdminGetShardAssignmentsRequest>
63  {
64  static void encode(Encoder& e, const gpudb::AdminGetShardAssignmentsRequest& v)
65  {
66  ::avro::encode(e, v.options);
67  }
68 
69  static void decode(Decoder& d, gpudb::AdminGetShardAssignmentsRequest& v)
70  {
71  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
72  {
73  const std::vector<size_t> fo = rd->fieldOrder();
74 
75  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
76  {
77  switch (*it)
78  {
79  case 0:
80  ::avro::decode(d, v.options);
81  break;
82 
83  default:
84  break;
85  }
86  }
87  }
88  else
89  {
90  ::avro::decode(d, v.options);
91  }
92  }
93  };
94 }
95 
100 namespace gpudb
101 {
102 
109  struct AdminGetShardAssignmentsResponse
110  {
111 
117  AdminGetShardAssignmentsResponse() :
118  version(int64_t()),
119  shardAssignmentsRank(std::vector<int32_t>()),
120  shardAssignmentsTom(std::vector<int32_t>())
121  {
122  }
123 
128  int64_t version;
129  std::vector<int32_t> shardAssignmentsRank;
130  std::vector<int32_t> shardAssignmentsTom;
131  };
132 }
133 
138 namespace avro
139 {
140  template<> struct codec_traits<gpudb::AdminGetShardAssignmentsResponse>
141  {
142  static void encode(Encoder& e, const gpudb::AdminGetShardAssignmentsResponse& v)
143  {
144  ::avro::encode(e, v.version);
145  ::avro::encode(e, v.shardAssignmentsRank);
146  ::avro::encode(e, v.shardAssignmentsTom);
147  }
148 
149  static void decode(Decoder& d, gpudb::AdminGetShardAssignmentsResponse& v)
150  {
151  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
152  {
153  const std::vector<size_t> fo = rd->fieldOrder();
154 
155  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
156  {
157  switch (*it)
158  {
159  case 0:
160  ::avro::decode(d, v.version);
161  break;
162 
163  case 1:
164  ::avro::decode(d, v.shardAssignmentsRank);
165  break;
166 
167  case 2:
168  ::avro::decode(d, v.shardAssignmentsTom);
169  break;
170 
171  default:
172  break;
173  }
174  }
175  }
176  else
177  {
178  ::avro::decode(d, v.version);
179  ::avro::decode(d, v.shardAssignmentsRank);
180  ::avro::decode(d, v.shardAssignmentsTom);
181  }
182  }
183  };
184 }
185 
186 #endif