node-storm
Version:
Node.js multilang protocol implementation for Storm
1,897 lines (1,858 loc) • 96.7 kB
JavaScript
//
// Autogenerated by Thrift Compiler (0.9.1)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('thrift').Thrift;
var ttypes = module.exports = {};
ttypes.TopologyInitialStatus = {
'ACTIVE' : 1,
'INACTIVE' : 2
};
JavaObjectArg = module.exports.JavaObjectArg = function(args) {
this.int_arg = null;
this.long_arg = null;
this.string_arg = null;
this.bool_arg = null;
this.binary_arg = null;
this.double_arg = null;
if (args) {
if (args.int_arg !== undefined) {
this.int_arg = args.int_arg;
}
if (args.long_arg !== undefined) {
this.long_arg = args.long_arg;
}
if (args.string_arg !== undefined) {
this.string_arg = args.string_arg;
}
if (args.bool_arg !== undefined) {
this.bool_arg = args.bool_arg;
}
if (args.binary_arg !== undefined) {
this.binary_arg = args.binary_arg;
}
if (args.double_arg !== undefined) {
this.double_arg = args.double_arg;
}
}
};
JavaObjectArg.prototype = {};
JavaObjectArg.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.int_arg = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I64) {
this.long_arg = input.readI64();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.string_arg = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.BOOL) {
this.bool_arg = input.readBool();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.binary_arg = input.readString();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.DOUBLE) {
this.double_arg = input.readDouble();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
JavaObjectArg.prototype.write = function(output) {
output.writeStructBegin('JavaObjectArg');
if (this.int_arg !== null && this.int_arg !== undefined) {
output.writeFieldBegin('int_arg', Thrift.Type.I32, 1);
output.writeI32(this.int_arg);
output.writeFieldEnd();
}
if (this.long_arg !== null && this.long_arg !== undefined) {
output.writeFieldBegin('long_arg', Thrift.Type.I64, 2);
output.writeI64(this.long_arg);
output.writeFieldEnd();
}
if (this.string_arg !== null && this.string_arg !== undefined) {
output.writeFieldBegin('string_arg', Thrift.Type.STRING, 3);
output.writeString(this.string_arg);
output.writeFieldEnd();
}
if (this.bool_arg !== null && this.bool_arg !== undefined) {
output.writeFieldBegin('bool_arg', Thrift.Type.BOOL, 4);
output.writeBool(this.bool_arg);
output.writeFieldEnd();
}
if (this.binary_arg !== null && this.binary_arg !== undefined) {
output.writeFieldBegin('binary_arg', Thrift.Type.STRING, 5);
output.writeString(this.binary_arg);
output.writeFieldEnd();
}
if (this.double_arg !== null && this.double_arg !== undefined) {
output.writeFieldBegin('double_arg', Thrift.Type.DOUBLE, 6);
output.writeDouble(this.double_arg);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
JavaObject = module.exports.JavaObject = function(args) {
this.full_class_name = null;
this.args_list = null;
if (args) {
if (args.full_class_name !== undefined) {
this.full_class_name = args.full_class_name;
}
if (args.args_list !== undefined) {
this.args_list = args.args_list;
}
}
};
JavaObject.prototype = {};
JavaObject.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.full_class_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size0 = 0;
var _rtmp34;
this.args_list = [];
var _etype3 = 0;
_rtmp34 = input.readListBegin();
_etype3 = _rtmp34.etype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var elem6 = null;
elem6 = new ttypes.JavaObjectArg();
elem6.read(input);
this.args_list.push(elem6);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
JavaObject.prototype.write = function(output) {
output.writeStructBegin('JavaObject');
if (this.full_class_name !== null && this.full_class_name !== undefined) {
output.writeFieldBegin('full_class_name', Thrift.Type.STRING, 1);
output.writeString(this.full_class_name);
output.writeFieldEnd();
}
if (this.args_list !== null && this.args_list !== undefined) {
output.writeFieldBegin('args_list', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRUCT, this.args_list.length);
for (var iter7 in this.args_list)
{
if (this.args_list.hasOwnProperty(iter7))
{
iter7 = this.args_list[iter7];
iter7.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
NullStruct = module.exports.NullStruct = function(args) {
};
NullStruct.prototype = {};
NullStruct.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
NullStruct.prototype.write = function(output) {
output.writeStructBegin('NullStruct');
output.writeFieldStop();
output.writeStructEnd();
return;
};
GlobalStreamId = module.exports.GlobalStreamId = function(args) {
this.componentId = null;
this.streamId = null;
if (args) {
if (args.componentId !== undefined) {
this.componentId = args.componentId;
}
if (args.streamId !== undefined) {
this.streamId = args.streamId;
}
}
};
GlobalStreamId.prototype = {};
GlobalStreamId.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.componentId = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.streamId = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
GlobalStreamId.prototype.write = function(output) {
output.writeStructBegin('GlobalStreamId');
if (this.componentId !== null && this.componentId !== undefined) {
output.writeFieldBegin('componentId', Thrift.Type.STRING, 1);
output.writeString(this.componentId);
output.writeFieldEnd();
}
if (this.streamId !== null && this.streamId !== undefined) {
output.writeFieldBegin('streamId', Thrift.Type.STRING, 2);
output.writeString(this.streamId);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
Grouping = module.exports.Grouping = function(args) {
this.fields = null;
this.shuffle = null;
this.all = null;
this.none = null;
this.direct = null;
this.custom_object = null;
this.custom_serialized = null;
this.local_or_shuffle = null;
if (args) {
if (args.fields !== undefined) {
this.fields = args.fields;
}
if (args.shuffle !== undefined) {
this.shuffle = args.shuffle;
}
if (args.all !== undefined) {
this.all = args.all;
}
if (args.none !== undefined) {
this.none = args.none;
}
if (args.direct !== undefined) {
this.direct = args.direct;
}
if (args.custom_object !== undefined) {
this.custom_object = args.custom_object;
}
if (args.custom_serialized !== undefined) {
this.custom_serialized = args.custom_serialized;
}
if (args.local_or_shuffle !== undefined) {
this.local_or_shuffle = args.local_or_shuffle;
}
}
};
Grouping.prototype = {};
Grouping.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size8 = 0;
var _rtmp312;
this.fields = [];
var _etype11 = 0;
_rtmp312 = input.readListBegin();
_etype11 = _rtmp312.etype;
_size8 = _rtmp312.size;
for (var _i13 = 0; _i13 < _size8; ++_i13)
{
var elem14 = null;
elem14 = input.readString();
this.fields.push(elem14);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.shuffle = new ttypes.NullStruct();
this.shuffle.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.all = new ttypes.NullStruct();
this.all.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.none = new ttypes.NullStruct();
this.none.read(input);
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.direct = new ttypes.NullStruct();
this.direct.read(input);
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.STRUCT) {
this.custom_object = new ttypes.JavaObject();
this.custom_object.read(input);
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRING) {
this.custom_serialized = input.readString();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.STRUCT) {
this.local_or_shuffle = new ttypes.NullStruct();
this.local_or_shuffle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Grouping.prototype.write = function(output) {
output.writeStructBegin('Grouping');
if (this.fields !== null && this.fields !== undefined) {
output.writeFieldBegin('fields', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRING, this.fields.length);
for (var iter15 in this.fields)
{
if (this.fields.hasOwnProperty(iter15))
{
iter15 = this.fields[iter15];
output.writeString(iter15);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.shuffle !== null && this.shuffle !== undefined) {
output.writeFieldBegin('shuffle', Thrift.Type.STRUCT, 2);
this.shuffle.write(output);
output.writeFieldEnd();
}
if (this.all !== null && this.all !== undefined) {
output.writeFieldBegin('all', Thrift.Type.STRUCT, 3);
this.all.write(output);
output.writeFieldEnd();
}
if (this.none !== null && this.none !== undefined) {
output.writeFieldBegin('none', Thrift.Type.STRUCT, 4);
this.none.write(output);
output.writeFieldEnd();
}
if (this.direct !== null && this.direct !== undefined) {
output.writeFieldBegin('direct', Thrift.Type.STRUCT, 5);
this.direct.write(output);
output.writeFieldEnd();
}
if (this.custom_object !== null && this.custom_object !== undefined) {
output.writeFieldBegin('custom_object', Thrift.Type.STRUCT, 6);
this.custom_object.write(output);
output.writeFieldEnd();
}
if (this.custom_serialized !== null && this.custom_serialized !== undefined) {
output.writeFieldBegin('custom_serialized', Thrift.Type.STRING, 7);
output.writeString(this.custom_serialized);
output.writeFieldEnd();
}
if (this.local_or_shuffle !== null && this.local_or_shuffle !== undefined) {
output.writeFieldBegin('local_or_shuffle', Thrift.Type.STRUCT, 8);
this.local_or_shuffle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
StreamInfo = module.exports.StreamInfo = function(args) {
this.output_fields = null;
this.direct = null;
if (args) {
if (args.output_fields !== undefined) {
this.output_fields = args.output_fields;
}
if (args.direct !== undefined) {
this.direct = args.direct;
}
}
};
StreamInfo.prototype = {};
StreamInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size16 = 0;
var _rtmp320;
this.output_fields = [];
var _etype19 = 0;
_rtmp320 = input.readListBegin();
_etype19 = _rtmp320.etype;
_size16 = _rtmp320.size;
for (var _i21 = 0; _i21 < _size16; ++_i21)
{
var elem22 = null;
elem22 = input.readString();
this.output_fields.push(elem22);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.direct = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
StreamInfo.prototype.write = function(output) {
output.writeStructBegin('StreamInfo');
if (this.output_fields !== null && this.output_fields !== undefined) {
output.writeFieldBegin('output_fields', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRING, this.output_fields.length);
for (var iter23 in this.output_fields)
{
if (this.output_fields.hasOwnProperty(iter23))
{
iter23 = this.output_fields[iter23];
output.writeString(iter23);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.direct !== null && this.direct !== undefined) {
output.writeFieldBegin('direct', Thrift.Type.BOOL, 2);
output.writeBool(this.direct);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ShellComponent = module.exports.ShellComponent = function(args) {
this.execution_command = null;
this.script = null;
if (args) {
if (args.execution_command !== undefined) {
this.execution_command = args.execution_command;
}
if (args.script !== undefined) {
this.script = args.script;
}
}
};
ShellComponent.prototype = {};
ShellComponent.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.execution_command = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.script = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ShellComponent.prototype.write = function(output) {
output.writeStructBegin('ShellComponent');
if (this.execution_command !== null && this.execution_command !== undefined) {
output.writeFieldBegin('execution_command', Thrift.Type.STRING, 1);
output.writeString(this.execution_command);
output.writeFieldEnd();
}
if (this.script !== null && this.script !== undefined) {
output.writeFieldBegin('script', Thrift.Type.STRING, 2);
output.writeString(this.script);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ComponentObject = module.exports.ComponentObject = function(args) {
this.serialized_java = null;
this.shell = null;
this.java_object = null;
if (args) {
if (args.serialized_java !== undefined) {
this.serialized_java = args.serialized_java;
}
if (args.shell !== undefined) {
this.shell = args.shell;
}
if (args.java_object !== undefined) {
this.java_object = args.java_object;
}
}
};
ComponentObject.prototype = {};
ComponentObject.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.serialized_java = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.shell = new ttypes.ShellComponent();
this.shell.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.java_object = new ttypes.JavaObject();
this.java_object.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ComponentObject.prototype.write = function(output) {
output.writeStructBegin('ComponentObject');
if (this.serialized_java !== null && this.serialized_java !== undefined) {
output.writeFieldBegin('serialized_java', Thrift.Type.STRING, 1);
output.writeString(this.serialized_java);
output.writeFieldEnd();
}
if (this.shell !== null && this.shell !== undefined) {
output.writeFieldBegin('shell', Thrift.Type.STRUCT, 2);
this.shell.write(output);
output.writeFieldEnd();
}
if (this.java_object !== null && this.java_object !== undefined) {
output.writeFieldBegin('java_object', Thrift.Type.STRUCT, 3);
this.java_object.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ComponentCommon = module.exports.ComponentCommon = function(args) {
this.inputs = null;
this.streams = null;
this.parallelism_hint = null;
this.json_conf = null;
if (args) {
if (args.inputs !== undefined) {
this.inputs = args.inputs;
}
if (args.streams !== undefined) {
this.streams = args.streams;
}
if (args.parallelism_hint !== undefined) {
this.parallelism_hint = args.parallelism_hint;
}
if (args.json_conf !== undefined) {
this.json_conf = args.json_conf;
}
}
};
ComponentCommon.prototype = {};
ComponentCommon.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.MAP) {
var _size24 = 0;
var _rtmp328;
this.inputs = {};
var _ktype25 = 0;
var _vtype26 = 0;
_rtmp328 = input.readMapBegin();
_ktype25 = _rtmp328.ktype;
_vtype26 = _rtmp328.vtype;
_size24 = _rtmp328.size;
for (var _i29 = 0; _i29 < _size24; ++_i29)
{
var key30 = null;
var val31 = null;
key30 = new ttypes.GlobalStreamId();
key30.read(input);
val31 = new ttypes.Grouping();
val31.read(input);
this.inputs[key30] = val31;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.MAP) {
var _size32 = 0;
var _rtmp336;
this.streams = {};
var _ktype33 = 0;
var _vtype34 = 0;
_rtmp336 = input.readMapBegin();
_ktype33 = _rtmp336.ktype;
_vtype34 = _rtmp336.vtype;
_size32 = _rtmp336.size;
for (var _i37 = 0; _i37 < _size32; ++_i37)
{
var key38 = null;
var val39 = null;
key38 = input.readString();
val39 = new ttypes.StreamInfo();
val39.read(input);
this.streams[key38] = val39;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.parallelism_hint = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.json_conf = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ComponentCommon.prototype.write = function(output) {
output.writeStructBegin('ComponentCommon');
if (this.inputs !== null && this.inputs !== undefined) {
output.writeFieldBegin('inputs', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRUCT, Thrift.Type.STRUCT, Thrift.objectLength(this.inputs));
for (var kiter40 in this.inputs)
{
if (this.inputs.hasOwnProperty(kiter40))
{
//Modified to support GlobalStreamId as map key
kiter40 = (this.getGlobalStreamId ? this.getGlobalStreamId(kiter40) : kiter40)
var viter41 = this.inputs[kiter40];
kiter40.write(output);
viter41.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.streams !== null && this.streams !== undefined) {
output.writeFieldBegin('streams', Thrift.Type.MAP, 2);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.streams));
for (var kiter42 in this.streams)
{
if (this.streams.hasOwnProperty(kiter42))
{
var viter43 = this.streams[kiter42];
output.writeString(kiter42);
viter43.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.parallelism_hint !== null && this.parallelism_hint !== undefined) {
output.writeFieldBegin('parallelism_hint', Thrift.Type.I32, 3);
output.writeI32(this.parallelism_hint);
output.writeFieldEnd();
}
if (this.json_conf !== null && this.json_conf !== undefined) {
output.writeFieldBegin('json_conf', Thrift.Type.STRING, 4);
output.writeString(this.json_conf);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
SpoutSpec = module.exports.SpoutSpec = function(args) {
this.spout_object = null;
this.common = null;
if (args) {
if (args.spout_object !== undefined) {
this.spout_object = args.spout_object;
}
if (args.common !== undefined) {
this.common = args.common;
}
}
};
SpoutSpec.prototype = {};
SpoutSpec.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.spout_object = new ttypes.ComponentObject();
this.spout_object.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.common = new ttypes.ComponentCommon();
this.common.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
SpoutSpec.prototype.write = function(output) {
output.writeStructBegin('SpoutSpec');
if (this.spout_object !== null && this.spout_object !== undefined) {
output.writeFieldBegin('spout_object', Thrift.Type.STRUCT, 1);
this.spout_object.write(output);
output.writeFieldEnd();
}
if (this.common !== null && this.common !== undefined) {
output.writeFieldBegin('common', Thrift.Type.STRUCT, 2);
this.common.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
Bolt = module.exports.Bolt = function(args) {
this.bolt_object = null;
this.common = null;
if (args) {
if (args.bolt_object !== undefined) {
this.bolt_object = args.bolt_object;
}
if (args.common !== undefined) {
this.common = args.common;
}
}
};
Bolt.prototype = {};
Bolt.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.bolt_object = new ttypes.ComponentObject();
this.bolt_object.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.common = new ttypes.ComponentCommon();
this.common.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Bolt.prototype.write = function(output) {
output.writeStructBegin('Bolt');
if (this.bolt_object !== null && this.bolt_object !== undefined) {
output.writeFieldBegin('bolt_object', Thrift.Type.STRUCT, 1);
this.bolt_object.write(output);
output.writeFieldEnd();
}
if (this.common !== null && this.common !== undefined) {
output.writeFieldBegin('common', Thrift.Type.STRUCT, 2);
this.common.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
StateSpoutSpec = module.exports.StateSpoutSpec = function(args) {
this.state_spout_object = null;
this.common = null;
if (args) {
if (args.state_spout_object !== undefined) {
this.state_spout_object = args.state_spout_object;
}
if (args.common !== undefined) {
this.common = args.common;
}
}
};
StateSpoutSpec.prototype = {};
StateSpoutSpec.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.state_spout_object = new ttypes.ComponentObject();
this.state_spout_object.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.common = new ttypes.ComponentCommon();
this.common.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
StateSpoutSpec.prototype.write = function(output) {
output.writeStructBegin('StateSpoutSpec');
if (this.state_spout_object !== null && this.state_spout_object !== undefined) {
output.writeFieldBegin('state_spout_object', Thrift.Type.STRUCT, 1);
this.state_spout_object.write(output);
output.writeFieldEnd();
}
if (this.common !== null && this.common !== undefined) {
output.writeFieldBegin('common', Thrift.Type.STRUCT, 2);
this.common.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
StormTopology = module.exports.StormTopology = function(args) {
this.spouts = null;
this.bolts = null;
this.state_spouts = null;
if (args) {
if (args.spouts !== undefined) {
this.spouts = args.spouts;
}
if (args.bolts !== undefined) {
this.bolts = args.bolts;
}
if (args.state_spouts !== undefined) {
this.state_spouts = args.state_spouts;
}
}
};
StormTopology.prototype = {};
StormTopology.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.MAP) {
var _size44 = 0;
var _rtmp348;
this.spouts = {};
var _ktype45 = 0;
var _vtype46 = 0;
_rtmp348 = input.readMapBegin();
_ktype45 = _rtmp348.ktype;
_vtype46 = _rtmp348.vtype;
_size44 = _rtmp348.size;
for (var _i49 = 0; _i49 < _size44; ++_i49)
{
var key50 = null;
var val51 = null;
key50 = input.readString();
val51 = new ttypes.SpoutSpec();
val51.read(input);
this.spouts[key50] = val51;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.MAP) {
var _size52 = 0;
var _rtmp356;
this.bolts = {};
var _ktype53 = 0;
var _vtype54 = 0;
_rtmp356 = input.readMapBegin();
_ktype53 = _rtmp356.ktype;
_vtype54 = _rtmp356.vtype;
_size52 = _rtmp356.size;
for (var _i57 = 0; _i57 < _size52; ++_i57)
{
var key58 = null;
var val59 = null;
key58 = input.readString();
val59 = new ttypes.Bolt();
val59.read(input);
this.bolts[key58] = val59;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size60 = 0;
var _rtmp364;
this.state_spouts = {};
var _ktype61 = 0;
var _vtype62 = 0;
_rtmp364 = input.readMapBegin();
_ktype61 = _rtmp364.ktype;
_vtype62 = _rtmp364.vtype;
_size60 = _rtmp364.size;
for (var _i65 = 0; _i65 < _size60; ++_i65)
{
var key66 = null;
var val67 = null;
key66 = input.readString();
val67 = new ttypes.StateSpoutSpec();
val67.read(input);
this.state_spouts[key66] = val67;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
StormTopology.prototype.write = function(output) {
output.writeStructBegin('StormTopology');
if (this.spouts !== null && this.spouts !== undefined) {
output.writeFieldBegin('spouts', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.spouts));
for (var kiter68 in this.spouts)
{
if (this.spouts.hasOwnProperty(kiter68))
{
var viter69 = this.spouts[kiter68];
output.writeString(kiter68);
viter69.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.bolts !== null && this.bolts !== undefined) {
output.writeFieldBegin('bolts', Thrift.Type.MAP, 2);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.bolts));
for (var kiter70 in this.bolts)
{
if (this.bolts.hasOwnProperty(kiter70))
{
var viter71 = this.bolts[kiter70];
output.writeString(kiter70);
viter71.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.state_spouts !== null && this.state_spouts !== undefined) {
output.writeFieldBegin('state_spouts', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.state_spouts));
for (var kiter72 in this.state_spouts)
{
if (this.state_spouts.hasOwnProperty(kiter72))
{
var viter73 = this.state_spouts[kiter72];
output.writeString(kiter72);
viter73.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
AlreadyAliveException = module.exports.AlreadyAliveException = function(args) {
Thrift.TException.call(this, "AlreadyAliveException")
this.name = "AlreadyAliveException"
this.msg = null;
if (args) {
if (args.msg !== undefined) {
this.msg = args.msg;
}
}
};
Thrift.inherits(AlreadyAliveException, Thrift.TException);
AlreadyAliveException.prototype.name = 'AlreadyAliveException';
AlreadyAliveException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.msg = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AlreadyAliveException.prototype.write = function(output) {
output.writeStructBegin('AlreadyAliveException');
if (this.msg !== null && this.msg !== undefined) {
output.writeFieldBegin('msg', Thrift.Type.STRING, 1);
output.writeString(this.msg);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
NotAliveException = module.exports.NotAliveException = function(args) {
Thrift.TException.call(this, "NotAliveException")
this.name = "NotAliveException"
this.msg = null;
if (args) {
if (args.msg !== undefined) {
this.msg = args.msg;
}
}
};
Thrift.inherits(NotAliveException, Thrift.TException);
NotAliveException.prototype.name = 'NotAliveException';
NotAliveException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.msg = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
NotAliveException.prototype.write = function(output) {
output.writeStructBegin('NotAliveException');
if (this.msg !== null && this.msg !== undefined) {
output.writeFieldBegin('msg', Thrift.Type.STRING, 1);
output.writeString(this.msg);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
InvalidTopologyException = module.exports.InvalidTopologyException = function(args) {
Thrift.TException.call(this, "InvalidTopologyException")
this.name = "InvalidTopologyException"
this.msg = null;
if (args) {
if (args.msg !== undefined) {
this.msg = args.msg;
}
}
};
Thrift.inherits(InvalidTopologyException, Thrift.TException);
InvalidTopologyException.prototype.name = 'InvalidTopologyException';
InvalidTopologyException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.msg = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
InvalidTopologyException.prototype.write = function(output) {
output.writeStructBegin('InvalidTopologyException');
if (this.msg !== null && this.msg !== undefined) {
output.writeFieldBegin('msg', Thrift.Type.STRING, 1);
output.writeString(this.msg);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
TopologySummary = module.exports.TopologySummary = function(args) {
this.id = null;
this.name = null;
this.num_tasks = null;
this.num_executors = null;
this.num_workers = null;
this.uptime_secs = null;
this.status = null;
if (args) {
if (args.id !== undefined) {
this.id = args.id;
}
if (args.name !== undefined) {
this.name = args.name;
}
if (args.num_tasks !== undefined) {
this.num_tasks = args.num_tasks;
}
if (args.num_executors !== undefined) {
this.num_executors = args.num_executors;
}
if (args.num_workers !== undefined) {
this.num_workers = args.num_workers;
}
if (args.uptime_secs !== undefined) {
this.uptime_secs = args.uptime_secs;
}
if (args.status !== undefined) {
this.status = args.status;
}
}
};
TopologySummary.prototype = {};
TopologySummary.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.id = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.num_tasks = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.num_executors = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.num_workers = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I32) {
this.uptime_secs = input.readI32();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRING) {
this.status = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TopologySummary.prototype.write = function(output) {
output.writeStructBegin('TopologySummary');
if (this.id !== null && this.id !== undefined) {
output.writeFieldBegin('id', Thrift.Type.STRING, 1);
output.writeString(this.id);
output.writeFieldEnd();
}
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 2);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.num_tasks !== null && this.num_tasks !== undefined) {
output.writeFieldBegin('num_tasks', Thrift.Type.I32, 3);
output.writeI32(this.num_tasks);
output.writeFieldEnd();
}
if (this.num_executors !== null && this.num_executors !== undefined) {
output.writeFieldBegin('num_executors', Thrift.Type.I32, 4);
output.writeI32(this.num_executors);
output.writeFieldEnd();
}
if (this.num_workers !== null && this.num_workers !== undefined) {
output.writeFieldBegin('num_workers', Thrift.Type.I32, 5);
output.writeI32(this.num_workers);
output.writeFieldEnd();
}
if (this.uptime_secs !== null && this.uptime_secs !== undefined) {
output.writeFieldBegin('uptime_secs', Thrift.Type.I32, 6);
output.writeI32(this.uptime_secs);
output.writeFieldEnd();
}
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRING, 7);
output.writeString(this.status);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
SupervisorSummary = module.exports.SupervisorSummary = function(args) {
this.host = null;
this.uptime_secs = null;
this.num_workers = null;
this.num_used_workers = null;
this.supervisor_id = null;
if (args) {
if (args.host !== undefined) {
this.host = args.host;
}
if (args.uptime_secs !== undefined) {
this.uptime_secs = args.uptime_secs;
}
if (args.num_workers !== undefined) {
this.num_workers = args.num_workers;
}
if (args.num_used_workers !== undefined) {
this.num_used_workers = args.num_used_workers;
}
if (args.supervisor_id !== undefined) {
this.supervisor_id = args.supervisor_id;
}
}
};
SupervisorSummary.prototype = {};
SupervisorSummary.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.host = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.uptime_secs = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.num_workers = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.num_used_workers = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.supervisor_id = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
SupervisorSummary.prototype.write = function(output) {
output.writeStructBegin('SupervisorSummary');
if (this.host !== null && this.host !== undefined) {
output.writeFieldBegin('host', Thrift.Type.STRING, 1);
output.writeString(this.host);
output.writeFieldEnd();
}
if (this.uptime_secs !== null && this.uptime_secs !== undefined) {
output.writeFieldBegin('uptime_secs', Thrift.Type.I32, 2);
output.writeI32(this.uptime_secs);
output.writeFieldEnd();
}
if (this.num_workers !== null && this.num_workers !== undefined) {
output.writeFieldBegin('num_workers', Thrift.Type.I32, 3);
output.writeI32(this.num_workers);
output.writeFieldEnd();
}
if (this.num_used_workers !== null && this.num_used_workers !== undefined) {
output.writeFieldBegin('num_used_workers', Thrift.Type.I32, 4);
output.writeI32(this.num_used_workers);
output.writeFieldEnd();
}
if (this.supervisor_id !== null && this.supervisor_id !== undefined) {
output.writeFieldBegin('supervisor_id', Thrift.Type.STRING, 5);
output.writeString(this.supervisor_id);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ClusterSummary = module.exports.ClusterSummary = function(args) {
this.supervisors = null;
this.nimbus_uptime_secs = null;
this.topologies = null;
if (args) {
if (args.supervisors !== undefined) {
this.supervisors = args.supervisors;
}
if (args.nimbus_uptime_secs !== undefined) {
this.nimbus_uptime_secs = args.nimbus_uptime_secs;
}
if (args.topologies !== undefined) {
this.topologies = args.topologies;
}
}
};
ClusterSummary.prototype = {};
ClusterSummary.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size74 = 0;
var _rtmp378;
this.supervisors = [];
var _etype77 = 0;
_rtmp378 = input.readListBegin();
_etype77 = _rtmp378.etype;
_size74 = _rtmp378.size;
for (var _i79 = 0; _i79 < _size74; ++_i79)
{
var elem80 = null;
elem80 = new ttypes.SupervisorSummary();
elem80.read(input);
this.supervisors.push(elem80);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.nimbus_uptime_secs = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size81 = 0;
var _rtmp385;
this.topologies = [];
var _etype84 = 0;
_rtmp385 = input.readListBegin();
_etype84 = _rtmp385.etype;
_size81 = _rtmp385.size;
for (var _i86 = 0; _i86 < _size81; ++_i86)
{
var elem87 = null;
elem87 = new ttypes.TopologySummary();
elem87.read(input);
this.topologies.push(elem87);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ClusterSummary.prototype.write = function(output) {
output.writeStructBegin('ClusterSummary');
if (this.supervisors !== null && this.supervisors !== undefined) {
output.writeFieldBegin('supervisors', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.supervisors.length);
for (var iter88 in this.supervisors)
{
if (this.supervisors.hasOwnProperty(iter88))
{
iter88 = this.supervisors[iter88];
iter88.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.nimbus_uptime_secs !== null && this.nimbus_uptime_secs !== undefined) {
output.writeFieldBegin('nimbus_uptime_secs', Thrift.Type.I32, 2);
output.writeI32(this.nimbus_uptime_secs);
output.writeFieldEnd();
}
if (this.topologies !== null && this.topologies !== undefined) {
output.writeFieldBegin('topologies', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRUCT, this.topologies.length);
for (var iter89 in this.topologies)
{
if (this.topologies.hasOwnProperty(iter89))
{
iter89 = this.topologies[iter89];
iter89.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ErrorInfo = module.exports.ErrorInfo = function(args) {
this.error = null;
this.error_time_secs = null;
this.host = null;
this.port = null;
if (args) {
if (args.error !== undefined) {
this.error = args.error;
}
if (args.error_time_secs !== undefined) {
this.error_time_secs = args.error_time_secs;
}
if (args.host !== undefined) {
this.host = args.host;
}
if (args.port !== undefined) {
this.port = args.port;
}
}
};
ErrorInfo.prototype = {};
ErrorInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.error = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.error_time_secs = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.host = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.port = input.readI32();
} else {
input.skip(ftype);
}