UNPKG

nopala

Version:

Impala and Hive client for Nodejs

1,893 lines (1,809 loc) 79.2 kB
// // 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 hive_metastore_ttypes = require('./hive_metastore_types'); var ttypes = require('./beeswax_types'); //HELPER FUNCTIONS AND STRUCTURES var BeeswaxService_query_args = function(args) { this.query = null; if (args) { if (args.query !== undefined && args.query !== null) { this.query = new ttypes.Query(args.query); } } }; BeeswaxService_query_args.prototype = {}; BeeswaxService_query_args.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.STRUCT) { this.query = new ttypes.Query(); this.query.read(input); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_query_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_query_args'); if (this.query !== null && this.query !== undefined) { output.writeFieldBegin('query', Thrift.Type.STRUCT, 1); this.query.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_query_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.BeeswaxException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = new ttypes.QueryHandle(args.success); } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_query_result.prototype = {}; BeeswaxService_query_result.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 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.QueryHandle(); this.success.read(input); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.BeeswaxException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_query_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_query_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_executeAndWait_args = function(args) { this.query = null; this.clientCtx = null; if (args) { if (args.query !== undefined && args.query !== null) { this.query = new ttypes.Query(args.query); } if (args.clientCtx !== undefined && args.clientCtx !== null) { this.clientCtx = args.clientCtx; } } }; BeeswaxService_executeAndWait_args.prototype = {}; BeeswaxService_executeAndWait_args.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.STRUCT) { this.query = new ttypes.Query(); this.query.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.clientCtx = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_executeAndWait_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_executeAndWait_args'); if (this.query !== null && this.query !== undefined) { output.writeFieldBegin('query', Thrift.Type.STRUCT, 1); this.query.write(output); output.writeFieldEnd(); } if (this.clientCtx !== null && this.clientCtx !== undefined) { output.writeFieldBegin('clientCtx', Thrift.Type.STRING, 2); output.writeString(this.clientCtx); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_executeAndWait_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.BeeswaxException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = new ttypes.QueryHandle(args.success); } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_executeAndWait_result.prototype = {}; BeeswaxService_executeAndWait_result.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 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.QueryHandle(); this.success.read(input); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.BeeswaxException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_executeAndWait_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_executeAndWait_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_explain_args = function(args) { this.query = null; if (args) { if (args.query !== undefined && args.query !== null) { this.query = new ttypes.Query(args.query); } } }; BeeswaxService_explain_args.prototype = {}; BeeswaxService_explain_args.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.STRUCT) { this.query = new ttypes.Query(); this.query.read(input); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_explain_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_explain_args'); if (this.query !== null && this.query !== undefined) { output.writeFieldBegin('query', Thrift.Type.STRUCT, 1); this.query.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_explain_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.BeeswaxException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = new ttypes.QueryExplanation(args.success); } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_explain_result.prototype = {}; BeeswaxService_explain_result.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 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.QueryExplanation(); this.success.read(input); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.BeeswaxException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_explain_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_explain_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_fetch_args = function(args) { this.query_id = null; this.start_over = null; this.fetch_size = -1; if (args) { if (args.query_id !== undefined && args.query_id !== null) { this.query_id = new ttypes.QueryHandle(args.query_id); } if (args.start_over !== undefined && args.start_over !== null) { this.start_over = args.start_over; } if (args.fetch_size !== undefined && args.fetch_size !== null) { this.fetch_size = args.fetch_size; } } }; BeeswaxService_fetch_args.prototype = {}; BeeswaxService_fetch_args.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.STRUCT) { this.query_id = new ttypes.QueryHandle(); this.query_id.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.BOOL) { this.start_over = input.readBool(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.fetch_size = input.readI32(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_fetch_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_fetch_args'); if (this.query_id !== null && this.query_id !== undefined) { output.writeFieldBegin('query_id', Thrift.Type.STRUCT, 1); this.query_id.write(output); output.writeFieldEnd(); } if (this.start_over !== null && this.start_over !== undefined) { output.writeFieldBegin('start_over', Thrift.Type.BOOL, 2); output.writeBool(this.start_over); output.writeFieldEnd(); } if (this.fetch_size !== null && this.fetch_size !== undefined) { output.writeFieldBegin('fetch_size', Thrift.Type.I32, 3); output.writeI32(this.fetch_size); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_fetch_result = function(args) { this.success = null; this.error = null; this.error2 = null; if (args instanceof ttypes.QueryNotFoundException) { this.error = args; return; } if (args instanceof ttypes.BeeswaxException) { this.error2 = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = new ttypes.Results(args.success); } if (args.error !== undefined && args.error !== null) { this.error = args.error; } if (args.error2 !== undefined && args.error2 !== null) { this.error2 = args.error2; } } }; BeeswaxService_fetch_result.prototype = {}; BeeswaxService_fetch_result.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 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.Results(); this.success.read(input); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.QueryNotFoundException(); this.error.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.error2 = new ttypes.BeeswaxException(); this.error2.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_fetch_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_fetch_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } if (this.error2 !== null && this.error2 !== undefined) { output.writeFieldBegin('error2', Thrift.Type.STRUCT, 2); this.error2.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_state_args = function(args) { this.handle = null; if (args) { if (args.handle !== undefined && args.handle !== null) { this.handle = new ttypes.QueryHandle(args.handle); } } }; BeeswaxService_get_state_args.prototype = {}; BeeswaxService_get_state_args.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.STRUCT) { this.handle = new ttypes.QueryHandle(); this.handle.read(input); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_state_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_state_args'); if (this.handle !== null && this.handle !== undefined) { output.writeFieldBegin('handle', Thrift.Type.STRUCT, 1); this.handle.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_state_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.QueryNotFoundException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = args.success; } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_get_state_result.prototype = {}; BeeswaxService_get_state_result.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 0: if (ftype == Thrift.Type.I32) { this.success = input.readI32(); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.QueryNotFoundException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_state_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_state_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.I32, 0); output.writeI32(this.success); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_results_metadata_args = function(args) { this.handle = null; if (args) { if (args.handle !== undefined && args.handle !== null) { this.handle = new ttypes.QueryHandle(args.handle); } } }; BeeswaxService_get_results_metadata_args.prototype = {}; BeeswaxService_get_results_metadata_args.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.STRUCT) { this.handle = new ttypes.QueryHandle(); this.handle.read(input); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_results_metadata_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_results_metadata_args'); if (this.handle !== null && this.handle !== undefined) { output.writeFieldBegin('handle', Thrift.Type.STRUCT, 1); this.handle.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_results_metadata_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.QueryNotFoundException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = new ttypes.ResultsMetadata(args.success); } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_get_results_metadata_result.prototype = {}; BeeswaxService_get_results_metadata_result.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 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.ResultsMetadata(); this.success.read(input); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.QueryNotFoundException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_results_metadata_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_results_metadata_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); this.success.write(output); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_echo_args = function(args) { this.s = null; if (args) { if (args.s !== undefined && args.s !== null) { this.s = args.s; } } }; BeeswaxService_echo_args.prototype = {}; BeeswaxService_echo_args.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.s = input.readString(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_echo_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_echo_args'); if (this.s !== null && this.s !== undefined) { output.writeFieldBegin('s', Thrift.Type.STRING, 1); output.writeString(this.s); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_echo_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { this.success = args.success; } } }; BeeswaxService_echo_result.prototype = {}; BeeswaxService_echo_result.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 0: if (ftype == Thrift.Type.STRING) { this.success = input.readString(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_echo_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_echo_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRING, 0); output.writeString(this.success); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_dump_config_args = function(args) { }; BeeswaxService_dump_config_args.prototype = {}; BeeswaxService_dump_config_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var ftype = ret.ftype; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_dump_config_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_dump_config_args'); output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_dump_config_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { this.success = args.success; } } }; BeeswaxService_dump_config_result.prototype = {}; BeeswaxService_dump_config_result.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 0: if (ftype == Thrift.Type.STRING) { this.success = input.readString(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_dump_config_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_dump_config_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRING, 0); output.writeString(this.success); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_log_args = function(args) { this.context = null; if (args) { if (args.context !== undefined && args.context !== null) { this.context = args.context; } } }; BeeswaxService_get_log_args.prototype = {}; BeeswaxService_get_log_args.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.context = input.readString(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_log_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_log_args'); if (this.context !== null && this.context !== undefined) { output.writeFieldBegin('context', Thrift.Type.STRING, 1); output.writeString(this.context); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_log_result = function(args) { this.success = null; this.error = null; if (args instanceof ttypes.QueryNotFoundException) { this.error = args; return; } if (args) { if (args.success !== undefined && args.success !== null) { this.success = args.success; } if (args.error !== undefined && args.error !== null) { this.error = args.error; } } }; BeeswaxService_get_log_result.prototype = {}; BeeswaxService_get_log_result.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 0: if (ftype == Thrift.Type.STRING) { this.success = input.readString(); } else { input.skip(ftype); } break; case 1: if (ftype == Thrift.Type.STRUCT) { this.error = new ttypes.QueryNotFoundException(); this.error.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_log_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_log_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRING, 0); output.writeString(this.success); output.writeFieldEnd(); } if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_default_configuration_args = function(args) { this.include_hadoop = null; if (args) { if (args.include_hadoop !== undefined && args.include_hadoop !== null) { this.include_hadoop = args.include_hadoop; } } }; BeeswaxService_get_default_configuration_args.prototype = {}; BeeswaxService_get_default_configuration_args.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.BOOL) { this.include_hadoop = input.readBool(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_default_configuration_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_default_configuration_args'); if (this.include_hadoop !== null && this.include_hadoop !== undefined) { output.writeFieldBegin('include_hadoop', Thrift.Type.BOOL, 1); output.writeBool(this.include_hadoop); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_get_default_configuration_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { this.success = Thrift.copyList(args.success, [ttypes.ConfigVariable]); } } }; BeeswaxService_get_default_configuration_result.prototype = {}; BeeswaxService_get_default_configuration_result.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 0: if (ftype == Thrift.Type.LIST) { this.success = []; var _rtmp316 = input.readListBegin(); var _size15 = _rtmp316.size || 0; for (var _i17 = 0; _i17 < _size15; ++_i17) { var elem18 = null; elem18 = new ttypes.ConfigVariable(); elem18.read(input); this.success.push(elem18); } input.readListEnd(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_get_default_configuration_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_get_default_configuration_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.LIST, 0); output.writeListBegin(Thrift.Type.STRUCT, this.success.length); for (var iter19 in this.success) { if (this.success.hasOwnProperty(iter19)) { iter19 = this.success[iter19]; iter19.write(output); } } output.writeListEnd(); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_close_args = function(args) { this.handle = null; if (args) { if (args.handle !== undefined && args.handle !== null) { this.handle = new ttypes.QueryHandle(args.handle); } } }; BeeswaxService_close_args.prototype = {}; BeeswaxService_close_args.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.STRUCT) { this.handle = new ttypes.QueryHandle(); this.handle.read(input); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_close_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_close_args'); if (this.handle !== null && this.handle !== undefined) { output.writeFieldBegin('handle', Thrift.Type.STRUCT, 1); this.handle.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_close_result = function(args) { this.error = null; this.error2 = null; if (args instanceof ttypes.QueryNotFoundException) { this.error = args; return; } if (args instanceof ttypes.BeeswaxException) { this.error2 = args; return; } if (args) { if (args.error !== undefined && args.error !== null) { this.error = args.error; } if (args.error2 !== undefined && args.error2 !== null) { this.error2 = args.error2; } } }; BeeswaxService_close_result.prototype = {}; BeeswaxService_close_result.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.STRUCT) { this.error = new ttypes.QueryNotFoundException(); this.error.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.error2 = new ttypes.BeeswaxException(); this.error2.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_close_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_close_result'); if (this.error !== null && this.error !== undefined) { output.writeFieldBegin('error', Thrift.Type.STRUCT, 1); this.error.write(output); output.writeFieldEnd(); } if (this.error2 !== null && this.error2 !== undefined) { output.writeFieldBegin('error2', Thrift.Type.STRUCT, 2); this.error2.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_clean_args = function(args) { this.log_context = null; if (args) { if (args.log_context !== undefined && args.log_context !== null) { this.log_context = args.log_context; } } }; BeeswaxService_clean_args.prototype = {}; BeeswaxService_clean_args.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.log_context = input.readString(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_clean_args.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_clean_args'); if (this.log_context !== null && this.log_context !== undefined) { output.writeFieldBegin('log_context', Thrift.Type.STRING, 1); output.writeString(this.log_context); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxService_clean_result = function(args) { }; BeeswaxService_clean_result.prototype = {}; BeeswaxService_clean_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var ftype = ret.ftype; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; BeeswaxService_clean_result.prototype.write = function(output) { output.writeStructBegin('BeeswaxService_clean_result'); output.writeFieldStop(); output.writeStructEnd(); return; }; var BeeswaxServiceClient = exports.Client = function(output, pClass) { this.output = output; this.pClass = pClass; this._seqid = 0; this._reqs = {}; }; BeeswaxServiceClient.prototype = {}; BeeswaxServiceClient.prototype.seqid = function() { return this._seqid; }; BeeswaxServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; BeeswaxServiceClient.prototype.query = function(query, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_query(query); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_query(query); } }; BeeswaxServiceClient.prototype.send_query = function(query) { var output = new this.pClass(this.output); var params = { query: query }; var args = new BeeswaxService_query_args(params); try { output.writeMessageBegin('query', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_query = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_query_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.success) { return callback(null, result.success); } return callback('query failed: unknown result'); }; BeeswaxServiceClient.prototype.executeAndWait = function(query, clientCtx, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_executeAndWait(query, clientCtx); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_executeAndWait(query, clientCtx); } }; BeeswaxServiceClient.prototype.send_executeAndWait = function(query, clientCtx) { var output = new this.pClass(this.output); var params = { query: query, clientCtx: clientCtx }; var args = new BeeswaxService_executeAndWait_args(params); try { output.writeMessageBegin('executeAndWait', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_executeAndWait = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_executeAndWait_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.success) { return callback(null, result.success); } return callback('executeAndWait failed: unknown result'); }; BeeswaxServiceClient.prototype.explain = function(query, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_explain(query); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_explain(query); } }; BeeswaxServiceClient.prototype.send_explain = function(query) { var output = new this.pClass(this.output); var params = { query: query }; var args = new BeeswaxService_explain_args(params); try { output.writeMessageBegin('explain', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_explain = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_explain_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.success) { return callback(null, result.success); } return callback('explain failed: unknown result'); }; BeeswaxServiceClient.prototype.fetch = function(query_id, start_over, fetch_size, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_fetch(query_id, start_over, fetch_size); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_fetch(query_id, start_over, fetch_size); } }; BeeswaxServiceClient.prototype.send_fetch = function(query_id, start_over, fetch_size) { var output = new this.pClass(this.output); var params = { query_id: query_id, start_over: start_over, fetch_size: fetch_size }; var args = new BeeswaxService_fetch_args(params); try { output.writeMessageBegin('fetch', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_fetch = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_fetch_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.error2) { return callback(result.error2); } if (null !== result.success) { return callback(null, result.success); } return callback('fetch failed: unknown result'); }; BeeswaxServiceClient.prototype.get_state = function(handle, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_get_state(handle); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_get_state(handle); } }; BeeswaxServiceClient.prototype.send_get_state = function(handle) { var output = new this.pClass(this.output); var params = { handle: handle }; var args = new BeeswaxService_get_state_args(params); try { output.writeMessageBegin('get_state', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_get_state = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_get_state_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.success) { return callback(null, result.success); } return callback('get_state failed: unknown result'); }; BeeswaxServiceClient.prototype.get_results_metadata = function(handle, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_get_results_metadata(handle); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_get_results_metadata(handle); } }; BeeswaxServiceClient.prototype.send_get_results_metadata = function(handle) { var output = new this.pClass(this.output); var params = { handle: handle }; var args = new BeeswaxService_get_results_metadata_args(params); try { output.writeMessageBegin('get_results_metadata', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_get_results_metadata = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_get_results_metadata_result(); result.read(input); input.readMessageEnd(); if (null !== result.error) { return callback(result.error); } if (null !== result.success) { return callback(null, result.success); } return callback('get_results_metadata failed: unknown result'); }; BeeswaxServiceClient.prototype.echo = function(s, callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_echo(s); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_echo(s); } }; BeeswaxServiceClient.prototype.send_echo = function(s) { var output = new this.pClass(this.output); var params = { s: s }; var args = new BeeswaxService_echo_args(params); try { output.writeMessageBegin('echo', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_echo = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || function() {}; delete this._reqs[rseqid]; if (mtype == Thrift.MessageType.EXCEPTION) { var x = new Thrift.TApplicationException(); x.read(input); input.readMessageEnd(); return callback(x); } var result = new BeeswaxService_echo_result(); result.read(input); input.readMessageEnd(); if (null !== result.success) { return callback(null, result.success); } return callback('echo failed: unknown result'); }; BeeswaxServiceClient.prototype.dump_config = function(callback) { this._seqid = this.new_seqid(); if (callback === undefined) { var _defer = Q.defer(); this._reqs[this.seqid()] = function(error, result) { if (error) { _defer.reject(error); } else { _defer.resolve(result); } }; this.send_dump_config(); return _defer.promise; } else { this._reqs[this.seqid()] = callback; this.send_dump_config(); } }; BeeswaxServiceClient.prototype.send_dump_config = function() { var output = new this.pClass(this.output); var args = new BeeswaxService_dump_config_args(); try { output.writeMessageBegin('dump_config', Thrift.MessageType.CALL, this.seqid()); args.write(output); output.writeMessageEnd(); return this.output.flush(); } catch (e) { delete this._reqs[this.seqid()]; if (typeof output.reset === 'function') { output.reset(); } throw e; } }; BeeswaxServiceClient.prototype.recv_dump_config = function(input,mtype,rseqid) { var callback = this._reqs[rseqid] || functi