apache-iotdb 2.0.4.dev0__py3-none-any.whl → 2.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,916 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.14.1)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+ # options string: py
7
+ #
8
+
9
+ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
10
+ from thrift.protocol.TProtocol import TProtocolException
11
+ from thrift.TRecursive import fix_spec
12
+
13
+ import sys
14
+ import iotdb.thrift.common.ttypes
15
+
16
+ from thrift.transport import TTransport
17
+ all_structs = []
18
+
19
+
20
+ class TDeleteModelReq(object):
21
+ """
22
+ Attributes:
23
+ - modelId
24
+
25
+ """
26
+
27
+
28
+ def __init__(self, modelId=None,):
29
+ self.modelId = modelId
30
+
31
+ def read(self, iprot):
32
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
33
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
34
+ return
35
+ iprot.readStructBegin()
36
+ while True:
37
+ (fname, ftype, fid) = iprot.readFieldBegin()
38
+ if ftype == TType.STOP:
39
+ break
40
+ if fid == 1:
41
+ if ftype == TType.STRING:
42
+ self.modelId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
43
+ else:
44
+ iprot.skip(ftype)
45
+ else:
46
+ iprot.skip(ftype)
47
+ iprot.readFieldEnd()
48
+ iprot.readStructEnd()
49
+
50
+ def write(self, oprot):
51
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
52
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
53
+ return
54
+ oprot.writeStructBegin('TDeleteModelReq')
55
+ if self.modelId is not None:
56
+ oprot.writeFieldBegin('modelId', TType.STRING, 1)
57
+ oprot.writeString(self.modelId.encode('utf-8') if sys.version_info[0] == 2 else self.modelId)
58
+ oprot.writeFieldEnd()
59
+ oprot.writeFieldStop()
60
+ oprot.writeStructEnd()
61
+
62
+ def validate(self):
63
+ if self.modelId is None:
64
+ raise TProtocolException(message='Required field modelId is unset!')
65
+ return
66
+
67
+ def __repr__(self):
68
+ L = ['%s=%r' % (key, value)
69
+ for key, value in self.__dict__.items()]
70
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
71
+
72
+ def __eq__(self, other):
73
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
74
+
75
+ def __ne__(self, other):
76
+ return not (self == other)
77
+
78
+
79
+ class TAIHeartbeatReq(object):
80
+ """
81
+ Attributes:
82
+ - heartbeatTimestamp
83
+ - needSamplingLoad
84
+
85
+ """
86
+
87
+
88
+ def __init__(self, heartbeatTimestamp=None, needSamplingLoad=None,):
89
+ self.heartbeatTimestamp = heartbeatTimestamp
90
+ self.needSamplingLoad = needSamplingLoad
91
+
92
+ def read(self, iprot):
93
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
94
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
95
+ return
96
+ iprot.readStructBegin()
97
+ while True:
98
+ (fname, ftype, fid) = iprot.readFieldBegin()
99
+ if ftype == TType.STOP:
100
+ break
101
+ if fid == 1:
102
+ if ftype == TType.I64:
103
+ self.heartbeatTimestamp = iprot.readI64()
104
+ else:
105
+ iprot.skip(ftype)
106
+ elif fid == 2:
107
+ if ftype == TType.BOOL:
108
+ self.needSamplingLoad = iprot.readBool()
109
+ else:
110
+ iprot.skip(ftype)
111
+ else:
112
+ iprot.skip(ftype)
113
+ iprot.readFieldEnd()
114
+ iprot.readStructEnd()
115
+
116
+ def write(self, oprot):
117
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
118
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
119
+ return
120
+ oprot.writeStructBegin('TAIHeartbeatReq')
121
+ if self.heartbeatTimestamp is not None:
122
+ oprot.writeFieldBegin('heartbeatTimestamp', TType.I64, 1)
123
+ oprot.writeI64(self.heartbeatTimestamp)
124
+ oprot.writeFieldEnd()
125
+ if self.needSamplingLoad is not None:
126
+ oprot.writeFieldBegin('needSamplingLoad', TType.BOOL, 2)
127
+ oprot.writeBool(self.needSamplingLoad)
128
+ oprot.writeFieldEnd()
129
+ oprot.writeFieldStop()
130
+ oprot.writeStructEnd()
131
+
132
+ def validate(self):
133
+ if self.heartbeatTimestamp is None:
134
+ raise TProtocolException(message='Required field heartbeatTimestamp is unset!')
135
+ if self.needSamplingLoad is None:
136
+ raise TProtocolException(message='Required field needSamplingLoad is unset!')
137
+ return
138
+
139
+ def __repr__(self):
140
+ L = ['%s=%r' % (key, value)
141
+ for key, value in self.__dict__.items()]
142
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
143
+
144
+ def __eq__(self, other):
145
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
146
+
147
+ def __ne__(self, other):
148
+ return not (self == other)
149
+
150
+
151
+ class TAIHeartbeatResp(object):
152
+ """
153
+ Attributes:
154
+ - heartbeatTimestamp
155
+ - status
156
+ - statusReason
157
+ - loadSample
158
+
159
+ """
160
+
161
+
162
+ def __init__(self, heartbeatTimestamp=None, status=None, statusReason=None, loadSample=None,):
163
+ self.heartbeatTimestamp = heartbeatTimestamp
164
+ self.status = status
165
+ self.statusReason = statusReason
166
+ self.loadSample = loadSample
167
+
168
+ def read(self, iprot):
169
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
170
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
171
+ return
172
+ iprot.readStructBegin()
173
+ while True:
174
+ (fname, ftype, fid) = iprot.readFieldBegin()
175
+ if ftype == TType.STOP:
176
+ break
177
+ if fid == 1:
178
+ if ftype == TType.I64:
179
+ self.heartbeatTimestamp = iprot.readI64()
180
+ else:
181
+ iprot.skip(ftype)
182
+ elif fid == 2:
183
+ if ftype == TType.STRING:
184
+ self.status = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
185
+ else:
186
+ iprot.skip(ftype)
187
+ elif fid == 3:
188
+ if ftype == TType.STRING:
189
+ self.statusReason = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
190
+ else:
191
+ iprot.skip(ftype)
192
+ elif fid == 4:
193
+ if ftype == TType.STRUCT:
194
+ self.loadSample = iotdb.thrift.common.ttypes.TLoadSample()
195
+ self.loadSample.read(iprot)
196
+ else:
197
+ iprot.skip(ftype)
198
+ else:
199
+ iprot.skip(ftype)
200
+ iprot.readFieldEnd()
201
+ iprot.readStructEnd()
202
+
203
+ def write(self, oprot):
204
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
205
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
206
+ return
207
+ oprot.writeStructBegin('TAIHeartbeatResp')
208
+ if self.heartbeatTimestamp is not None:
209
+ oprot.writeFieldBegin('heartbeatTimestamp', TType.I64, 1)
210
+ oprot.writeI64(self.heartbeatTimestamp)
211
+ oprot.writeFieldEnd()
212
+ if self.status is not None:
213
+ oprot.writeFieldBegin('status', TType.STRING, 2)
214
+ oprot.writeString(self.status.encode('utf-8') if sys.version_info[0] == 2 else self.status)
215
+ oprot.writeFieldEnd()
216
+ if self.statusReason is not None:
217
+ oprot.writeFieldBegin('statusReason', TType.STRING, 3)
218
+ oprot.writeString(self.statusReason.encode('utf-8') if sys.version_info[0] == 2 else self.statusReason)
219
+ oprot.writeFieldEnd()
220
+ if self.loadSample is not None:
221
+ oprot.writeFieldBegin('loadSample', TType.STRUCT, 4)
222
+ self.loadSample.write(oprot)
223
+ oprot.writeFieldEnd()
224
+ oprot.writeFieldStop()
225
+ oprot.writeStructEnd()
226
+
227
+ def validate(self):
228
+ if self.heartbeatTimestamp is None:
229
+ raise TProtocolException(message='Required field heartbeatTimestamp is unset!')
230
+ if self.status is None:
231
+ raise TProtocolException(message='Required field status is unset!')
232
+ return
233
+
234
+ def __repr__(self):
235
+ L = ['%s=%r' % (key, value)
236
+ for key, value in self.__dict__.items()]
237
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
238
+
239
+ def __eq__(self, other):
240
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
241
+
242
+ def __ne__(self, other):
243
+ return not (self == other)
244
+
245
+
246
+ class TRegisterModelReq(object):
247
+ """
248
+ Attributes:
249
+ - uri
250
+ - modelId
251
+
252
+ """
253
+
254
+
255
+ def __init__(self, uri=None, modelId=None,):
256
+ self.uri = uri
257
+ self.modelId = modelId
258
+
259
+ def read(self, iprot):
260
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
261
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
262
+ return
263
+ iprot.readStructBegin()
264
+ while True:
265
+ (fname, ftype, fid) = iprot.readFieldBegin()
266
+ if ftype == TType.STOP:
267
+ break
268
+ if fid == 1:
269
+ if ftype == TType.STRING:
270
+ self.uri = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
271
+ else:
272
+ iprot.skip(ftype)
273
+ elif fid == 2:
274
+ if ftype == TType.STRING:
275
+ self.modelId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
276
+ else:
277
+ iprot.skip(ftype)
278
+ else:
279
+ iprot.skip(ftype)
280
+ iprot.readFieldEnd()
281
+ iprot.readStructEnd()
282
+
283
+ def write(self, oprot):
284
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
285
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
286
+ return
287
+ oprot.writeStructBegin('TRegisterModelReq')
288
+ if self.uri is not None:
289
+ oprot.writeFieldBegin('uri', TType.STRING, 1)
290
+ oprot.writeString(self.uri.encode('utf-8') if sys.version_info[0] == 2 else self.uri)
291
+ oprot.writeFieldEnd()
292
+ if self.modelId is not None:
293
+ oprot.writeFieldBegin('modelId', TType.STRING, 2)
294
+ oprot.writeString(self.modelId.encode('utf-8') if sys.version_info[0] == 2 else self.modelId)
295
+ oprot.writeFieldEnd()
296
+ oprot.writeFieldStop()
297
+ oprot.writeStructEnd()
298
+
299
+ def validate(self):
300
+ if self.uri is None:
301
+ raise TProtocolException(message='Required field uri is unset!')
302
+ if self.modelId is None:
303
+ raise TProtocolException(message='Required field modelId is unset!')
304
+ return
305
+
306
+ def __repr__(self):
307
+ L = ['%s=%r' % (key, value)
308
+ for key, value in self.__dict__.items()]
309
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
310
+
311
+ def __eq__(self, other):
312
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
313
+
314
+ def __ne__(self, other):
315
+ return not (self == other)
316
+
317
+
318
+ class TConfigs(object):
319
+ """
320
+ Attributes:
321
+ - input_shape
322
+ - output_shape
323
+ - input_type
324
+ - output_type
325
+
326
+ """
327
+
328
+
329
+ def __init__(self, input_shape=None, output_shape=None, input_type=None, output_type=None,):
330
+ self.input_shape = input_shape
331
+ self.output_shape = output_shape
332
+ self.input_type = input_type
333
+ self.output_type = output_type
334
+
335
+ def read(self, iprot):
336
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
337
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
338
+ return
339
+ iprot.readStructBegin()
340
+ while True:
341
+ (fname, ftype, fid) = iprot.readFieldBegin()
342
+ if ftype == TType.STOP:
343
+ break
344
+ if fid == 1:
345
+ if ftype == TType.LIST:
346
+ self.input_shape = []
347
+ (_etype3, _size0) = iprot.readListBegin()
348
+ for _i4 in range(_size0):
349
+ _elem5 = iprot.readI32()
350
+ self.input_shape.append(_elem5)
351
+ iprot.readListEnd()
352
+ else:
353
+ iprot.skip(ftype)
354
+ elif fid == 2:
355
+ if ftype == TType.LIST:
356
+ self.output_shape = []
357
+ (_etype9, _size6) = iprot.readListBegin()
358
+ for _i10 in range(_size6):
359
+ _elem11 = iprot.readI32()
360
+ self.output_shape.append(_elem11)
361
+ iprot.readListEnd()
362
+ else:
363
+ iprot.skip(ftype)
364
+ elif fid == 3:
365
+ if ftype == TType.LIST:
366
+ self.input_type = []
367
+ (_etype15, _size12) = iprot.readListBegin()
368
+ for _i16 in range(_size12):
369
+ _elem17 = iprot.readByte()
370
+ self.input_type.append(_elem17)
371
+ iprot.readListEnd()
372
+ else:
373
+ iprot.skip(ftype)
374
+ elif fid == 4:
375
+ if ftype == TType.LIST:
376
+ self.output_type = []
377
+ (_etype21, _size18) = iprot.readListBegin()
378
+ for _i22 in range(_size18):
379
+ _elem23 = iprot.readByte()
380
+ self.output_type.append(_elem23)
381
+ iprot.readListEnd()
382
+ else:
383
+ iprot.skip(ftype)
384
+ else:
385
+ iprot.skip(ftype)
386
+ iprot.readFieldEnd()
387
+ iprot.readStructEnd()
388
+
389
+ def write(self, oprot):
390
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
391
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
392
+ return
393
+ oprot.writeStructBegin('TConfigs')
394
+ if self.input_shape is not None:
395
+ oprot.writeFieldBegin('input_shape', TType.LIST, 1)
396
+ oprot.writeListBegin(TType.I32, len(self.input_shape))
397
+ for iter24 in self.input_shape:
398
+ oprot.writeI32(iter24)
399
+ oprot.writeListEnd()
400
+ oprot.writeFieldEnd()
401
+ if self.output_shape is not None:
402
+ oprot.writeFieldBegin('output_shape', TType.LIST, 2)
403
+ oprot.writeListBegin(TType.I32, len(self.output_shape))
404
+ for iter25 in self.output_shape:
405
+ oprot.writeI32(iter25)
406
+ oprot.writeListEnd()
407
+ oprot.writeFieldEnd()
408
+ if self.input_type is not None:
409
+ oprot.writeFieldBegin('input_type', TType.LIST, 3)
410
+ oprot.writeListBegin(TType.BYTE, len(self.input_type))
411
+ for iter26 in self.input_type:
412
+ oprot.writeByte(iter26)
413
+ oprot.writeListEnd()
414
+ oprot.writeFieldEnd()
415
+ if self.output_type is not None:
416
+ oprot.writeFieldBegin('output_type', TType.LIST, 4)
417
+ oprot.writeListBegin(TType.BYTE, len(self.output_type))
418
+ for iter27 in self.output_type:
419
+ oprot.writeByte(iter27)
420
+ oprot.writeListEnd()
421
+ oprot.writeFieldEnd()
422
+ oprot.writeFieldStop()
423
+ oprot.writeStructEnd()
424
+
425
+ def validate(self):
426
+ if self.input_shape is None:
427
+ raise TProtocolException(message='Required field input_shape is unset!')
428
+ if self.output_shape is None:
429
+ raise TProtocolException(message='Required field output_shape is unset!')
430
+ if self.input_type is None:
431
+ raise TProtocolException(message='Required field input_type is unset!')
432
+ if self.output_type is None:
433
+ raise TProtocolException(message='Required field output_type is unset!')
434
+ return
435
+
436
+ def __repr__(self):
437
+ L = ['%s=%r' % (key, value)
438
+ for key, value in self.__dict__.items()]
439
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
440
+
441
+ def __eq__(self, other):
442
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
443
+
444
+ def __ne__(self, other):
445
+ return not (self == other)
446
+
447
+
448
+ class TRegisterModelResp(object):
449
+ """
450
+ Attributes:
451
+ - status
452
+ - configs
453
+ - attributes
454
+
455
+ """
456
+
457
+
458
+ def __init__(self, status=None, configs=None, attributes=None,):
459
+ self.status = status
460
+ self.configs = configs
461
+ self.attributes = attributes
462
+
463
+ def read(self, iprot):
464
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
465
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
466
+ return
467
+ iprot.readStructBegin()
468
+ while True:
469
+ (fname, ftype, fid) = iprot.readFieldBegin()
470
+ if ftype == TType.STOP:
471
+ break
472
+ if fid == 1:
473
+ if ftype == TType.STRUCT:
474
+ self.status = iotdb.thrift.common.ttypes.TSStatus()
475
+ self.status.read(iprot)
476
+ else:
477
+ iprot.skip(ftype)
478
+ elif fid == 2:
479
+ if ftype == TType.STRUCT:
480
+ self.configs = TConfigs()
481
+ self.configs.read(iprot)
482
+ else:
483
+ iprot.skip(ftype)
484
+ elif fid == 3:
485
+ if ftype == TType.STRING:
486
+ self.attributes = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
487
+ else:
488
+ iprot.skip(ftype)
489
+ else:
490
+ iprot.skip(ftype)
491
+ iprot.readFieldEnd()
492
+ iprot.readStructEnd()
493
+
494
+ def write(self, oprot):
495
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
496
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
497
+ return
498
+ oprot.writeStructBegin('TRegisterModelResp')
499
+ if self.status is not None:
500
+ oprot.writeFieldBegin('status', TType.STRUCT, 1)
501
+ self.status.write(oprot)
502
+ oprot.writeFieldEnd()
503
+ if self.configs is not None:
504
+ oprot.writeFieldBegin('configs', TType.STRUCT, 2)
505
+ self.configs.write(oprot)
506
+ oprot.writeFieldEnd()
507
+ if self.attributes is not None:
508
+ oprot.writeFieldBegin('attributes', TType.STRING, 3)
509
+ oprot.writeString(self.attributes.encode('utf-8') if sys.version_info[0] == 2 else self.attributes)
510
+ oprot.writeFieldEnd()
511
+ oprot.writeFieldStop()
512
+ oprot.writeStructEnd()
513
+
514
+ def validate(self):
515
+ if self.status is None:
516
+ raise TProtocolException(message='Required field status is unset!')
517
+ return
518
+
519
+ def __repr__(self):
520
+ L = ['%s=%r' % (key, value)
521
+ for key, value in self.__dict__.items()]
522
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
523
+
524
+ def __eq__(self, other):
525
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
526
+
527
+ def __ne__(self, other):
528
+ return not (self == other)
529
+
530
+
531
+ class TInferenceReq(object):
532
+ """
533
+ Attributes:
534
+ - modelId
535
+ - dataset
536
+ - typeList
537
+ - columnNameList
538
+ - columnNameIndexMap
539
+ - windowParams
540
+ - inferenceAttributes
541
+
542
+ """
543
+
544
+
545
+ def __init__(self, modelId=None, dataset=None, typeList=None, columnNameList=None, columnNameIndexMap=None, windowParams=None, inferenceAttributes=None,):
546
+ self.modelId = modelId
547
+ self.dataset = dataset
548
+ self.typeList = typeList
549
+ self.columnNameList = columnNameList
550
+ self.columnNameIndexMap = columnNameIndexMap
551
+ self.windowParams = windowParams
552
+ self.inferenceAttributes = inferenceAttributes
553
+
554
+ def read(self, iprot):
555
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
556
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
557
+ return
558
+ iprot.readStructBegin()
559
+ while True:
560
+ (fname, ftype, fid) = iprot.readFieldBegin()
561
+ if ftype == TType.STOP:
562
+ break
563
+ if fid == 1:
564
+ if ftype == TType.STRING:
565
+ self.modelId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
566
+ else:
567
+ iprot.skip(ftype)
568
+ elif fid == 2:
569
+ if ftype == TType.STRING:
570
+ self.dataset = iprot.readBinary()
571
+ else:
572
+ iprot.skip(ftype)
573
+ elif fid == 3:
574
+ if ftype == TType.LIST:
575
+ self.typeList = []
576
+ (_etype31, _size28) = iprot.readListBegin()
577
+ for _i32 in range(_size28):
578
+ _elem33 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
579
+ self.typeList.append(_elem33)
580
+ iprot.readListEnd()
581
+ else:
582
+ iprot.skip(ftype)
583
+ elif fid == 4:
584
+ if ftype == TType.LIST:
585
+ self.columnNameList = []
586
+ (_etype37, _size34) = iprot.readListBegin()
587
+ for _i38 in range(_size34):
588
+ _elem39 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
589
+ self.columnNameList.append(_elem39)
590
+ iprot.readListEnd()
591
+ else:
592
+ iprot.skip(ftype)
593
+ elif fid == 5:
594
+ if ftype == TType.MAP:
595
+ self.columnNameIndexMap = {}
596
+ (_ktype41, _vtype42, _size40) = iprot.readMapBegin()
597
+ for _i44 in range(_size40):
598
+ _key45 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
599
+ _val46 = iprot.readI32()
600
+ self.columnNameIndexMap[_key45] = _val46
601
+ iprot.readMapEnd()
602
+ else:
603
+ iprot.skip(ftype)
604
+ elif fid == 6:
605
+ if ftype == TType.STRUCT:
606
+ self.windowParams = TWindowParams()
607
+ self.windowParams.read(iprot)
608
+ else:
609
+ iprot.skip(ftype)
610
+ elif fid == 7:
611
+ if ftype == TType.MAP:
612
+ self.inferenceAttributes = {}
613
+ (_ktype48, _vtype49, _size47) = iprot.readMapBegin()
614
+ for _i51 in range(_size47):
615
+ _key52 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
616
+ _val53 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
617
+ self.inferenceAttributes[_key52] = _val53
618
+ iprot.readMapEnd()
619
+ else:
620
+ iprot.skip(ftype)
621
+ else:
622
+ iprot.skip(ftype)
623
+ iprot.readFieldEnd()
624
+ iprot.readStructEnd()
625
+
626
+ def write(self, oprot):
627
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
628
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
629
+ return
630
+ oprot.writeStructBegin('TInferenceReq')
631
+ if self.modelId is not None:
632
+ oprot.writeFieldBegin('modelId', TType.STRING, 1)
633
+ oprot.writeString(self.modelId.encode('utf-8') if sys.version_info[0] == 2 else self.modelId)
634
+ oprot.writeFieldEnd()
635
+ if self.dataset is not None:
636
+ oprot.writeFieldBegin('dataset', TType.STRING, 2)
637
+ oprot.writeBinary(self.dataset)
638
+ oprot.writeFieldEnd()
639
+ if self.typeList is not None:
640
+ oprot.writeFieldBegin('typeList', TType.LIST, 3)
641
+ oprot.writeListBegin(TType.STRING, len(self.typeList))
642
+ for iter54 in self.typeList:
643
+ oprot.writeString(iter54.encode('utf-8') if sys.version_info[0] == 2 else iter54)
644
+ oprot.writeListEnd()
645
+ oprot.writeFieldEnd()
646
+ if self.columnNameList is not None:
647
+ oprot.writeFieldBegin('columnNameList', TType.LIST, 4)
648
+ oprot.writeListBegin(TType.STRING, len(self.columnNameList))
649
+ for iter55 in self.columnNameList:
650
+ oprot.writeString(iter55.encode('utf-8') if sys.version_info[0] == 2 else iter55)
651
+ oprot.writeListEnd()
652
+ oprot.writeFieldEnd()
653
+ if self.columnNameIndexMap is not None:
654
+ oprot.writeFieldBegin('columnNameIndexMap', TType.MAP, 5)
655
+ oprot.writeMapBegin(TType.STRING, TType.I32, len(self.columnNameIndexMap))
656
+ for kiter56, viter57 in self.columnNameIndexMap.items():
657
+ oprot.writeString(kiter56.encode('utf-8') if sys.version_info[0] == 2 else kiter56)
658
+ oprot.writeI32(viter57)
659
+ oprot.writeMapEnd()
660
+ oprot.writeFieldEnd()
661
+ if self.windowParams is not None:
662
+ oprot.writeFieldBegin('windowParams', TType.STRUCT, 6)
663
+ self.windowParams.write(oprot)
664
+ oprot.writeFieldEnd()
665
+ if self.inferenceAttributes is not None:
666
+ oprot.writeFieldBegin('inferenceAttributes', TType.MAP, 7)
667
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.inferenceAttributes))
668
+ for kiter58, viter59 in self.inferenceAttributes.items():
669
+ oprot.writeString(kiter58.encode('utf-8') if sys.version_info[0] == 2 else kiter58)
670
+ oprot.writeString(viter59.encode('utf-8') if sys.version_info[0] == 2 else viter59)
671
+ oprot.writeMapEnd()
672
+ oprot.writeFieldEnd()
673
+ oprot.writeFieldStop()
674
+ oprot.writeStructEnd()
675
+
676
+ def validate(self):
677
+ if self.modelId is None:
678
+ raise TProtocolException(message='Required field modelId is unset!')
679
+ if self.dataset is None:
680
+ raise TProtocolException(message='Required field dataset is unset!')
681
+ if self.typeList is None:
682
+ raise TProtocolException(message='Required field typeList is unset!')
683
+ if self.columnNameList is None:
684
+ raise TProtocolException(message='Required field columnNameList is unset!')
685
+ if self.columnNameIndexMap is None:
686
+ raise TProtocolException(message='Required field columnNameIndexMap is unset!')
687
+ return
688
+
689
+ def __repr__(self):
690
+ L = ['%s=%r' % (key, value)
691
+ for key, value in self.__dict__.items()]
692
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
693
+
694
+ def __eq__(self, other):
695
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
696
+
697
+ def __ne__(self, other):
698
+ return not (self == other)
699
+
700
+
701
+ class TWindowParams(object):
702
+ """
703
+ Attributes:
704
+ - windowInterval
705
+ - windowStep
706
+
707
+ """
708
+
709
+
710
+ def __init__(self, windowInterval=None, windowStep=None,):
711
+ self.windowInterval = windowInterval
712
+ self.windowStep = windowStep
713
+
714
+ def read(self, iprot):
715
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
716
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
717
+ return
718
+ iprot.readStructBegin()
719
+ while True:
720
+ (fname, ftype, fid) = iprot.readFieldBegin()
721
+ if ftype == TType.STOP:
722
+ break
723
+ if fid == 1:
724
+ if ftype == TType.I32:
725
+ self.windowInterval = iprot.readI32()
726
+ else:
727
+ iprot.skip(ftype)
728
+ elif fid == 2:
729
+ if ftype == TType.I32:
730
+ self.windowStep = iprot.readI32()
731
+ else:
732
+ iprot.skip(ftype)
733
+ else:
734
+ iprot.skip(ftype)
735
+ iprot.readFieldEnd()
736
+ iprot.readStructEnd()
737
+
738
+ def write(self, oprot):
739
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
740
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
741
+ return
742
+ oprot.writeStructBegin('TWindowParams')
743
+ if self.windowInterval is not None:
744
+ oprot.writeFieldBegin('windowInterval', TType.I32, 1)
745
+ oprot.writeI32(self.windowInterval)
746
+ oprot.writeFieldEnd()
747
+ if self.windowStep is not None:
748
+ oprot.writeFieldBegin('windowStep', TType.I32, 2)
749
+ oprot.writeI32(self.windowStep)
750
+ oprot.writeFieldEnd()
751
+ oprot.writeFieldStop()
752
+ oprot.writeStructEnd()
753
+
754
+ def validate(self):
755
+ if self.windowInterval is None:
756
+ raise TProtocolException(message='Required field windowInterval is unset!')
757
+ if self.windowStep is None:
758
+ raise TProtocolException(message='Required field windowStep is unset!')
759
+ return
760
+
761
+ def __repr__(self):
762
+ L = ['%s=%r' % (key, value)
763
+ for key, value in self.__dict__.items()]
764
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
765
+
766
+ def __eq__(self, other):
767
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
768
+
769
+ def __ne__(self, other):
770
+ return not (self == other)
771
+
772
+
773
+ class TInferenceResp(object):
774
+ """
775
+ Attributes:
776
+ - status
777
+ - inferenceResult
778
+
779
+ """
780
+
781
+
782
+ def __init__(self, status=None, inferenceResult=None,):
783
+ self.status = status
784
+ self.inferenceResult = inferenceResult
785
+
786
+ def read(self, iprot):
787
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
788
+ iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
789
+ return
790
+ iprot.readStructBegin()
791
+ while True:
792
+ (fname, ftype, fid) = iprot.readFieldBegin()
793
+ if ftype == TType.STOP:
794
+ break
795
+ if fid == 1:
796
+ if ftype == TType.STRUCT:
797
+ self.status = iotdb.thrift.common.ttypes.TSStatus()
798
+ self.status.read(iprot)
799
+ else:
800
+ iprot.skip(ftype)
801
+ elif fid == 2:
802
+ if ftype == TType.LIST:
803
+ self.inferenceResult = []
804
+ (_etype63, _size60) = iprot.readListBegin()
805
+ for _i64 in range(_size60):
806
+ _elem65 = iprot.readBinary()
807
+ self.inferenceResult.append(_elem65)
808
+ iprot.readListEnd()
809
+ else:
810
+ iprot.skip(ftype)
811
+ else:
812
+ iprot.skip(ftype)
813
+ iprot.readFieldEnd()
814
+ iprot.readStructEnd()
815
+
816
+ def write(self, oprot):
817
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
818
+ oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
819
+ return
820
+ oprot.writeStructBegin('TInferenceResp')
821
+ if self.status is not None:
822
+ oprot.writeFieldBegin('status', TType.STRUCT, 1)
823
+ self.status.write(oprot)
824
+ oprot.writeFieldEnd()
825
+ if self.inferenceResult is not None:
826
+ oprot.writeFieldBegin('inferenceResult', TType.LIST, 2)
827
+ oprot.writeListBegin(TType.STRING, len(self.inferenceResult))
828
+ for iter66 in self.inferenceResult:
829
+ oprot.writeBinary(iter66)
830
+ oprot.writeListEnd()
831
+ oprot.writeFieldEnd()
832
+ oprot.writeFieldStop()
833
+ oprot.writeStructEnd()
834
+
835
+ def validate(self):
836
+ if self.status is None:
837
+ raise TProtocolException(message='Required field status is unset!')
838
+ if self.inferenceResult is None:
839
+ raise TProtocolException(message='Required field inferenceResult is unset!')
840
+ return
841
+
842
+ def __repr__(self):
843
+ L = ['%s=%r' % (key, value)
844
+ for key, value in self.__dict__.items()]
845
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
846
+
847
+ def __eq__(self, other):
848
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
849
+
850
+ def __ne__(self, other):
851
+ return not (self == other)
852
+ all_structs.append(TDeleteModelReq)
853
+ TDeleteModelReq.thrift_spec = (
854
+ None, # 0
855
+ (1, TType.STRING, 'modelId', 'UTF8', None, ), # 1
856
+ )
857
+ all_structs.append(TAIHeartbeatReq)
858
+ TAIHeartbeatReq.thrift_spec = (
859
+ None, # 0
860
+ (1, TType.I64, 'heartbeatTimestamp', None, None, ), # 1
861
+ (2, TType.BOOL, 'needSamplingLoad', None, None, ), # 2
862
+ )
863
+ all_structs.append(TAIHeartbeatResp)
864
+ TAIHeartbeatResp.thrift_spec = (
865
+ None, # 0
866
+ (1, TType.I64, 'heartbeatTimestamp', None, None, ), # 1
867
+ (2, TType.STRING, 'status', 'UTF8', None, ), # 2
868
+ (3, TType.STRING, 'statusReason', 'UTF8', None, ), # 3
869
+ (4, TType.STRUCT, 'loadSample', [iotdb.thrift.common.ttypes.TLoadSample, None], None, ), # 4
870
+ )
871
+ all_structs.append(TRegisterModelReq)
872
+ TRegisterModelReq.thrift_spec = (
873
+ None, # 0
874
+ (1, TType.STRING, 'uri', 'UTF8', None, ), # 1
875
+ (2, TType.STRING, 'modelId', 'UTF8', None, ), # 2
876
+ )
877
+ all_structs.append(TConfigs)
878
+ TConfigs.thrift_spec = (
879
+ None, # 0
880
+ (1, TType.LIST, 'input_shape', (TType.I32, None, False), None, ), # 1
881
+ (2, TType.LIST, 'output_shape', (TType.I32, None, False), None, ), # 2
882
+ (3, TType.LIST, 'input_type', (TType.BYTE, None, False), None, ), # 3
883
+ (4, TType.LIST, 'output_type', (TType.BYTE, None, False), None, ), # 4
884
+ )
885
+ all_structs.append(TRegisterModelResp)
886
+ TRegisterModelResp.thrift_spec = (
887
+ None, # 0
888
+ (1, TType.STRUCT, 'status', [iotdb.thrift.common.ttypes.TSStatus, None], None, ), # 1
889
+ (2, TType.STRUCT, 'configs', [TConfigs, None], None, ), # 2
890
+ (3, TType.STRING, 'attributes', 'UTF8', None, ), # 3
891
+ )
892
+ all_structs.append(TInferenceReq)
893
+ TInferenceReq.thrift_spec = (
894
+ None, # 0
895
+ (1, TType.STRING, 'modelId', 'UTF8', None, ), # 1
896
+ (2, TType.STRING, 'dataset', 'BINARY', None, ), # 2
897
+ (3, TType.LIST, 'typeList', (TType.STRING, 'UTF8', False), None, ), # 3
898
+ (4, TType.LIST, 'columnNameList', (TType.STRING, 'UTF8', False), None, ), # 4
899
+ (5, TType.MAP, 'columnNameIndexMap', (TType.STRING, 'UTF8', TType.I32, None, False), None, ), # 5
900
+ (6, TType.STRUCT, 'windowParams', [TWindowParams, None], None, ), # 6
901
+ (7, TType.MAP, 'inferenceAttributes', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 7
902
+ )
903
+ all_structs.append(TWindowParams)
904
+ TWindowParams.thrift_spec = (
905
+ None, # 0
906
+ (1, TType.I32, 'windowInterval', None, None, ), # 1
907
+ (2, TType.I32, 'windowStep', None, None, ), # 2
908
+ )
909
+ all_structs.append(TInferenceResp)
910
+ TInferenceResp.thrift_spec = (
911
+ None, # 0
912
+ (1, TType.STRUCT, 'status', [iotdb.thrift.common.ttypes.TSStatus, None], None, ), # 1
913
+ (2, TType.LIST, 'inferenceResult', (TType.STRING, 'BINARY', False), None, ), # 2
914
+ )
915
+ fix_spec(all_structs)
916
+ del all_structs