nopala
Version:
Impala and Hive client for Nodejs
2,652 lines • 79.2 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 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] || 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_dump_config_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('dump_config failed: unknown result');
};
BeeswaxServiceClient.prototype.get_log = function(context, 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_log(context);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_get_log(context);
}
};
BeeswaxServiceClient.prototype.send_get_log = function(context) {
var output = new this.pClass(this.output);
var params = {
context: context
};
var args = new BeeswaxService_get_log_args(params);
try {
output.writeMessageBegin('get_log', 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_log = 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_log_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_log failed: unknown result');
};
BeeswaxServiceClient.prototype.get_default_configuration = function(include_hadoop, 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_default_configuration(include_hadoop);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_get_default_configuration(include_hadoop);
}
};
BeeswaxServiceClient.prototype.send_get_default_configuration = function(include_hadoop) {
var output = new this.pClass(this.output);
var params = {
include_hadoop: include_hadoop
};
var args = new BeeswaxService_get_default_configuration_args(params);
try {
output.writeMessageBegin('get_default_configuration', 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_default_configuration = 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_default_configuration_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_default_configuration failed: unknown result');
};
BeeswaxServiceClient.prototype.close = 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_close(handle);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_close(handle);
}
};
BeeswaxServiceClient.prototype.send_close = function(handle) {
var output = new this.pClass(this.output);
var params = {
handle: handle
};
var args = new BeeswaxService_close_args(params);
try {
output.writeMessageBegin('close', 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_close = 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_close_result();
result.read(input);
input.readMessageEnd();
if (null !== result.error) {
return callback(result.error);
}
if (null !== result.error2) {
return callback(result.error2);
}
callback(null);
};
BeeswaxServiceClient.prototype.clean = function(log_context, 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_clean(log_context);
return _defer.promise;
} else {
this._reqs[this.seqid()] = callback;
this.send_clean(log_context);
}
};
BeeswaxServiceClient.prototype.send_clean = function(log_context) {
var output = new this.pClass(this.output);
var params = {
log_context: log_context
};
var args = new BeeswaxService_clean_args(params);
try {
output.writeMessageBegin('clean', 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_clean = 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_clean_result();
result.read(input);
input.readMessageEnd();
callback(null);
};
var BeeswaxServiceProcessor = exports.Processor = function(handler) {
this._handler = handler;
};
BeeswaxServiceProcessor.prototype.process = function(input, output) {
var r = input.readMessageBegin();
if (this['process_' + r.fname]) {
return this['process_' + r.fname].call(this, r.rseqid, input, output);
} else {
input.skip(Thrift.Type.STRUCT);
input.readMessageEnd();
var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);
output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);
x.write(output);
output.writeMessageEnd();
output.flush();
}
};
BeeswaxServiceProcessor.prototype.process_query = function(seqid, input, output) {
var args = new BeeswaxService_query_args();
args.read(input);
input.readMessageEnd();
if (this._handler.query.length === 1) {
Q.fcall(this._handler.query.bind(this._handler),
args.query
).then(function(result) {
var result_obj = new BeeswaxService_query_result({success: result});
output.writeMessageBegin("query", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.BeeswaxException) {
result = new BeeswaxService_query_result(err);
output.writeMessageBegin("query", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("query", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.query(args.query, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.BeeswaxException) {
result_obj = new BeeswaxService_query_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("query", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("query", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_executeAndWait = function(seqid, input, output) {
var args = new BeeswaxService_executeAndWait_args();
args.read(input);
input.readMessageEnd();
if (this._handler.executeAndWait.length === 2) {
Q.fcall(this._handler.executeAndWait.bind(this._handler),
args.query,
args.clientCtx
).then(function(result) {
var result_obj = new BeeswaxService_executeAndWait_result({success: result});
output.writeMessageBegin("executeAndWait", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.BeeswaxException) {
result = new BeeswaxService_executeAndWait_result(err);
output.writeMessageBegin("executeAndWait", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("executeAndWait", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.executeAndWait(args.query, args.clientCtx, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.BeeswaxException) {
result_obj = new BeeswaxService_executeAndWait_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("executeAndWait", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("executeAndWait", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_explain = function(seqid, input, output) {
var args = new BeeswaxService_explain_args();
args.read(input);
input.readMessageEnd();
if (this._handler.explain.length === 1) {
Q.fcall(this._handler.explain.bind(this._handler),
args.query
).then(function(result) {
var result_obj = new BeeswaxService_explain_result({success: result});
output.writeMessageBegin("explain", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.BeeswaxException) {
result = new BeeswaxService_explain_result(err);
output.writeMessageBegin("explain", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("explain", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.explain(args.query, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.BeeswaxException) {
result_obj = new BeeswaxService_explain_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("explain", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("explain", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_fetch = function(seqid, input, output) {
var args = new BeeswaxService_fetch_args();
args.read(input);
input.readMessageEnd();
if (this._handler.fetch.length === 3) {
Q.fcall(this._handler.fetch.bind(this._handler),
args.query_id,
args.start_over,
args.fetch_size
).then(function(result) {
var result_obj = new BeeswaxService_fetch_result({success: result});
output.writeMessageBegin("fetch", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.QueryNotFoundException || err instanceof ttypes.BeeswaxException) {
result = new BeeswaxService_fetch_result(err);
output.writeMessageBegin("fetch", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("fetch", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.fetch(args.query_id, args.start_over, args.fetch_size, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.QueryNotFoundException || err instanceof ttypes.BeeswaxException) {
result_obj = new BeeswaxService_fetch_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("fetch", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("fetch", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_get_state = function(seqid, input, output) {
var args = new BeeswaxService_get_state_args();
args.read(input);
input.readMessageEnd();
if (this._handler.get_state.length === 1) {
Q.fcall(this._handler.get_state.bind(this._handler),
args.handle
).then(function(result) {
var result_obj = new BeeswaxService_get_state_result({success: result});
output.writeMessageBegin("get_state", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.QueryNotFoundException) {
result = new BeeswaxService_get_state_result(err);
output.writeMessageBegin("get_state", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_state", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.get_state(args.handle, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.QueryNotFoundException) {
result_obj = new BeeswaxService_get_state_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("get_state", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_state", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_get_results_metadata = function(seqid, input, output) {
var args = new BeeswaxService_get_results_metadata_args();
args.read(input);
input.readMessageEnd();
if (this._handler.get_results_metadata.length === 1) {
Q.fcall(this._handler.get_results_metadata.bind(this._handler),
args.handle
).then(function(result) {
var result_obj = new BeeswaxService_get_results_metadata_result({success: result});
output.writeMessageBegin("get_results_metadata", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.QueryNotFoundException) {
result = new BeeswaxService_get_results_metadata_result(err);
output.writeMessageBegin("get_results_metadata", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_results_metadata", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.get_results_metadata(args.handle, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.QueryNotFoundException) {
result_obj = new BeeswaxService_get_results_metadata_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("get_results_metadata", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_results_metadata", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_echo = function(seqid, input, output) {
var args = new BeeswaxService_echo_args();
args.read(input);
input.readMessageEnd();
if (this._handler.echo.length === 1) {
Q.fcall(this._handler.echo.bind(this._handler),
args.s
).then(function(result) {
var result_obj = new BeeswaxService_echo_result({success: result});
output.writeMessageBegin("echo", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("echo", Thrift.MessageType.EXCEPTION, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.echo(args.s, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new BeeswaxService_echo_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("echo", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("echo", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_dump_config = function(seqid, input, output) {
var args = new BeeswaxService_dump_config_args();
args.read(input);
input.readMessageEnd();
if (this._handler.dump_config.length === 0) {
Q.fcall(this._handler.dump_config.bind(this._handler)
).then(function(result) {
var result_obj = new BeeswaxService_dump_config_result({success: result});
output.writeMessageBegin("dump_config", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("dump_config", Thrift.MessageType.EXCEPTION, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.dump_config(function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new BeeswaxService_dump_config_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("dump_config", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("dump_config", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_get_log = function(seqid, input, output) {
var args = new BeeswaxService_get_log_args();
args.read(input);
input.readMessageEnd();
if (this._handler.get_log.length === 1) {
Q.fcall(this._handler.get_log.bind(this._handler),
args.context
).then(function(result) {
var result_obj = new BeeswaxService_get_log_result({success: result});
output.writeMessageBegin("get_log", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.QueryNotFoundException) {
result = new BeeswaxService_get_log_result(err);
output.writeMessageBegin("get_log", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_log", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.get_log(args.context, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.QueryNotFoundException) {
result_obj = new BeeswaxService_get_log_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("get_log", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_log", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_get_default_configuration = function(seqid, input, output) {
var args = new BeeswaxService_get_default_configuration_args();
args.read(input);
input.readMessageEnd();
if (this._handler.get_default_configuration.length === 1) {
Q.fcall(this._handler.get_default_configuration.bind(this._handler),
args.include_hadoop
).then(function(result) {
var result_obj = new BeeswaxService_get_default_configuration_result({success: result});
output.writeMessageBegin("get_default_configuration", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_default_configuration", Thrift.MessageType.EXCEPTION, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.get_default_configuration(args.include_hadoop, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new BeeswaxService_get_default_configuration_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("get_default_configuration", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("get_default_configuration", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_close = function(seqid, input, output) {
var args = new BeeswaxService_close_args();
args.read(input);
input.readMessageEnd();
if (this._handler.close.length === 1) {
Q.fcall(this._handler.close.bind(this._handler),
args.handle
).then(function(result) {
var result_obj = new BeeswaxService_close_result({success: result});
output.writeMessageBegin("close", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
if (err instanceof ttypes.QueryNotFoundException || err instanceof ttypes.BeeswaxException) {
result = new BeeswaxService_close_result(err);
output.writeMessageBegin("close", Thrift.MessageType.REPLY, seqid);
} else {
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("close", Thrift.MessageType.EXCEPTION, seqid);
}
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.close(args.handle, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined') || err instanceof ttypes.QueryNotFoundException || err instanceof ttypes.BeeswaxException) {
result_obj = new BeeswaxService_close_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("close", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("close", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};
BeeswaxServiceProcessor.prototype.process_clean = function(seqid, input, output) {
var args = new BeeswaxService_clean_args();
args.read(input);
input.readMessageEnd();
if (this._handler.clean.length === 1) {
Q.fcall(this._handler.clean.bind(this._handler),
args.log_context
).then(function(result) {
var result_obj = new BeeswaxService_clean_result({success: result});
output.writeMessageBegin("clean", Thrift.MessageType.REPLY, seqid);
result_obj.write(output);
output.writeMessageEnd();
output.flush();
}).catch(function (err) {
var result;
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("clean", Thrift.MessageType.EXCEPTION, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
});
} else {
this._handler.clean(args.log_context, function (err, result) {
var result_obj;
if ((err === null || typeof err === 'undefined')) {
result_obj = new BeeswaxService_clean_result((err !== null || typeof err === 'undefined') ? err : {success: result});
output.writeMessageBegin("clean", Thrift.MessageType.REPLY, seqid);
} else {
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
output.writeMessageBegin("clean", Thrift.MessageType.EXCEPTION, seqid);
}
result_obj.write(output);
output.writeMessageEnd();
output.flush();
});
}
};