nopala
Version:
Impala and Hive client for Nodejs
1,093 lines (1,072 loc) • 35 kB
JavaScript
//
// Autogenerated by Thrift Compiler (0.12.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;
var ExecStats_ttypes = require('./ExecStats_types');
var Metrics_ttypes = require('./Metrics_types');
var Types_ttypes = require('./Types_types');
var ttypes = module.exports = {};
ttypes.TRuntimeProfileFormat = {
'STRING' : 0,
'BASE64' : 1,
'THRIFT' : 2
};
var TCounter = module.exports.TCounter = function(args) {
this.name = null;
this.unit = null;
this.value = null;
if (args) {
if (args.name !== undefined && args.name !== null) {
this.name = args.name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!');
}
if (args.unit !== undefined && args.unit !== null) {
this.unit = args.unit;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field unit is unset!');
}
if (args.value !== undefined && args.value !== null) {
this.value = args.value;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field value is unset!');
}
}
};
TCounter.prototype = {};
TCounter.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.unit = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I64) {
this.value = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCounter.prototype.write = function(output) {
output.writeStructBegin('TCounter');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.unit !== null && this.unit !== undefined) {
output.writeFieldBegin('unit', Thrift.Type.I32, 2);
output.writeI32(this.unit);
output.writeFieldEnd();
}
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.I64, 3);
output.writeI64(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TEventSequence = module.exports.TEventSequence = function(args) {
this.name = null;
this.timestamps = null;
this.labels = null;
if (args) {
if (args.name !== undefined && args.name !== null) {
this.name = args.name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!');
}
if (args.timestamps !== undefined && args.timestamps !== null) {
this.timestamps = Thrift.copyList(args.timestamps, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!');
}
if (args.labels !== undefined && args.labels !== null) {
this.labels = Thrift.copyList(args.labels, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field labels is unset!');
}
}
};
TEventSequence.prototype = {};
TEventSequence.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
this.timestamps = [];
var _rtmp31 = input.readListBegin();
var _size0 = _rtmp31.size || 0;
for (var _i2 = 0; _i2 < _size0; ++_i2) {
var elem3 = null;
elem3 = input.readI64();
this.timestamps.push(elem3);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
this.labels = [];
var _rtmp35 = input.readListBegin();
var _size4 = _rtmp35.size || 0;
for (var _i6 = 0; _i6 < _size4; ++_i6) {
var elem7 = null;
elem7 = input.readString();
this.labels.push(elem7);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TEventSequence.prototype.write = function(output) {
output.writeStructBegin('TEventSequence');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.timestamps !== null && this.timestamps !== undefined) {
output.writeFieldBegin('timestamps', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.I64, this.timestamps.length);
for (var iter8 in this.timestamps) {
if (this.timestamps.hasOwnProperty(iter8)) {
iter8 = this.timestamps[iter8];
output.writeI64(iter8);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.labels !== null && this.labels !== undefined) {
output.writeFieldBegin('labels', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.labels.length);
for (var iter9 in this.labels) {
if (this.labels.hasOwnProperty(iter9)) {
iter9 = this.labels[iter9];
output.writeString(iter9);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TTimeSeriesCounter = module.exports.TTimeSeriesCounter = function(args) {
this.name = null;
this.unit = null;
this.period_ms = null;
this.values = null;
this.start_index = null;
if (args) {
if (args.name !== undefined && args.name !== null) {
this.name = args.name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!');
}
if (args.unit !== undefined && args.unit !== null) {
this.unit = args.unit;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field unit is unset!');
}
if (args.period_ms !== undefined && args.period_ms !== null) {
this.period_ms = args.period_ms;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field period_ms is unset!');
}
if (args.values !== undefined && args.values !== null) {
this.values = Thrift.copyList(args.values, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
}
if (args.start_index !== undefined && args.start_index !== null) {
this.start_index = args.start_index;
}
}
};
TTimeSeriesCounter.prototype = {};
TTimeSeriesCounter.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.unit = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.period_ms = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.LIST) {
this.values = [];
var _rtmp311 = input.readListBegin();
var _size10 = _rtmp311.size || 0;
for (var _i12 = 0; _i12 < _size10; ++_i12) {
var elem13 = null;
elem13 = input.readI64();
this.values.push(elem13);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I64) {
this.start_index = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TTimeSeriesCounter.prototype.write = function(output) {
output.writeStructBegin('TTimeSeriesCounter');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.unit !== null && this.unit !== undefined) {
output.writeFieldBegin('unit', Thrift.Type.I32, 2);
output.writeI32(this.unit);
output.writeFieldEnd();
}
if (this.period_ms !== null && this.period_ms !== undefined) {
output.writeFieldBegin('period_ms', Thrift.Type.I32, 3);
output.writeI32(this.period_ms);
output.writeFieldEnd();
}
if (this.values !== null && this.values !== undefined) {
output.writeFieldBegin('values', Thrift.Type.LIST, 4);
output.writeListBegin(Thrift.Type.I64, this.values.length);
for (var iter14 in this.values) {
if (this.values.hasOwnProperty(iter14)) {
iter14 = this.values[iter14];
output.writeI64(iter14);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.start_index !== null && this.start_index !== undefined) {
output.writeFieldBegin('start_index', Thrift.Type.I64, 5);
output.writeI64(this.start_index);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TSummaryStatsCounter = module.exports.TSummaryStatsCounter = function(args) {
this.name = null;
this.unit = null;
this.sum = null;
this.total_num_values = null;
this.min_value = null;
this.max_value = null;
if (args) {
if (args.name !== undefined && args.name !== null) {
this.name = args.name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!');
}
if (args.unit !== undefined && args.unit !== null) {
this.unit = args.unit;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field unit is unset!');
}
if (args.sum !== undefined && args.sum !== null) {
this.sum = args.sum;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sum is unset!');
}
if (args.total_num_values !== undefined && args.total_num_values !== null) {
this.total_num_values = args.total_num_values;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field total_num_values is unset!');
}
if (args.min_value !== undefined && args.min_value !== null) {
this.min_value = args.min_value;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field min_value is unset!');
}
if (args.max_value !== undefined && args.max_value !== null) {
this.max_value = args.max_value;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field max_value is unset!');
}
}
};
TSummaryStatsCounter.prototype = {};
TSummaryStatsCounter.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.unit = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I64) {
this.sum = input.readI64();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I64) {
this.total_num_values = input.readI64();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I64) {
this.min_value = input.readI64();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I64) {
this.max_value = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TSummaryStatsCounter.prototype.write = function(output) {
output.writeStructBegin('TSummaryStatsCounter');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.unit !== null && this.unit !== undefined) {
output.writeFieldBegin('unit', Thrift.Type.I32, 2);
output.writeI32(this.unit);
output.writeFieldEnd();
}
if (this.sum !== null && this.sum !== undefined) {
output.writeFieldBegin('sum', Thrift.Type.I64, 3);
output.writeI64(this.sum);
output.writeFieldEnd();
}
if (this.total_num_values !== null && this.total_num_values !== undefined) {
output.writeFieldBegin('total_num_values', Thrift.Type.I64, 4);
output.writeI64(this.total_num_values);
output.writeFieldEnd();
}
if (this.min_value !== null && this.min_value !== undefined) {
output.writeFieldBegin('min_value', Thrift.Type.I64, 5);
output.writeI64(this.min_value);
output.writeFieldEnd();
}
if (this.max_value !== null && this.max_value !== undefined) {
output.writeFieldBegin('max_value', Thrift.Type.I64, 6);
output.writeI64(this.max_value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRuntimeProfileNodeMetadata = module.exports.TRuntimeProfileNodeMetadata = function(args) {
this.plan_node_id = null;
this.data_sink_id = null;
if (args) {
if (args.plan_node_id !== undefined && args.plan_node_id !== null) {
this.plan_node_id = args.plan_node_id;
}
if (args.data_sink_id !== undefined && args.data_sink_id !== null) {
this.data_sink_id = args.data_sink_id;
}
}
};
TRuntimeProfileNodeMetadata.prototype = {};
TRuntimeProfileNodeMetadata.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.I32) {
this.plan_node_id = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.data_sink_id = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRuntimeProfileNodeMetadata.prototype.write = function(output) {
output.writeStructBegin('TRuntimeProfileNodeMetadata');
if (this.plan_node_id !== null && this.plan_node_id !== undefined) {
output.writeFieldBegin('plan_node_id', Thrift.Type.I32, 1);
output.writeI32(this.plan_node_id);
output.writeFieldEnd();
}
if (this.data_sink_id !== null && this.data_sink_id !== undefined) {
output.writeFieldBegin('data_sink_id', Thrift.Type.I32, 2);
output.writeI32(this.data_sink_id);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRuntimeProfileNode = module.exports.TRuntimeProfileNode = function(args) {
this.name = null;
this.num_children = null;
this.counters = null;
this.metadata = null;
this.indent = null;
this.info_strings = null;
this.info_strings_display_order = null;
this.child_counters_map = null;
this.event_sequences = null;
this.time_series_counters = null;
this.summary_stats_counters = null;
this.node_metadata = null;
if (args) {
if (args.name !== undefined && args.name !== null) {
this.name = args.name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!');
}
if (args.num_children !== undefined && args.num_children !== null) {
this.num_children = args.num_children;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field num_children is unset!');
}
if (args.counters !== undefined && args.counters !== null) {
this.counters = Thrift.copyList(args.counters, [ttypes.TCounter]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field counters is unset!');
}
if (args.metadata !== undefined && args.metadata !== null) {
this.metadata = args.metadata;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
}
if (args.indent !== undefined && args.indent !== null) {
this.indent = args.indent;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field indent is unset!');
}
if (args.info_strings !== undefined && args.info_strings !== null) {
this.info_strings = Thrift.copyMap(args.info_strings, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field info_strings is unset!');
}
if (args.info_strings_display_order !== undefined && args.info_strings_display_order !== null) {
this.info_strings_display_order = Thrift.copyList(args.info_strings_display_order, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field info_strings_display_order is unset!');
}
if (args.child_counters_map !== undefined && args.child_counters_map !== null) {
this.child_counters_map = Thrift.copyMap(args.child_counters_map, [Thrift.copyList, null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field child_counters_map is unset!');
}
if (args.event_sequences !== undefined && args.event_sequences !== null) {
this.event_sequences = Thrift.copyList(args.event_sequences, [ttypes.TEventSequence]);
}
if (args.time_series_counters !== undefined && args.time_series_counters !== null) {
this.time_series_counters = Thrift.copyList(args.time_series_counters, [ttypes.TTimeSeriesCounter]);
}
if (args.summary_stats_counters !== undefined && args.summary_stats_counters !== null) {
this.summary_stats_counters = Thrift.copyList(args.summary_stats_counters, [ttypes.TSummaryStatsCounter]);
}
if (args.node_metadata !== undefined && args.node_metadata !== null) {
this.node_metadata = new ttypes.TRuntimeProfileNodeMetadata(args.node_metadata);
}
}
};
TRuntimeProfileNode.prototype = {};
TRuntimeProfileNode.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.num_children = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
this.counters = [];
var _rtmp316 = input.readListBegin();
var _size15 = _rtmp316.size || 0;
for (var _i17 = 0; _i17 < _size15; ++_i17) {
var elem18 = null;
elem18 = new ttypes.TCounter();
elem18.read(input);
this.counters.push(elem18);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I64) {
this.metadata = input.readI64();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.BOOL) {
this.indent = input.readBool();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.MAP) {
this.info_strings = {};
var _rtmp320 = input.readMapBegin();
var _size19 = _rtmp320.size || 0;
for (var _i21 = 0; _i21 < _size19; ++_i21) {
var key22 = null;
var val23 = null;
key22 = input.readString();
val23 = input.readString();
this.info_strings[key22] = val23;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.LIST) {
this.info_strings_display_order = [];
var _rtmp325 = input.readListBegin();
var _size24 = _rtmp325.size || 0;
for (var _i26 = 0; _i26 < _size24; ++_i26) {
var elem27 = null;
elem27 = input.readString();
this.info_strings_display_order.push(elem27);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.MAP) {
this.child_counters_map = {};
var _rtmp329 = input.readMapBegin();
var _size28 = _rtmp329.size || 0;
for (var _i30 = 0; _i30 < _size28; ++_i30) {
var key31 = null;
var val32 = null;
key31 = input.readString();
val32 = [];
var _rtmp334 = input.readSetBegin();
var _size33 = _rtmp334.size || 0;
for (var _i35 = 0; _i35 < _size33; ++_i35) {
var elem36 = null;
elem36 = input.readString();
val32.push(elem36);
}
input.readSetEnd();
this.child_counters_map[key31] = val32;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 9:
if (ftype == Thrift.Type.LIST) {
this.event_sequences = [];
var _rtmp338 = input.readListBegin();
var _size37 = _rtmp338.size || 0;
for (var _i39 = 0; _i39 < _size37; ++_i39) {
var elem40 = null;
elem40 = new ttypes.TEventSequence();
elem40.read(input);
this.event_sequences.push(elem40);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 10:
if (ftype == Thrift.Type.LIST) {
this.time_series_counters = [];
var _rtmp342 = input.readListBegin();
var _size41 = _rtmp342.size || 0;
for (var _i43 = 0; _i43 < _size41; ++_i43) {
var elem44 = null;
elem44 = new ttypes.TTimeSeriesCounter();
elem44.read(input);
this.time_series_counters.push(elem44);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 11:
if (ftype == Thrift.Type.LIST) {
this.summary_stats_counters = [];
var _rtmp346 = input.readListBegin();
var _size45 = _rtmp346.size || 0;
for (var _i47 = 0; _i47 < _size45; ++_i47) {
var elem48 = null;
elem48 = new ttypes.TSummaryStatsCounter();
elem48.read(input);
this.summary_stats_counters.push(elem48);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 12:
if (ftype == Thrift.Type.STRUCT) {
this.node_metadata = new ttypes.TRuntimeProfileNodeMetadata();
this.node_metadata.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRuntimeProfileNode.prototype.write = function(output) {
output.writeStructBegin('TRuntimeProfileNode');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.num_children !== null && this.num_children !== undefined) {
output.writeFieldBegin('num_children', Thrift.Type.I32, 2);
output.writeI32(this.num_children);
output.writeFieldEnd();
}
if (this.counters !== null && this.counters !== undefined) {
output.writeFieldBegin('counters', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRUCT, this.counters.length);
for (var iter49 in this.counters) {
if (this.counters.hasOwnProperty(iter49)) {
iter49 = this.counters[iter49];
iter49.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.metadata !== null && this.metadata !== undefined) {
output.writeFieldBegin('metadata', Thrift.Type.I64, 4);
output.writeI64(this.metadata);
output.writeFieldEnd();
}
if (this.indent !== null && this.indent !== undefined) {
output.writeFieldBegin('indent', Thrift.Type.BOOL, 5);
output.writeBool(this.indent);
output.writeFieldEnd();
}
if (this.info_strings !== null && this.info_strings !== undefined) {
output.writeFieldBegin('info_strings', Thrift.Type.MAP, 6);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.info_strings));
for (var kiter50 in this.info_strings) {
if (this.info_strings.hasOwnProperty(kiter50)) {
var viter51 = this.info_strings[kiter50];
output.writeString(kiter50);
output.writeString(viter51);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.info_strings_display_order !== null && this.info_strings_display_order !== undefined) {
output.writeFieldBegin('info_strings_display_order', Thrift.Type.LIST, 7);
output.writeListBegin(Thrift.Type.STRING, this.info_strings_display_order.length);
for (var iter52 in this.info_strings_display_order) {
if (this.info_strings_display_order.hasOwnProperty(iter52)) {
iter52 = this.info_strings_display_order[iter52];
output.writeString(iter52);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.child_counters_map !== null && this.child_counters_map !== undefined) {
output.writeFieldBegin('child_counters_map', Thrift.Type.MAP, 8);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.SET, Thrift.objectLength(this.child_counters_map));
for (var kiter53 in this.child_counters_map) {
if (this.child_counters_map.hasOwnProperty(kiter53)) {
var viter54 = this.child_counters_map[kiter53];
output.writeString(kiter53);
output.writeSetBegin(Thrift.Type.STRING, viter54.length);
for (var iter55 in viter54) {
if (viter54.hasOwnProperty(iter55)) {
iter55 = viter54[iter55];
output.writeString(iter55);
}
}
output.writeSetEnd();
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.event_sequences !== null && this.event_sequences !== undefined) {
output.writeFieldBegin('event_sequences', Thrift.Type.LIST, 9);
output.writeListBegin(Thrift.Type.STRUCT, this.event_sequences.length);
for (var iter56 in this.event_sequences) {
if (this.event_sequences.hasOwnProperty(iter56)) {
iter56 = this.event_sequences[iter56];
iter56.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.time_series_counters !== null && this.time_series_counters !== undefined) {
output.writeFieldBegin('time_series_counters', Thrift.Type.LIST, 10);
output.writeListBegin(Thrift.Type.STRUCT, this.time_series_counters.length);
for (var iter57 in this.time_series_counters) {
if (this.time_series_counters.hasOwnProperty(iter57)) {
iter57 = this.time_series_counters[iter57];
iter57.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.summary_stats_counters !== null && this.summary_stats_counters !== undefined) {
output.writeFieldBegin('summary_stats_counters', Thrift.Type.LIST, 11);
output.writeListBegin(Thrift.Type.STRUCT, this.summary_stats_counters.length);
for (var iter58 in this.summary_stats_counters) {
if (this.summary_stats_counters.hasOwnProperty(iter58)) {
iter58 = this.summary_stats_counters[iter58];
iter58.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.node_metadata !== null && this.node_metadata !== undefined) {
output.writeFieldBegin('node_metadata', Thrift.Type.STRUCT, 12);
this.node_metadata.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRuntimeProfileTree = module.exports.TRuntimeProfileTree = function(args) {
this.nodes = null;
this.exec_summary = null;
if (args) {
if (args.nodes !== undefined && args.nodes !== null) {
this.nodes = Thrift.copyList(args.nodes, [ttypes.TRuntimeProfileNode]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodes is unset!');
}
if (args.exec_summary !== undefined && args.exec_summary !== null) {
this.exec_summary = new ExecStats_ttypes.TExecSummary(args.exec_summary);
}
}
};
TRuntimeProfileTree.prototype = {};
TRuntimeProfileTree.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.LIST) {
this.nodes = [];
var _rtmp360 = input.readListBegin();
var _size59 = _rtmp360.size || 0;
for (var _i61 = 0; _i61 < _size59; ++_i61) {
var elem62 = null;
elem62 = new ttypes.TRuntimeProfileNode();
elem62.read(input);
this.nodes.push(elem62);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.exec_summary = new ExecStats_ttypes.TExecSummary();
this.exec_summary.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRuntimeProfileTree.prototype.write = function(output) {
output.writeStructBegin('TRuntimeProfileTree');
if (this.nodes !== null && this.nodes !== undefined) {
output.writeFieldBegin('nodes', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.nodes.length);
for (var iter63 in this.nodes) {
if (this.nodes.hasOwnProperty(iter63)) {
iter63 = this.nodes[iter63];
iter63.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.exec_summary !== null && this.exec_summary !== undefined) {
output.writeFieldBegin('exec_summary', Thrift.Type.STRUCT, 2);
this.exec_summary.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRuntimeProfileForest = module.exports.TRuntimeProfileForest = function(args) {
this.profile_trees = null;
this.host_profile = null;
if (args) {
if (args.profile_trees !== undefined && args.profile_trees !== null) {
this.profile_trees = Thrift.copyList(args.profile_trees, [ttypes.TRuntimeProfileTree]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field profile_trees is unset!');
}
if (args.host_profile !== undefined && args.host_profile !== null) {
this.host_profile = new ttypes.TRuntimeProfileTree(args.host_profile);
}
}
};
TRuntimeProfileForest.prototype = {};
TRuntimeProfileForest.prototype.read = function(input) {
input.readStructBegin();
while (true) {
var ret = input.readFieldBegin();
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.LIST) {
this.profile_trees = [];
var _rtmp365 = input.readListBegin();
var _size64 = _rtmp365.size || 0;
for (var _i66 = 0; _i66 < _size64; ++_i66) {
var elem67 = null;
elem67 = new ttypes.TRuntimeProfileTree();
elem67.read(input);
this.profile_trees.push(elem67);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.host_profile = new ttypes.TRuntimeProfileTree();
this.host_profile.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRuntimeProfileForest.prototype.write = function(output) {
output.writeStructBegin('TRuntimeProfileForest');
if (this.profile_trees !== null && this.profile_trees !== undefined) {
output.writeFieldBegin('profile_trees', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.profile_trees.length);
for (var iter68 in this.profile_trees) {
if (this.profile_trees.hasOwnProperty(iter68)) {
iter68 = this.profile_trees[iter68];
iter68.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.host_profile !== null && this.host_profile !== undefined) {
output.writeFieldBegin('host_profile', Thrift.Type.STRUCT, 2);
this.host_profile.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};