Skip to content

Commit 2eded86

Browse files
committed
refact: add nebula thrift modules
1 parent a18eb25 commit 2eded86

File tree

313 files changed

+106516
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+106516
-0
lines changed

lib/gen/nebula/nebula.dart

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Autogenerated by Thrift Compiler (0.18.1)
3+
*
4+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5+
* @generated
6+
*/
7+
8+
library nebula;
9+
10+
export 'src/null_type.dart' show NullType;
11+
export 'src/property_type.dart' show PropertyType;
12+
export 'src/error_code.dart' show ErrorCode;
13+
export 'src/schema_id.dart' show SchemaID;
14+
export 'src/date.dart' show Date;
15+
export 'src/time.dart' show Time;
16+
export 'src/date_time.dart' show DateTime;
17+
export 'src/value.dart' show Value;
18+
export 'src/n_list.dart' show NList;
19+
export 'src/n_map.dart' show NMap;
20+
export 'src/n_set.dart' show NSet;
21+
export 'src/row.dart' show Row;
22+
export 'src/data_set.dart' show DataSet;
23+
export 'src/coordinate.dart' show Coordinate;
24+
export 'src/point.dart' show Point;
25+
export 'src/line_string.dart' show LineString;
26+
export 'src/polygon.dart' show Polygon;
27+
export 'src/geography.dart' show Geography;
28+
export 'src/tag.dart' show Tag;
29+
export 'src/vertex.dart' show Vertex;
30+
export 'src/edge.dart' show Edge;
31+
export 'src/step.dart' show Step;
32+
export 'src/path.dart' show Path;
33+
export 'src/host_addr.dart' show HostAddr;
34+
export 'src/key_value.dart' show KeyValue;
35+
// export 'src/duration.dart' show Duration;
36+
export 'src/log_info.dart' show LogInfo;
37+
export 'src/dir_info.dart' show DirInfo;
38+
export 'src/checkpoint_info.dart' show CheckpointInfo;
39+
export 'src/log_entry.dart' show LogEntry;
40+
export 'src/common_constants.dart' show CommonConstants;
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
/**
2+
* Autogenerated by Thrift Compiler (0.18.1)
3+
*
4+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5+
* @generated
6+
*/
7+
library nebula.src.checkpoint_info;
8+
9+
import 'dart:typed_data' show Int8List;
10+
import 'package:fbthrift/fbthrift.dart';
11+
import '../nebula.dart';
12+
13+
class CheckpointInfo implements TBase {
14+
static final TStruct _STRUCT_DESC = new TStruct("CheckpointInfo");
15+
static final TField _SPACE_ID_FIELD_DESC =
16+
new TField("space_id", TType.I32, 1);
17+
static final TField _PARTS_FIELD_DESC = new TField("parts", TType.MAP, 2);
18+
static final TField _DATA_PATH_FIELD_DESC =
19+
new TField("data_path", TType.STRING, 3);
20+
21+
int _space_id = 0;
22+
static const int SPACE_ID = 1;
23+
Map<int, LogInfo>? _parts;
24+
static const int PARTS = 2;
25+
Int8List? _data_path;
26+
static const int DATA_PATH = 3;
27+
28+
bool __isset_space_id = false;
29+
30+
CheckpointInfo() {}
31+
32+
// space_id
33+
int get space_id => this._space_id;
34+
35+
set space_id(int space_id) {
36+
this._space_id = space_id;
37+
this.__isset_space_id = true;
38+
}
39+
40+
bool isSetSpace_id() => this.__isset_space_id;
41+
42+
unsetSpace_id() {
43+
this.__isset_space_id = false;
44+
}
45+
46+
// parts
47+
Map<int, LogInfo>? get parts => this._parts;
48+
49+
set parts(Map<int, LogInfo>? parts) {
50+
this._parts = parts;
51+
}
52+
53+
bool isSetParts() => this.parts != null;
54+
55+
unsetParts() {
56+
this.parts = null;
57+
}
58+
59+
// data_path
60+
Int8List? get data_path => this._data_path;
61+
62+
set data_path(Int8List? data_path) {
63+
this._data_path = data_path;
64+
}
65+
66+
bool isSetData_path() => this.data_path != null;
67+
68+
unsetData_path() {
69+
this.data_path = null;
70+
}
71+
72+
getFieldValue(int fieldID) {
73+
switch (fieldID) {
74+
case SPACE_ID:
75+
return this.space_id;
76+
case PARTS:
77+
return this.parts;
78+
case DATA_PATH:
79+
return this.data_path;
80+
default:
81+
throw new ArgumentError("Field $fieldID doesn't exist!");
82+
}
83+
}
84+
85+
setFieldValue(int fieldID, Object value) {
86+
switch (fieldID) {
87+
case SPACE_ID:
88+
if (value == null) {
89+
unsetSpace_id();
90+
} else {
91+
this.space_id = value as int;
92+
}
93+
break;
94+
95+
case PARTS:
96+
if (value == null) {
97+
unsetParts();
98+
} else {
99+
this.parts = value as Map<int, LogInfo>;
100+
}
101+
break;
102+
103+
case DATA_PATH:
104+
if (value == null) {
105+
unsetData_path();
106+
} else {
107+
this.data_path = value as Int8List;
108+
}
109+
break;
110+
111+
default:
112+
throw new ArgumentError("Field $fieldID doesn't exist!");
113+
}
114+
}
115+
116+
// Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
117+
bool isSet(int fieldID) {
118+
switch (fieldID) {
119+
case SPACE_ID:
120+
return isSetSpace_id();
121+
case PARTS:
122+
return isSetParts();
123+
case DATA_PATH:
124+
return isSetData_path();
125+
default:
126+
throw new ArgumentError("Field $fieldID doesn't exist!");
127+
}
128+
}
129+
130+
read(TProtocol iprot) {
131+
TField field;
132+
iprot.readStructBegin();
133+
while (true) {
134+
field = iprot.readFieldBegin();
135+
if (field.type == TType.STOP) {
136+
break;
137+
}
138+
switch (field.id) {
139+
case SPACE_ID:
140+
if (field.type == TType.I32) {
141+
this.space_id = iprot.readI32();
142+
this.__isset_space_id = true;
143+
} else {
144+
TProtocolUtil.skip(iprot, field.type);
145+
}
146+
break;
147+
case PARTS:
148+
if (field.type == TType.MAP) {
149+
{
150+
TMap _map68 = iprot.readMapBegin();
151+
this.parts = new Map<int, LogInfo>();
152+
for (int _i69 = 0; _i69 < _map68.length; ++_i69) {
153+
int _key70;
154+
LogInfo _val71;
155+
_key70 = iprot.readI32();
156+
_val71 = new LogInfo();
157+
_val71.read(iprot);
158+
this.parts?[_key70] = _val71;
159+
}
160+
iprot.readMapEnd();
161+
}
162+
} else {
163+
TProtocolUtil.skip(iprot, field.type);
164+
}
165+
break;
166+
case DATA_PATH:
167+
if (field.type == TType.STRING) {
168+
this.data_path = iprot.readBinary();
169+
} else {
170+
TProtocolUtil.skip(iprot, field.type);
171+
}
172+
break;
173+
default:
174+
TProtocolUtil.skip(iprot, field.type);
175+
break;
176+
}
177+
iprot.readFieldEnd();
178+
}
179+
iprot.readStructEnd();
180+
181+
// check for required fields of primitive type, which can't be checked in the validate method
182+
validate();
183+
}
184+
185+
write(TProtocol oprot) {
186+
validate();
187+
188+
oprot.writeStructBegin(_STRUCT_DESC);
189+
oprot.writeFieldBegin(_SPACE_ID_FIELD_DESC);
190+
oprot.writeI32(this.space_id);
191+
oprot.writeFieldEnd();
192+
if (this.parts != null) {
193+
oprot.writeFieldBegin(_PARTS_FIELD_DESC);
194+
{
195+
oprot.writeMapBegin(
196+
new TMap(TType.I32, TType.STRUCT, this.parts?.length));
197+
for (var elem73 in this.parts?.keys ?? <int>[]) {
198+
oprot.writeI32(elem73);
199+
this.parts?[elem73]?.write(oprot);
200+
}
201+
oprot.writeMapEnd();
202+
}
203+
oprot.writeFieldEnd();
204+
}
205+
if (this.data_path != null) {
206+
oprot.writeFieldBegin(_DATA_PATH_FIELD_DESC);
207+
oprot.writeBinary(this.data_path);
208+
oprot.writeFieldEnd();
209+
}
210+
oprot.writeFieldStop();
211+
oprot.writeStructEnd();
212+
}
213+
214+
String toString() {
215+
StringBuffer ret = new StringBuffer("CheckpointInfo(");
216+
217+
ret.write("space_id:");
218+
ret.write(this.space_id);
219+
220+
ret.write(", ");
221+
ret.write("parts:");
222+
if (this.parts == null) {
223+
ret.write("null");
224+
} else {
225+
ret.write(this.parts);
226+
}
227+
228+
ret.write(", ");
229+
ret.write("data_path:");
230+
if (this.data_path == null) {
231+
ret.write("null");
232+
} else {
233+
ret.write("BINARY");
234+
}
235+
236+
ret.write(")");
237+
238+
return ret.toString();
239+
}
240+
241+
validate() {
242+
// check for required fields
243+
// check that fields of type enum have valid values
244+
}
245+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Autogenerated by Thrift Compiler (0.18.1)
3+
*
4+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5+
* @generated
6+
*/
7+
library nebula.src.common_constants;
8+
9+
import 'dart:convert';
10+
import 'dart:typed_data' show Uint8List;
11+
import 'package:fbthrift/fbthrift.dart';
12+
import '../nebula.dart';
13+
14+
class CommonConstants {
15+
static final Uint8List version = Uint8List.fromList(utf8.encode('3.0.0'));
16+
}

0 commit comments

Comments
 (0)