This repository has been archived by the owner on May 25, 2021. It is now read-only.
/
KsDef.cs
309 lines (293 loc) · 7.67 KB
/
KsDef.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using FluentCassandra.Thrift;
using FluentCassandra.Thrift.Collections;
using System.Runtime.Serialization;
using FluentCassandra.Thrift.Protocol;
using FluentCassandra.Thrift.Transport;
namespace FluentCassandra.Apache.Cassandra
{
#if !SILVERLIGHT
[Serializable]
#endif
public partial class KsDef : TBase
{
private string _name;
private string _strategy_class;
private Dictionary<string, string> _strategy_options;
private int _replication_factor;
private List<CfDef> _cf_defs;
private bool _durable_writes;
public string Name
{
get
{
return _name;
}
set
{
__isset.name = true;
this._name = value;
}
}
public string Strategy_class
{
get
{
return _strategy_class;
}
set
{
__isset.strategy_class = true;
this._strategy_class = value;
}
}
public Dictionary<string, string> Strategy_options
{
get
{
return _strategy_options;
}
set
{
__isset.strategy_options = true;
this._strategy_options = value;
}
}
/// <summary>
/// @deprecated, ignored
/// </summary>
public int Replication_factor
{
get
{
return _replication_factor;
}
set
{
__isset.replication_factor = true;
this._replication_factor = value;
}
}
public List<CfDef> Cf_defs
{
get
{
return _cf_defs;
}
set
{
__isset.cf_defs = true;
this._cf_defs = value;
}
}
public bool Durable_writes
{
get
{
return _durable_writes;
}
set
{
__isset.durable_writes = true;
this._durable_writes = value;
}
}
public Isset __isset;
#if !SILVERLIGHT
[Serializable]
#endif
public struct Isset {
public bool name;
public bool strategy_class;
public bool strategy_options;
public bool replication_factor;
public bool cf_defs;
public bool durable_writes;
}
public KsDef() {
this._durable_writes = true;
}
public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Name = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
Strategy_class = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.Map) {
{
Strategy_options = new Dictionary<string, string>();
TMap _map60 = iprot.ReadMapBegin();
for( int _i61 = 0; _i61 < _map60.Count; ++_i61)
{
string _key62;
string _val63;
_key62 = iprot.ReadString();
_val63 = iprot.ReadString();
Strategy_options[_key62] = _val63;
}
iprot.ReadMapEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 4:
if (field.Type == TType.I32) {
Replication_factor = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 5:
if (field.Type == TType.List) {
{
Cf_defs = new List<CfDef>();
TList _list64 = iprot.ReadListBegin();
for( int _i65 = 0; _i65 < _list64.Count; ++_i65)
{
CfDef _elem66 = new CfDef();
_elem66 = new CfDef();
_elem66.Read(iprot);
Cf_defs.Add(_elem66);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 6:
if (field.Type == TType.Bool) {
Durable_writes = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
public void Write(TProtocol oprot) {
TStruct struc = new TStruct("KsDef");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Name != null && __isset.name) {
field.Name = "name";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Name);
oprot.WriteFieldEnd();
}
if (Strategy_class != null && __isset.strategy_class) {
field.Name = "strategy_class";
field.Type = TType.String;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteString(Strategy_class);
oprot.WriteFieldEnd();
}
if (Strategy_options != null && __isset.strategy_options) {
field.Name = "strategy_options";
field.Type = TType.Map;
field.ID = 3;
oprot.WriteFieldBegin(field);
{
oprot.WriteMapBegin(new TMap(TType.String, TType.String, Strategy_options.Count));
foreach (string _iter67 in Strategy_options.Keys)
{
oprot.WriteString(_iter67);
oprot.WriteString(Strategy_options[_iter67]);
}
oprot.WriteMapEnd();
}
oprot.WriteFieldEnd();
}
if (__isset.replication_factor) {
field.Name = "replication_factor";
field.Type = TType.I32;
field.ID = 4;
oprot.WriteFieldBegin(field);
oprot.WriteI32(Replication_factor);
oprot.WriteFieldEnd();
}
if (Cf_defs != null && __isset.cf_defs) {
field.Name = "cf_defs";
field.Type = TType.List;
field.ID = 5;
oprot.WriteFieldBegin(field);
{
oprot.WriteListBegin(new TList(TType.Struct, Cf_defs.Count));
foreach (CfDef _iter68 in Cf_defs)
{
_iter68.Write(oprot);
}
oprot.WriteListEnd();
}
oprot.WriteFieldEnd();
}
if (__isset.durable_writes) {
field.Name = "durable_writes";
field.Type = TType.Bool;
field.ID = 6;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Durable_writes);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
public override string ToString() {
StringBuilder sb = new StringBuilder("KsDef(");
sb.Append("Name: ");
sb.Append(Name);
sb.Append(",Strategy_class: ");
sb.Append(Strategy_class);
sb.Append(",Strategy_options: ");
sb.Append(Strategy_options);
sb.Append(",Replication_factor: ");
sb.Append(Replication_factor);
sb.Append(",Cf_defs: ");
sb.Append(Cf_defs);
sb.Append(",Durable_writes: ");
sb.Append(Durable_writes);
sb.Append(")");
return sb.ToString();
}
}
}