GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
admin_set_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_SET_SHARD_ASSIGNMENTS_H__
7 #define __ADMIN_SET_SHARD_ASSIGNMENTS_H__
8 
13 namespace gpudb
14 {
15 
22  struct AdminSetShardAssignmentsRequest
23  {
24 
30  AdminSetShardAssignmentsRequest() :
31  version(int64_t()),
32  partialReassignment(bool()),
33  shardAssignmentsRank(std::vector<int32_t>()),
34  shardAssignmentsTom(std::vector<int32_t>()),
35  assignmentIndex(std::vector<int32_t>()),
36  options(std::map<std::string, std::string>())
37  {
38  }
39 
53  AdminSetShardAssignmentsRequest(const int64_t version_, const bool partialReassignment_, const std::vector<int32_t>& shardAssignmentsRank_, const std::vector<int32_t>& shardAssignmentsTom_, const std::vector<int32_t>& assignmentIndex_, const std::map<std::string, std::string>& options_):
54  version( version_ ),
55  partialReassignment( partialReassignment_ ),
56  shardAssignmentsRank( shardAssignmentsRank_ ),
57  shardAssignmentsTom( shardAssignmentsTom_ ),
58  assignmentIndex( assignmentIndex_ ),
59  options( options_ )
60  {
61  }
62 
67  int64_t version;
68  bool partialReassignment;
69  std::vector<int32_t> shardAssignmentsRank;
70  std::vector<int32_t> shardAssignmentsTom;
71  std::vector<int32_t> assignmentIndex;
72  std::map<std::string, std::string> options;
73  };
74 }
75 
80 namespace avro
81 {
82  template<> struct codec_traits<gpudb::AdminSetShardAssignmentsRequest>
83  {
84  static void encode(Encoder& e, const gpudb::AdminSetShardAssignmentsRequest& v)
85  {
86  ::avro::encode(e, v.version);
87  ::avro::encode(e, v.partialReassignment);
88  ::avro::encode(e, v.shardAssignmentsRank);
89  ::avro::encode(e, v.shardAssignmentsTom);
90  ::avro::encode(e, v.assignmentIndex);
91  ::avro::encode(e, v.options);
92  }
93 
94  static void decode(Decoder& d, gpudb::AdminSetShardAssignmentsRequest& v)
95  {
96  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
97  {
98  const std::vector<size_t> fo = rd->fieldOrder();
99 
100  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
101  {
102  switch (*it)
103  {
104  case 0:
105  ::avro::decode(d, v.version);
106  break;
107 
108  case 1:
109  ::avro::decode(d, v.partialReassignment);
110  break;
111 
112  case 2:
113  ::avro::decode(d, v.shardAssignmentsRank);
114  break;
115 
116  case 3:
117  ::avro::decode(d, v.shardAssignmentsTom);
118  break;
119 
120  case 4:
121  ::avro::decode(d, v.assignmentIndex);
122  break;
123 
124  case 5:
125  ::avro::decode(d, v.options);
126  break;
127 
128  default:
129  break;
130  }
131  }
132  }
133  else
134  {
135  ::avro::decode(d, v.version);
136  ::avro::decode(d, v.partialReassignment);
137  ::avro::decode(d, v.shardAssignmentsRank);
138  ::avro::decode(d, v.shardAssignmentsTom);
139  ::avro::decode(d, v.assignmentIndex);
140  ::avro::decode(d, v.options);
141  }
142  }
143  };
144 }
145 
150 namespace gpudb
151 {
152 
159  struct AdminSetShardAssignmentsResponse
160  {
161 
167  AdminSetShardAssignmentsResponse() :
168  version(int64_t())
169  {
170  }
171 
176  int64_t version;
177  };
178 }
179 
184 namespace avro
185 {
186  template<> struct codec_traits<gpudb::AdminSetShardAssignmentsResponse>
187  {
188  static void encode(Encoder& e, const gpudb::AdminSetShardAssignmentsResponse& v)
189  {
190  ::avro::encode(e, v.version);
191  }
192 
193  static void decode(Decoder& d, gpudb::AdminSetShardAssignmentsResponse& v)
194  {
195  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
196  {
197  const std::vector<size_t> fo = rd->fieldOrder();
198 
199  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
200  {
201  switch (*it)
202  {
203  case 0:
204  ::avro::decode(d, v.version);
205  break;
206 
207  default:
208  break;
209  }
210  }
211  }
212  else
213  {
214  ::avro::decode(d, v.version);
215  }
216  }
217  };
218 }
219 
220 #endif