'}]);
client.end();
});
});
app.get('/summary_bulk', function(req, res){
var client = shibclient(req);
if (shib.setting('disable_history')) {
res.send({disabled: true});
return;
}
var history_queries;
var history = []; /* ["201302", "201301", "201212", "201211"] */
var history_ids = {}; /* {"201302":[query_ids], "201301":[query_ids], ...} */
var query_ids = []; /* [query_ids of all months] */
var fetchRecent = function(cb){
client.recentQueries(RECENT_FETCHES, function(err, list){ // list: [Query, ...]
if (err) { cb(err); return; }
history_queries = list;
cb(null);
});
};
var bundleMonths = function(cb){ // [{yyyymm:...,queryid:....}] => {yyyymm:[queryids], yyyymm:[queryids]}
var pad = function(n){return n < 10 ? '0'+n : n;};
var historyKey = function(date){
return '' + date.getFullYear() + pad(date.getMonth() + 1);
};
history_queries.forEach(function(query){
var month = historyKey(query.datetime);
if (history.indexOf(month) < 0)
history.push(month);
if (! history_ids[month])
history_ids[month] = [];
history_ids[month].push(query.queryid);
query_ids.push(query.queryid);
});
history.sort().reverse();
cb(null);
};
var queryUnique = function(cb){
var exist_ids = {};
query_ids = query_ids.filter(function(id){ if (exist_ids[id]) return false; exist_ids[id] = true; return true;});
cb(null);
};
async.series([fetchRecent, bundleMonths, queryUnique], function(err, results){
if (err) { error_handle(req, res, err); return; }
res.send({history: history, history_ids: history_ids, query_ids: query_ids});
});
});
// generate pseudo query object (simulate v0 query)
function pseudo_query_data(query){
var q = {};
q['queryid'] = query.queryid;
q['engine'] = query.engine;
q['dbname'] = query.dbname;
q['querystring'] = query.querystring;
q['results'] = [];
if (query.state !== "running") {
q['results'] = [{resultid: query.resultid, executed_at: new Date(query.datetime).toLocaleString()}];
}
return q;
}
app.post('/execute', function(req, res){
var auth = shib.auth();
var client = shibclient(req);
var engineLabel = req.body.engineLabel;
var dbname = req.body.dbname;
if (!engineLabel || !dbname) {
engineLabel = enginesCache.pairs[0][0];
dbname = enginesCache.pairs[0][1];
}
var querystring = req.body.querystring;
var scheduled = req.body.scheduled;
var userdata = auth.userdata(req);
if (auth.require_always && !userdata) {
shib.logger().warn('This shib requires authentication to execute queries, but there are no authInfo', {query: querystring});
res.send(403, "Authentication failed");
return;
}
if (userdata) {
shib.logger().info('User try to execute query', {username: userdata.username, query: querystring});
}
client.createQuery(engineLabel, dbname, querystring, scheduled, userdata, function(err, query){
if (err) {
if (err.error) {
err = err.error;
}
if (err instanceof InvalidQueryError) {
shib.logger().warn('Invalid query submitted', {query: querystring, err: err.message});
res.send(400, err.message);
this.end();
return;
}
error_handle(req, res, err); return;
}
res.send(pseudo_query_data(query));
var queryid = query.queryid;
this.execute(query, {
prepare: function(){ runningQueries[queryid] = new Date(); },
stopCheck: function(){ return (! runningQueries[queryid]); },
stop: function(){ client.end(); },
success: function(){ delete runningQueries[queryid]; client.end(); },
error: function(){ delete runningQueries[queryid]; client.end(); }
});
});
});
app.post('/giveup', function(req, res){
var targetid = req.body.queryid;
var client = shibclient(req);
client.query(targetid, function(err, query){
client.giveup(query, function(err, query) {
if (err) {error_handle(req, res, err); client.end(); return;}
client.end(true); // half close
delete runningQueries[query.queryid];
res.send(pseudo_query_data(query));
});
});
});
app.post('/delete', function(req, res){
var targetid = req.body.queryid;
var client = shibclient(req);
delete runningQueries[targetid];
client.deleteQuery(targetid, function(err){
if (err) {error_handle(req, res, err); client.end(); return;}
res.send({result:'ok'});
client.end();
});
});
//TODO: any APIs w/o pseudo_query_data ?
app.get('/query/:queryid', function(req, res){
shibclient(req).query(req.params.queryid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send('query not found', 404);
this.end();
return;
}
res.send(pseudo_query_data(query));
this.end();
});
});
app.post('/queries', function(req, res){
shibclient(req).queries(req.body.ids, function(err, queries){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send({queries: queries.map(function(q){ return pseudo_query_data(q); })});
this.end();
});
});
app.get('/tags/:queryid', function(req, res){
shibclient(req).tags(req.params.queryid, function(err, tags){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send(tags);
this.end();
});
});
app.post('/addtag', function(req, res){
var tag = req.body.tag;
if (tag.length < 1 || tag.length > 16) {
error_handle(req, res, {message: 'invalid tag length [1-16]'});
return;
}
shibclient(req).addTag(req.body.queryid, tag, function(err){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send({result:'ok'});
this.end();
});
});
app.post('/deletetag', function(req, res){
shibclient(req).deleteTag(req.body.queryid, req.body.tag, function(err){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send({result:'ok'});
this.end();
});
});
app.get('/tagged/:tag', function(req, res){
shibclient(req).taggedQueries(req.params.tag, function(err, queryids){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send(queryids);
this.end();
});
});
app.get('/taglist', function(req, res){
shibclient(req).tagList(function(err, tags){
if (err) { error_handle(req, res, err); this.end(); return; }
res.send(tags);
this.end();
});
});
// convert query.state into status label (simulate v0 Client.prototype.status)
function pseudo_status(query_state){
/*
running: newest-and-only query running, and result not stored yet.
executed (done): newest query executed, and result stored.
error: newest query executed, but done with error.
*/
switch (query_state) {
case 'running': return "running";
case 'error': return "error";
default: return "executed";
}
}
app.get('/status/:queryid', function(req, res){
shibclient(req).query(req.params.queryid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send('query not found', 404);
this.end();
return;
}
res.send(pseudo_status(query.state));
this.end();
});
});
app.get('/detailstatus/:queryid', function(req, res){
shibclient(req).query(req.params.queryid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
this.detailStatus(query, function(err, data){
if (err) { error_handle(req, res, err); this.end(); return; }
if (data === null)
res.send('query not found', 404);
else
res.send(data);
this.end();
});
});
});
// generate pseudo result object (simulate v0 result)
function pseudo_result_data(query){
var r = query.result;
r['resultid'] = query.resultid;
r['executed_at'] = new Date(query.datetime).toLocaleString();
if (r['completed_at'])
r['completed_at'] = new Date(r['completed_at']).toLocaleString();
r['state'] = query.state;
return r;
}
app.get('/lastresult/:queryid', function(req, res){
shibclient(req).query(req.params.queryid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send('query not found', 404);
this.end();
return;
}
res.send(pseudo_result_data(query));
this.end();
});
});
app.get('/result/:resultid', function(req, res){
shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send('query not found', 404);
this.end();
return;
}
res.send(pseudo_result_data(query));
this.end();
});
});
app.post('/results', function(req, res){
/*
* obsolete: bad implementation for API compatibility
*/
var client = shibclient(req);
var fetchers = (req.body.ids || []).map(function(resultid){
return function(cb){
client.getQueryByResultId(resultid, function(err, query){
if (query === null) {
res.send('query not found', 404);
this.end();
return;
}
if (err) { cb(err); return; }
cb(null, pseudo_result_data(query));
});
};
});
async.series(fetchers, function(err, results){
if (err) { error_handle(req, res, err); client.end(); return; }
res.send({results: results});
client.end();
});
});
app.get('/show/full/:resultid', function(req, res){
var client = shibclient(req);
var file = client.generatePath(req.params.resultid);
if (! fs.existsSync(file)) {
res.send(null);
res.end();
client.end();
return;
}
res.sendfile(file)
});
app.get('/show/head/:resultid', function(req, res){
var client = shibclient(req);
var file = client.generatePath(req.params.resultid);
if (! fs.existsSync(file)) {
res.send(null);
res.end();
client.end();
return;
}
var rStream = fs.createReadStream(file);
var readline = require('readline');
var rl = readline.createInterface(rStream, {});
var line_number = 0;
rl.on('line', function(line) {
if (line_number < SHOW_RESULT_HEAD_LINES) {
res.write(line + '\n');
line_number++;
} else {
rl.close();
}
});
rl.on('close', function() {
res.end();
client.end();
});
res.on('resume', function() {
rl.resume();
});
});
app.get('/download/tsv/:resultid', function(req, res){
shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send(null);
this.end();
return;
}
res.attachment(req.params.resultid + '.tsv');
res.set('X-Shib-Query-ID', query.queryid);
res.set('X-Shib-Result-ID', query.resultid);
res.set('X-Shib-Executed-At', new Date(query.datetime).getTime());
res.set('X-Shib-Completed-At', query.result.completed_msec || 0);
var client = shib.client();
var file = client.generatePath(req.params.resultid);
if (! fs.existsSync(file)) {
res.send(null);
res.end();
client.end();
return;
}
res.sendfile(file)
});
});
app.get('/download/csv/:resultid', function(req, res){
shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){
if (err) { error_handle(req, res, err); this.end(); return; }
if (query === null) {
res.send(null);
this.end();
return;
}
res.attachment(req.params.resultid + '.csv');
res.set('X-Shib-Query-ID', query.queryid);
res.set('X-Shib-Result-ID', query.resultid);
res.set('X-Shib-Executed-At', new Date(query.datetime).getTime());
res.set('X-Shib-Completed-At', query.result.completed_msec || 0);
var client = shib.client();
var file = client.generatePath(req.params.resultid);
if (! fs.existsSync(file)) {
res.send(null);
res.end();
client.end();
return;
}
var rStream = fs.createReadStream(file);
var readline = require('readline');
var rl = readline.createInterface(rStream, {});
rl.on('line', function(line){
res.write(SimpleCSVBuilder.build(line.split('\t')));
});
rl.on('close', function(){
res.end();
client.end();
});
res.on('resume', function(){
rl.resume();
});
});
});
shib.auth(); // to initialize and check auth module
shib.client().end(); // to initialize sqlite3 database
shib.logger().info('Starting shib.');
if (! shib.auth().require_always){
var d = require('domain').create();
d.on('error', function(err){
// Failed to update engine cache
// This may occur by communication errors w/ servers
if (err.code === 'ECONNREFUSED') {
var e = err.domainEmitter;
shib.logger().error('Connection refused', {host: e.host, port: e.port});
} else {
shib.logger().error('In domain creation', err);
}
process.exit();
});
d.run(function(){
var enginesCacheUpdate = function(){
var AccessControl = require('shib/access_control').AccessControl;
// generate cache w/ all engines and databases forcely
// this cache isn't used for the situation configured as auth:require_always
shib.client({credential: AccessControl.defaultAllowDelegator()}).engineInfo(function(err, info){
if (!err && info)
enginesCache = info;
this.end();
});
};
setInterval(enginesCacheUpdate, 60*60*1000); // cache update per hour
enginesCacheUpdate();
});
}
app.listen(app.get('port'));
================================================
FILE: bin/dbmigrate.js
================================================
var async = require('async')
, fs = require('fs')
, sqlite3 = require('sqlite3');
var target_db_path = process.argv[2];
if (! target_db_path) {
console.log("USAGE: npm run migrate");
console.log(" OR: npm run dbmigrate -- DATABASE_FILE_PATH");
console.log(" : node bin/dbmigrate.js DATABASE_FILE_PATH (if your npm --version is 1.x)");
process.exit(0);
}
var migrate_db_path = target_db_path + ".migrate";
/*
var SQLITE_TABLE_DEFINITIONS_v0 = [
'CREATE TABLE IF NOT EXISTS queries (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',
'CREATE TABLE IF NOT EXISTS results (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',
'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',
'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
];
*/
var SQLITE_TABLE_DEFINITIONS_v1 = [
'CREATE TABLE IF NOT EXISTS queries (autoid INTEGER PRIMARY KEY AUTOINCREMENT, id VARCHAR(32) NOT NULL UNIQUE, datetime TEXT NOT NULL, scheduled INTEGER DEFAULT NULL, engine TEXT DEFAULT NULL, dbname DEFAULT NULL, expression TEXT NOT NULL, state VARCHAR(32) NOT NULL, resultid VARCHAR(32) NOT NULL UNIQUE, result DEFAULT NULL)',
'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
];
var on_connect = function(cb){
async.series(SQLITE_TABLE_DEFINITIONS_v1.map(function(sql){
return function(callback) {
migrate.run(sql, function(error){
if (error) { callback(error.message); return; }
callback(null);
});
};
}), function(err,results){
if (err)
throw "failed to initialize new db file: " + migrate_db_path;
cb();
});
};
var original;
var migrate;
var open_original = function(cb){
original = new sqlite3.Database(target_db_path, sqlite3.OPEN_READONLY, function(err){
if (err) { cb(err); return; }
cb(null);
});
};
var close_original = function(cb){
original.close(function(){ cb(null); });
};
var open_migrate = function(cb){
migrate = new sqlite3.Database(migrate_db_path, (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE), function(err){
if (err) { cb(err); return; }
on_connect(function(){ cb(null); });
});
};
var close_migrate = function(cb){
migrate.close(function(){ cb(null); });
};
var migrate_tags = function(cb){
original.all('SELECT queryid, tag FROM tags ORDER BY id', function(err, rows){
if (err) {
cb(err);
return;
}
async.series(rows.map(function(row){
return function(cb){
migrate.run('INSERT INTO tags (queryid, tag) VALUES (?,?)', [row.queryid, row.tag], function(err){
cb(err);
});
};
}), function(err, results){
cb(err);
});
});
};
var history = {}; // queryid => true
var store_history = function(cb){
// 'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',
original.all('SELECT yyyymm, queryid FROM history', function(err, rows){
if (err) { cb(err); return; }
var size = rows.length - 1;
for (var i = 0 ; i < size ; i++){
history[rows[i].queryid] = true;
}
cb(null);
});
};
var results = {}; // resultid -> obj
var store_results = function(cb){
original.all('SELECT id, json FROM results', function(err, rows){
if (err) { cb(err); return; }
var size = rows.length - 1;
var row = null;
for (var i = 0 ; i < size ; i++){
row = rows[i];
results[row.id] = row.json;
};
cb(null);
});
};
var migrate_queries = function(cb){
original.all('SELECT id, json FROM queries', function(err, rows_original){
if (err) {
cb(err);
return;
}
var rows = rows_original.filter(function(row){
var json = row.json;
if (json) {
var r = JSON.parse(json).results.concat().pop();
if (r && results[r.resultid])
return true;
}
return false;
}).map(function(row){
var obj = JSON.parse(row.json);
var result = obj.results.pop();
var result_obj = JSON.parse(results[result.resultid]);
var state = result_obj['state'];
delete result_obj['state'];
delete result_obj['queryid'];
delete result_obj['resultid'];
return {
id: row.id,
scheduled: (history[row.id] ? 1 : null),
engine: obj.engine,
dbname: obj.dbname,
expression: obj.querystring,
state: state,
resultid: result.resultid,
result_json: JSON.stringify(result_obj),
date: new Date(result.executed_at).toJSON()
};
});
rows.sort(function(a, b){ return a.date - b.date; });
async.series(rows.map(function(obj){
return function(cb) {
migrate.run(
'INSERT INTO queries (id,datetime,scheduled,engine,dbname,expression,state,resultid,result) VALUES (?,?,?,?,?,?,?,?,?)',
[obj.id, obj.date, obj.scheduled, obj.engine, obj.dbname, obj.expression, obj.state, obj.resultid, obj.result_json],
function(err){ cb(err); }
);
};
}), function(err, results){ cb(err); });
});
};
async.series([
open_original,
open_migrate,
migrate_tags,
store_history,
store_results,
migrate_queries,
close_original,
close_migrate
], function(err, results){
if (err) {
console.log(err);
throw "failed to migrate database...";
}
fs.renameSync(target_db_path, target_db_path + ".v0");
fs.renameSync(migrate_db_path, target_db_path);
});
================================================
FILE: bin/purge.js
================================================
var async = require('async')
, fs = require('fs')
, sqlite3 = require('sqlite3');
if (process.argv.length < 4) {
console.log("USAGE: npm run purge -- DAYS_PURGE_BEFORE");
console.log(" OR: node bin/purge.js DATABASE_FILE_PATH DAYS_PURGE_BEFORE (if your npm --version is 1.x)");
console.log("");
console.log("NOTICE: result data files under DATADIR/results should be removed by yourself.");
console.log(" (ex: find var/results -mtime ... | xargs rm)");
process.exit(0);
}
var target_db_path = process.argv[2];
var purge_days_before = parseInt(process.argv[3]);
if (purge_days_before < 3) {
console.log("ERROR: DAYS_PURGE_BEFORE must be larger than 7, but: " + process.argv[3]);
process.exit(1);
}
var SQLITE_TABLE_DEFINITIONS_v1 = [
'CREATE TABLE IF NOT EXISTS queries (autoid INTEGER PRIMARY KEY AUTOINCREMENT, id VARCHAR(32) NOT NULL UNIQUE, datetime TEXT NOT NULL, engine TEXT DEFAULT NULL, dbname DEFAULT NULL, expression TEXT NOT NULL, state VARCHAR(32) NOT NULL, resultid VARCHAR(32) NOT NULL UNIQUE, result DEFAULT NULL)',
'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
];
var db = null;
var open_db = function(cb){
db = new sqlite3.Database(target_db_path, (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE), function(err){
cb(err);
});
};
var close_db = function(cb){
db.close(function(){ cb(null); });
};
var delete_rows = function(cb){
var purge_threshold_datetime = new Date(new Date() - purge_days_before * 1000 * 86400).toJSON();
db.run('DELETE FROM queries WHERE datetime < ?', [purge_threshold_datetime], function(err){ cb(err); });
};
var vacuum = function(cb){
db.run('VACUUM', function(err){ cb(err); });
};
async.series([
open_db,
delete_rows,
vacuum,
close_db
], function(err, results){
if (err) {
console.log(err);
throw "failed to purge old data and vacuum...";
}
});
================================================
FILE: config.js
================================================
var servers = exports.servers = {
listen: 3000,
fetch_lines: 1000,
query_timeout: null, // seconds. (null:shib will wait query response infinitely).
setup_queries: [],
storage: {
datadir: './var'
},
executer: {
name: 'hiveserver', // or 'hiveserver2', 'presto', 'bigquery'
host: 'localhost',
port: 10000,
support_database: true,
default_database: 'default'
/*
// If you use 'bigquery' executer, set following values
project_id: 'project_id',
key_filename: '/path/to/keyfile.json'
*/
},
monitor: null
/*
monitor: {
name : 'huahin_mrv1', // or 'presto'
host: 'localhost',
port: 9010
}
*/
};
================================================
FILE: examples/hive_beeline_client.js
================================================
// NODE_PATH=lib node example/hive_beeline_client.js
var thrift = require('node-thrift')
, ttransport = require('node-thrift/lib/thrift/transport')
, TCLIService = require('shib/engines/hiveserver2/TCLIService')
, TTypes = require('shib/engines/hiveserver2/TCLIService_types');
var MaxRows = 10000;
var fetchOperationResult = function(op, err, res, callback) {
console.log({seq:'fetchOperationResult', op:op, err:err, res:res});
if (err) { callback(err); return; }
if (!res || !res['status'] || res.status['statusCode'] !== 0) {
callback({err:'Failed to operate "' + op + '"', res:res, status: (res && res['status'] && res.status['statusCode'])});
return;
}
var oph = res.operationHandle;
var POLLING_INTERVAL = 50; // 50ms
var poller = function(){
console.log({seq:'GetOperationStatus', op:op});
client.GetOperationStatus(new TTypes.TGetOperationStatusReq({operationHandle:oph}), function(err, res){
console.log({seq:'GetOperationStatus', op:op, err:err, res:res});
if (err) { callback(err); return; }
var statusCode = res && res['status'] && res.status.statusCode;
if (statusCode === TTypes.TStatusCode['STILL_EXECUTING_STATUS']) {
setTimeout(poller, POLLING_INTERVAL);
return;
}
if (statusCode !== TTypes.TStatusCode['SUCCESS_STATUS'] &&
statusCode !== TTypes.TStatusCode['STATUS_WITH_INFO_STATUS']) {
if (statusCode === TTypes.TStatusCode['ERROR_STATUS']) {
callback({err:'ERROR_STATUS', status:res.status});
} else if (statusCode === TTypes.TStatusCode['INVALID_HANDLE_STATUS']) {
callback({err:'INVALID_HANDLE_STATUS', status:res.status});
} else {
callback({err:'UNKNOWN STATUS:' + statusCode, status:res.status});
}
client.CloseOperation(new TTypes.TCloseOperationReq({operationHandle:oph}), function(err, res){
return err || res && res['status'];
});
}
/* success */
if (res.status.statusCode === TTypes.TStatusCode['STATUS_WITH_INFO_STATUS']) {
console.log({req:'withInfoStatus', res:res}); // TODO: what is WITH_INFO_STATUS ?
}
client.FetchResults(new TTypes.TFetchResultsReq({operationHandle:oph, maxRows:MaxRows}), function(err, res){
if (err) { callback(err); return; }
console.log({seq:'FetchResults', op:op, err:err, res:res});
if (res.hasMoreRows)
throw "Operation hasMoreRow, type:" + oph.operationType;
var results = res.results;
client.CloseOperation(new TTypes.TCloseOperationReq({operationHandle:oph}), function(err, res){
callback(null, results);
return;
});
});
});
};
setTimeout(poller, POLLING_INTERVAL);
};
/* hive.server2.authentication='NOSASL' or SASLTransport ... */
var connection = thrift.createConnection("server.name.local", 10001, {transport: ttransport.TBufferedTransport, timeout: 600*1000});
var client = thrift.createClient(TCLIService, connection);
connection.on('error', function(err){ console.error(err); });
connection.addListener("connect", function(){ console.log("connected"); });
client.OpenSession(new TTypes.TOpenSessionReq({username: '', password: ''}), function(err,res){
var sessionHandle = res.sessionHandle;
var treq = new TTypes.TGetTablesReq({sessionHandle:sessionHandle});
client.GetTables(treq, function(e,r){ fetchOperationResult('GetTables', e, r, function(err, res){
console.log([err, res]);
console.log(JSON.stringify(res.rows, null, 4));
var sreq = new TTypes.TGetSchemasReq({sessionHandle:sessionHandle});
client.GetSchemas(sreq, function(e,r){ fetchOperationResult('GetSchemas', e, r, function(err, res){
console.log([err, res]);
console.log(JSON.stringify(res.rows, null, 4));
var creq = new TTypes.TCloseSessionReq({sessionHandle:sessionHandle});
client.CloseSession(creq, function(e,r){ connection.end(); });
}); });
}); });
/*
var q = 'select service, count(*) as cnt from access_log where service="servic_ename" and yyyymmdd="20130210" group by service';
var req = new TTypes.TExecuteStatementReq({sessionHandle: sessionHandle, statement: q});
client.ExecuteStatement(req, function(e,r){ fetchOperationResult('ExecuteStatement', e, r, function(err,rows){
console.log({err:err, rows:rows});
var creq = new TTypes.TCloseSessionReq({sessionHandle:sessionHandle});
client.CloseSession(creq, function(e,r){ connection.end(); });
}); });
*/
});
/*
http://www.slideshare.net/schubertzhang/hiveserver2/7
ExecuteStatement
TExecuteStatementReq(sessionHandle, statement, confOverlay)
TExecuteStatementResp(status, operationHandle)
GetResultSetMetadata
TGetResultSetMetadataReq(operationHandle)
TGetResultSetMetadataResp(status, schema)
FetchResults
TFetchResultsReq(operationHandle, orientation = 0, maxRows)
TFetchResultsResp(status, hasMoreRows, results)
GetCatalogs : "Catalog: do nothing so far"
TGetCatalogsReq(sessionHandle)
TGetCatalogsResp(status, operationHandle)
GetSchemas
TGetSchemasReq(sessionHandle, catalogName, schemaName)
TGetSchemasResp(status, operationHandle)
GetTableTypes
TGetTableTypesReq(sessionHandle)
TGetTableTypesResp(status, operationHandle)
GetTables
TGetTablesReq(sessionHandle, catalogName, schemaName, tableName, tableTypes)
TGetTablesResp(status, operationHandle)
GetColumns
TGetColumnsReq(sessionHandle, catalogName, schemaName, tableName, columnName)
TGetColumnsResp(status, operationHandle)
GetFunctions
TGetFunctionsReq(sessionHandle, catalogName, schemaName, functionName)
TGetFunctionsResp(status, operationHandle)
OpenSession
TOpenSessionReq(username, password, configuration)
TOpenSessionResp(status, serverProtocol, sessionHandle, configuration)
CloseSession
TCloseSessionReq(sessionHandle)
GetInfo
TGetInfoReq(sessionHandle, infoType)
TGetInfoResp(status, infoValue)
GetTypeInfo
TGetTypeInfoReq(sessionHandle)
TGetTypeInfoResp(status, operationHandle)
GetOperationStatus
TGetOperationStatusReq(operationHandle)
TGetOperationStatusResp(status, operationState)
GetCancelOperation
TCancelOperationReq(operationHandle)
TCancelOperationResp(status)
CloseOperation
TCloseOperationReq(operationHandle)
TCloseOperationResp(status)
オマケ: SessionHandle と OperationHandle
TSessionHandle(sessionId)
TOperationHandle(operationId, operationType, hasResultSet, modifiedRowCount)
*/
================================================
FILE: examples/hive_client.js
================================================
var thrift = require('thrift'),
ttransport = require('thrift/transport'),
ThriftHive = require('./gen-nodejs/ThriftHive');
var connection = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 600*1000}),
client = thrift.createClient(ThriftHive, connection);
connection.on('error', function(err) {
console.error(err);
});
connection.addListener("connect", function() {
client.execute('select count(*) from p', function(err){
console.error("pos");
if (err) { console.error("error on execute(): " + err); process.exit(1); }
client.fetchAll(function(err, data){
if (err){ console.error("error on fetchAll(): " + err); process.exit(1); }
console.error(data);
connection.end();
process.exit(0);
});
});
});
================================================
FILE: examples/hive_methods.js
================================================
var thrift = require('thrift'),
ttransport = require('thrift/transport'),
ThriftHive = require('gen-nodejs/ThriftHive');
var connection = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 600*1000}),
client = thrift.createClient(ThriftHive, connection);
connection.on('error', function(err) {
console.error(err);
});
connection.addListener("connect", function() {
client.getClusterStatus(function(err, data){
console.log("getClusterStatus:", data);
client.execute('select x, count(*) as cnt from p group by x sort by cnt limit 10', function(err){
if (err) { console.error("error on execute(): " + err); process.exit(1); }
client.getQueryPlan(function(err, data){
console.log("getQueryPlan:", data);
console.log("queryplan queryAttributes:", data.queries[0].queryAttributes);
console.log("queryplan stageGraph:", data.queries[0].stageGraph);
console.log("queryplan stageGraph adjacencyList children:", data.queries[0].stageGraph.adjacencyList[0].children);
console.log("queryplan stageList:", data.queries[0].stageList);
console.log("queryplan stageList taskList:", data.queries[0].stageList[0].taskList[0]);
console.log("queryplan stageList taskList operatorGraph adjacencyList:", data.queries[0].stageList[0].taskList[0].operatorGraph.adjacencyList);
client.getSchema(function(err, data){
console.log("getSchema:", data);
client.getThriftSchema(function(err,data){
console.log("getThriftSchema:", data);
client.fetchAll(function(err, data){
if (err){ console.error("error on fetchAll(): " + err); process.exit(1); }
console.log("fetchAll:", data);
connection.end();
process.exit(0);
});
});
});
});
});
});
});
================================================
FILE: examples/hive_multi_client.js
================================================
var thrift = require('thrift'),
ttransport = require('thrift/transport'),
ThriftHive = require('gen-nodejs/ThriftHive');
var connection1 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}),
client1 = thrift.createClient(ThriftHive, connection1);
var connection2 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}),
client2 = thrift.createClient(ThriftHive, connection2);
connection1.on('error', function(err){ console.error(err); });
connection2.on('error', function(err){ console.error(err); });
var query1 = 'select x, count(*) from p group by x';
var query2 = 'select x, count(*) as cnt, "hoge" from p group by x sort by cnt desc limit 30';
var done1 = false;
var done2 = false;
var run_test = function(conn, client, query, label, wait, callback) {
var func = function(){
console.log(label, "executing.");
client.execute(query, function(err){
console.log(label, "executed.");
if (err){ console.error(label, "error on execute():", err); }
client.fetchAll(function(err, data){
console.log(label, "fetched.");
if (err){ console.error(label, "error on fetchAll():", err); }
console.log(label, "result:", data);
callback();
});
});
};
conn.addListener("connect", function(){
console.log(label, "connected.");
setTimeout(func, wait);
});
};
run_test(connection1, client1, query1, "conn1:", 5000, function(){ done1 = true; });
run_test(connection2, client2, query2, "conn2:", 1000, function(){ done2 = true; });
setInterval(function(){
if (done1 && done2){
connection1.end();
connection2.end();
process.exit(0);
}
}, 1000);
================================================
FILE: examples/hive_server2_engine.example.js
================================================
var engine = require('shib/engines/hiveserver2');
var executer = new engine.Executer({"name":"hiveserver2", "host":"hiveserver2.server.local", "port":10001});
executer.execute(
'jobname',
'select service, count(*) as cnt, false, 0.01, 1, array(1,2,3) as a from access_log where (service="blog" or service="news") and yyyymmdd="20121122" group by service',
function(err, fetcher){
console.log({op:'execute', err:err, fetcher:fetcher});
if (err) return;
fetcher.schema(function(err,schema){
if (err) {
console.log(JSON.stringify(err, null, " "));
return;
}
console.log(JSON.stringify(schema, null, " "));
fetcher.fetch(null, function(err, rows){
console.log({op:'fetch', err:err, rows:rows});
console.log(JSON.stringify(rows, null, " "));
});
});
}
);
executer.execute(
null,
'show tables',
function(err, fetcher){
console.log({op:'execute', err:err, fetcher:fetcher});
if (err) {
console.log(JSON.stringify(err, null, " "));
return;
}
fetcher.schema(function(err,res){
if (err) {
console.log(JSON.stringify(err, null, " "));
return;
}
console.log(JSON.stringify(res, null, " "));
fetcher.fetch(null, function(err, rows){
console.log({op:'fetch', err:err, rows:rows});
console.log(JSON.stringify(rows, null, " "));
});
});
}
);
executer.execute(
null,
'show tables',
function(err, fetcher){
console.log({op:'execute', err:err, fetcher:fetcher});
fetcher.fetch(null, function(err, rows){
console.log({op:'fetch', err:err, rows:rows});
});
}
);
executer.execute(
null,
'show tables',
function(err, fetcher){
console.log({op:'execute', err:err, fetcher:fetcher});
fetcher.schema(function(err, schema){
console.log({op:'schema', err:err, schema:schema});
fetcher.fetch(null, function(err, rows){
console.log({op:'fetch', err:err, rows:rows});
});
});
}
);
================================================
FILE: examples/hive_server2_results.js
================================================
/*
* GetTables
* rows: [ table_items ]
* table_items: [ ???(catalog?), database(schema?), tablename, tabletype, ??? ]
*/
/*
[
{
"colVals": [
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": ""
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "default"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "access_log"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "MANAGED_TABLE"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": null
}
}
]
},
{
"colVals": [
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": ""
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "default"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "pageviews"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "MANAGED_TABLE"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": null
}
}
]
},
{
"colVals": [
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": ""
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "default"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "hourly_log"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "MANAGED_TABLE"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": null
}
}
]
}
]
*/
/*
* GetSchemas
*/
/*
[
{
"colVals": [
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": "default"
}
},
{
"boolVal": null,
"byteVal": null,
"i16Val": null,
"i32Val": null,
"i64Val": null,
"doubleVal": null,
"stringVal": {
"value": ""
}
}
]
}
]
*/
================================================
FILE: lib/shib/access_control.js
================================================
var AccessControl = exports.AccessControl = function(config){
this.default_rule = config['default'] || "allow";
this.databases = config['databases'] || {};
};
AccessControl.prototype.allowed = function(tablename, dbname){
var dbconf = this.databases[dbname];
if (! dbconf)
return (this.default_rule === "allow");
return this.checkDBPrivilege(dbconf, tablename);
};
AccessControl.prototype.visible = function(dbname){
if (! this.databases[dbname])
return (this.default_rule === "allow");
// this.databases[dbname] exists
var dbrule = this.databases[dbname];
if (dbrule['default'] === "deny" && (dbrule.allow || []).length < 1)
// specified db configured db-scope denied
return false;
// visible tables are exists -> db visible
return true;
};
AccessControl.prototype.checkDBPrivilege = function(dbconf, tablename){
if (dbconf['default'] === "allow") {
var deny = dbconf.deny || [];
return ( deny.indexOf(tablename) === -1 );
} else { // default deny
var allow = dbconf.allow || [];
return ( allow.indexOf(tablename) >= 0 );
}
};
AccessControl.defaultDenyDelegator = function(){
var delegator = new function(){
this.allowed = function(t,d){return false;};
this.visible = function(d){return false;};
};
return delegator;
};
AccessControl.defaultAllowDelegator = function(){
var delegator = new function(){
this.allowed = function(t,d){return true;};
this.visible = function(d){return true;};
};
return delegator;
};
================================================
FILE: lib/shib/auth/dumb.js
================================================
var Auth = exports.Auth = function(args){
};
Auth.prototype.check = function(req, callback) {
callback(null, {username: req.body.username, password: req.body.password});
};
Auth.prototype.acl_delegators = function(required_always, username, req) {
// allowed(tablename, dbname), visible(dbname)
return [function(t,d){return true;}, function(d){return true;}];
};
================================================
FILE: lib/shib/auth/http_basic_auth.js
================================================
var url = require('url')
, http = require('http')
, https = require('https');
var AccessControl = require('shib/access_control').AccessControl;
var Auth = exports.Auth = function(args, logger){
this.logger = logger;
var parsed = {};
if (args.url) {
parsed = url.parse(args.url);
/*
{ protocol: 'http:',
slashes: true,
auth: null,
host: 'localhost',
port: null,
hostname: 'localhost',
hash: null,
search: null,
query: null,
pathname: '/path',
path: '/path',
href: 'http://localhost/path' }
*/
}
this._url = parsed.href || args.url;
this._method = args.method || 'GET';
this._hostname = args.host || parsed.hostname;
this._port = args.port || parsed.port || 80;
this._path = args.path || '/'; // including query string
var protocol = args.protocol || parsed.protocol || 'http';
this._client = http;
if (protocol === 'https' || protocol === 'https:')
this._client = https;
if (! this._hostname || ! this._path)
throw "basic auth target host/path not speicifed";
this._acl_config = args.access_control;
};
Auth.prototype.check = function(req, callback) {
var username = req.body.username;
var password = req.body.password;
if (!username || !password) {
callback(null, false);
return;
}
var auth_string = username + ':' + password;
var options = {
hostname: this._hostname,
port: this._port,
method: this._method,
path: this._path,
auth: auth_string
};
var authreq = this._client.request(options, function(res){
var success = false;
if (res.statusCode == 200) {
success = {username: username, password: password};
}
var waiting = true;
res.on('data', function(){
if (waiting) {
waiting = false;
callback(null, success);
}
});
});
authreq.on('error', function(e){ callback(e); });
authreq.end();
};
/*
var auth = {
type: 'http_basic_auth',
url: '....',
realm: '',
access_control: {
users: {
normal_user_name: {
databases: {
public: { default: "allow" }
},
default: "deny"
},
super_user_name: {
default: "allow"
}
},
default: "allow" // default
},
};
*/
Auth.prototype.acl_delegators = function(req, username, options) {
var acl_config = null;
if (username && this._acl_config && this._acl_config['users'] && this._acl_config['users'][username])
acl_config = this._acl_config['users'][username];
if (!acl_config) {
if (options.require_always || this._acl_config && this._acl_config['default'] === 'deny')
return [function(t,d){return false;}, function(d){return false;}];
return [function(t,d){return true;}, function(d){return true;}];
}
var acl = new AccessControl(acl_config);
// allowed(tablename, dbname), visible(dbname)
return [function(t,d){return acl.allowed(t,d);}, function(d){return acl.visible(d);}];
};
================================================
FILE: lib/shib/auth/http_custom_header.js
================================================
var AccessControl = require('shib/access_control').AccessControl;
/*
var auth = {
require_always: true,
type: 'http_custom_header',
realm: 'linecorp rev',
username: 'X-Shib-Auth-User',
groupname: 'X-Shib-Auth-Group',
access_control: {
users: {
tagomoris: {
default: "deny",
databases: {
default: { default: "allow" },
legy: { default: "deny", allow: ["access_logs"] }
}
},
hogepos: {
default: "allow"
}
},
groups: {
supermember: {
default: "allow"
},
limitedmember: {
default: "deny",
databases: {
default: { default: "allow" }
}
}
},
order: ["group", "user"], //default
default: "deny" //default
}
};
*/
var Auth = exports.Auth = function(args, logger){
this.logger = logger;
this.realm = args.realm;
if (! args.require_always)
throw "Auth 'http_custom_headers' does not permit 'require_always: false'";
if (! args.username)
throw "Auth 'http_custom_headers' requires username";
this._username = args.username;
this._groupname = args.groupname;
this._acl_config = args.access_control;
};
Auth.prototype.check = function(req, callback) {
var username = req.get(this._username);
var groupname = null;
if (this._groupname)
groupname = req.get(this._groupname);
if (!username && !groupname) {
callback(null, false);
return;
}
callback(null, {username: username});
};
// On this auth plugin, HTTP custom headers is the most important credential,
// rather than Shib auth headers.
Auth.prototype.acl_delegators = function(req, username, options) {
// [ allowed(tablename, dbname), visible(dbname) ]
if (!username)
username = req.get(this._username);
if (!username || username !== req.get(this._username))
return [function(t,d){return false;}, function(d){return false;}];
var groupname = null;
if (this._groupname)
groupname = req.get(this._groupname);
var aclconfig = this._acl_config;
var order = (aclconfig['order'] || ["group","user"]);
var acl = null;
order.forEach(function(order_item){
if (acl)
return; // continue
if (order_item === "group") {
if (! groupname)
return; // continue
var gdata = (aclconfig['groups'] || {})[groupname];
if (gdata)
acl = new AccessControl(gdata);
} else { // user
var udata = (aclconfig['users'] || {})[username];
if (udata)
acl = new AccessControl(udata);
}
});
if (acl)
return [function(t,d){return acl.allowed(t,d);}, function(d){return acl.visible(d);}];
if (aclconfig['default'] === "allow")
return [function(t,d){return true;}, function(d){return true;}];
// default deny
return [function(t,d){return false;}, function(d){return false;}];
};
================================================
FILE: lib/shib/auth.js
================================================
var crypto = require('crypto');
var dumb = require('./auth/dumb')
, http_basic_auth = require('./auth/http_basic_auth')
, http_custom_header = require('./auth/http_custom_header');
var CRYPTO_DEFAULT_CIPHER = 'aes192';
var passphrase = null;
var secret = null;
var Auth = exports.Auth = function(config, logger){
this.logger = logger;
if (!passphrase)
passphrase = crypto.pseudoRandomBytes(32).toString('binary');
if (!secret)
secret = crypto.pseudoRandomBytes(4).toString('hex');
this._provider = null;
this.enabled = false;
this.require_always = config.require_always || false;
this.realm = config.realm || '';
if (config.type === null || config.type === undefined){
this._provider = new dumb.Auth();
} else if (config.type === 'http_basic_auth'){
this._provider = new http_basic_auth.Auth(config, logger);
this.enabled = true;
} else if (config.type === 'http_custom_header'){
this._provider = new http_custom_header.Auth(config, logger);
this.enabled = true;
} else {
throw "unknown auth type name:" + config.type;
}
};
Auth.prototype.check = function(req, callback){
this._provider.check(req, callback);
};
Auth.prototype.credential = function(req){
var user = this.userdata(req);
var username = null;
if (user)
username = user.username;
return new Credential(this._provider.acl_delegators(req, username, {require_always: this.require_always}));
};
Auth.prototype.userdata = function(req){
var data = req.body.authInfo || req.get('X-Shib-AuthInfo');
if (!data)
return null;
return this.decrypto(data);
};
Auth.prototype.crypto = function(username){
var cipher = crypto.createCipher(CRYPTO_DEFAULT_CIPHER, passphrase);
var data = secret + ':' + String(username);
var buf0 = cipher.update(data, 'utf8', 'hex');
var buf1 = cipher.final('hex');
return buf0 + buf1;
};
Auth.prototype.decrypto = function(data){
var user;
var decipher = crypto.createDecipher(CRYPTO_DEFAULT_CIPHER, passphrase);
var r0 = decipher.update(data, 'hex', 'utf8');
try {
var r1 = decipher.final('utf8');
var ary = (r0 + r1).split(':');
if (ary[0] === secret) {
user = ary[1];
}
} catch (x) {
// TypeError: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
// decrypt error
}
if (!user)
return null;
return {username: user};
};
var Credential = function(acl_delegators){
this.allowed_delegator = acl_delegators[0];
this.visible_delegator = acl_delegators[1];
};
Credential.prototype.allowed = function(tablename, dbname){
return this.allowed_delegator(tablename, dbname);
};
Credential.prototype.visible = function(dbname){
return this.visible_delegator(dbname);
};
================================================
FILE: lib/shib/client.js
================================================
var Query = require('./query').Query;
var async = require('async');
var localdiskstore = require('./localdiskstore'),
LocalDiskStoreError = localdiskstore.LocalStoreError;
var engine = require('./engine');
var FETCH_LINES_DEFAULT = 1000;
var Client = exports.Client = function(args, logger, credential){
var self = this;
this.logger = logger;
this._conf = args;
this._localstore = undefined;
/*
* engine configurations defaults
* fetch_lines: 1000,
* query_timeout: null,
* setup_queries: [],
* setup_queries_auth: [],
* max_result_file_byte_size: null,
* default_database: 'default',
*
* these may be overwritten by each engine configurations
*/
this._default_fetch_lines = this._conf.fetch_lines || FETCH_LINES_DEFAULT;
this._default_query_timeout = this._conf.query_timeout || null;
this._default_setup_queries = this._conf.setup_queries || [];
this._default_setup_queries_auth = this._conf.setup_queries_auth || [];
this._default_max_result_file_byte_size = this._conf.max_result_file_byte_size || null;
this._default_default_database = this._conf.default_database || 'default';
this._default_engine_label = undefined;
this._engine_configs = {};
this._engines = {};
if (this._conf.executer) {
this._default_engine_label = 'default';
var engine_conf = {
label: 'default',
executer: this._conf.executer,
monitor: this._conf.monitor
};
this._engine_configs['default'] = engine_conf;
this._conf.engines = [engine_conf];
}
else if (this._conf.engines) {
this._default_engine_label = this._conf.engines[0].label;
this._conf.engines.forEach(function(e){
if (! e.label)
throw "label missing in engines configuration!";
if (! e.executer)
throw "executer not found in engines configuration!";
self._engine_configs[e.label] = e;
});
}
else
throw "engines configuration missing";
this.localStore(); // to initialize sqlite3 database
this.auth_credential = credential;
};
function error_callback(name, t, callback, err, data){
if (! callback) return;
if (data && data['ERROR'])
err.message += ' ERROR:' + data['ERROR'];
callback.apply(t, [err]);
};
Client.prototype.localStore = function(){
if (this._localstore) {
return this._localstore;
}
this._localstore = new localdiskstore.LocalDiskStore(this._conf.storage.datadir, this.logger);
return this._localstore;
};
Client.prototype.engineLabels = function(){
var self = this;
var labels = [];
this._conf.engines.forEach(function(e){
labels.push( e.label );
});
return labels;
};
Client.prototype.engineInfo = function(callback){
var self = this;
var labels = this.engineLabels();
var response = { monitor: {} };
var funclist = [];
// default engine is head of engineLabels
// default database is head of each database lists of engines
// we MUST keep orders of engineLabels and database lists
var dblists = {};
labels.forEach(function(label){
response.monitor[label] = self.engine(label).supports('status');
funclist.push(function(cb){
self.databases(label, function(err,dblist){
if (err) { cb(err); return; }
dblists[label] = dblist;
cb(null);
});
});
});
async.parallel(funclist, function(err, results){
if (err) { error_callback('engineInfo', self, callback, err); return; }
var pairs = [];
labels.forEach(function(label){
var part = dblists[label].map(function(dbname){ return [ label, dbname ]; });
pairs = pairs.concat(part);
});
response['pairs'] = pairs;
callback.apply(self, [err, response]);
});
};
Client.prototype.engine = function(label){
if (!label)
label = this._default_engine_label;
if (this._engines[label])
return this._engines[label];
var conf = this._engine_configs[label];
if (! conf)
return null; // unconfigured engine label
var executer_conf = conf.executer;
var monitor_conf = conf.monitor;
var options = {
query_timeout: this._default_query_timeout,
fetch_lines: this._default_fetch_lines,
setup_queries: this._default_setup_queries,
setup_queries_auth: this._default_setup_queries_auth,
auth_credential: this.auth_credential
};
if (executer_conf.fetch_lines)
options.fetch_lines = executer_conf.fetch_lines;
if (executer_conf.query_timeout)
options.query_timeout = executer_conf.query_timeout;
if (executer_conf.setup_queries)
options.setup_queries = executer_conf.setup_queries;
if (executer_conf.setup_queries_auth)
options.setup_queries_auth = executer_conf.setup_queries_auth;
if (! executer_conf.default_database)
executer_conf.default_database = this._default_default_database;
this._engines[label] = new engine.Engine(label, executer_conf, monitor_conf, options, this.logger);
return this._engines[label];
};
Client.prototype.end = function(half){
var client = this;
if (this._localstore) {
this._localstore.close();
this._localstore = undefined;
}
if (half)
return;
if (this._engines) {
for (var label in this._engines) {
this._engines[label].close();
}
this._engines = undefined;
}
};
Client.prototype.recentQueries = function(num, callback){
var client = this;
this.localStore().recentQueries(num, function(err, list){
if (err) { error_callback('recentQueries', client, callback, err); return; }
callback.apply(client, [err, list]);
});
};
Client.prototype.getQuery = function(queryid, callback){
var client = this;
this.localStore().query(queryid, function(err, data){
if (err) { error_callback('getQuery', client, callback, err, data); return; }
callback.apply(client, [err, data]);
});
};
Client.prototype.query = Client.prototype.getQuery;
Client.prototype.getQueries = function(queryids, callback){
var client = this;
this.localStore().queries(queryids, function(err, list){
if (err) { error_callback('getQueries', client, callback, err, list); return; }
callback.apply(client, [err, list]);
});
};
Client.prototype.queries = Client.prototype.getQueries;
Client.prototype.updateQuery = function(query, callback) {
var client = this;
this.localStore().updateQuery(query, function(err){
if (err) { error_callback('updateQuery', client, callback, err); return; }
if (callback)
callback.apply(client, [err]);
});
};
Client.prototype.createQuery = function(engineLabel, dbname, querystring, scheduled, userdata, callback){
var client = this;
var seed;
var query;
try {
var rand = Math.floor(Math.random() * 10000);
seed = (new Date()).toTimeString() + ";" + rand.toString(); // for queryid
var auth;
if(userdata) {
auth = true;
} else {
auth = false;
}
query = new Query({querystring:querystring, engine: engineLabel, dbname: dbname, scheduled: scheduled, seed: seed, auth: auth});
}
catch (e) {
error_callback('createQuery catch', client, callback, e);
return;
}
client.query(query.queryid, function(err, savedquery){
if (!err && savedquery) { callback.apply(client, [err, savedquery]); return; }
this.localStore().insertQuery(query, function(err){
if (err) { error_callback('createQuery', client, callback, err); return; }
callback.apply(client, [err, query]);
});
});
};
/*
* delete query, tag and resultData
*/
Client.prototype.deleteQuery = function(queryid, callback){
var client = this;
this.query(queryid, function(err, query){
if (err) { callback(err); return; }
if (query === null) { error_callback('deleteQuery', client, callback, new Error("queryid=" + queryid + " is not found in DB.")); return; }
var resultid = query.resultid;
async.series([
function(cb){ client.localStore().deleteQuery(queryid, function(err){ cb(err); }); },
function(cb){ client.localStore().deleteTagForQuery(queryid, function(err){ cb(err); }); },
function(cb){ client.localStore().deleteResultData(resultid, function(err){ cb(err); }); }
], function(err, results){ callback(err); });
});
};
Client.prototype.getQueryByResultId = function(resultid, callback){
var client = this;
this.localStore().queryByResultId(resultid, function(err, data){
if (err) { error_callback('getQuery', client, callback, err, data); return; }
callback.apply(client, [err, data]);
});
};
Client.prototype.tagList = function(callback){
var client = this;
this.localStore().tagList(function(err, tags){
if (err) { error_callback('tagList', client, callback, err); return; }
callback.apply(client, [err, tags]);
});
};
Client.prototype.tags = function(queryid, callback){
var client = this;
this.localStore().tags(queryid, function(err, tags){
if (err) { error_callback('tags', client, callback, err); return; }
callback.apply(client, [err, tags]);
});
};
Client.prototype.addTag = function(queryid, tag, callback){
var client = this;
this.localStore().addTag(queryid, tag, function(err){
if (err) { error_callback('addTag', client, callback, err); return; }
callback.apply(client, [err]);
});
};
Client.prototype.deleteTag = function(queryid, tag, callback){
var client = this;
this.localStore().deleteTag(queryid, tag, function(err){
if (err) { error_callback('deleteTag', client, callback, err); return; }
callback.apply(client, [err]);
});
};
Client.prototype.taggedQueries = function(tag, callback){
var client = this;
this.localStore().taggedQueries(tag, function(err, queryids){
if (err) { error_callback('taggedQueries', client, callback, err); return; }
callback.apply(client, [err, queryids]);
});
};
Client.prototype.getResultData = function(resultid, callback){
var client = this;
this.localStore().readResultData(resultid, function(err, data){
if (err) { error_callback('getResultData', client, callback, err, data); return; }
var list = [];
data.split("\n").forEach(function(line){
if (line == "")
return;
list.push(line.split("\t"));
});
callback.apply(client, [err, list]);
});
};
Client.prototype.resultData = Client.prototype.getResultData;
Client.prototype.getRawResultData = function(resultid, callback){
var client = this;
this.localStore().readResultData(resultid, function(err, data){
if (err) { error_callback('getRawResultData', client, callback, err, data); return; }
callback.apply(client, [err, data]);
});
};
Client.prototype.rawResultData = Client.prototype.getRawResultData;
Client.prototype.appendResultData = function(resultid, data, callback){
var client = this;
this.localStore().appendResultData(resultid, data.join("\n") + "\n", function(err){
if (err) { error_callback('appendResultData', client, callback, err); return; }
if (callback)
callback.apply(client, [err]);
});
};
Client.prototype.databases = function(engineLabel, callback){
var client = this;
var engine = client.engine(engineLabel);
if (! engine) {
callback.apply(client, [{message: "RELOAD page: unknown engine label, " + engineLabel}]);
return;
}
if (! engine.supports('databases')) {
callback.apply(client, [null, ['(default)']]);
return;
}
engine.databases(function(error, data){
callback.apply(client, [error, data]);
});
};
Client.prototype.tables = function(engineLabel, dbname, callback){
var client = this;
var engine = client.engine(engineLabel);
if (! engine) {
callback.apply(client, [{message: "RELOAD page: unknown engine label, " + engineLabel}]);
return;
}
engine.tables(dbname, function(error, data){
callback.apply(client, [error, data]);
});
};
/* get partitions of specified table */
Client.prototype.partitions = function(engineLabel, dbname, tablename, callback){
var client = this;
var engine = client.engine(engineLabel);
if (! engine) {
callback.apply(client, [{message: "RELOAD page: unknown engine label, " + engineLabel}]);
return;
}
engine.partitions(dbname, tablename, function(error, data){
// engine().partitions() returns
// [ 'part1=val1/part2=val2/part3=val3', .... ]
var partition_nodes = [];
var treenodes = {};
var create_node = function(partition, hasChildren){
if (treenodes[partition])
return treenodes[partition];
var parts = partition.split('/');
var leafName = parts.pop();
var node = {title: leafName};
if (hasChildren) {
node.children = [];
}
if (parts.length > 0) {
var parent = create_node(parts.join('/'), true);
parent.children.push(node);
}
else {
partition_nodes.push(node);
}
treenodes[partition] = node;
return node;
};
(data || []).forEach(function(partition){
create_node(partition);
});
callback.apply(client, [error, partition_nodes]);
});
};
/* get table schema info */
Client.prototype.describe = function(engineLabel, dbname, tablename, callback){
var client = this;
var engine = client.engine(engineLabel);
if (! engine) {
callback.apply(client, [{message: "RELOAD page: unknown engine label, " + engineLabel}]);
return;
}
engine.describe(dbname, tablename, function(error, data){
callback.apply(client, [error, data]);
});
};
Client.prototype.giveup = function(query, callback){
var client = this;
query.markAsExecuted({message: 'specified as "give up"'});
client.updateQuery(query);
if (callback)
callback.apply(client, [null, query]);
if (! query.engine){
client.end(); // self close after half close
return;
}
var engine = client.engine(query.engine);
if (! engine) {
callback.apply(client, [{message: "RELOAD page: unknown engine label, " + query.engine}]);
client.end(); // self close after half close
return;
}
engine.status(query.queryid, function(err, jobdata){
if (err){ // engine doesn't support 'status' or errors with other reason
// cannot kill with no status information
error_callback('giveup', client, callback, err);
client.end(); // self close after half close
return;
}
if (jobdata) {// killed job terminates hive query and executer calls callback with error "killed by user"
engine.kill(jobdata.jobid, function(err){
if (err) {
client.logger.error("Error on killing job", {jobid: jobdata.jobid, error: err});
}
client.end(); // self close after half close
});
}
});
};
Client.prototype.execute = function(query, args){
if (! args)
args = {};
var client = this;
var executed_time = new Date();
//query.state is already running, and resultid/result is set
if (args.prepare)
args.prepare(query);
var schemaRow = null;
var resultLines = 0;
var resultBytes = 0;
var onerror = null;
var engine = client.engine(query.engine);
if (! engine) {
query.markAsExecuted({message: "RELOAD page: unknown engine label, " + query.engine});
if (args.error)
args.error();
return;
}
engine.execute(query.queryid, query.dbname, query.composed(), query.auth, {
stopcheck: args.stopCheck,
stop: args.stop,
complete: function(err){
if (err){ onerror = err; }
query.markAsExecuted(onerror, resultLines, resultBytes);
client.updateQuery(query);
if (onerror && args.error)
args.error();
else if (args.success)
args.success();
},
error: function(err){
query.markAsExecuted(err);
client.updateQuery(query);
if (args.error)
args.error();
},
timeout: function(err){
var queryid = query.queryid;
query.markAsExecuted(err);
client.updateQuery(query, function(err){ client.end(true); }); // early half close to close database
// DO NOT operate database after here
if (engine.supports('status') && engine.supports('kill')) {
engine.status(queryid, function(err, jobdata){
if (err){
if (args.error)
args.error();
return;
}
if (jobdata) {// killed job terminates hive query and executer calls callback with error "killed by user"
engine.kill(jobdata.jobid, function(err){
if (err) { client.logger.error("Error on killing job", {jobid: jobdata.jobid, error: err}); }
if (args.error)
args.error();
});
}
});
}
else {
if (args.error)
args.error();
}
},
schema: function(error, data){
if (error){ onerror = error; return; }
query.addSchema(data);
// set to write to top of result data
schemaRow = data.map(function(f){return f.name.toUpperCase();}).join('\t');
},
fetch: function(error, rows, cb){
if (error){ onerror = error; cb(error); return; }
if (schemaRow) {
rows.unshift(schemaRow);
schemaRow = null;
}
client.appendResultData(query.resultid, rows, function(err){
if (err) {
client.logger.error('failed to append result data', err);
cb(err);
throw new LocalDiskStoreError("failed to append result data");
}
resultLines += rows.length;
resultBytes += rows.reduce(function(prev,v){return prev + v.length + 1;}, 0);
if (this._default_max_result_file_byte_size != null && resultBytes > this._default_max_result_file_byte_size) {
cb({message:"Result file size exceeds " + this._default_max_result_file_byte_size + " bytes."})
} else {
cb();
}
});
}
});
};
Client.prototype.detailStatus = function(query, callback){
var client = this;
var engine = client.engine(query.engine);
if (! engine) {
error_callback('detailStatus', client, callback, {message: "RELOAD page: unknown engine label, " + query.engine}); return;
return;
}
engine.status(query.queryid, function(err, status){
if (err) { error_callback('detailStatus', client, callback, err); return; }
callback.apply(client, [null, status]);
});
};
Client.prototype.generatePath = function(key){
return this.localStore().generatePath(key);
};
================================================
FILE: lib/shib/engine.js
================================================
var dummyengine = require('./engines/dummyengine')
, dummy = require('./engines/dummy')
, hiveserver = require('./engines/hiveserver')
, hiveserver2 = require('./engines/hiveserver2')
, presto = require('./engines/presto')
, jobtracker = require('./engines/jobtracker')
, yarn = require('./engines/yarn')
, huahin_mrv1 = require('./engines/huahin_mrv1')
, bigquery = require('./engines/bigquery');
var Query = require('./query').Query
, AccessControl = require('./access_control').AccessControl;
var Engine = exports.Engine = function(label, executer_conf, monitor_conf, options, logger) {
// query_timeout is for timeout between 'setup' and just after 'execute' callback call.
this.label = label;
this.logger = logger;
// this._executer = dummyengine.Executer();
this._query_timeout = options.query_timeout;
this._setup_queries = options.setup_queries;
this._setup_queries_auth = options.setup_queries_auth;
this._fetch_lines = options.fetch_lines;
this._auth_credential = options.auth_credential;
this._executer = null;
this._monitor = null;
if (! executer_conf || !executer_conf.name) {
throw "executer configuration or executer name not found";
}
var executer = null;
var monitor = null;
switch (executer_conf.name) {
case 'hiveserver':
executer = hiveserver.Executer;
break;
case 'hiveserver2':
executer = hiveserver2.Executer;
// monitor = hiveserver2.Monitor;
break;
case 'presto':
executer = presto.Executer;
monitor = presto.Monitor; // default monitor
break;
case 'bigquery':
executer = bigquery.Executer;
monitor = bigquery.Monitor; // default monitor
break;
case 'dummy':
executer = dummy.Executer;
monitor = dummy.Monitor;
break;
default:
throw "unknown executer name:" + executer_conf.name;
}
if (! executer_conf.default_database)
throw "BUG: default_database missing in executer_conf";
this._default_dbname = executer_conf.default_database;
this._executer = new executer(executer_conf, this.logger);
this._acl_config = executer_conf.access_control || {};
if (monitor_conf) {
if (! monitor_conf.name)
throw "monitor name not found";
switch (monitor_conf.name) {
case 'jobtracker':
monitor = jobtracker.Monitor;
break;
case 'yarn':
monitor = yarn.Monitor;
break;
case 'huahin_mrv1':
monitor = huahin_mrv1.Monitor;
break;
case 'presto':
monitor = presto.Monitor;
break;
case 'bigquery':
monitor = bigquery.Monitor;
break;
case 'dummy':
monitor = dummy.Monitor;
break;
default:
throw "unknown monitor name:" + monitor_conf.name;
}
this._monitor = new monitor(monitor_conf, this.logger);
} else if (monitor) {
// default monitor same with executor
this._monitor = new monitor(executer_conf, this.logger);
} else {
this._monitor = new dummyengine.Monitor();
}
};
Engine.prototype.supports = function(operation) {
switch (operation) {
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'partitions':
case 'describe':
case 'execute':
return this._executer.supports(operation); // executer MUST support setup() and execute()
case 'status':
case 'kill':
return this._monitor.supports(operation); // monitor CAN support status() and kill()
}
throw "invalid operation for engines:" + operation;
};
Engine.prototype.acl = function(){
if (this._acl_config['delegate'] === 'auth') {
if (! this._auth_credential) {
this.logger.warn("auth credential not found: default denied for all requests");
return AccessControl.defaultDenyDelegator();
}
return this._auth_credential;
}
return new AccessControl(this._acl_config);
};
Engine.prototype.close = function(){
this._executer.end();
this._executer = undefined;
this._monitor.end();
this._monitor = undefined;
};
Engine.prototype.default_database_name = function(){
if (this.supports('database'))
return this._default_dbname;
return null;
};
Engine.prototype.databases = function(callback){
var self = this;
if (this.supports('databases')) {
this._executer.databases(function(err, dbnamelist){
if (err) { self.logger.error('databases', err); callback(err); return; }
var dbs = [self._default_dbname];
dbnamelist.forEach(function(dbname){
if (dbname === self._default_dbname)
return;
if (self.acl().visible(dbname))
dbs.push(dbname);
});
callback(null, dbs);
});
} else {
callback({message:'Failed to get database list, not supported'});
}
};
Engine.prototype.tables = function(dbname, callback){
var self = this;
if (this.supports('tables')) {
if (! this.acl().visible(dbname)) {
callback(null, []);
return;
}
this._executer.tables(dbname, function(err, data){
var tables = [];
data.forEach(function(tablename){
if (self.acl().allowed(tablename, dbname))
tables.push(tablename);
});
callback(null, tables);
});
} else {
callback({message:'Failed to get table list, not supported'});
}
};
Engine.prototype.partitions = function(dbname, tablename, callback){
if (this.supports('partitions')) {
if (! this.acl().allowed(tablename, dbname)) {
callback({message:'access denied'});
return;
}
this._executer.partitions(dbname, tablename, callback);
} else {
callback({message:'Failed to get partition list, not supported'});
}
};
Engine.prototype.describe = function(dbname, tablename, callback){
if (this.supports('describe')) {
if (! this.acl().allowed(tablename, dbname)) {
callback({message:'access denied'});
return;
}
this._executer.describe(dbname, tablename, callback);
} else {
callback({message:'Failed to get table schema, not supported'});
}
};
/*
options: {
schema: function(error, data){},
callback: function(error, rows){}, // default callback (exclusive with error/success/fetch/complete)
stopcheck: function(query){},
stop: function(){},
error: function(error){},
fetch: function(error, rows){},
complete: function(error){},
success: function(){} // without fetchNum, fetchAll() -> success_callback(result_rows) (or callback(null,result_rows) )
}
*/
Engine.prototype.execute = function(queryid, dbname, query, auth, options) {
var self = this;
var executer = this._executer;
if (options.call) { // 3rd argument is single callback function
var callback = options;
options = {callback: callback};
}
var schema_callback = options.schema || function(err,data){};
var stopcheck = options.stopcheck || function(){return false;};
var success_callback = options.success || options.callback || function(err,data){};
var stop_callback = options.stop || options.callback || function(err,data){};
var error_callback = options.error || options.callback || function(err){};
// query_timeout is for timeout between 'setup' and just after 'execute' callback call.
var timeout_callback = options.timeout || error_callback || function(err){};
var setups = this._setup_queries || [];
if(auth) {
setups = setups.concat(this._setup_queries_auth)
}
var fetchnum = this._fetch_lines;
var fetch_callback = null;
var complete_callback = null;
if (fetchnum) {
if (!options.fetch || !options.complete)
throw "missing fetch or complete callback for fetch api";
fetch_callback = options.fetch;
complete_callback = options.complete;
}
var timeout_watch = null;
var disable_timeout_handler = function(){
if(timeout_watch && timeout_watch.state) {
timeout_watch.state = false;
clearTimeout(timeout_watch.timer);
}
};
if (this._query_timeout) {
var timeout_seconds = this._query_timeout * 1000;
var timer = setTimeout(function(){
if (timeout_watch && timeout_watch.state) {
timeout_watch.expired = true;
timeout_callback({message: 'query is expired with configured timeout seconds (' + String(timeout_seconds) + ')'});
}
}, timeout_seconds);
var state = true; // not expired
timeout_watch = { timer:timer, state:state, expired:false };
}
var table_db_pairs = Query.parseTableNames(query);
var access_denied = false;
table_db_pairs.forEach(function(pair){
if (! self.acl().allowed(pair[0], (pair[1] || dbname)))
access_denied = true;
});
if (access_denied) {
disable_timeout_handler();
error_callback({message: "access denied for db/table"});
return;
}
executer.setup(setups, function(err){
var jobname = executer.jobname(queryid);
executer.execute(jobname, dbname, query, function(err, fetcher){
if (timeout_watch && timeout_watch.expired) {
// this query has expired, and timeout_callback() has already been executed
return;
}
if (stopcheck()) { disable_timeout_handler(); stop_callback({message: "stopped by stopcheck"}); return; }
if (err) { disable_timeout_handler(); error_callback(err); return; }
fetcher.schema(function(err, data){
if (err) { disable_timeout_handler(); error_callback(err); return; }
if (timeout_watch && timeout_watch.expired) {
// this query has expired, and timeout_callback() has already been executed
return;
}
disable_timeout_handler();
if (schema_callback)
schema_callback(err, data);
// fetch all result rows at once
if (! fetchnum) {
fetcher.fetch(null, function(err, rows){ // fetch all records
if (err) { error_callback(err); return; }
success_callback(null, rows);
});
return;
}
var has_errors = false;
// fetch N-rows step by step
var continuous_fetch = function(err){
if (err) {
has_errors = true;
self.logger.warn("fetch killed with upper layer error", {err: err});
complete_callback({message:"Fetching exits with errors. " + err.message});
return;
}
fetcher.fetch(fetchnum, function(err, rows){
if (err) {
has_errors = true;
self.logger.warn("fetch error", {err: err});
}
if (stopcheck()) { stop_callback({message: "stopped by stopcheck"}); return; }
if (rows == null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {
// end of fetched rows
if (has_errors)
complete_callback({message:"HiveQL exits with errors"});
else
complete_callback(null);
return;
}
fetch_callback(err, rows, continuous_fetch);
});
};
continuous_fetch(null);
});
});
});
};
Engine.prototype.status = function(queryid, callback) {
var jobname = this._executer.jobname(queryid);
if (this.supports('status')) {
this._monitor.status(jobname, callback);
} else {
callback({message:'Failed to get job(' + jobname + ') status, not supported'});
}
};
Engine.prototype.kill = function(jobid, callback) {
if (this.supports('kill')) {
this._monitor.kill(jobid, callback);
} else {
callback({message:'Failed to kill job(jobid:' + jobid + '), not supported'});
}
};
================================================
FILE: lib/shib/engines/bigquery/index.js
================================================
var gcloud = require('gcloud')
, util = require('util');
// check interval for real queries, not system queries
var BLOCK_CHECK_INTERVAL = 1000; // 1sec
var MAX_RESULTS_FOR_EACH_FETCH = 1000;
var jobname_jobid_map = {};
var Executer = exports.Executer = function(conf, logger){
if (conf.name !== 'bigquery')
throw "executer name mismatch for bigquery:" + conf.name;
if (!conf.project_id)
throw "project_id MUST be specified for bigquery executer";
if (!conf.key_filename)
throw "key_filename MUST be specified for bigquery executer";
this.logger = logger;
this._client = gcloud.bigquery({
projectId: conf.project_id,
keyFilename: conf.key_filename
});
};
Executer.prototype.end = function(){
// Nothing to do for HTTP API :-)
};
Executer.prototype.supports = function(operation){
switch (operation) { // "executer" methods
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'describe':
case 'execute':
return true;
}
throw "unknown operation name (for bigquery):" + operation;
};
Executer.prototype.jobname = function(queryid) {
return 'shib-bigquery-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
callback(null);
};
Executer.prototype.databases = function(callback){
var results = []
, pageToken = null
, self = this;
var processDatasets = function(datasets) {
datasets.forEach(function(row) {
var dbname = row.metadata.datasetReference.datasetId;
results.push(dbname);
});
};
var fetchDatesets = function() {
self._client.getDatasets({ maxResults: MAX_RESULTS_FOR_EACH_FETCH, pageToken: pageToken }, function(err, datasets, nextQuery){
if (err) { callback(err); return; }
processDatasets(datasets);
if (nextQuery) {
pageToken = nextQuery.pageToken;
setTimeout(fetchDatesets, 0);
} else {
callback(null, results);
}
});
};
fetchDatesets();
};
Executer.prototype.tables = function(dbname, callback){
var results = []
, pageToken = null
, self = this
, dataset = self._client.dataset(dbname);
var processTables = function(tables) {
tables.forEach(function(row) {
var table = row.metadata.tableReference.tableId;
results.push(table);
});
};
var fetchTables = function() {
dataset.getTables({ maxResults: MAX_RESULTS_FOR_EACH_FETCH, pageToken: pageToken }, function(err, tables, nextQuery){
if (err) { callback(err); return; }
processTables(tables);
if (nextQuery) {
pageToken = nextQuery.pageToken;
setTimeout(fetchTables, 0);
} else {
callback(null, results);
}
});
};
fetchTables();
};
Executer.prototype.partitions = function(dbname, tablename, callback){
// bigquery engine does not support 'partitions'
callback(null, []);
};
Executer.prototype.describe = function(dbname, tablename, callback){
var dataset = this._client.dataset(dbname);
var table = dataset.table(tablename);
table.getMetadata(function(err, metadata){
if (err) { callback(err); return; }
var results = [];
var fields = metadata.schema.fields;
fields.forEach(function(field){
var name = field.name;
var type = field.type;
var comment = field.description ? field.description : '';
results.push([name, type, comment]);
});
callback(null, results);
});
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
var client = this._client;
var fetcher = new Fetcher(client, jobname);
var error_callback = function(e){
delete jobname_jobid_map[jobname];
if (!fetcher._rpcError) // only first error is stored
fetcher._rpcError = e;
};
client.startQuery(query, function(err, job) {
if (err) { error_callback(err); return; }
jobname_jobid_map[jobname] = job.id;
});
callback(null, fetcher);
};
var Fetcher = function(client, jobname){
this._client = client;
this._jobname = jobname;
this._hasResults = false;
this._noMoreResults = false;
this._rpcError = null;
this._nextQuery = null;
this._cache = { data: [], schema: null };
this._processColumn = function(data){
var columns = [];
if (data.length > 0) {
var first = data[0];
Object.keys(first).forEach(function(key){
columns.push({ name: key });
});
}
this._cache.schema = columns;
this._hasResults = true;
};
this._processData = function(data){
var buf = []
, len = data.length
, schema = this._cache.schema
, schemaLen = schema.length;
for ( var i = 0 ; i < len ; i++ ) {
var row = [];
for (var j = 0 ; j < schemaLen; j++ ) {
row.push(data[i][schema[j].name]);
}
buf.push( row.join('\t') );
}
this._push( buf );
};
this._push = function(data) {
this._cache.data = this._cache.data.concat(data);
};
this._waitComplete = function(callback) {
if (this._hasResults || this._rpcError) {
if (this._rpcError)
callback(this._rpcError);
else
callback(null);
return;
}
var self = this;
var check = function() {
var jobId = jobname_jobid_map[self._jobname];
if (jobId) {
var job = self._client.job(jobId);
job.getQueryResults({
maxResults: MAX_RESULTS_FOR_EACH_FETCH,
pageToken: self._nextQuery ? self._nextQuery.pageToken : null
}, function (err, rows, nextQuery) {
if (err) { callback(err); return; }
if (!self._hasResults) {
self._processColumn(rows);
}
self._processData(rows);
if (!nextQuery) {
self._nextQuery = null;
self._noMoreResults = true;
delete jobname_jobid_map[self._jobname];
return callback(null);
}
self._nextQuery = nextQuery;
setTimeout(check, BLOCK_CHECK_INTERVAL);
});
} else {
setTimeout(check, BLOCK_CHECK_INTERVAL);
}
};
check();
};
this.schema = function(callback){
/*
* schema(callback): callback(err, schema)
* schema: {fieldSchemas: [{name:'fieldname1'}, {name:'fieldname2'}, {name:'fieldname3'}, ...]}
* //?? schema: [{name:'fieldname1'}, {name:'fieldname2'}, ...]
*/
var self = this;
this._waitComplete(function(err){
if (err) { callback(err); return; }
// self._cache.schema: [ { name: "username", type: "varchar" }, { name: "cnt", type: "bigint" } ]
callback(null, self._cache.schema);
});
};
this.fetch = function(num, callback){
if (!num) {
this._fetchAll(callback);
return;
}
var self = this;
if (self._cache.data.length < 1 && self._noMoreResults) {
// if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {
// end of fetched rows
callback(null, null);
return;
}
var buf = [];
var fill = function() {
var chunk = self._cache.data.splice(0, num - buf.length);
if (chunk.length < 1) {
if (self._noMoreResults) {
var tmpbuf = buf;
buf = [];
callback(null, tmpbuf); // if tmpbuf is empty, this is end of fetching
return;
}
else {
setTimeout(fill, BLOCK_CHECK_INTERVAL);
return;
}
}
buf = buf.concat(chunk);
if (buf.length >= num || self._noMoreResults) {
var fullchunk = buf;
buf = [];
callback(null, fullchunk);
}
else
setTimeout(fill, BLOCK_CHECK_INTERVAL);
};
this._waitComplete(function(err){
if (err) { callback(err); return; }
fill();
});
};
this._fetchAll = function(callback) {
var self = this;
var check = function() {
if (self._rpcError)
callback(self._rpcError);
else if (self._noMoreResults)
callback(null, self._cache.data);
else
setTimeout(check, BLOCK_CHECK_INTERVAL);
};
check();
};
};
var Monitor = exports.Monitor = function(conf){
if (conf.name !== 'bigquery')
throw "executer name mismatch for bigquery:" + conf.name;
if (!conf.project_id)
throw "project_id MUST be specified for bigquery executer";
if (!conf.key_filename)
throw "key_filename MUST be specified for bigquery executer";
this._client = gcloud.bigquery({
projectId: conf.project_id,
keyFilename: conf.key_filename
});
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) { // "monitor" methods
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for bigquery.Monitor):" + operation;
};
function convertStatus(jobname, status) {
if (status === undefined) {
return null;
}
var retval = {};
// https://cloud.google.com/bigquery/docs/reference/v2/jobs
retval['jobid'] = status['jobReference']['jobId'];
retval['name'] = jobname;
retval['priority'] = status['configuration']['priority'] || 'INTERACTIVE';
retval['state'] = status['status']['state'];
retval['trackingURL'] = status['selfLink'];
retval['startTime'] = new Date(parseInt(status['statistics']['creationTime']));
retval['complete'] = (retval['state'] === 'DONE' ? 100 : 0);
return retval;
}
Monitor.prototype.status = function(jobname, callback){
var jobId = jobname_jobid_map[jobname];
if (!jobId) {
callback({message:"job already expired (maybe completed)"}, null);
return;
}
var job = this._client.job(jobId);
job.getMetadata(function(err, data){
if (err) { callback(err); return; }
callback(null, convertStatus(jobname, data));
});
};
Monitor.prototype.kill = function(query_id, callback){
callback(null);
};
================================================
FILE: lib/shib/engines/dummy/index.js
================================================
/*
* This engine is for development on local environment
*/
var Executer = exports.Executer = function(conf, logger){
if (conf.name !== 'dummy')
throw "executer name mismatch for dummy:" + conf.name;
this.logger = logger;
};
Executer.prototype.end = function(){
};
Executer.prototype.supports = function(operation){
switch (operation) { // "executer" methods
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'partitions':
case 'describe':
case 'execute':
return true;
}
throw "unknown operation name (for dummy):" + operation;
};
Executer.prototype.jobname = function(queryid) {
return 'dummy-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
callback(null);
};
Executer.prototype.databases = function(callback){
callback(null, [ ['default'], ['dummy1'] ]);
};
Executer.prototype.tables = function(dbname, callback){
callback(null, [ ['t1'], ['t2'] ]);
};
Executer.prototype.partitions = function(dbname, tablename, callback){
callback(null, ['f1=1/f2=1', 'f1=1/f2=2', 'f1=2/f2=1', 'f1=2/f2=2']);
};
Executer.prototype.describe = function(dbname, tablename, callback){
callback(null, [ ['f1', 'string', ''], ['f2', 'string', ''], ['id', 'bigint', ''], ['json', 'string', ''] ]);
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
callback(null, new Fetcher(this));
};
/*
* Fetcher
*
* schema(callback): callback(err, schema)
* schema: [ { name: 'fieldname1', type: 'typename' }, ...]
*
* fetch(num, callback): callback(err, rows)
* num: rows to fetch (null == all)
* rows: ["_col1value_\t_col2value_\t_col3value_", "_col1value_\t_col2value_\t_col3value_", ...]
* no more rows exists if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1))
*/
var Fetcher = function(client){
this.schema = function(callback){
callback(null, [ {name:"f1", type:"string"}, {name:"f2", type:"string"}, {name:"id", type:"bigint"}, {name:"json", type:"string"} ]);
};
var finished = false;
this.fetch = function(num, callback){
// always returns only 4 row after 10 seconds
if (finished) {
callback(null, []);
return;
}
setTimeout(function(){
callback(null, ["1\t1\t1000\t{}", "1\t2\t1001\t{}", "2\t1\t1002\t{}", "2\t2\t1003\t{}"]);
finished = true;
}, 10000);
};
};
var Monitor = exports.Monitor = function(conf){
if (conf.name !== 'dummy')
throw "executer name mismatch for dummy:" + conf.name;
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) { // "monitor" methods
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for dummy.Monitor):" + operation;
};
Monitor.prototype.status = function(jobname, callback){
callback(null, {
jobid: "dummy-id-000001",
name: jobname,
priority: "unknown",
state: "RUNNING",
trackingURL: "http://localhost/dummy/",
startTime: new Date().toLocaleString(),
mapComplete: null,
reduceComplete: null
});
};
Monitor.prototype.kill = function(query_id, callback){
callback(null);
};
================================================
FILE: lib/shib/engines/dummyengine.js
================================================
var Executer = exports.Executer = function(){
this.supports = function(operation){ return true; };
};
Executer.prototype.jobname = function(queryid) {
return 'dummy-shib-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
callback(null);
};
Executer.prototype.databases = function(callback){
callback(null, []); // ['db1', 'db2']
};
Executer.prototype.tables = function(dbname, callback){
callback(null, []); // ['table1', 'table2']
};
Executer.prototype.partitions = function(dbname, tablename, callback){
callback(null, []); // ['f1=va1/f2=vb1', 'f1=va1/f2=vb2']
};
Executer.prototype.describe = function(dbname, tablename, callback){
callback(null, []); // [ [ 'fieldname', 'type', 'comment' ], ... ]
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
callback(null, new Fetcher());
};
Executer.prototype.end = function(){};
var Fetcher = function(){
this.schema = function(callback){ callback(null, []); };
this.fetch = function(num, callback){ callback(null, []); };
};
/*
* Fetcher
*
* schema(callback): callback(err, schema)
* schema: [ { name: 'fieldname1', type: 'typename' }, ...]
*
* fetch(num, callback): callback(err, rows)
* num: rows to fetch (null == all)
* rows: ["_col1value_\t_col2value_\t_col3value_", "_col1value_\t_col2value_\t_col3value_", ...]
* no more rows exists if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1))
*/
var Monitor = exports.Monitor = function(){
this.supports = function(operation){ return false; };
};
Monitor.prototype.status = function(jobname, callback){
callback(null, {});
};
Monitor.prototype.kill = function(jobid, callback){
callback(null);
};
Monitor.prototype.end = function(){};
================================================
FILE: lib/shib/engines/hiveserver/FacebookService.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = require('./fb303_types');
//HELPER FUNCTIONS AND STRUCTURES
var FacebookService_getName_args = function(args) {
};
FacebookService_getName_args.prototype = {};
FacebookService_getName_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getName_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getName_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getName_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getName_result.prototype = {};
FacebookService_getName_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 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;
};
FacebookService_getName_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getName_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getVersion_args = function(args) {
};
FacebookService_getVersion_args.prototype = {};
FacebookService_getVersion_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getVersion_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getVersion_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getVersion_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getVersion_result.prototype = {};
FacebookService_getVersion_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 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;
};
FacebookService_getVersion_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getVersion_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getStatus_args = function(args) {
};
FacebookService_getStatus_args.prototype = {};
FacebookService_getStatus_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getStatus_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getStatus_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getStatus_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getStatus_result.prototype = {};
FacebookService_getStatus_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.I32) {
this.success = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getStatus_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getStatus_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.I32, 0);
output.writeI32(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getStatusDetails_args = function(args) {
};
FacebookService_getStatusDetails_args.prototype = {};
FacebookService_getStatusDetails_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getStatusDetails_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getStatusDetails_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getStatusDetails_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getStatusDetails_result.prototype = {};
FacebookService_getStatusDetails_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 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;
};
FacebookService_getStatusDetails_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getStatusDetails_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCounters_args = function(args) {
};
FacebookService_getCounters_args.prototype = {};
FacebookService_getCounters_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getCounters_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCounters_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCounters_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getCounters_result.prototype = {};
FacebookService_getCounters_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.MAP) {
var _size0 = 0;
var _rtmp34;
this.success = {};
var _ktype1 = 0;
var _vtype2 = 0;
_rtmp34 = input.readMapBegin();
_ktype1 = _rtmp34.ktype;
_vtype2 = _rtmp34.vtype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
if (_i5 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key6 = null;
var val7 = null;
key6 = input.readString();
val7 = input.readI64();
this.success[key6] = val7;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getCounters_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCounters_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.MAP, 0);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.success));
for (var kiter8 in this.success)
{
if (this.success.hasOwnProperty(kiter8))
{
var viter9 = this.success[kiter8];
output.writeString(kiter8);
output.writeI64(viter9);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCounter_args = function(args) {
this.key = null;
if (args) {
if (args.key !== undefined) {
this.key = args.key;
}
}
};
FacebookService_getCounter_args.prototype = {};
FacebookService_getCounter_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.key = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getCounter_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCounter_args');
if (this.key) {
output.writeFieldBegin('key', Thrift.Type.STRING, 1);
output.writeString(this.key);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCounter_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getCounter_result.prototype = {};
FacebookService_getCounter_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.I64) {
this.success = input.readI64();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getCounter_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCounter_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.I64, 0);
output.writeI64(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_setOption_args = function(args) {
this.key = null;
this.value = null;
if (args) {
if (args.key !== undefined) {
this.key = args.key;
}
if (args.value !== undefined) {
this.value = args.value;
}
}
};
FacebookService_setOption_args.prototype = {};
FacebookService_setOption_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.key = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.value = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_setOption_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_setOption_args');
if (this.key) {
output.writeFieldBegin('key', Thrift.Type.STRING, 1);
output.writeString(this.key);
output.writeFieldEnd();
}
if (this.value) {
output.writeFieldBegin('value', Thrift.Type.STRING, 2);
output.writeString(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_setOption_result = function(args) {
};
FacebookService_setOption_result.prototype = {};
FacebookService_setOption_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_setOption_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_setOption_result');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getOption_args = function(args) {
this.key = null;
if (args) {
if (args.key !== undefined) {
this.key = args.key;
}
}
};
FacebookService_getOption_args.prototype = {};
FacebookService_getOption_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.key = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getOption_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getOption_args');
if (this.key) {
output.writeFieldBegin('key', Thrift.Type.STRING, 1);
output.writeString(this.key);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getOption_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getOption_result.prototype = {};
FacebookService_getOption_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 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;
};
FacebookService_getOption_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getOption_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getOptions_args = function(args) {
};
FacebookService_getOptions_args.prototype = {};
FacebookService_getOptions_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getOptions_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getOptions_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getOptions_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getOptions_result.prototype = {};
FacebookService_getOptions_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.MAP) {
var _size10 = 0;
var _rtmp314;
this.success = {};
var _ktype11 = 0;
var _vtype12 = 0;
_rtmp314 = input.readMapBegin();
_ktype11 = _rtmp314.ktype;
_vtype12 = _rtmp314.vtype;
_size10 = _rtmp314.size;
for (var _i15 = 0; _i15 < _size10; ++_i15)
{
if (_i15 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key16 = null;
var val17 = null;
key16 = input.readString();
val17 = input.readString();
this.success[key16] = val17;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getOptions_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getOptions_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.MAP, 0);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.success));
for (var kiter18 in this.success)
{
if (this.success.hasOwnProperty(kiter18))
{
var viter19 = this.success[kiter18];
output.writeString(kiter18);
output.writeString(viter19);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCpuProfile_args = function(args) {
this.profileDurationInSec = null;
if (args) {
if (args.profileDurationInSec !== undefined) {
this.profileDurationInSec = args.profileDurationInSec;
}
}
};
FacebookService_getCpuProfile_args.prototype = {};
FacebookService_getCpuProfile_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.profileDurationInSec = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_getCpuProfile_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCpuProfile_args');
if (this.profileDurationInSec) {
output.writeFieldBegin('profileDurationInSec', Thrift.Type.I32, 1);
output.writeI32(this.profileDurationInSec);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_getCpuProfile_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_getCpuProfile_result.prototype = {};
FacebookService_getCpuProfile_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 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;
};
FacebookService_getCpuProfile_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_getCpuProfile_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_aliveSince_args = function(args) {
};
FacebookService_aliveSince_args.prototype = {};
FacebookService_aliveSince_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_aliveSince_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_aliveSince_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_aliveSince_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
FacebookService_aliveSince_result.prototype = {};
FacebookService_aliveSince_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.I64) {
this.success = input.readI64();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_aliveSince_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_aliveSince_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.I64, 0);
output.writeI64(this.success);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_reinitialize_args = function(args) {
};
FacebookService_reinitialize_args.prototype = {};
FacebookService_reinitialize_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_reinitialize_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_reinitialize_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_reinitialize_result = function(args) {
};
FacebookService_reinitialize_result.prototype = {};
FacebookService_reinitialize_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_reinitialize_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_reinitialize_result');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_shutdown_args = function(args) {
};
FacebookService_shutdown_args.prototype = {};
FacebookService_shutdown_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_shutdown_args.prototype.write = function(output) {
output.writeStructBegin('FacebookService_shutdown_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookService_shutdown_result = function(args) {
};
FacebookService_shutdown_result.prototype = {};
FacebookService_shutdown_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FacebookService_shutdown_result.prototype.write = function(output) {
output.writeStructBegin('FacebookService_shutdown_result');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FacebookServiceClient = exports.Client = function(output, pClass) {
this.output = output;
this.pClass = pClass;
this.seqid = 0;
this._reqs = {};
};
FacebookServiceClient.prototype = {};
FacebookServiceClient.prototype.getName = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getName();
};
FacebookServiceClient.prototype.send_getName = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getName', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getName_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getName = 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 FacebookService_getName_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getName failed: unknown result');
};
FacebookServiceClient.prototype.getVersion = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getVersion();
};
FacebookServiceClient.prototype.send_getVersion = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getVersion', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getVersion_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getVersion = 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 FacebookService_getVersion_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getVersion failed: unknown result');
};
FacebookServiceClient.prototype.getStatus = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getStatus();
};
FacebookServiceClient.prototype.send_getStatus = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getStatus', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getStatus_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getStatus = 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 FacebookService_getStatus_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getStatus failed: unknown result');
};
FacebookServiceClient.prototype.getStatusDetails = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getStatusDetails();
};
FacebookServiceClient.prototype.send_getStatusDetails = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getStatusDetails', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getStatusDetails_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getStatusDetails = 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 FacebookService_getStatusDetails_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getStatusDetails failed: unknown result');
};
FacebookServiceClient.prototype.getCounters = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getCounters();
};
FacebookServiceClient.prototype.send_getCounters = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getCounters', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getCounters_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getCounters = 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 FacebookService_getCounters_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getCounters failed: unknown result');
};
FacebookServiceClient.prototype.getCounter = function(key, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getCounter(key);
};
FacebookServiceClient.prototype.send_getCounter = function(key) {
var output = new this.pClass(this.output);
output.writeMessageBegin('getCounter', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getCounter_args();
args.key = key;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getCounter = 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 FacebookService_getCounter_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getCounter failed: unknown result');
};
FacebookServiceClient.prototype.setOption = function(key, value, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_setOption(key, value);
};
FacebookServiceClient.prototype.send_setOption = function(key, value) {
var output = new this.pClass(this.output);
output.writeMessageBegin('setOption', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_setOption_args();
args.key = key;
args.value = value;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_setOption = 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 FacebookService_setOption_result();
result.read(input);
input.readMessageEnd();
callback(null)
};
FacebookServiceClient.prototype.getOption = function(key, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getOption(key);
};
FacebookServiceClient.prototype.send_getOption = function(key) {
var output = new this.pClass(this.output);
output.writeMessageBegin('getOption', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getOption_args();
args.key = key;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getOption = 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 FacebookService_getOption_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getOption failed: unknown result');
};
FacebookServiceClient.prototype.getOptions = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getOptions();
};
FacebookServiceClient.prototype.send_getOptions = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getOptions', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getOptions_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getOptions = 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 FacebookService_getOptions_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getOptions failed: unknown result');
};
FacebookServiceClient.prototype.getCpuProfile = function(profileDurationInSec, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getCpuProfile(profileDurationInSec);
};
FacebookServiceClient.prototype.send_getCpuProfile = function(profileDurationInSec) {
var output = new this.pClass(this.output);
output.writeMessageBegin('getCpuProfile', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_getCpuProfile_args();
args.profileDurationInSec = profileDurationInSec;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_getCpuProfile = 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 FacebookService_getCpuProfile_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getCpuProfile failed: unknown result');
};
FacebookServiceClient.prototype.aliveSince = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_aliveSince();
};
FacebookServiceClient.prototype.send_aliveSince = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('aliveSince', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_aliveSince_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.recv_aliveSince = 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 FacebookService_aliveSince_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('aliveSince failed: unknown result');
};
FacebookServiceClient.prototype.reinitialize = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_reinitialize();
};
FacebookServiceClient.prototype.send_reinitialize = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('reinitialize', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_reinitialize_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
FacebookServiceClient.prototype.shutdown = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_shutdown();
};
FacebookServiceClient.prototype.send_shutdown = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('shutdown', Thrift.MessageType.CALL, this.seqid);
var args = new FacebookService_shutdown_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
var FacebookServiceProcessor = exports.Processor = function(handler) {
this._handler = handler
}
FacebookServiceProcessor.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();
}
}
FacebookServiceProcessor.prototype.process_getName = function(seqid, input, output) {
var args = new FacebookService_getName_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getName_result();
this._handler.getName(function (success) {
result.success = success;
output.writeMessageBegin("getName", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getVersion = function(seqid, input, output) {
var args = new FacebookService_getVersion_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getVersion_result();
this._handler.getVersion(function (success) {
result.success = success;
output.writeMessageBegin("getVersion", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getStatus = function(seqid, input, output) {
var args = new FacebookService_getStatus_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getStatus_result();
this._handler.getStatus(function (success) {
result.success = success;
output.writeMessageBegin("getStatus", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getStatusDetails = function(seqid, input, output) {
var args = new FacebookService_getStatusDetails_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getStatusDetails_result();
this._handler.getStatusDetails(function (success) {
result.success = success;
output.writeMessageBegin("getStatusDetails", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getCounters = function(seqid, input, output) {
var args = new FacebookService_getCounters_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getCounters_result();
this._handler.getCounters(function (success) {
result.success = success;
output.writeMessageBegin("getCounters", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getCounter = function(seqid, input, output) {
var args = new FacebookService_getCounter_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getCounter_result();
this._handler.getCounter(args.key, function (success) {
result.success = success;
output.writeMessageBegin("getCounter", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_setOption = function(seqid, input, output) {
var args = new FacebookService_setOption_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_setOption_result();
this._handler.setOption(args.key, args.value, function (success) {
result.success = success;
output.writeMessageBegin("setOption", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getOption = function(seqid, input, output) {
var args = new FacebookService_getOption_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getOption_result();
this._handler.getOption(args.key, function (success) {
result.success = success;
output.writeMessageBegin("getOption", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getOptions = function(seqid, input, output) {
var args = new FacebookService_getOptions_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getOptions_result();
this._handler.getOptions(function (success) {
result.success = success;
output.writeMessageBegin("getOptions", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_getCpuProfile = function(seqid, input, output) {
var args = new FacebookService_getCpuProfile_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_getCpuProfile_result();
this._handler.getCpuProfile(args.profileDurationInSec, function (success) {
result.success = success;
output.writeMessageBegin("getCpuProfile", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_aliveSince = function(seqid, input, output) {
var args = new FacebookService_aliveSince_args();
args.read(input);
input.readMessageEnd();
var result = new FacebookService_aliveSince_result();
this._handler.aliveSince(function (success) {
result.success = success;
output.writeMessageBegin("aliveSince", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
FacebookServiceProcessor.prototype.process_reinitialize = function(seqid, input, output) {
var args = new FacebookService_reinitialize_args();
args.read(input);
input.readMessageEnd();
this._handler.reinitialize()
}
FacebookServiceProcessor.prototype.process_shutdown = function(seqid, input, output) {
var args = new FacebookService_shutdown_args();
args.read(input);
input.readMessageEnd();
this._handler.shutdown()
}
================================================
FILE: lib/shib/engines/hiveserver/ThriftHive.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var fb303_ttypes = require('./fb303_types')
var hive_metastore_ttypes = require('./hive_metastore_types')
var queryplan_ttypes = require('./queryplan_types')
var ThriftHiveMetastore = require('./ThriftHiveMetastore')
var ThriftHiveMetastoreClient = ThriftHiveMetastore.Client
var ThriftHiveMetastoreProcessor = ThriftHiveMetastore.Processor
var ttypes = require('./hive_service_types');
//HELPER FUNCTIONS AND STRUCTURES
var ThriftHive_execute_args = function(args) {
this.query = null;
if (args) {
if (args.query !== undefined) {
this.query = args.query;
}
}
};
ThriftHive_execute_args.prototype = {};
ThriftHive_execute_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.query = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_execute_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_execute_args');
if (this.query) {
output.writeFieldBegin('query', Thrift.Type.STRING, 1);
output.writeString(this.query);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_execute_result = function(args) {
this.ex = null;
if (args) {
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_execute_result.prototype = {};
ThriftHive_execute_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_execute_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_execute_result');
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchOne_args = function(args) {
};
ThriftHive_fetchOne_args.prototype = {};
ThriftHive_fetchOne_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchOne_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchOne_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchOne_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_fetchOne_result.prototype = {};
ThriftHive_fetchOne_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRING) {
this.success = input.readString();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchOne_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchOne_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchN_args = function(args) {
this.numRows = null;
if (args) {
if (args.numRows !== undefined) {
this.numRows = args.numRows;
}
}
};
ThriftHive_fetchN_args.prototype = {};
ThriftHive_fetchN_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.numRows = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchN_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchN_args');
if (this.numRows) {
output.writeFieldBegin('numRows', Thrift.Type.I32, 1);
output.writeI32(this.numRows);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchN_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_fetchN_result.prototype = {};
ThriftHive_fetchN_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size0 = 0;
var _rtmp34;
this.success = [];
var _etype3 = 0;
_rtmp34 = input.readListBegin();
_etype3 = _rtmp34.etype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var elem6 = null;
elem6 = input.readString();
this.success.push(elem6);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchN_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchN_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter7 in this.success)
{
if (this.success.hasOwnProperty(iter7))
{
iter7 = this.success[iter7];
output.writeString(iter7);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchAll_args = function(args) {
};
ThriftHive_fetchAll_args.prototype = {};
ThriftHive_fetchAll_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchAll_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchAll_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_fetchAll_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_fetchAll_result.prototype = {};
ThriftHive_fetchAll_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size8 = 0;
var _rtmp312;
this.success = [];
var _etype11 = 0;
_rtmp312 = input.readListBegin();
_etype11 = _rtmp312.etype;
_size8 = _rtmp312.size;
for (var _i13 = 0; _i13 < _size8; ++_i13)
{
var elem14 = null;
elem14 = input.readString();
this.success.push(elem14);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_fetchAll_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_fetchAll_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter15 in this.success)
{
if (this.success.hasOwnProperty(iter15))
{
iter15 = this.success[iter15];
output.writeString(iter15);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getSchema_args = function(args) {
};
ThriftHive_getSchema_args.prototype = {};
ThriftHive_getSchema_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getSchema_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getSchema_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getSchema_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_getSchema_result.prototype = {};
ThriftHive_getSchema_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new hive_metastore_ttypes.Schema();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getSchema_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getSchema_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getThriftSchema_args = function(args) {
};
ThriftHive_getThriftSchema_args.prototype = {};
ThriftHive_getThriftSchema_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getThriftSchema_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getThriftSchema_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getThriftSchema_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_getThriftSchema_result.prototype = {};
ThriftHive_getThriftSchema_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new hive_metastore_ttypes.Schema();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getThriftSchema_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getThriftSchema_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getClusterStatus_args = function(args) {
};
ThriftHive_getClusterStatus_args.prototype = {};
ThriftHive_getClusterStatus_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getClusterStatus_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getClusterStatus_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getClusterStatus_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_getClusterStatus_result.prototype = {};
ThriftHive_getClusterStatus_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.HiveClusterStatus();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getClusterStatus_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getClusterStatus_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getQueryPlan_args = function(args) {
};
ThriftHive_getQueryPlan_args.prototype = {};
ThriftHive_getQueryPlan_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getQueryPlan_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getQueryPlan_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_getQueryPlan_result = function(args) {
this.success = null;
this.ex = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.ex !== undefined) {
this.ex = args.ex;
}
}
};
ThriftHive_getQueryPlan_result.prototype = {};
ThriftHive_getQueryPlan_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new queryplan_ttypes.QueryPlan();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.ex = new ttypes.HiveServerException();
this.ex.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_getQueryPlan_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_getQueryPlan_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.ex) {
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
this.ex.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_clean_args = function(args) {
};
ThriftHive_clean_args.prototype = {};
ThriftHive_clean_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_clean_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_clean_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHive_clean_result = function(args) {
};
ThriftHive_clean_result.prototype = {};
ThriftHive_clean_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHive_clean_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHive_clean_result');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveClient = exports.Client = function(output, pClass) {
this.output = output;
this.pClass = pClass;
this.seqid = 0;
this._reqs = {};
};
Thrift.inherits(ThriftHiveClient, ThriftHiveMetastoreClient)
ThriftHiveClient.prototype.execute = function(query, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_execute(query);
};
ThriftHiveClient.prototype.send_execute = function(query) {
var output = new this.pClass(this.output);
output.writeMessageBegin('execute', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_execute_args();
args.query = query;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_execute = 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 ThriftHive_execute_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
callback(null)
};
ThriftHiveClient.prototype.fetchOne = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_fetchOne();
};
ThriftHiveClient.prototype.send_fetchOne = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('fetchOne', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_fetchOne_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_fetchOne = 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 ThriftHive_fetchOne_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('fetchOne failed: unknown result');
};
ThriftHiveClient.prototype.fetchN = function(numRows, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_fetchN(numRows);
};
ThriftHiveClient.prototype.send_fetchN = function(numRows) {
var output = new this.pClass(this.output);
output.writeMessageBegin('fetchN', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_fetchN_args();
args.numRows = numRows;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_fetchN = 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 ThriftHive_fetchN_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('fetchN failed: unknown result');
};
ThriftHiveClient.prototype.fetchAll = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_fetchAll();
};
ThriftHiveClient.prototype.send_fetchAll = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('fetchAll', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_fetchAll_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_fetchAll = 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 ThriftHive_fetchAll_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('fetchAll failed: unknown result');
};
ThriftHiveClient.prototype.getSchema = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getSchema();
};
ThriftHiveClient.prototype.send_getSchema = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getSchema', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_getSchema_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_getSchema = 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 ThriftHive_getSchema_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getSchema failed: unknown result');
};
ThriftHiveClient.prototype.getThriftSchema = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getThriftSchema();
};
ThriftHiveClient.prototype.send_getThriftSchema = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getThriftSchema', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_getThriftSchema_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_getThriftSchema = 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 ThriftHive_getThriftSchema_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getThriftSchema failed: unknown result');
};
ThriftHiveClient.prototype.getClusterStatus = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getClusterStatus();
};
ThriftHiveClient.prototype.send_getClusterStatus = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getClusterStatus', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_getClusterStatus_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_getClusterStatus = 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 ThriftHive_getClusterStatus_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getClusterStatus failed: unknown result');
};
ThriftHiveClient.prototype.getQueryPlan = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_getQueryPlan();
};
ThriftHiveClient.prototype.send_getQueryPlan = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('getQueryPlan', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_getQueryPlan_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.prototype.recv_getQueryPlan = 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 ThriftHive_getQueryPlan_result();
result.read(input);
input.readMessageEnd();
if (null !== result.ex) {
return callback(result.ex);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('getQueryPlan failed: unknown result');
};
ThriftHiveClient.prototype.clean = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_clean();
};
ThriftHiveClient.prototype.send_clean = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('clean', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHive_clean_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveClient.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 ThriftHive_clean_result();
result.read(input);
input.readMessageEnd();
callback(null)
};
var ThriftHiveProcessor = exports.Processor = function(handler) {
this._handler = handler
}
Thrift.inherits(ThriftHiveProcessor, ThriftHiveMetastoreProcessor)
ThriftHiveProcessor.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();
}
}
ThriftHiveProcessor.prototype.process_execute = function(seqid, input, output) {
var args = new ThriftHive_execute_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_execute_result();
this._handler.execute(args.query, function (success) {
result.success = success;
output.writeMessageBegin("execute", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_fetchOne = function(seqid, input, output) {
var args = new ThriftHive_fetchOne_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_fetchOne_result();
this._handler.fetchOne(function (success) {
result.success = success;
output.writeMessageBegin("fetchOne", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_fetchN = function(seqid, input, output) {
var args = new ThriftHive_fetchN_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_fetchN_result();
this._handler.fetchN(args.numRows, function (success) {
result.success = success;
output.writeMessageBegin("fetchN", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_fetchAll = function(seqid, input, output) {
var args = new ThriftHive_fetchAll_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_fetchAll_result();
this._handler.fetchAll(function (success) {
result.success = success;
output.writeMessageBegin("fetchAll", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_getSchema = function(seqid, input, output) {
var args = new ThriftHive_getSchema_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_getSchema_result();
this._handler.getSchema(function (success) {
result.success = success;
output.writeMessageBegin("getSchema", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_getThriftSchema = function(seqid, input, output) {
var args = new ThriftHive_getThriftSchema_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_getThriftSchema_result();
this._handler.getThriftSchema(function (success) {
result.success = success;
output.writeMessageBegin("getThriftSchema", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_getClusterStatus = function(seqid, input, output) {
var args = new ThriftHive_getClusterStatus_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_getClusterStatus_result();
this._handler.getClusterStatus(function (success) {
result.success = success;
output.writeMessageBegin("getClusterStatus", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_getQueryPlan = function(seqid, input, output) {
var args = new ThriftHive_getQueryPlan_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_getQueryPlan_result();
this._handler.getQueryPlan(function (success) {
result.success = success;
output.writeMessageBegin("getQueryPlan", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveProcessor.prototype.process_clean = function(seqid, input, output) {
var args = new ThriftHive_clean_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHive_clean_result();
this._handler.clean(function (success) {
result.success = success;
output.writeMessageBegin("clean", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
================================================
FILE: lib/shib/engines/hiveserver/ThriftHiveMetastore.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var fb303_ttypes = require('./fb303_types')
var FacebookService = require('./FacebookService')
var FacebookServiceClient = FacebookService.Client
var FacebookServiceProcessor = FacebookService.Processor
var ttypes = require('./hive_metastore_types');
//HELPER FUNCTIONS AND STRUCTURES
var ThriftHiveMetastore_create_database_args = function(args) {
this.database = null;
if (args) {
if (args.database !== undefined) {
this.database = args.database;
}
}
};
ThriftHiveMetastore_create_database_args.prototype = {};
ThriftHiveMetastore_create_database_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.database = new ttypes.Database();
this.database.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_database_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_database_args');
if (this.database) {
output.writeFieldBegin('database', Thrift.Type.STRUCT, 1);
this.database.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_database_result = function(args) {
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_create_database_result.prototype = {};
ThriftHiveMetastore_create_database_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.AlreadyExistsException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.InvalidObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_database_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_database_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_database_args = function(args) {
this.name = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
}
};
ThriftHiveMetastore_get_database_args.prototype = {};
ThriftHiveMetastore_get_database_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_database_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_database_args');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_database_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_database_result.prototype = {};
ThriftHiveMetastore_get_database_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Database();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_database_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_database_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_database_args = function(args) {
this.name = null;
this.deleteData = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.deleteData !== undefined) {
this.deleteData = args.deleteData;
}
}
};
ThriftHiveMetastore_drop_database_args.prototype = {};
ThriftHiveMetastore_drop_database_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.deleteData = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_database_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_database_args');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.deleteData) {
output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 2);
output.writeBool(this.deleteData);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_database_result = function(args) {
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_drop_database_result.prototype = {};
ThriftHiveMetastore_drop_database_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.InvalidOperationException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_database_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_database_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_databases_args = function(args) {
this.pattern = null;
if (args) {
if (args.pattern !== undefined) {
this.pattern = args.pattern;
}
}
};
ThriftHiveMetastore_get_databases_args.prototype = {};
ThriftHiveMetastore_get_databases_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.pattern = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_databases_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_databases_args');
if (this.pattern) {
output.writeFieldBegin('pattern', Thrift.Type.STRING, 1);
output.writeString(this.pattern);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_databases_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_databases_result.prototype = {};
ThriftHiveMetastore_get_databases_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size196 = 0;
var _rtmp3200;
this.success = [];
var _etype199 = 0;
_rtmp3200 = input.readListBegin();
_etype199 = _rtmp3200.etype;
_size196 = _rtmp3200.size;
for (var _i201 = 0; _i201 < _size196; ++_i201)
{
var elem202 = null;
elem202 = input.readString();
this.success.push(elem202);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_databases_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_databases_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter203 in this.success)
{
if (this.success.hasOwnProperty(iter203))
{
iter203 = this.success[iter203];
output.writeString(iter203);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_all_databases_args = function(args) {
};
ThriftHiveMetastore_get_all_databases_args.prototype = {};
ThriftHiveMetastore_get_all_databases_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_all_databases_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_all_databases_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_all_databases_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_all_databases_result.prototype = {};
ThriftHiveMetastore_get_all_databases_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size204 = 0;
var _rtmp3208;
this.success = [];
var _etype207 = 0;
_rtmp3208 = input.readListBegin();
_etype207 = _rtmp3208.etype;
_size204 = _rtmp3208.size;
for (var _i209 = 0; _i209 < _size204; ++_i209)
{
var elem210 = null;
elem210 = input.readString();
this.success.push(elem210);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_all_databases_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_all_databases_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter211 in this.success)
{
if (this.success.hasOwnProperty(iter211))
{
iter211 = this.success[iter211];
output.writeString(iter211);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_database_args = function(args) {
this.dbname = null;
this.db = null;
if (args) {
if (args.dbname !== undefined) {
this.dbname = args.dbname;
}
if (args.db !== undefined) {
this.db = args.db;
}
}
};
ThriftHiveMetastore_alter_database_args.prototype = {};
ThriftHiveMetastore_alter_database_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.dbname = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.db = new ttypes.Database();
this.db.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_database_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_database_args');
if (this.dbname) {
output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);
output.writeString(this.dbname);
output.writeFieldEnd();
}
if (this.db) {
output.writeFieldBegin('db', Thrift.Type.STRUCT, 2);
this.db.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_database_result = function(args) {
this.o1 = null;
this.o2 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_alter_database_result.prototype = {};
ThriftHiveMetastore_alter_database_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_database_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_database_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_type_args = function(args) {
this.name = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
}
};
ThriftHiveMetastore_get_type_args.prototype = {};
ThriftHiveMetastore_get_type_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_type_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_type_args');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_type_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_type_result.prototype = {};
ThriftHiveMetastore_get_type_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Type();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_type_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_type_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_type_args = function(args) {
this.type = null;
if (args) {
if (args.type !== undefined) {
this.type = args.type;
}
}
};
ThriftHiveMetastore_create_type_args.prototype = {};
ThriftHiveMetastore_create_type_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.type = new ttypes.Type();
this.type.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_type_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_type_args');
if (this.type) {
output.writeFieldBegin('type', Thrift.Type.STRUCT, 1);
this.type.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_type_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_create_type_result.prototype = {};
ThriftHiveMetastore_create_type_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.AlreadyExistsException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.InvalidObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_type_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_type_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_type_args = function(args) {
this.type = null;
if (args) {
if (args.type !== undefined) {
this.type = args.type;
}
}
};
ThriftHiveMetastore_drop_type_args.prototype = {};
ThriftHiveMetastore_drop_type_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.type = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_type_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_type_args');
if (this.type) {
output.writeFieldBegin('type', Thrift.Type.STRING, 1);
output.writeString(this.type);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_type_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_drop_type_result.prototype = {};
ThriftHiveMetastore_drop_type_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_type_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_type_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_type_all_args = function(args) {
this.name = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
}
};
ThriftHiveMetastore_get_type_all_args.prototype = {};
ThriftHiveMetastore_get_type_all_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_type_all_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_type_all_args');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_type_all_result = function(args) {
this.success = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_type_all_result.prototype = {};
ThriftHiveMetastore_get_type_all_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.MAP) {
var _size212 = 0;
var _rtmp3216;
this.success = {};
var _ktype213 = 0;
var _vtype214 = 0;
_rtmp3216 = input.readMapBegin();
_ktype213 = _rtmp3216.ktype;
_vtype214 = _rtmp3216.vtype;
_size212 = _rtmp3216.size;
for (var _i217 = 0; _i217 < _size212; ++_i217)
{
if (_i217 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key218 = null;
var val219 = null;
key218 = input.readString();
val219 = new ttypes.Type();
val219.read(input);
this.success[key218] = val219;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_type_all_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_type_all_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.MAP, 0);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.success));
for (var kiter220 in this.success)
{
if (this.success.hasOwnProperty(kiter220))
{
var viter221 = this.success[kiter220];
output.writeString(kiter220);
viter221.write(output);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_fields_args = function(args) {
this.db_name = null;
this.table_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.table_name !== undefined) {
this.table_name = args.table_name;
}
}
};
ThriftHiveMetastore_get_fields_args.prototype = {};
ThriftHiveMetastore_get_fields_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.table_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_fields_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_fields_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.table_name) {
output.writeFieldBegin('table_name', Thrift.Type.STRING, 2);
output.writeString(this.table_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_fields_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_get_fields_result.prototype = {};
ThriftHiveMetastore_get_fields_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size222 = 0;
var _rtmp3226;
this.success = [];
var _etype225 = 0;
_rtmp3226 = input.readListBegin();
_etype225 = _rtmp3226.etype;
_size222 = _rtmp3226.size;
for (var _i227 = 0; _i227 < _size222; ++_i227)
{
var elem228 = null;
elem228 = new ttypes.FieldSchema();
elem228.read(input);
this.success.push(elem228);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.UnknownTableException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.UnknownDBException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_fields_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_fields_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter229 in this.success)
{
if (this.success.hasOwnProperty(iter229))
{
iter229 = this.success[iter229];
iter229.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_schema_args = function(args) {
this.db_name = null;
this.table_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.table_name !== undefined) {
this.table_name = args.table_name;
}
}
};
ThriftHiveMetastore_get_schema_args.prototype = {};
ThriftHiveMetastore_get_schema_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.table_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_schema_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_schema_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.table_name) {
output.writeFieldBegin('table_name', Thrift.Type.STRING, 2);
output.writeString(this.table_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_schema_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_get_schema_result.prototype = {};
ThriftHiveMetastore_get_schema_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size230 = 0;
var _rtmp3234;
this.success = [];
var _etype233 = 0;
_rtmp3234 = input.readListBegin();
_etype233 = _rtmp3234.etype;
_size230 = _rtmp3234.size;
for (var _i235 = 0; _i235 < _size230; ++_i235)
{
var elem236 = null;
elem236 = new ttypes.FieldSchema();
elem236.read(input);
this.success.push(elem236);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.UnknownTableException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.UnknownDBException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_schema_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_schema_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter237 in this.success)
{
if (this.success.hasOwnProperty(iter237))
{
iter237 = this.success[iter237];
iter237.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_table_args = function(args) {
this.tbl = null;
if (args) {
if (args.tbl !== undefined) {
this.tbl = args.tbl;
}
}
};
ThriftHiveMetastore_create_table_args.prototype = {};
ThriftHiveMetastore_create_table_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.tbl = new ttypes.Table();
this.tbl.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_table_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_table_args');
if (this.tbl) {
output.writeFieldBegin('tbl', Thrift.Type.STRUCT, 1);
this.tbl.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_table_result = function(args) {
this.o1 = null;
this.o2 = null;
this.o3 = null;
this.o4 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
if (args.o4 !== undefined) {
this.o4 = args.o4;
}
}
};
ThriftHiveMetastore_create_table_result.prototype = {};
ThriftHiveMetastore_create_table_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.AlreadyExistsException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.InvalidObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.o4 = new ttypes.NoSuchObjectException();
this.o4.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_table_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_table_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
if (this.o4) {
output.writeFieldBegin('o4', Thrift.Type.STRUCT, 4);
this.o4.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_table_args = function(args) {
this.dbname = null;
this.name = null;
this.deleteData = null;
if (args) {
if (args.dbname !== undefined) {
this.dbname = args.dbname;
}
if (args.name !== undefined) {
this.name = args.name;
}
if (args.deleteData !== undefined) {
this.deleteData = args.deleteData;
}
}
};
ThriftHiveMetastore_drop_table_args.prototype = {};
ThriftHiveMetastore_drop_table_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.dbname = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.BOOL) {
this.deleteData = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_table_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_table_args');
if (this.dbname) {
output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);
output.writeString(this.dbname);
output.writeFieldEnd();
}
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 2);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.deleteData) {
output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 3);
output.writeBool(this.deleteData);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_table_result = function(args) {
this.o1 = null;
this.o3 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_drop_table_result.prototype = {};
ThriftHiveMetastore_drop_table_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_table_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_table_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 2);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_tables_args = function(args) {
this.db_name = null;
this.pattern = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.pattern !== undefined) {
this.pattern = args.pattern;
}
}
};
ThriftHiveMetastore_get_tables_args.prototype = {};
ThriftHiveMetastore_get_tables_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.pattern = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_tables_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_tables_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.pattern) {
output.writeFieldBegin('pattern', Thrift.Type.STRING, 2);
output.writeString(this.pattern);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_tables_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_tables_result.prototype = {};
ThriftHiveMetastore_get_tables_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size238 = 0;
var _rtmp3242;
this.success = [];
var _etype241 = 0;
_rtmp3242 = input.readListBegin();
_etype241 = _rtmp3242.etype;
_size238 = _rtmp3242.size;
for (var _i243 = 0; _i243 < _size238; ++_i243)
{
var elem244 = null;
elem244 = input.readString();
this.success.push(elem244);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_tables_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_tables_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter245 in this.success)
{
if (this.success.hasOwnProperty(iter245))
{
iter245 = this.success[iter245];
output.writeString(iter245);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_all_tables_args = function(args) {
this.db_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
}
};
ThriftHiveMetastore_get_all_tables_args.prototype = {};
ThriftHiveMetastore_get_all_tables_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_all_tables_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_all_tables_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_all_tables_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_all_tables_result.prototype = {};
ThriftHiveMetastore_get_all_tables_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size246 = 0;
var _rtmp3250;
this.success = [];
var _etype249 = 0;
_rtmp3250 = input.readListBegin();
_etype249 = _rtmp3250.etype;
_size246 = _rtmp3250.size;
for (var _i251 = 0; _i251 < _size246; ++_i251)
{
var elem252 = null;
elem252 = input.readString();
this.success.push(elem252);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_all_tables_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_all_tables_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter253 in this.success)
{
if (this.success.hasOwnProperty(iter253))
{
iter253 = this.success[iter253];
output.writeString(iter253);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_table_args = function(args) {
this.dbname = null;
this.tbl_name = null;
if (args) {
if (args.dbname !== undefined) {
this.dbname = args.dbname;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
}
};
ThriftHiveMetastore_get_table_args.prototype = {};
ThriftHiveMetastore_get_table_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.dbname = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_table_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_table_args');
if (this.dbname) {
output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);
output.writeString(this.dbname);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_table_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_table_result.prototype = {};
ThriftHiveMetastore_get_table_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Table();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_table_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_table_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_table_args = function(args) {
this.dbname = null;
this.tbl_name = null;
this.new_tbl = null;
if (args) {
if (args.dbname !== undefined) {
this.dbname = args.dbname;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.new_tbl !== undefined) {
this.new_tbl = args.new_tbl;
}
}
};
ThriftHiveMetastore_alter_table_args.prototype = {};
ThriftHiveMetastore_alter_table_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.dbname = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.new_tbl = new ttypes.Table();
this.new_tbl.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_table_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_table_args');
if (this.dbname) {
output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);
output.writeString(this.dbname);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.new_tbl) {
output.writeFieldBegin('new_tbl', Thrift.Type.STRUCT, 3);
this.new_tbl.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_table_result = function(args) {
this.o1 = null;
this.o2 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_alter_table_result.prototype = {};
ThriftHiveMetastore_alter_table_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidOperationException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_table_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_table_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_add_partition_args = function(args) {
this.new_part = null;
if (args) {
if (args.new_part !== undefined) {
this.new_part = args.new_part;
}
}
};
ThriftHiveMetastore_add_partition_args.prototype = {};
ThriftHiveMetastore_add_partition_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.new_part = new ttypes.Partition();
this.new_part.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_add_partition_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_add_partition_args');
if (this.new_part) {
output.writeFieldBegin('new_part', Thrift.Type.STRUCT, 1);
this.new_part.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_add_partition_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_add_partition_result.prototype = {};
ThriftHiveMetastore_add_partition_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.AlreadyExistsException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_add_partition_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_add_partition_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_append_partition_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
}
};
ThriftHiveMetastore_append_partition_args.prototype = {};
ThriftHiveMetastore_append_partition_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size254 = 0;
var _rtmp3258;
this.part_vals = [];
var _etype257 = 0;
_rtmp3258 = input.readListBegin();
_etype257 = _rtmp3258.etype;
_size254 = _rtmp3258.size;
for (var _i259 = 0; _i259 < _size254; ++_i259)
{
var elem260 = null;
elem260 = input.readString();
this.part_vals.push(elem260);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_append_partition_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_append_partition_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter261 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter261))
{
iter261 = this.part_vals[iter261];
output.writeString(iter261);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_append_partition_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_append_partition_result.prototype = {};
ThriftHiveMetastore_append_partition_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.AlreadyExistsException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_append_partition_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_append_partition_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_append_partition_by_name_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_name !== undefined) {
this.part_name = args.part_name;
}
}
};
ThriftHiveMetastore_append_partition_by_name_args.prototype = {};
ThriftHiveMetastore_append_partition_by_name_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.part_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_append_partition_by_name_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_append_partition_by_name_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_name) {
output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);
output.writeString(this.part_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_append_partition_by_name_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_append_partition_by_name_result.prototype = {};
ThriftHiveMetastore_append_partition_by_name_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.AlreadyExistsException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_append_partition_by_name_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_append_partition_by_name_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_partition_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
this.deleteData = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
if (args.deleteData !== undefined) {
this.deleteData = args.deleteData;
}
}
};
ThriftHiveMetastore_drop_partition_args.prototype = {};
ThriftHiveMetastore_drop_partition_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size262 = 0;
var _rtmp3266;
this.part_vals = [];
var _etype265 = 0;
_rtmp3266 = input.readListBegin();
_etype265 = _rtmp3266.etype;
_size262 = _rtmp3266.size;
for (var _i267 = 0; _i267 < _size262; ++_i267)
{
var elem268 = null;
elem268 = input.readString();
this.part_vals.push(elem268);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.BOOL) {
this.deleteData = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_partition_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_partition_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter269 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter269))
{
iter269 = this.part_vals[iter269];
output.writeString(iter269);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.deleteData) {
output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);
output.writeBool(this.deleteData);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_partition_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_drop_partition_result.prototype = {};
ThriftHiveMetastore_drop_partition_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_partition_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_partition_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_partition_by_name_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_name = null;
this.deleteData = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_name !== undefined) {
this.part_name = args.part_name;
}
if (args.deleteData !== undefined) {
this.deleteData = args.deleteData;
}
}
};
ThriftHiveMetastore_drop_partition_by_name_args.prototype = {};
ThriftHiveMetastore_drop_partition_by_name_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.part_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.BOOL) {
this.deleteData = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_partition_by_name_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_name) {
output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);
output.writeString(this.part_name);
output.writeFieldEnd();
}
if (this.deleteData) {
output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);
output.writeBool(this.deleteData);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_partition_by_name_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_drop_partition_by_name_result.prototype = {};
ThriftHiveMetastore_drop_partition_by_name_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_partition_by_name_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
}
};
ThriftHiveMetastore_get_partition_args.prototype = {};
ThriftHiveMetastore_get_partition_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size270 = 0;
var _rtmp3274;
this.part_vals = [];
var _etype273 = 0;
_rtmp3274 = input.readListBegin();
_etype273 = _rtmp3274.etype;
_size270 = _rtmp3274.size;
for (var _i275 = 0; _i275 < _size270; ++_i275)
{
var elem276 = null;
elem276 = input.readString();
this.part_vals.push(elem276);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter277 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter277))
{
iter277 = this.part_vals[iter277];
output.writeString(iter277);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partition_result.prototype = {};
ThriftHiveMetastore_get_partition_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_with_auth_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
this.user_name = null;
this.group_names = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
if (args.user_name !== undefined) {
this.user_name = args.user_name;
}
if (args.group_names !== undefined) {
this.group_names = args.group_names;
}
}
};
ThriftHiveMetastore_get_partition_with_auth_args.prototype = {};
ThriftHiveMetastore_get_partition_with_auth_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size278 = 0;
var _rtmp3282;
this.part_vals = [];
var _etype281 = 0;
_rtmp3282 = input.readListBegin();
_etype281 = _rtmp3282.etype;
_size278 = _rtmp3282.size;
for (var _i283 = 0; _i283 < _size278; ++_i283)
{
var elem284 = null;
elem284 = input.readString();
this.part_vals.push(elem284);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.user_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.LIST) {
var _size285 = 0;
var _rtmp3289;
this.group_names = [];
var _etype288 = 0;
_rtmp3289 = input.readListBegin();
_etype288 = _rtmp3289.etype;
_size285 = _rtmp3289.size;
for (var _i290 = 0; _i290 < _size285; ++_i290)
{
var elem291 = null;
elem291 = input.readString();
this.group_names.push(elem291);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_with_auth_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_with_auth_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter292 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter292))
{
iter292 = this.part_vals[iter292];
output.writeString(iter292);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.user_name) {
output.writeFieldBegin('user_name', Thrift.Type.STRING, 4);
output.writeString(this.user_name);
output.writeFieldEnd();
}
if (this.group_names) {
output.writeFieldBegin('group_names', Thrift.Type.LIST, 5);
output.writeListBegin(Thrift.Type.STRING, this.group_names.length);
for (var iter293 in this.group_names)
{
if (this.group_names.hasOwnProperty(iter293))
{
iter293 = this.group_names[iter293];
output.writeString(iter293);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_with_auth_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partition_with_auth_result.prototype = {};
ThriftHiveMetastore_get_partition_with_auth_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_with_auth_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_with_auth_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_by_name_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_name !== undefined) {
this.part_name = args.part_name;
}
}
};
ThriftHiveMetastore_get_partition_by_name_args.prototype = {};
ThriftHiveMetastore_get_partition_by_name_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.part_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_by_name_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_by_name_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_name) {
output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);
output.writeString(this.part_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_by_name_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partition_by_name_result.prototype = {};
ThriftHiveMetastore_get_partition_by_name_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Partition();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_by_name_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_by_name_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.max_parts = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
}
};
ThriftHiveMetastore_get_partitions_args.prototype = {};
ThriftHiveMetastore_get_partitions_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partitions_result.prototype = {};
ThriftHiveMetastore_get_partitions_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size294 = 0;
var _rtmp3298;
this.success = [];
var _etype297 = 0;
_rtmp3298 = input.readListBegin();
_etype297 = _rtmp3298.etype;
_size294 = _rtmp3298.size;
for (var _i299 = 0; _i299 < _size294; ++_i299)
{
var elem300 = null;
elem300 = new ttypes.Partition();
elem300.read(input);
this.success.push(elem300);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter301 in this.success)
{
if (this.success.hasOwnProperty(iter301))
{
iter301 = this.success[iter301];
iter301.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_with_auth_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.max_parts = -1;
this.user_name = null;
this.group_names = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
if (args.user_name !== undefined) {
this.user_name = args.user_name;
}
if (args.group_names !== undefined) {
this.group_names = args.group_names;
}
}
};
ThriftHiveMetastore_get_partitions_with_auth_args.prototype = {};
ThriftHiveMetastore_get_partitions_with_auth_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.user_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.LIST) {
var _size302 = 0;
var _rtmp3306;
this.group_names = [];
var _etype305 = 0;
_rtmp3306 = input.readListBegin();
_etype305 = _rtmp3306.etype;
_size302 = _rtmp3306.size;
for (var _i307 = 0; _i307 < _size302; ++_i307)
{
var elem308 = null;
elem308 = input.readString();
this.group_names.push(elem308);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_with_auth_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_with_auth_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
if (this.user_name) {
output.writeFieldBegin('user_name', Thrift.Type.STRING, 4);
output.writeString(this.user_name);
output.writeFieldEnd();
}
if (this.group_names) {
output.writeFieldBegin('group_names', Thrift.Type.LIST, 5);
output.writeListBegin(Thrift.Type.STRING, this.group_names.length);
for (var iter309 in this.group_names)
{
if (this.group_names.hasOwnProperty(iter309))
{
iter309 = this.group_names[iter309];
output.writeString(iter309);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_with_auth_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partitions_with_auth_result.prototype = {};
ThriftHiveMetastore_get_partitions_with_auth_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size310 = 0;
var _rtmp3314;
this.success = [];
var _etype313 = 0;
_rtmp3314 = input.readListBegin();
_etype313 = _rtmp3314.etype;
_size310 = _rtmp3314.size;
for (var _i315 = 0; _i315 < _size310; ++_i315)
{
var elem316 = null;
elem316 = new ttypes.Partition();
elem316.read(input);
this.success.push(elem316);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_with_auth_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_with_auth_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter317 in this.success)
{
if (this.success.hasOwnProperty(iter317))
{
iter317 = this.success[iter317];
iter317.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_names_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.max_parts = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
}
};
ThriftHiveMetastore_get_partition_names_args.prototype = {};
ThriftHiveMetastore_get_partition_names_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_names_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_names_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_names_result = function(args) {
this.success = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partition_names_result.prototype = {};
ThriftHiveMetastore_get_partition_names_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size318 = 0;
var _rtmp3322;
this.success = [];
var _etype321 = 0;
_rtmp3322 = input.readListBegin();
_etype321 = _rtmp3322.etype;
_size318 = _rtmp3322.size;
for (var _i323 = 0; _i323 < _size318; ++_i323)
{
var elem324 = null;
elem324 = input.readString();
this.success.push(elem324);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_names_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_names_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter325 in this.success)
{
if (this.success.hasOwnProperty(iter325))
{
iter325 = this.success[iter325];
output.writeString(iter325);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_ps_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
this.max_parts = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
}
};
ThriftHiveMetastore_get_partitions_ps_args.prototype = {};
ThriftHiveMetastore_get_partitions_ps_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size326 = 0;
var _rtmp3330;
this.part_vals = [];
var _etype329 = 0;
_rtmp3330 = input.readListBegin();
_etype329 = _rtmp3330.etype;
_size326 = _rtmp3330.size;
for (var _i331 = 0; _i331 < _size326; ++_i331)
{
var elem332 = null;
elem332 = input.readString();
this.part_vals.push(elem332);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_ps_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter333 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter333))
{
iter333 = this.part_vals[iter333];
output.writeString(iter333);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_ps_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_partitions_ps_result.prototype = {};
ThriftHiveMetastore_get_partitions_ps_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size334 = 0;
var _rtmp3338;
this.success = [];
var _etype337 = 0;
_rtmp3338 = input.readListBegin();
_etype337 = _rtmp3338.etype;
_size334 = _rtmp3338.size;
for (var _i339 = 0; _i339 < _size334; ++_i339)
{
var elem340 = null;
elem340 = new ttypes.Partition();
elem340.read(input);
this.success.push(elem340);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_ps_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter341 in this.success)
{
if (this.success.hasOwnProperty(iter341))
{
iter341 = this.success[iter341];
iter341.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_ps_with_auth_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
this.max_parts = -1;
this.user_name = null;
this.group_names = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
if (args.user_name !== undefined) {
this.user_name = args.user_name;
}
if (args.group_names !== undefined) {
this.group_names = args.group_names;
}
}
};
ThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype = {};
ThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size342 = 0;
var _rtmp3346;
this.part_vals = [];
var _etype345 = 0;
_rtmp3346 = input.readListBegin();
_etype345 = _rtmp3346.etype;
_size342 = _rtmp3346.size;
for (var _i347 = 0; _i347 < _size342; ++_i347)
{
var elem348 = null;
elem348 = input.readString();
this.part_vals.push(elem348);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.user_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.LIST) {
var _size349 = 0;
var _rtmp3353;
this.group_names = [];
var _etype352 = 0;
_rtmp3353 = input.readListBegin();
_etype352 = _rtmp3353.etype;
_size349 = _rtmp3353.size;
for (var _i354 = 0; _i354 < _size349; ++_i354)
{
var elem355 = null;
elem355 = input.readString();
this.group_names.push(elem355);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_with_auth_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter356 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter356))
{
iter356 = this.part_vals[iter356];
output.writeString(iter356);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
if (this.user_name) {
output.writeFieldBegin('user_name', Thrift.Type.STRING, 5);
output.writeString(this.user_name);
output.writeFieldEnd();
}
if (this.group_names) {
output.writeFieldBegin('group_names', Thrift.Type.LIST, 6);
output.writeListBegin(Thrift.Type.STRING, this.group_names.length);
for (var iter357 in this.group_names)
{
if (this.group_names.hasOwnProperty(iter357))
{
iter357 = this.group_names[iter357];
output.writeString(iter357);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_ps_with_auth_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype = {};
ThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size358 = 0;
var _rtmp3362;
this.success = [];
var _etype361 = 0;
_rtmp3362 = input.readListBegin();
_etype361 = _rtmp3362.etype;
_size358 = _rtmp3362.size;
for (var _i363 = 0; _i363 < _size358; ++_i363)
{
var elem364 = null;
elem364 = new ttypes.Partition();
elem364.read(input);
this.success.push(elem364);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_with_auth_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter365 in this.success)
{
if (this.success.hasOwnProperty(iter365))
{
iter365 = this.success[iter365];
iter365.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_names_ps_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.part_vals = null;
this.max_parts = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.part_vals !== undefined) {
this.part_vals = args.part_vals;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
}
};
ThriftHiveMetastore_get_partition_names_ps_args.prototype = {};
ThriftHiveMetastore_get_partition_names_ps_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size366 = 0;
var _rtmp3370;
this.part_vals = [];
var _etype369 = 0;
_rtmp3370 = input.readListBegin();
_etype369 = _rtmp3370.etype;
_size366 = _rtmp3370.size;
for (var _i371 = 0; _i371 < _size366; ++_i371)
{
var elem372 = null;
elem372 = input.readString();
this.part_vals.push(elem372);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_names_ps_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.part_vals) {
output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);
for (var iter373 in this.part_vals)
{
if (this.part_vals.hasOwnProperty(iter373))
{
iter373 = this.part_vals[iter373];
output.writeString(iter373);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partition_names_ps_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_partition_names_ps_result.prototype = {};
ThriftHiveMetastore_get_partition_names_ps_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size374 = 0;
var _rtmp3378;
this.success = [];
var _etype377 = 0;
_rtmp3378 = input.readListBegin();
_etype377 = _rtmp3378.etype;
_size374 = _rtmp3378.size;
for (var _i379 = 0; _i379 < _size374; ++_i379)
{
var elem380 = null;
elem380 = input.readString();
this.success.push(elem380);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partition_names_ps_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter381 in this.success)
{
if (this.success.hasOwnProperty(iter381))
{
iter381 = this.success[iter381];
output.writeString(iter381);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_by_filter_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.filter = null;
this.max_parts = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.filter !== undefined) {
this.filter = args.filter;
}
if (args.max_parts !== undefined) {
this.max_parts = args.max_parts;
}
}
};
ThriftHiveMetastore_get_partitions_by_filter_args.prototype = {};
ThriftHiveMetastore_get_partitions_by_filter_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.filter = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I16) {
this.max_parts = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_by_filter_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_by_filter_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.filter) {
output.writeFieldBegin('filter', Thrift.Type.STRING, 3);
output.writeString(this.filter);
output.writeFieldEnd();
}
if (this.max_parts) {
output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);
output.writeI16(this.max_parts);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_partitions_by_filter_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_partitions_by_filter_result.prototype = {};
ThriftHiveMetastore_get_partitions_by_filter_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size382 = 0;
var _rtmp3386;
this.success = [];
var _etype385 = 0;
_rtmp3386 = input.readListBegin();
_etype385 = _rtmp3386.etype;
_size382 = _rtmp3386.size;
for (var _i387 = 0; _i387 < _size382; ++_i387)
{
var elem388 = null;
elem388 = new ttypes.Partition();
elem388.read(input);
this.success.push(elem388);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_partitions_by_filter_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_partitions_by_filter_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter389 in this.success)
{
if (this.success.hasOwnProperty(iter389))
{
iter389 = this.success[iter389];
iter389.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_partition_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.new_part = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.new_part !== undefined) {
this.new_part = args.new_part;
}
}
};
ThriftHiveMetastore_alter_partition_args.prototype = {};
ThriftHiveMetastore_alter_partition_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.new_part = new ttypes.Partition();
this.new_part.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_partition_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_partition_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.new_part) {
output.writeFieldBegin('new_part', Thrift.Type.STRUCT, 3);
this.new_part.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_partition_result = function(args) {
this.o1 = null;
this.o2 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_alter_partition_result.prototype = {};
ThriftHiveMetastore_alter_partition_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidOperationException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_partition_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_partition_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_config_value_args = function(args) {
this.name = null;
this.defaultValue = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.defaultValue !== undefined) {
this.defaultValue = args.defaultValue;
}
}
};
ThriftHiveMetastore_get_config_value_args.prototype = {};
ThriftHiveMetastore_get_config_value_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.defaultValue = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_config_value_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_config_value_args');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.defaultValue) {
output.writeFieldBegin('defaultValue', Thrift.Type.STRING, 2);
output.writeString(this.defaultValue);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_config_value_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_config_value_result.prototype = {};
ThriftHiveMetastore_get_config_value_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRING) {
this.success = input.readString();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.ConfigValSecurityException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_config_value_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_config_value_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_partition_name_to_vals_args = function(args) {
this.part_name = null;
if (args) {
if (args.part_name !== undefined) {
this.part_name = args.part_name;
}
}
};
ThriftHiveMetastore_partition_name_to_vals_args.prototype = {};
ThriftHiveMetastore_partition_name_to_vals_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.part_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_partition_name_to_vals_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_args');
if (this.part_name) {
output.writeFieldBegin('part_name', Thrift.Type.STRING, 1);
output.writeString(this.part_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_partition_name_to_vals_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_partition_name_to_vals_result.prototype = {};
ThriftHiveMetastore_partition_name_to_vals_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size390 = 0;
var _rtmp3394;
this.success = [];
var _etype393 = 0;
_rtmp3394 = input.readListBegin();
_etype393 = _rtmp3394.etype;
_size390 = _rtmp3394.size;
for (var _i395 = 0; _i395 < _size390; ++_i395)
{
var elem396 = null;
elem396 = input.readString();
this.success.push(elem396);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_partition_name_to_vals_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter397 in this.success)
{
if (this.success.hasOwnProperty(iter397))
{
iter397 = this.success[iter397];
output.writeString(iter397);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_partition_name_to_spec_args = function(args) {
this.part_name = null;
if (args) {
if (args.part_name !== undefined) {
this.part_name = args.part_name;
}
}
};
ThriftHiveMetastore_partition_name_to_spec_args.prototype = {};
ThriftHiveMetastore_partition_name_to_spec_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.part_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_partition_name_to_spec_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_args');
if (this.part_name) {
output.writeFieldBegin('part_name', Thrift.Type.STRING, 1);
output.writeString(this.part_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_partition_name_to_spec_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_partition_name_to_spec_result.prototype = {};
ThriftHiveMetastore_partition_name_to_spec_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.MAP) {
var _size398 = 0;
var _rtmp3402;
this.success = {};
var _ktype399 = 0;
var _vtype400 = 0;
_rtmp3402 = input.readMapBegin();
_ktype399 = _rtmp3402.ktype;
_vtype400 = _rtmp3402.vtype;
_size398 = _rtmp3402.size;
for (var _i403 = 0; _i403 < _size398; ++_i403)
{
if (_i403 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key404 = null;
var val405 = null;
key404 = input.readString();
val405 = input.readString();
this.success[key404] = val405;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_partition_name_to_spec_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.MAP, 0);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.success));
for (var kiter406 in this.success)
{
if (this.success.hasOwnProperty(kiter406))
{
var viter407 = this.success[kiter406];
output.writeString(kiter406);
output.writeString(viter407);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_add_index_args = function(args) {
this.new_index = null;
this.index_table = null;
if (args) {
if (args.new_index !== undefined) {
this.new_index = args.new_index;
}
if (args.index_table !== undefined) {
this.index_table = args.index_table;
}
}
};
ThriftHiveMetastore_add_index_args.prototype = {};
ThriftHiveMetastore_add_index_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.new_index = new ttypes.Index();
this.new_index.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.index_table = new ttypes.Table();
this.index_table.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_add_index_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_add_index_args');
if (this.new_index) {
output.writeFieldBegin('new_index', Thrift.Type.STRUCT, 1);
this.new_index.write(output);
output.writeFieldEnd();
}
if (this.index_table) {
output.writeFieldBegin('index_table', Thrift.Type.STRUCT, 2);
this.index_table.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_add_index_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
this.o3 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
if (args.o3 !== undefined) {
this.o3 = args.o3;
}
}
};
ThriftHiveMetastore_add_index_result.prototype = {};
ThriftHiveMetastore_add_index_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Index();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.AlreadyExistsException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.o3 = new ttypes.MetaException();
this.o3.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_add_index_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_add_index_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
if (this.o3) {
output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);
this.o3.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_index_args = function(args) {
this.dbname = null;
this.base_tbl_name = null;
this.idx_name = null;
this.new_idx = null;
if (args) {
if (args.dbname !== undefined) {
this.dbname = args.dbname;
}
if (args.base_tbl_name !== undefined) {
this.base_tbl_name = args.base_tbl_name;
}
if (args.idx_name !== undefined) {
this.idx_name = args.idx_name;
}
if (args.new_idx !== undefined) {
this.new_idx = args.new_idx;
}
}
};
ThriftHiveMetastore_alter_index_args.prototype = {};
ThriftHiveMetastore_alter_index_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.dbname = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.base_tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.idx_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.new_idx = new ttypes.Index();
this.new_idx.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_index_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_index_args');
if (this.dbname) {
output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);
output.writeString(this.dbname);
output.writeFieldEnd();
}
if (this.base_tbl_name) {
output.writeFieldBegin('base_tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.base_tbl_name);
output.writeFieldEnd();
}
if (this.idx_name) {
output.writeFieldBegin('idx_name', Thrift.Type.STRING, 3);
output.writeString(this.idx_name);
output.writeFieldEnd();
}
if (this.new_idx) {
output.writeFieldBegin('new_idx', Thrift.Type.STRUCT, 4);
this.new_idx.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_alter_index_result = function(args) {
this.o1 = null;
this.o2 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_alter_index_result.prototype = {};
ThriftHiveMetastore_alter_index_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.InvalidOperationException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_alter_index_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_alter_index_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_index_by_name_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.index_name = null;
this.deleteData = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.index_name !== undefined) {
this.index_name = args.index_name;
}
if (args.deleteData !== undefined) {
this.deleteData = args.deleteData;
}
}
};
ThriftHiveMetastore_drop_index_by_name_args.prototype = {};
ThriftHiveMetastore_drop_index_by_name_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.index_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.BOOL) {
this.deleteData = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_index_by_name_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_index_by_name_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.index_name) {
output.writeFieldBegin('index_name', Thrift.Type.STRING, 3);
output.writeString(this.index_name);
output.writeFieldEnd();
}
if (this.deleteData) {
output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);
output.writeBool(this.deleteData);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_index_by_name_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_drop_index_by_name_result.prototype = {};
ThriftHiveMetastore_drop_index_by_name_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_index_by_name_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_index_by_name_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_index_by_name_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.index_name = null;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.index_name !== undefined) {
this.index_name = args.index_name;
}
}
};
ThriftHiveMetastore_get_index_by_name_args.prototype = {};
ThriftHiveMetastore_get_index_by_name_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.index_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_index_by_name_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_index_by_name_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.index_name) {
output.writeFieldBegin('index_name', Thrift.Type.STRING, 3);
output.writeString(this.index_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_index_by_name_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_index_by_name_result.prototype = {};
ThriftHiveMetastore_get_index_by_name_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.Index();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.NoSuchObjectException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_index_by_name_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_index_by_name_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_indexes_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.max_indexes = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.max_indexes !== undefined) {
this.max_indexes = args.max_indexes;
}
}
};
ThriftHiveMetastore_get_indexes_args.prototype = {};
ThriftHiveMetastore_get_indexes_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.max_indexes = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_indexes_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_indexes_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.max_indexes) {
output.writeFieldBegin('max_indexes', Thrift.Type.I16, 3);
output.writeI16(this.max_indexes);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_indexes_result = function(args) {
this.success = null;
this.o1 = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_indexes_result.prototype = {};
ThriftHiveMetastore_get_indexes_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size408 = 0;
var _rtmp3412;
this.success = [];
var _etype411 = 0;
_rtmp3412 = input.readListBegin();
_etype411 = _rtmp3412.etype;
_size408 = _rtmp3412.size;
for (var _i413 = 0; _i413 < _size408; ++_i413)
{
var elem414 = null;
elem414 = new ttypes.Index();
elem414.read(input);
this.success.push(elem414);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.NoSuchObjectException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_indexes_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_indexes_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter415 in this.success)
{
if (this.success.hasOwnProperty(iter415))
{
iter415 = this.success[iter415];
iter415.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_index_names_args = function(args) {
this.db_name = null;
this.tbl_name = null;
this.max_indexes = -1;
if (args) {
if (args.db_name !== undefined) {
this.db_name = args.db_name;
}
if (args.tbl_name !== undefined) {
this.tbl_name = args.tbl_name;
}
if (args.max_indexes !== undefined) {
this.max_indexes = args.max_indexes;
}
}
};
ThriftHiveMetastore_get_index_names_args.prototype = {};
ThriftHiveMetastore_get_index_names_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.db_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.tbl_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I16) {
this.max_indexes = input.readI16();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_index_names_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_index_names_args');
if (this.db_name) {
output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);
output.writeString(this.db_name);
output.writeFieldEnd();
}
if (this.tbl_name) {
output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);
output.writeString(this.tbl_name);
output.writeFieldEnd();
}
if (this.max_indexes) {
output.writeFieldBegin('max_indexes', Thrift.Type.I16, 3);
output.writeI16(this.max_indexes);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_index_names_result = function(args) {
this.success = null;
this.o2 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o2 !== undefined) {
this.o2 = args.o2;
}
}
};
ThriftHiveMetastore_get_index_names_result.prototype = {};
ThriftHiveMetastore_get_index_names_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size416 = 0;
var _rtmp3420;
this.success = [];
var _etype419 = 0;
_rtmp3420 = input.readListBegin();
_etype419 = _rtmp3420.etype;
_size416 = _rtmp3420.size;
for (var _i421 = 0; _i421 < _size416; ++_i421)
{
var elem422 = null;
elem422 = input.readString();
this.success.push(elem422);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o2 = new ttypes.MetaException();
this.o2.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_index_names_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_index_names_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter423 in this.success)
{
if (this.success.hasOwnProperty(iter423))
{
iter423 = this.success[iter423];
output.writeString(iter423);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o2) {
output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);
this.o2.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_role_args = function(args) {
this.role = null;
if (args) {
if (args.role !== undefined) {
this.role = args.role;
}
}
};
ThriftHiveMetastore_create_role_args.prototype = {};
ThriftHiveMetastore_create_role_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.role = new ttypes.Role();
this.role.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_role_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_role_args');
if (this.role) {
output.writeFieldBegin('role', Thrift.Type.STRUCT, 1);
this.role.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_create_role_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_create_role_result.prototype = {};
ThriftHiveMetastore_create_role_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_create_role_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_create_role_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_role_args = function(args) {
this.role_name = null;
if (args) {
if (args.role_name !== undefined) {
this.role_name = args.role_name;
}
}
};
ThriftHiveMetastore_drop_role_args.prototype = {};
ThriftHiveMetastore_drop_role_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.role_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_role_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_role_args');
if (this.role_name) {
output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);
output.writeString(this.role_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_drop_role_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_drop_role_result.prototype = {};
ThriftHiveMetastore_drop_role_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_drop_role_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_drop_role_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_role_names_args = function(args) {
};
ThriftHiveMetastore_get_role_names_args.prototype = {};
ThriftHiveMetastore_get_role_names_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
input.skip(ftype);
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_role_names_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_role_names_args');
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_role_names_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_role_names_result.prototype = {};
ThriftHiveMetastore_get_role_names_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size424 = 0;
var _rtmp3428;
this.success = [];
var _etype427 = 0;
_rtmp3428 = input.readListBegin();
_etype427 = _rtmp3428.etype;
_size424 = _rtmp3428.size;
for (var _i429 = 0; _i429 < _size424; ++_i429)
{
var elem430 = null;
elem430 = input.readString();
this.success.push(elem430);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_role_names_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_role_names_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRING, this.success.length);
for (var iter431 in this.success)
{
if (this.success.hasOwnProperty(iter431))
{
iter431 = this.success[iter431];
output.writeString(iter431);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_grant_role_args = function(args) {
this.role_name = null;
this.principal_name = null;
this.principal_type = null;
this.grantor = null;
this.grantorType = null;
this.grant_option = null;
if (args) {
if (args.role_name !== undefined) {
this.role_name = args.role_name;
}
if (args.principal_name !== undefined) {
this.principal_name = args.principal_name;
}
if (args.principal_type !== undefined) {
this.principal_type = args.principal_type;
}
if (args.grantor !== undefined) {
this.grantor = args.grantor;
}
if (args.grantorType !== undefined) {
this.grantorType = args.grantorType;
}
if (args.grant_option !== undefined) {
this.grant_option = args.grant_option;
}
}
};
ThriftHiveMetastore_grant_role_args.prototype = {};
ThriftHiveMetastore_grant_role_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.role_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.principal_type = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.grantor = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.grantorType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.BOOL) {
this.grant_option = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_grant_role_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_grant_role_args');
if (this.role_name) {
output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);
output.writeString(this.role_name);
output.writeFieldEnd();
}
if (this.principal_name) {
output.writeFieldBegin('principal_name', Thrift.Type.STRING, 2);
output.writeString(this.principal_name);
output.writeFieldEnd();
}
if (this.principal_type) {
output.writeFieldBegin('principal_type', Thrift.Type.I32, 3);
output.writeI32(this.principal_type);
output.writeFieldEnd();
}
if (this.grantor) {
output.writeFieldBegin('grantor', Thrift.Type.STRING, 4);
output.writeString(this.grantor);
output.writeFieldEnd();
}
if (this.grantorType) {
output.writeFieldBegin('grantorType', Thrift.Type.I32, 5);
output.writeI32(this.grantorType);
output.writeFieldEnd();
}
if (this.grant_option) {
output.writeFieldBegin('grant_option', Thrift.Type.BOOL, 6);
output.writeBool(this.grant_option);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_grant_role_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_grant_role_result.prototype = {};
ThriftHiveMetastore_grant_role_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_grant_role_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_grant_role_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_revoke_role_args = function(args) {
this.role_name = null;
this.principal_name = null;
this.principal_type = null;
if (args) {
if (args.role_name !== undefined) {
this.role_name = args.role_name;
}
if (args.principal_name !== undefined) {
this.principal_name = args.principal_name;
}
if (args.principal_type !== undefined) {
this.principal_type = args.principal_type;
}
}
};
ThriftHiveMetastore_revoke_role_args.prototype = {};
ThriftHiveMetastore_revoke_role_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.role_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.principal_type = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_revoke_role_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_revoke_role_args');
if (this.role_name) {
output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);
output.writeString(this.role_name);
output.writeFieldEnd();
}
if (this.principal_name) {
output.writeFieldBegin('principal_name', Thrift.Type.STRING, 2);
output.writeString(this.principal_name);
output.writeFieldEnd();
}
if (this.principal_type) {
output.writeFieldBegin('principal_type', Thrift.Type.I32, 3);
output.writeI32(this.principal_type);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_revoke_role_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_revoke_role_result.prototype = {};
ThriftHiveMetastore_revoke_role_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_revoke_role_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_revoke_role_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_list_roles_args = function(args) {
this.principal_name = null;
this.principal_type = null;
if (args) {
if (args.principal_name !== undefined) {
this.principal_name = args.principal_name;
}
if (args.principal_type !== undefined) {
this.principal_type = args.principal_type;
}
}
};
ThriftHiveMetastore_list_roles_args.prototype = {};
ThriftHiveMetastore_list_roles_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.principal_type = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_list_roles_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_list_roles_args');
if (this.principal_name) {
output.writeFieldBegin('principal_name', Thrift.Type.STRING, 1);
output.writeString(this.principal_name);
output.writeFieldEnd();
}
if (this.principal_type) {
output.writeFieldBegin('principal_type', Thrift.Type.I32, 2);
output.writeI32(this.principal_type);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_list_roles_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_list_roles_result.prototype = {};
ThriftHiveMetastore_list_roles_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size432 = 0;
var _rtmp3436;
this.success = [];
var _etype435 = 0;
_rtmp3436 = input.readListBegin();
_etype435 = _rtmp3436.etype;
_size432 = _rtmp3436.size;
for (var _i437 = 0; _i437 < _size432; ++_i437)
{
var elem438 = null;
elem438 = new ttypes.Role();
elem438.read(input);
this.success.push(elem438);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_list_roles_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_list_roles_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter439 in this.success)
{
if (this.success.hasOwnProperty(iter439))
{
iter439 = this.success[iter439];
iter439.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_privilege_set_args = function(args) {
this.hiveObject = null;
this.user_name = null;
this.group_names = null;
if (args) {
if (args.hiveObject !== undefined) {
this.hiveObject = args.hiveObject;
}
if (args.user_name !== undefined) {
this.user_name = args.user_name;
}
if (args.group_names !== undefined) {
this.group_names = args.group_names;
}
}
};
ThriftHiveMetastore_get_privilege_set_args.prototype = {};
ThriftHiveMetastore_get_privilege_set_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.hiveObject = new ttypes.HiveObjectRef();
this.hiveObject.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.user_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size440 = 0;
var _rtmp3444;
this.group_names = [];
var _etype443 = 0;
_rtmp3444 = input.readListBegin();
_etype443 = _rtmp3444.etype;
_size440 = _rtmp3444.size;
for (var _i445 = 0; _i445 < _size440; ++_i445)
{
var elem446 = null;
elem446 = input.readString();
this.group_names.push(elem446);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_privilege_set_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_privilege_set_args');
if (this.hiveObject) {
output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 1);
this.hiveObject.write(output);
output.writeFieldEnd();
}
if (this.user_name) {
output.writeFieldBegin('user_name', Thrift.Type.STRING, 2);
output.writeString(this.user_name);
output.writeFieldEnd();
}
if (this.group_names) {
output.writeFieldBegin('group_names', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRING, this.group_names.length);
for (var iter447 in this.group_names)
{
if (this.group_names.hasOwnProperty(iter447))
{
iter447 = this.group_names[iter447];
output.writeString(iter447);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_privilege_set_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_privilege_set_result.prototype = {};
ThriftHiveMetastore_get_privilege_set_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.PrincipalPrivilegeSet();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_privilege_set_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_privilege_set_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_list_privileges_args = function(args) {
this.principal_name = null;
this.principal_type = null;
this.hiveObject = null;
if (args) {
if (args.principal_name !== undefined) {
this.principal_name = args.principal_name;
}
if (args.principal_type !== undefined) {
this.principal_type = args.principal_type;
}
if (args.hiveObject !== undefined) {
this.hiveObject = args.hiveObject;
}
}
};
ThriftHiveMetastore_list_privileges_args.prototype = {};
ThriftHiveMetastore_list_privileges_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.principal_type = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.hiveObject = new ttypes.HiveObjectRef();
this.hiveObject.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_list_privileges_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_list_privileges_args');
if (this.principal_name) {
output.writeFieldBegin('principal_name', Thrift.Type.STRING, 1);
output.writeString(this.principal_name);
output.writeFieldEnd();
}
if (this.principal_type) {
output.writeFieldBegin('principal_type', Thrift.Type.I32, 2);
output.writeI32(this.principal_type);
output.writeFieldEnd();
}
if (this.hiveObject) {
output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 3);
this.hiveObject.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_list_privileges_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_list_privileges_result.prototype = {};
ThriftHiveMetastore_list_privileges_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.LIST) {
var _size448 = 0;
var _rtmp3452;
this.success = [];
var _etype451 = 0;
_rtmp3452 = input.readListBegin();
_etype451 = _rtmp3452.etype;
_size448 = _rtmp3452.size;
for (var _i453 = 0; _i453 < _size448; ++_i453)
{
var elem454 = null;
elem454 = new ttypes.HiveObjectPrivilege();
elem454.read(input);
this.success.push(elem454);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_list_privileges_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_list_privileges_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
for (var iter455 in this.success)
{
if (this.success.hasOwnProperty(iter455))
{
iter455 = this.success[iter455];
iter455.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_grant_privileges_args = function(args) {
this.privileges = null;
if (args) {
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
ThriftHiveMetastore_grant_privileges_args.prototype = {};
ThriftHiveMetastore_grant_privileges_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.privileges = new ttypes.PrivilegeBag();
this.privileges.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_grant_privileges_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_grant_privileges_args');
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 1);
this.privileges.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_grant_privileges_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_grant_privileges_result.prototype = {};
ThriftHiveMetastore_grant_privileges_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_grant_privileges_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_grant_privileges_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_revoke_privileges_args = function(args) {
this.privileges = null;
if (args) {
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
ThriftHiveMetastore_revoke_privileges_args.prototype = {};
ThriftHiveMetastore_revoke_privileges_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.privileges = new ttypes.PrivilegeBag();
this.privileges.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_revoke_privileges_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_revoke_privileges_args');
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 1);
this.privileges.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_revoke_privileges_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_revoke_privileges_result.prototype = {};
ThriftHiveMetastore_revoke_privileges_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.BOOL) {
this.success = input.readBool();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_revoke_privileges_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_revoke_privileges_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.BOOL, 0);
output.writeBool(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_delegation_token_args = function(args) {
this.renewer_kerberos_principal_name = null;
if (args) {
if (args.renewer_kerberos_principal_name !== undefined) {
this.renewer_kerberos_principal_name = args.renewer_kerberos_principal_name;
}
}
};
ThriftHiveMetastore_get_delegation_token_args.prototype = {};
ThriftHiveMetastore_get_delegation_token_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.renewer_kerberos_principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_delegation_token_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_args');
if (this.renewer_kerberos_principal_name) {
output.writeFieldBegin('renewer_kerberos_principal_name', Thrift.Type.STRING, 1);
output.writeString(this.renewer_kerberos_principal_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_delegation_token_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_delegation_token_result.prototype = {};
ThriftHiveMetastore_get_delegation_token_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRING) {
this.success = input.readString();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_delegation_token_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_delegation_token_with_signature_args = function(args) {
this.renewer_kerberos_principal_name = null;
this.token_signature = null;
if (args) {
if (args.renewer_kerberos_principal_name !== undefined) {
this.renewer_kerberos_principal_name = args.renewer_kerberos_principal_name;
}
if (args.token_signature !== undefined) {
this.token_signature = args.token_signature;
}
}
};
ThriftHiveMetastore_get_delegation_token_with_signature_args.prototype = {};
ThriftHiveMetastore_get_delegation_token_with_signature_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.renewer_kerberos_principal_name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.token_signature = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_delegation_token_with_signature_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_args');
if (this.renewer_kerberos_principal_name) {
output.writeFieldBegin('renewer_kerberos_principal_name', Thrift.Type.STRING, 1);
output.writeString(this.renewer_kerberos_principal_name);
output.writeFieldEnd();
}
if (this.token_signature) {
output.writeFieldBegin('token_signature', Thrift.Type.STRING, 2);
output.writeString(this.token_signature);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_get_delegation_token_with_signature_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_get_delegation_token_with_signature_result.prototype = {};
ThriftHiveMetastore_get_delegation_token_with_signature_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRING) {
this.success = input.readString();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_get_delegation_token_with_signature_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.STRING, 0);
output.writeString(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_renew_delegation_token_args = function(args) {
this.token_str_form = null;
if (args) {
if (args.token_str_form !== undefined) {
this.token_str_form = args.token_str_form;
}
}
};
ThriftHiveMetastore_renew_delegation_token_args.prototype = {};
ThriftHiveMetastore_renew_delegation_token_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.token_str_form = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_renew_delegation_token_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_renew_delegation_token_args');
if (this.token_str_form) {
output.writeFieldBegin('token_str_form', Thrift.Type.STRING, 1);
output.writeString(this.token_str_form);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_renew_delegation_token_result = function(args) {
this.success = null;
this.o1 = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_renew_delegation_token_result.prototype = {};
ThriftHiveMetastore_renew_delegation_token_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.I64) {
this.success = input.readI64();
} else {
input.skip(ftype);
}
break;
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_renew_delegation_token_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_renew_delegation_token_result');
if (this.success) {
output.writeFieldBegin('success', Thrift.Type.I64, 0);
output.writeI64(this.success);
output.writeFieldEnd();
}
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_cancel_delegation_token_args = function(args) {
this.token_str_form = null;
if (args) {
if (args.token_str_form !== undefined) {
this.token_str_form = args.token_str_form;
}
}
};
ThriftHiveMetastore_cancel_delegation_token_args.prototype = {};
ThriftHiveMetastore_cancel_delegation_token_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.token_str_form = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_cancel_delegation_token_args.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_args');
if (this.token_str_form) {
output.writeFieldBegin('token_str_form', Thrift.Type.STRING, 1);
output.writeString(this.token_str_form);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastore_cancel_delegation_token_result = function(args) {
this.o1 = null;
if (args) {
if (args.o1 !== undefined) {
this.o1 = args.o1;
}
}
};
ThriftHiveMetastore_cancel_delegation_token_result.prototype = {};
ThriftHiveMetastore_cancel_delegation_token_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.o1 = new ttypes.MetaException();
this.o1.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ThriftHiveMetastore_cancel_delegation_token_result.prototype.write = function(output) {
output.writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_result');
if (this.o1) {
output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);
this.o1.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ThriftHiveMetastoreClient = exports.Client = function(output, pClass) {
this.output = output;
this.pClass = pClass;
this.seqid = 0;
this._reqs = {};
};
Thrift.inherits(ThriftHiveMetastoreClient, FacebookServiceClient)
ThriftHiveMetastoreClient.prototype.create_database = function(database, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_create_database(database);
};
ThriftHiveMetastoreClient.prototype.send_create_database = function(database) {
var output = new this.pClass(this.output);
output.writeMessageBegin('create_database', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_create_database_args();
args.database = database;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_create_database = 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 ThriftHiveMetastore_create_database_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.get_database = function(name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_database(name);
};
ThriftHiveMetastoreClient.prototype.send_get_database = function(name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_database', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_database_args();
args.name = name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_database = 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 ThriftHiveMetastore_get_database_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_database failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.drop_database = function(name, deleteData, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_database(name, deleteData);
};
ThriftHiveMetastoreClient.prototype.send_drop_database = function(name, deleteData) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_database', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_database_args();
args.name = name;
args.deleteData = deleteData;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_database = 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 ThriftHiveMetastore_drop_database_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.get_databases = function(pattern, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_databases(pattern);
};
ThriftHiveMetastoreClient.prototype.send_get_databases = function(pattern) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_databases', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_databases_args();
args.pattern = pattern;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_databases = 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 ThriftHiveMetastore_get_databases_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_databases failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_all_databases = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_all_databases();
};
ThriftHiveMetastoreClient.prototype.send_get_all_databases = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_all_databases', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_all_databases_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_all_databases = 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 ThriftHiveMetastore_get_all_databases_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_all_databases failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.alter_database = function(dbname, db, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_alter_database(dbname, db);
};
ThriftHiveMetastoreClient.prototype.send_alter_database = function(dbname, db) {
var output = new this.pClass(this.output);
output.writeMessageBegin('alter_database', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_alter_database_args();
args.dbname = dbname;
args.db = db;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_alter_database = 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 ThriftHiveMetastore_alter_database_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.get_type = function(name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_type(name);
};
ThriftHiveMetastoreClient.prototype.send_get_type = function(name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_type', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_type_args();
args.name = name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_type = 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 ThriftHiveMetastore_get_type_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_type failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.create_type = function(type, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_create_type(type);
};
ThriftHiveMetastoreClient.prototype.send_create_type = function(type) {
var output = new this.pClass(this.output);
output.writeMessageBegin('create_type', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_create_type_args();
args.type = type;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_create_type = 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 ThriftHiveMetastore_create_type_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('create_type failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.drop_type = function(type, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_type(type);
};
ThriftHiveMetastoreClient.prototype.send_drop_type = function(type) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_type', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_type_args();
args.type = type;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_type = 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 ThriftHiveMetastore_drop_type_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('drop_type failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_type_all = function(name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_type_all(name);
};
ThriftHiveMetastoreClient.prototype.send_get_type_all = function(name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_type_all', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_type_all_args();
args.name = name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_type_all = 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 ThriftHiveMetastore_get_type_all_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_type_all failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_fields = function(db_name, table_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_fields(db_name, table_name);
};
ThriftHiveMetastoreClient.prototype.send_get_fields = function(db_name, table_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_fields', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_fields_args();
args.db_name = db_name;
args.table_name = table_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_fields = 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 ThriftHiveMetastore_get_fields_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_fields failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_schema = function(db_name, table_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_schema(db_name, table_name);
};
ThriftHiveMetastoreClient.prototype.send_get_schema = function(db_name, table_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_schema', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_schema_args();
args.db_name = db_name;
args.table_name = table_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_schema = 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 ThriftHiveMetastore_get_schema_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_schema failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.create_table = function(tbl, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_create_table(tbl);
};
ThriftHiveMetastoreClient.prototype.send_create_table = function(tbl) {
var output = new this.pClass(this.output);
output.writeMessageBegin('create_table', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_create_table_args();
args.tbl = tbl;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_create_table = 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 ThriftHiveMetastore_create_table_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.o4) {
return callback(result.o4);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.drop_table = function(dbname, name, deleteData, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_table(dbname, name, deleteData);
};
ThriftHiveMetastoreClient.prototype.send_drop_table = function(dbname, name, deleteData) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_table', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_table_args();
args.dbname = dbname;
args.name = name;
args.deleteData = deleteData;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_table = 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 ThriftHiveMetastore_drop_table_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o3) {
return callback(result.o3);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.get_tables = function(db_name, pattern, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_tables(db_name, pattern);
};
ThriftHiveMetastoreClient.prototype.send_get_tables = function(db_name, pattern) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_tables', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_tables_args();
args.db_name = db_name;
args.pattern = pattern;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_tables = 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 ThriftHiveMetastore_get_tables_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_tables failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_all_tables = function(db_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_all_tables(db_name);
};
ThriftHiveMetastoreClient.prototype.send_get_all_tables = function(db_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_all_tables', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_all_tables_args();
args.db_name = db_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_all_tables = 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 ThriftHiveMetastore_get_all_tables_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_all_tables failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_table = function(dbname, tbl_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_table(dbname, tbl_name);
};
ThriftHiveMetastoreClient.prototype.send_get_table = function(dbname, tbl_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_table', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_table_args();
args.dbname = dbname;
args.tbl_name = tbl_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_table = 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 ThriftHiveMetastore_get_table_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_table failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.alter_table = function(dbname, tbl_name, new_tbl, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_alter_table(dbname, tbl_name, new_tbl);
};
ThriftHiveMetastoreClient.prototype.send_alter_table = function(dbname, tbl_name, new_tbl) {
var output = new this.pClass(this.output);
output.writeMessageBegin('alter_table', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_alter_table_args();
args.dbname = dbname;
args.tbl_name = tbl_name;
args.new_tbl = new_tbl;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_alter_table = 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 ThriftHiveMetastore_alter_table_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.add_partition = function(new_part, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_add_partition(new_part);
};
ThriftHiveMetastoreClient.prototype.send_add_partition = function(new_part) {
var output = new this.pClass(this.output);
output.writeMessageBegin('add_partition', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_add_partition_args();
args.new_part = new_part;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_add_partition = 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 ThriftHiveMetastore_add_partition_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('add_partition failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.append_partition = function(db_name, tbl_name, part_vals, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_append_partition(db_name, tbl_name, part_vals);
};
ThriftHiveMetastoreClient.prototype.send_append_partition = function(db_name, tbl_name, part_vals) {
var output = new this.pClass(this.output);
output.writeMessageBegin('append_partition', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_append_partition_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_append_partition = 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 ThriftHiveMetastore_append_partition_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('append_partition failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.append_partition_by_name = function(db_name, tbl_name, part_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_append_partition_by_name(db_name, tbl_name, part_name);
};
ThriftHiveMetastoreClient.prototype.send_append_partition_by_name = function(db_name, tbl_name, part_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('append_partition_by_name', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_append_partition_by_name_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_name = part_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_append_partition_by_name = 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 ThriftHiveMetastore_append_partition_by_name_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('append_partition_by_name failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.drop_partition = function(db_name, tbl_name, part_vals, deleteData, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_partition(db_name, tbl_name, part_vals, deleteData);
};
ThriftHiveMetastoreClient.prototype.send_drop_partition = function(db_name, tbl_name, part_vals, deleteData) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_partition', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_partition_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.deleteData = deleteData;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_partition = 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 ThriftHiveMetastore_drop_partition_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('drop_partition failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.drop_partition_by_name = function(db_name, tbl_name, part_name, deleteData, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData);
};
ThriftHiveMetastoreClient.prototype.send_drop_partition_by_name = function(db_name, tbl_name, part_name, deleteData) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_partition_by_name', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_partition_by_name_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_name = part_name;
args.deleteData = deleteData;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_partition_by_name = 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 ThriftHiveMetastore_drop_partition_by_name_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('drop_partition_by_name failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partition = function(db_name, tbl_name, part_vals, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partition(db_name, tbl_name, part_vals);
};
ThriftHiveMetastoreClient.prototype.send_get_partition = function(db_name, tbl_name, part_vals) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partition', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partition_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partition = 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 ThriftHiveMetastore_get_partition_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partition failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partition_with_auth = function(db_name, tbl_name, part_vals, user_name, group_names, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names);
};
ThriftHiveMetastoreClient.prototype.send_get_partition_with_auth = function(db_name, tbl_name, part_vals, user_name, group_names) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partition_with_auth', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partition_with_auth_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.user_name = user_name;
args.group_names = group_names;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partition_with_auth = 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 ThriftHiveMetastore_get_partition_with_auth_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partition_with_auth failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partition_by_name = function(db_name, tbl_name, part_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partition_by_name(db_name, tbl_name, part_name);
};
ThriftHiveMetastoreClient.prototype.send_get_partition_by_name = function(db_name, tbl_name, part_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partition_by_name', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partition_by_name_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_name = part_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partition_by_name = 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 ThriftHiveMetastore_get_partition_by_name_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partition_by_name failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partitions = function(db_name, tbl_name, max_parts, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partitions(db_name, tbl_name, max_parts);
};
ThriftHiveMetastoreClient.prototype.send_get_partitions = function(db_name, tbl_name, max_parts) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partitions', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partitions_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.max_parts = max_parts;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partitions = 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 ThriftHiveMetastore_get_partitions_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partitions failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partitions_with_auth = function(db_name, tbl_name, max_parts, user_name, group_names, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names);
};
ThriftHiveMetastoreClient.prototype.send_get_partitions_with_auth = function(db_name, tbl_name, max_parts, user_name, group_names) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partitions_with_auth', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partitions_with_auth_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.max_parts = max_parts;
args.user_name = user_name;
args.group_names = group_names;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partitions_with_auth = 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 ThriftHiveMetastore_get_partitions_with_auth_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partitions_with_auth failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partition_names = function(db_name, tbl_name, max_parts, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partition_names(db_name, tbl_name, max_parts);
};
ThriftHiveMetastoreClient.prototype.send_get_partition_names = function(db_name, tbl_name, max_parts) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partition_names', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partition_names_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.max_parts = max_parts;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partition_names = 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 ThriftHiveMetastore_get_partition_names_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partition_names failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partitions_ps = function(db_name, tbl_name, part_vals, max_parts, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts);
};
ThriftHiveMetastoreClient.prototype.send_get_partitions_ps = function(db_name, tbl_name, part_vals, max_parts) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partitions_ps', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partitions_ps_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.max_parts = max_parts;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partitions_ps = 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 ThriftHiveMetastore_get_partitions_ps_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partitions_ps failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partitions_ps_with_auth = function(db_name, tbl_name, part_vals, max_parts, user_name, group_names, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names);
};
ThriftHiveMetastoreClient.prototype.send_get_partitions_ps_with_auth = function(db_name, tbl_name, part_vals, max_parts, user_name, group_names) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partitions_ps_with_auth', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partitions_ps_with_auth_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.max_parts = max_parts;
args.user_name = user_name;
args.group_names = group_names;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partitions_ps_with_auth = 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 ThriftHiveMetastore_get_partitions_ps_with_auth_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partitions_ps_with_auth failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partition_names_ps = function(db_name, tbl_name, part_vals, max_parts, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts);
};
ThriftHiveMetastoreClient.prototype.send_get_partition_names_ps = function(db_name, tbl_name, part_vals, max_parts) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partition_names_ps', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partition_names_ps_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.part_vals = part_vals;
args.max_parts = max_parts;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partition_names_ps = 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 ThriftHiveMetastore_get_partition_names_ps_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partition_names_ps failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_partitions_by_filter = function(db_name, tbl_name, filter, max_parts, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts);
};
ThriftHiveMetastoreClient.prototype.send_get_partitions_by_filter = function(db_name, tbl_name, filter, max_parts) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_partitions_by_filter', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_partitions_by_filter_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.filter = filter;
args.max_parts = max_parts;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_partitions_by_filter = 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 ThriftHiveMetastore_get_partitions_by_filter_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_partitions_by_filter failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.alter_partition = function(db_name, tbl_name, new_part, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_alter_partition(db_name, tbl_name, new_part);
};
ThriftHiveMetastoreClient.prototype.send_alter_partition = function(db_name, tbl_name, new_part) {
var output = new this.pClass(this.output);
output.writeMessageBegin('alter_partition', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_alter_partition_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.new_part = new_part;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_alter_partition = 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 ThriftHiveMetastore_alter_partition_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.get_config_value = function(name, defaultValue, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_config_value(name, defaultValue);
};
ThriftHiveMetastoreClient.prototype.send_get_config_value = function(name, defaultValue) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_config_value', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_config_value_args();
args.name = name;
args.defaultValue = defaultValue;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_config_value = 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 ThriftHiveMetastore_get_config_value_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_config_value failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.partition_name_to_vals = function(part_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_partition_name_to_vals(part_name);
};
ThriftHiveMetastoreClient.prototype.send_partition_name_to_vals = function(part_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('partition_name_to_vals', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_partition_name_to_vals_args();
args.part_name = part_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_partition_name_to_vals = 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 ThriftHiveMetastore_partition_name_to_vals_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('partition_name_to_vals failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.partition_name_to_spec = function(part_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_partition_name_to_spec(part_name);
};
ThriftHiveMetastoreClient.prototype.send_partition_name_to_spec = function(part_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('partition_name_to_spec', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_partition_name_to_spec_args();
args.part_name = part_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_partition_name_to_spec = 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 ThriftHiveMetastore_partition_name_to_spec_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('partition_name_to_spec failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.add_index = function(new_index, index_table, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_add_index(new_index, index_table);
};
ThriftHiveMetastoreClient.prototype.send_add_index = function(new_index, index_table) {
var output = new this.pClass(this.output);
output.writeMessageBegin('add_index', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_add_index_args();
args.new_index = new_index;
args.index_table = index_table;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_add_index = 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 ThriftHiveMetastore_add_index_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.o3) {
return callback(result.o3);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('add_index failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.alter_index = function(dbname, base_tbl_name, idx_name, new_idx, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_alter_index(dbname, base_tbl_name, idx_name, new_idx);
};
ThriftHiveMetastoreClient.prototype.send_alter_index = function(dbname, base_tbl_name, idx_name, new_idx) {
var output = new this.pClass(this.output);
output.writeMessageBegin('alter_index', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_alter_index_args();
args.dbname = dbname;
args.base_tbl_name = base_tbl_name;
args.idx_name = idx_name;
args.new_idx = new_idx;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_alter_index = 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 ThriftHiveMetastore_alter_index_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
callback(null)
};
ThriftHiveMetastoreClient.prototype.drop_index_by_name = function(db_name, tbl_name, index_name, deleteData, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_index_by_name(db_name, tbl_name, index_name, deleteData);
};
ThriftHiveMetastoreClient.prototype.send_drop_index_by_name = function(db_name, tbl_name, index_name, deleteData) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_index_by_name', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_index_by_name_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.index_name = index_name;
args.deleteData = deleteData;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_index_by_name = 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 ThriftHiveMetastore_drop_index_by_name_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('drop_index_by_name failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_index_by_name = function(db_name, tbl_name, index_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_index_by_name(db_name, tbl_name, index_name);
};
ThriftHiveMetastoreClient.prototype.send_get_index_by_name = function(db_name, tbl_name, index_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_index_by_name', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_index_by_name_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.index_name = index_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_index_by_name = 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 ThriftHiveMetastore_get_index_by_name_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_index_by_name failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_indexes = function(db_name, tbl_name, max_indexes, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_indexes(db_name, tbl_name, max_indexes);
};
ThriftHiveMetastoreClient.prototype.send_get_indexes = function(db_name, tbl_name, max_indexes) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_indexes', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_indexes_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.max_indexes = max_indexes;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_indexes = 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 ThriftHiveMetastore_get_indexes_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_indexes failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_index_names = function(db_name, tbl_name, max_indexes, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_index_names(db_name, tbl_name, max_indexes);
};
ThriftHiveMetastoreClient.prototype.send_get_index_names = function(db_name, tbl_name, max_indexes) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_index_names', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_index_names_args();
args.db_name = db_name;
args.tbl_name = tbl_name;
args.max_indexes = max_indexes;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_index_names = 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 ThriftHiveMetastore_get_index_names_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o2) {
return callback(result.o2);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_index_names failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.create_role = function(role, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_create_role(role);
};
ThriftHiveMetastoreClient.prototype.send_create_role = function(role) {
var output = new this.pClass(this.output);
output.writeMessageBegin('create_role', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_create_role_args();
args.role = role;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_create_role = 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 ThriftHiveMetastore_create_role_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('create_role failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.drop_role = function(role_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_drop_role(role_name);
};
ThriftHiveMetastoreClient.prototype.send_drop_role = function(role_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('drop_role', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_drop_role_args();
args.role_name = role_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_drop_role = 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 ThriftHiveMetastore_drop_role_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('drop_role failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_role_names = function(callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_role_names();
};
ThriftHiveMetastoreClient.prototype.send_get_role_names = function() {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_role_names', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_role_names_args();
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_role_names = 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 ThriftHiveMetastore_get_role_names_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_role_names failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.grant_role = function(role_name, principal_name, principal_type, grantor, grantorType, grant_option, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option);
};
ThriftHiveMetastoreClient.prototype.send_grant_role = function(role_name, principal_name, principal_type, grantor, grantorType, grant_option) {
var output = new this.pClass(this.output);
output.writeMessageBegin('grant_role', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_grant_role_args();
args.role_name = role_name;
args.principal_name = principal_name;
args.principal_type = principal_type;
args.grantor = grantor;
args.grantorType = grantorType;
args.grant_option = grant_option;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_grant_role = 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 ThriftHiveMetastore_grant_role_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('grant_role failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.revoke_role = function(role_name, principal_name, principal_type, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_revoke_role(role_name, principal_name, principal_type);
};
ThriftHiveMetastoreClient.prototype.send_revoke_role = function(role_name, principal_name, principal_type) {
var output = new this.pClass(this.output);
output.writeMessageBegin('revoke_role', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_revoke_role_args();
args.role_name = role_name;
args.principal_name = principal_name;
args.principal_type = principal_type;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_revoke_role = 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 ThriftHiveMetastore_revoke_role_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('revoke_role failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.list_roles = function(principal_name, principal_type, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_list_roles(principal_name, principal_type);
};
ThriftHiveMetastoreClient.prototype.send_list_roles = function(principal_name, principal_type) {
var output = new this.pClass(this.output);
output.writeMessageBegin('list_roles', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_list_roles_args();
args.principal_name = principal_name;
args.principal_type = principal_type;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_list_roles = 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 ThriftHiveMetastore_list_roles_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('list_roles failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_privilege_set = function(hiveObject, user_name, group_names, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_privilege_set(hiveObject, user_name, group_names);
};
ThriftHiveMetastoreClient.prototype.send_get_privilege_set = function(hiveObject, user_name, group_names) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_privilege_set', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_privilege_set_args();
args.hiveObject = hiveObject;
args.user_name = user_name;
args.group_names = group_names;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_privilege_set = 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 ThriftHiveMetastore_get_privilege_set_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_privilege_set failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.list_privileges = function(principal_name, principal_type, hiveObject, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_list_privileges(principal_name, principal_type, hiveObject);
};
ThriftHiveMetastoreClient.prototype.send_list_privileges = function(principal_name, principal_type, hiveObject) {
var output = new this.pClass(this.output);
output.writeMessageBegin('list_privileges', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_list_privileges_args();
args.principal_name = principal_name;
args.principal_type = principal_type;
args.hiveObject = hiveObject;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_list_privileges = 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 ThriftHiveMetastore_list_privileges_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('list_privileges failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.grant_privileges = function(privileges, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_grant_privileges(privileges);
};
ThriftHiveMetastoreClient.prototype.send_grant_privileges = function(privileges) {
var output = new this.pClass(this.output);
output.writeMessageBegin('grant_privileges', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_grant_privileges_args();
args.privileges = privileges;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_grant_privileges = 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 ThriftHiveMetastore_grant_privileges_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('grant_privileges failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.revoke_privileges = function(privileges, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_revoke_privileges(privileges);
};
ThriftHiveMetastoreClient.prototype.send_revoke_privileges = function(privileges) {
var output = new this.pClass(this.output);
output.writeMessageBegin('revoke_privileges', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_revoke_privileges_args();
args.privileges = privileges;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_revoke_privileges = 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 ThriftHiveMetastore_revoke_privileges_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('revoke_privileges failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_delegation_token = function(renewer_kerberos_principal_name, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_delegation_token(renewer_kerberos_principal_name);
};
ThriftHiveMetastoreClient.prototype.send_get_delegation_token = function(renewer_kerberos_principal_name) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_delegation_token', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_delegation_token_args();
args.renewer_kerberos_principal_name = renewer_kerberos_principal_name;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_delegation_token = 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 ThriftHiveMetastore_get_delegation_token_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_delegation_token failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.get_delegation_token_with_signature = function(renewer_kerberos_principal_name, token_signature, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature);
};
ThriftHiveMetastoreClient.prototype.send_get_delegation_token_with_signature = function(renewer_kerberos_principal_name, token_signature) {
var output = new this.pClass(this.output);
output.writeMessageBegin('get_delegation_token_with_signature', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_get_delegation_token_with_signature_args();
args.renewer_kerberos_principal_name = renewer_kerberos_principal_name;
args.token_signature = token_signature;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_get_delegation_token_with_signature = 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 ThriftHiveMetastore_get_delegation_token_with_signature_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('get_delegation_token_with_signature failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.renew_delegation_token = function(token_str_form, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_renew_delegation_token(token_str_form);
};
ThriftHiveMetastoreClient.prototype.send_renew_delegation_token = function(token_str_form) {
var output = new this.pClass(this.output);
output.writeMessageBegin('renew_delegation_token', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_renew_delegation_token_args();
args.token_str_form = token_str_form;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_renew_delegation_token = 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 ThriftHiveMetastore_renew_delegation_token_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
if (null !== result.success) {
return callback(null, result.success);
}
return callback('renew_delegation_token failed: unknown result');
};
ThriftHiveMetastoreClient.prototype.cancel_delegation_token = function(token_str_form, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_cancel_delegation_token(token_str_form);
};
ThriftHiveMetastoreClient.prototype.send_cancel_delegation_token = function(token_str_form) {
var output = new this.pClass(this.output);
output.writeMessageBegin('cancel_delegation_token', Thrift.MessageType.CALL, this.seqid);
var args = new ThriftHiveMetastore_cancel_delegation_token_args();
args.token_str_form = token_str_form;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
ThriftHiveMetastoreClient.prototype.recv_cancel_delegation_token = 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 ThriftHiveMetastore_cancel_delegation_token_result();
result.read(input);
input.readMessageEnd();
if (null !== result.o1) {
return callback(result.o1);
}
callback(null)
};
var ThriftHiveMetastoreProcessor = exports.Processor = function(handler) {
this._handler = handler
}
Thrift.inherits(ThriftHiveMetastoreProcessor, FacebookServiceProcessor)
ThriftHiveMetastoreProcessor.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();
}
}
ThriftHiveMetastoreProcessor.prototype.process_create_database = function(seqid, input, output) {
var args = new ThriftHiveMetastore_create_database_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_create_database_result();
this._handler.create_database(args.database, function (success) {
result.success = success;
output.writeMessageBegin("create_database", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_database = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_database_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_database_result();
this._handler.get_database(args.name, function (success) {
result.success = success;
output.writeMessageBegin("get_database", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_database = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_database_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_database_result();
this._handler.drop_database(args.name, args.deleteData, function (success) {
result.success = success;
output.writeMessageBegin("drop_database", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_databases = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_databases_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_databases_result();
this._handler.get_databases(args.pattern, function (success) {
result.success = success;
output.writeMessageBegin("get_databases", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_all_databases = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_all_databases_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_all_databases_result();
this._handler.get_all_databases(function (success) {
result.success = success;
output.writeMessageBegin("get_all_databases", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_alter_database = function(seqid, input, output) {
var args = new ThriftHiveMetastore_alter_database_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_alter_database_result();
this._handler.alter_database(args.dbname, args.db, function (success) {
result.success = success;
output.writeMessageBegin("alter_database", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_type = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_type_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_type_result();
this._handler.get_type(args.name, function (success) {
result.success = success;
output.writeMessageBegin("get_type", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_create_type = function(seqid, input, output) {
var args = new ThriftHiveMetastore_create_type_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_create_type_result();
this._handler.create_type(args.type, function (success) {
result.success = success;
output.writeMessageBegin("create_type", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_type = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_type_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_type_result();
this._handler.drop_type(args.type, function (success) {
result.success = success;
output.writeMessageBegin("drop_type", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_type_all = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_type_all_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_type_all_result();
this._handler.get_type_all(args.name, function (success) {
result.success = success;
output.writeMessageBegin("get_type_all", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_fields = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_fields_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_fields_result();
this._handler.get_fields(args.db_name, args.table_name, function (success) {
result.success = success;
output.writeMessageBegin("get_fields", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_schema = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_schema_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_schema_result();
this._handler.get_schema(args.db_name, args.table_name, function (success) {
result.success = success;
output.writeMessageBegin("get_schema", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_create_table = function(seqid, input, output) {
var args = new ThriftHiveMetastore_create_table_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_create_table_result();
this._handler.create_table(args.tbl, function (success) {
result.success = success;
output.writeMessageBegin("create_table", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_table = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_table_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_table_result();
this._handler.drop_table(args.dbname, args.name, args.deleteData, function (success) {
result.success = success;
output.writeMessageBegin("drop_table", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_tables = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_tables_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_tables_result();
this._handler.get_tables(args.db_name, args.pattern, function (success) {
result.success = success;
output.writeMessageBegin("get_tables", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_all_tables = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_all_tables_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_all_tables_result();
this._handler.get_all_tables(args.db_name, function (success) {
result.success = success;
output.writeMessageBegin("get_all_tables", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_table = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_table_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_table_result();
this._handler.get_table(args.dbname, args.tbl_name, function (success) {
result.success = success;
output.writeMessageBegin("get_table", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_alter_table = function(seqid, input, output) {
var args = new ThriftHiveMetastore_alter_table_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_alter_table_result();
this._handler.alter_table(args.dbname, args.tbl_name, args.new_tbl, function (success) {
result.success = success;
output.writeMessageBegin("alter_table", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_add_partition = function(seqid, input, output) {
var args = new ThriftHiveMetastore_add_partition_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_add_partition_result();
this._handler.add_partition(args.new_part, function (success) {
result.success = success;
output.writeMessageBegin("add_partition", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_append_partition = function(seqid, input, output) {
var args = new ThriftHiveMetastore_append_partition_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_append_partition_result();
this._handler.append_partition(args.db_name, args.tbl_name, args.part_vals, function (success) {
result.success = success;
output.writeMessageBegin("append_partition", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_append_partition_by_name = function(seqid, input, output) {
var args = new ThriftHiveMetastore_append_partition_by_name_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_append_partition_by_name_result();
this._handler.append_partition_by_name(args.db_name, args.tbl_name, args.part_name, function (success) {
result.success = success;
output.writeMessageBegin("append_partition_by_name", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_partition = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_partition_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_partition_result();
this._handler.drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData, function (success) {
result.success = success;
output.writeMessageBegin("drop_partition", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_partition_by_name = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_partition_by_name_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_partition_by_name_result();
this._handler.drop_partition_by_name(args.db_name, args.tbl_name, args.part_name, args.deleteData, function (success) {
result.success = success;
output.writeMessageBegin("drop_partition_by_name", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partition = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partition_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partition_result();
this._handler.get_partition(args.db_name, args.tbl_name, args.part_vals, function (success) {
result.success = success;
output.writeMessageBegin("get_partition", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partition_with_auth = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partition_with_auth_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partition_with_auth_result();
this._handler.get_partition_with_auth(args.db_name, args.tbl_name, args.part_vals, args.user_name, args.group_names, function (success) {
result.success = success;
output.writeMessageBegin("get_partition_with_auth", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partition_by_name = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partition_by_name_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partition_by_name_result();
this._handler.get_partition_by_name(args.db_name, args.tbl_name, args.part_name, function (success) {
result.success = success;
output.writeMessageBegin("get_partition_by_name", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partitions = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partitions_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partitions_result();
this._handler.get_partitions(args.db_name, args.tbl_name, args.max_parts, function (success) {
result.success = success;
output.writeMessageBegin("get_partitions", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partitions_with_auth = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partitions_with_auth_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partitions_with_auth_result();
this._handler.get_partitions_with_auth(args.db_name, args.tbl_name, args.max_parts, args.user_name, args.group_names, function (success) {
result.success = success;
output.writeMessageBegin("get_partitions_with_auth", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partition_names = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partition_names_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partition_names_result();
this._handler.get_partition_names(args.db_name, args.tbl_name, args.max_parts, function (success) {
result.success = success;
output.writeMessageBegin("get_partition_names", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partitions_ps = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partitions_ps_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partitions_ps_result();
this._handler.get_partitions_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts, function (success) {
result.success = success;
output.writeMessageBegin("get_partitions_ps", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partitions_ps_with_auth = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partitions_ps_with_auth_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partitions_ps_with_auth_result();
this._handler.get_partitions_ps_with_auth(args.db_name, args.tbl_name, args.part_vals, args.max_parts, args.user_name, args.group_names, function (success) {
result.success = success;
output.writeMessageBegin("get_partitions_ps_with_auth", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partition_names_ps = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partition_names_ps_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partition_names_ps_result();
this._handler.get_partition_names_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts, function (success) {
result.success = success;
output.writeMessageBegin("get_partition_names_ps", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_partitions_by_filter = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_partitions_by_filter_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_partitions_by_filter_result();
this._handler.get_partitions_by_filter(args.db_name, args.tbl_name, args.filter, args.max_parts, function (success) {
result.success = success;
output.writeMessageBegin("get_partitions_by_filter", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_alter_partition = function(seqid, input, output) {
var args = new ThriftHiveMetastore_alter_partition_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_alter_partition_result();
this._handler.alter_partition(args.db_name, args.tbl_name, args.new_part, function (success) {
result.success = success;
output.writeMessageBegin("alter_partition", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_config_value = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_config_value_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_config_value_result();
this._handler.get_config_value(args.name, args.defaultValue, function (success) {
result.success = success;
output.writeMessageBegin("get_config_value", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_partition_name_to_vals = function(seqid, input, output) {
var args = new ThriftHiveMetastore_partition_name_to_vals_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_partition_name_to_vals_result();
this._handler.partition_name_to_vals(args.part_name, function (success) {
result.success = success;
output.writeMessageBegin("partition_name_to_vals", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_partition_name_to_spec = function(seqid, input, output) {
var args = new ThriftHiveMetastore_partition_name_to_spec_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_partition_name_to_spec_result();
this._handler.partition_name_to_spec(args.part_name, function (success) {
result.success = success;
output.writeMessageBegin("partition_name_to_spec", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_add_index = function(seqid, input, output) {
var args = new ThriftHiveMetastore_add_index_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_add_index_result();
this._handler.add_index(args.new_index, args.index_table, function (success) {
result.success = success;
output.writeMessageBegin("add_index", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_alter_index = function(seqid, input, output) {
var args = new ThriftHiveMetastore_alter_index_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_alter_index_result();
this._handler.alter_index(args.dbname, args.base_tbl_name, args.idx_name, args.new_idx, function (success) {
result.success = success;
output.writeMessageBegin("alter_index", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_index_by_name = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_index_by_name_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_index_by_name_result();
this._handler.drop_index_by_name(args.db_name, args.tbl_name, args.index_name, args.deleteData, function (success) {
result.success = success;
output.writeMessageBegin("drop_index_by_name", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_index_by_name = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_index_by_name_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_index_by_name_result();
this._handler.get_index_by_name(args.db_name, args.tbl_name, args.index_name, function (success) {
result.success = success;
output.writeMessageBegin("get_index_by_name", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_indexes = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_indexes_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_indexes_result();
this._handler.get_indexes(args.db_name, args.tbl_name, args.max_indexes, function (success) {
result.success = success;
output.writeMessageBegin("get_indexes", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_index_names = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_index_names_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_index_names_result();
this._handler.get_index_names(args.db_name, args.tbl_name, args.max_indexes, function (success) {
result.success = success;
output.writeMessageBegin("get_index_names", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_create_role = function(seqid, input, output) {
var args = new ThriftHiveMetastore_create_role_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_create_role_result();
this._handler.create_role(args.role, function (success) {
result.success = success;
output.writeMessageBegin("create_role", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_drop_role = function(seqid, input, output) {
var args = new ThriftHiveMetastore_drop_role_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_drop_role_result();
this._handler.drop_role(args.role_name, function (success) {
result.success = success;
output.writeMessageBegin("drop_role", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_role_names = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_role_names_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_role_names_result();
this._handler.get_role_names(function (success) {
result.success = success;
output.writeMessageBegin("get_role_names", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_grant_role = function(seqid, input, output) {
var args = new ThriftHiveMetastore_grant_role_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_grant_role_result();
this._handler.grant_role(args.role_name, args.principal_name, args.principal_type, args.grantor, args.grantorType, args.grant_option, function (success) {
result.success = success;
output.writeMessageBegin("grant_role", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_revoke_role = function(seqid, input, output) {
var args = new ThriftHiveMetastore_revoke_role_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_revoke_role_result();
this._handler.revoke_role(args.role_name, args.principal_name, args.principal_type, function (success) {
result.success = success;
output.writeMessageBegin("revoke_role", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_list_roles = function(seqid, input, output) {
var args = new ThriftHiveMetastore_list_roles_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_list_roles_result();
this._handler.list_roles(args.principal_name, args.principal_type, function (success) {
result.success = success;
output.writeMessageBegin("list_roles", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_privilege_set = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_privilege_set_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_privilege_set_result();
this._handler.get_privilege_set(args.hiveObject, args.user_name, args.group_names, function (success) {
result.success = success;
output.writeMessageBegin("get_privilege_set", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_list_privileges = function(seqid, input, output) {
var args = new ThriftHiveMetastore_list_privileges_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_list_privileges_result();
this._handler.list_privileges(args.principal_name, args.principal_type, args.hiveObject, function (success) {
result.success = success;
output.writeMessageBegin("list_privileges", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_grant_privileges = function(seqid, input, output) {
var args = new ThriftHiveMetastore_grant_privileges_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_grant_privileges_result();
this._handler.grant_privileges(args.privileges, function (success) {
result.success = success;
output.writeMessageBegin("grant_privileges", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_revoke_privileges = function(seqid, input, output) {
var args = new ThriftHiveMetastore_revoke_privileges_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_revoke_privileges_result();
this._handler.revoke_privileges(args.privileges, function (success) {
result.success = success;
output.writeMessageBegin("revoke_privileges", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_delegation_token = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_delegation_token_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_delegation_token_result();
this._handler.get_delegation_token(args.renewer_kerberos_principal_name, function (success) {
result.success = success;
output.writeMessageBegin("get_delegation_token", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_get_delegation_token_with_signature = function(seqid, input, output) {
var args = new ThriftHiveMetastore_get_delegation_token_with_signature_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_get_delegation_token_with_signature_result();
this._handler.get_delegation_token_with_signature(args.renewer_kerberos_principal_name, args.token_signature, function (success) {
result.success = success;
output.writeMessageBegin("get_delegation_token_with_signature", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_renew_delegation_token = function(seqid, input, output) {
var args = new ThriftHiveMetastore_renew_delegation_token_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_renew_delegation_token_result();
this._handler.renew_delegation_token(args.token_str_form, function (success) {
result.success = success;
output.writeMessageBegin("renew_delegation_token", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
ThriftHiveMetastoreProcessor.prototype.process_cancel_delegation_token = function(seqid, input, output) {
var args = new ThriftHiveMetastore_cancel_delegation_token_args();
args.read(input);
input.readMessageEnd();
var result = new ThriftHiveMetastore_cancel_delegation_token_result();
this._handler.cancel_delegation_token(args.token_str_form, function (success) {
result.success = success;
output.writeMessageBegin("cancel_delegation_token", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
================================================
FILE: lib/shib/engines/hiveserver/fb303_types.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = module.exports = {};
ttypes.fb_status = {
'DEAD' : 0,
'STARTING' : 1,
'ALIVE' : 2,
'STOPPING' : 3,
'STOPPED' : 4,
'WARNING' : 5
};
================================================
FILE: lib/shib/engines/hiveserver/hive_metastore_types.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = module.exports = {};
ttypes.HiveObjectType = {
'GLOBAL' : 1,
'DATABASE' : 2,
'TABLE' : 3,
'PARTITION' : 4,
'COLUMN' : 5
};
ttypes.PrincipalType = {
'USER' : 1,
'ROLE' : 2,
'GROUP' : 3
};
var Version = module.exports.Version = function(args) {
this.version = null;
this.comments = null;
if (args) {
if (args.version !== undefined) {
this.version = args.version;
}
if (args.comments !== undefined) {
this.comments = args.comments;
}
}
};
Version.prototype = {};
Version.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.version = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.comments = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Version.prototype.write = function(output) {
output.writeStructBegin('Version');
if (this.version) {
output.writeFieldBegin('version', Thrift.Type.STRING, 1);
output.writeString(this.version);
output.writeFieldEnd();
}
if (this.comments) {
output.writeFieldBegin('comments', Thrift.Type.STRING, 2);
output.writeString(this.comments);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var FieldSchema = module.exports.FieldSchema = function(args) {
this.name = null;
this.type = null;
this.comment = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.type !== undefined) {
this.type = args.type;
}
if (args.comment !== undefined) {
this.comment = args.comment;
}
}
};
FieldSchema.prototype = {};
FieldSchema.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.type = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.comment = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
FieldSchema.prototype.write = function(output) {
output.writeStructBegin('FieldSchema');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.type) {
output.writeFieldBegin('type', Thrift.Type.STRING, 2);
output.writeString(this.type);
output.writeFieldEnd();
}
if (this.comment) {
output.writeFieldBegin('comment', Thrift.Type.STRING, 3);
output.writeString(this.comment);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Type = module.exports.Type = function(args) {
this.name = null;
this.type1 = null;
this.type2 = null;
this.fields = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.type1 !== undefined) {
this.type1 = args.type1;
}
if (args.type2 !== undefined) {
this.type2 = args.type2;
}
if (args.fields !== undefined) {
this.fields = args.fields;
}
}
};
Type.prototype = {};
Type.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.type1 = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.type2 = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.LIST) {
var _size0 = 0;
var _rtmp34;
this.fields = [];
var _etype3 = 0;
_rtmp34 = input.readListBegin();
_etype3 = _rtmp34.etype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var elem6 = null;
elem6 = new ttypes.FieldSchema();
elem6.read(input);
this.fields.push(elem6);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Type.prototype.write = function(output) {
output.writeStructBegin('Type');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.type1) {
output.writeFieldBegin('type1', Thrift.Type.STRING, 2);
output.writeString(this.type1);
output.writeFieldEnd();
}
if (this.type2) {
output.writeFieldBegin('type2', Thrift.Type.STRING, 3);
output.writeString(this.type2);
output.writeFieldEnd();
}
if (this.fields) {
output.writeFieldBegin('fields', Thrift.Type.LIST, 4);
output.writeListBegin(Thrift.Type.STRUCT, this.fields.length);
for (var iter7 in this.fields)
{
if (this.fields.hasOwnProperty(iter7))
{
iter7 = this.fields[iter7];
iter7.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var HiveObjectRef = module.exports.HiveObjectRef = function(args) {
this.objectType = null;
this.dbName = null;
this.objectName = null;
this.partValues = null;
this.columnName = null;
if (args) {
if (args.objectType !== undefined) {
this.objectType = args.objectType;
}
if (args.dbName !== undefined) {
this.dbName = args.dbName;
}
if (args.objectName !== undefined) {
this.objectName = args.objectName;
}
if (args.partValues !== undefined) {
this.partValues = args.partValues;
}
if (args.columnName !== undefined) {
this.columnName = args.columnName;
}
}
};
HiveObjectRef.prototype = {};
HiveObjectRef.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.objectType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.dbName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.objectName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.LIST) {
var _size8 = 0;
var _rtmp312;
this.partValues = [];
var _etype11 = 0;
_rtmp312 = input.readListBegin();
_etype11 = _rtmp312.etype;
_size8 = _rtmp312.size;
for (var _i13 = 0; _i13 < _size8; ++_i13)
{
var elem14 = null;
elem14 = input.readString();
this.partValues.push(elem14);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.columnName = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
HiveObjectRef.prototype.write = function(output) {
output.writeStructBegin('HiveObjectRef');
if (this.objectType) {
output.writeFieldBegin('objectType', Thrift.Type.I32, 1);
output.writeI32(this.objectType);
output.writeFieldEnd();
}
if (this.dbName) {
output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);
output.writeString(this.dbName);
output.writeFieldEnd();
}
if (this.objectName) {
output.writeFieldBegin('objectName', Thrift.Type.STRING, 3);
output.writeString(this.objectName);
output.writeFieldEnd();
}
if (this.partValues) {
output.writeFieldBegin('partValues', Thrift.Type.LIST, 4);
output.writeListBegin(Thrift.Type.STRING, this.partValues.length);
for (var iter15 in this.partValues)
{
if (this.partValues.hasOwnProperty(iter15))
{
iter15 = this.partValues[iter15];
output.writeString(iter15);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.columnName) {
output.writeFieldBegin('columnName', Thrift.Type.STRING, 5);
output.writeString(this.columnName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var PrivilegeGrantInfo = module.exports.PrivilegeGrantInfo = function(args) {
this.privilege = null;
this.createTime = null;
this.grantor = null;
this.grantorType = null;
this.grantOption = null;
if (args) {
if (args.privilege !== undefined) {
this.privilege = args.privilege;
}
if (args.createTime !== undefined) {
this.createTime = args.createTime;
}
if (args.grantor !== undefined) {
this.grantor = args.grantor;
}
if (args.grantorType !== undefined) {
this.grantorType = args.grantorType;
}
if (args.grantOption !== undefined) {
this.grantOption = args.grantOption;
}
}
};
PrivilegeGrantInfo.prototype = {};
PrivilegeGrantInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.privilege = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.createTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.grantor = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.grantorType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.BOOL) {
this.grantOption = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
PrivilegeGrantInfo.prototype.write = function(output) {
output.writeStructBegin('PrivilegeGrantInfo');
if (this.privilege) {
output.writeFieldBegin('privilege', Thrift.Type.STRING, 1);
output.writeString(this.privilege);
output.writeFieldEnd();
}
if (this.createTime) {
output.writeFieldBegin('createTime', Thrift.Type.I32, 2);
output.writeI32(this.createTime);
output.writeFieldEnd();
}
if (this.grantor) {
output.writeFieldBegin('grantor', Thrift.Type.STRING, 3);
output.writeString(this.grantor);
output.writeFieldEnd();
}
if (this.grantorType) {
output.writeFieldBegin('grantorType', Thrift.Type.I32, 4);
output.writeI32(this.grantorType);
output.writeFieldEnd();
}
if (this.grantOption) {
output.writeFieldBegin('grantOption', Thrift.Type.BOOL, 5);
output.writeBool(this.grantOption);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var HiveObjectPrivilege = module.exports.HiveObjectPrivilege = function(args) {
this.hiveObject = null;
this.principalName = null;
this.principalType = null;
this.grantInfo = null;
if (args) {
if (args.hiveObject !== undefined) {
this.hiveObject = args.hiveObject;
}
if (args.principalName !== undefined) {
this.principalName = args.principalName;
}
if (args.principalType !== undefined) {
this.principalType = args.principalType;
}
if (args.grantInfo !== undefined) {
this.grantInfo = args.grantInfo;
}
}
};
HiveObjectPrivilege.prototype = {};
HiveObjectPrivilege.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.hiveObject = new ttypes.HiveObjectRef();
this.hiveObject.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.principalName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.principalType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.grantInfo = new ttypes.PrivilegeGrantInfo();
this.grantInfo.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
HiveObjectPrivilege.prototype.write = function(output) {
output.writeStructBegin('HiveObjectPrivilege');
if (this.hiveObject) {
output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 1);
this.hiveObject.write(output);
output.writeFieldEnd();
}
if (this.principalName) {
output.writeFieldBegin('principalName', Thrift.Type.STRING, 2);
output.writeString(this.principalName);
output.writeFieldEnd();
}
if (this.principalType) {
output.writeFieldBegin('principalType', Thrift.Type.I32, 3);
output.writeI32(this.principalType);
output.writeFieldEnd();
}
if (this.grantInfo) {
output.writeFieldBegin('grantInfo', Thrift.Type.STRUCT, 4);
this.grantInfo.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var PrivilegeBag = module.exports.PrivilegeBag = function(args) {
this.privileges = null;
if (args) {
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
PrivilegeBag.prototype = {};
PrivilegeBag.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size16 = 0;
var _rtmp320;
this.privileges = [];
var _etype19 = 0;
_rtmp320 = input.readListBegin();
_etype19 = _rtmp320.etype;
_size16 = _rtmp320.size;
for (var _i21 = 0; _i21 < _size16; ++_i21)
{
var elem22 = null;
elem22 = new ttypes.HiveObjectPrivilege();
elem22.read(input);
this.privileges.push(elem22);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
PrivilegeBag.prototype.write = function(output) {
output.writeStructBegin('PrivilegeBag');
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.privileges.length);
for (var iter23 in this.privileges)
{
if (this.privileges.hasOwnProperty(iter23))
{
iter23 = this.privileges[iter23];
iter23.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var PrincipalPrivilegeSet = module.exports.PrincipalPrivilegeSet = function(args) {
this.userPrivileges = null;
this.groupPrivileges = null;
this.rolePrivileges = null;
if (args) {
if (args.userPrivileges !== undefined) {
this.userPrivileges = args.userPrivileges;
}
if (args.groupPrivileges !== undefined) {
this.groupPrivileges = args.groupPrivileges;
}
if (args.rolePrivileges !== undefined) {
this.rolePrivileges = args.rolePrivileges;
}
}
};
PrincipalPrivilegeSet.prototype = {};
PrincipalPrivilegeSet.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.MAP) {
var _size24 = 0;
var _rtmp328;
this.userPrivileges = {};
var _ktype25 = 0;
var _vtype26 = 0;
_rtmp328 = input.readMapBegin();
_ktype25 = _rtmp328.ktype;
_vtype26 = _rtmp328.vtype;
_size24 = _rtmp328.size;
for (var _i29 = 0; _i29 < _size24; ++_i29)
{
if (_i29 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key30 = null;
var val31 = null;
key30 = input.readString();
var _size32 = 0;
var _rtmp336;
val31 = [];
var _etype35 = 0;
_rtmp336 = input.readListBegin();
_etype35 = _rtmp336.etype;
_size32 = _rtmp336.size;
for (var _i37 = 0; _i37 < _size32; ++_i37)
{
var elem38 = null;
elem38 = new ttypes.PrivilegeGrantInfo();
elem38.read(input);
val31.push(elem38);
}
input.readListEnd();
this.userPrivileges[key30] = val31;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.MAP) {
var _size39 = 0;
var _rtmp343;
this.groupPrivileges = {};
var _ktype40 = 0;
var _vtype41 = 0;
_rtmp343 = input.readMapBegin();
_ktype40 = _rtmp343.ktype;
_vtype41 = _rtmp343.vtype;
_size39 = _rtmp343.size;
for (var _i44 = 0; _i44 < _size39; ++_i44)
{
if (_i44 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key45 = null;
var val46 = null;
key45 = input.readString();
var _size47 = 0;
var _rtmp351;
val46 = [];
var _etype50 = 0;
_rtmp351 = input.readListBegin();
_etype50 = _rtmp351.etype;
_size47 = _rtmp351.size;
for (var _i52 = 0; _i52 < _size47; ++_i52)
{
var elem53 = null;
elem53 = new ttypes.PrivilegeGrantInfo();
elem53.read(input);
val46.push(elem53);
}
input.readListEnd();
this.groupPrivileges[key45] = val46;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size54 = 0;
var _rtmp358;
this.rolePrivileges = {};
var _ktype55 = 0;
var _vtype56 = 0;
_rtmp358 = input.readMapBegin();
_ktype55 = _rtmp358.ktype;
_vtype56 = _rtmp358.vtype;
_size54 = _rtmp358.size;
for (var _i59 = 0; _i59 < _size54; ++_i59)
{
if (_i59 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key60 = null;
var val61 = null;
key60 = input.readString();
var _size62 = 0;
var _rtmp366;
val61 = [];
var _etype65 = 0;
_rtmp366 = input.readListBegin();
_etype65 = _rtmp366.etype;
_size62 = _rtmp366.size;
for (var _i67 = 0; _i67 < _size62; ++_i67)
{
var elem68 = null;
elem68 = new ttypes.PrivilegeGrantInfo();
elem68.read(input);
val61.push(elem68);
}
input.readListEnd();
this.rolePrivileges[key60] = val61;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
PrincipalPrivilegeSet.prototype.write = function(output) {
output.writeStructBegin('PrincipalPrivilegeSet');
if (this.userPrivileges) {
output.writeFieldBegin('userPrivileges', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.userPrivileges));
for (var kiter69 in this.userPrivileges)
{
if (this.userPrivileges.hasOwnProperty(kiter69))
{
var viter70 = this.userPrivileges[kiter69];
output.writeString(kiter69);
output.writeListBegin(Thrift.Type.STRUCT, viter70.length);
for (var iter71 in viter70)
{
if (viter70.hasOwnProperty(iter71))
{
iter71 = viter70[iter71];
iter71.write(output);
}
}
output.writeListEnd();
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.groupPrivileges) {
output.writeFieldBegin('groupPrivileges', Thrift.Type.MAP, 2);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.groupPrivileges));
for (var kiter72 in this.groupPrivileges)
{
if (this.groupPrivileges.hasOwnProperty(kiter72))
{
var viter73 = this.groupPrivileges[kiter72];
output.writeString(kiter72);
output.writeListBegin(Thrift.Type.STRUCT, viter73.length);
for (var iter74 in viter73)
{
if (viter73.hasOwnProperty(iter74))
{
iter74 = viter73[iter74];
iter74.write(output);
}
}
output.writeListEnd();
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.rolePrivileges) {
output.writeFieldBegin('rolePrivileges', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.rolePrivileges));
for (var kiter75 in this.rolePrivileges)
{
if (this.rolePrivileges.hasOwnProperty(kiter75))
{
var viter76 = this.rolePrivileges[kiter75];
output.writeString(kiter75);
output.writeListBegin(Thrift.Type.STRUCT, viter76.length);
for (var iter77 in viter76)
{
if (viter76.hasOwnProperty(iter77))
{
iter77 = viter76[iter77];
iter77.write(output);
}
}
output.writeListEnd();
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Role = module.exports.Role = function(args) {
this.roleName = null;
this.createTime = null;
this.ownerName = null;
if (args) {
if (args.roleName !== undefined) {
this.roleName = args.roleName;
}
if (args.createTime !== undefined) {
this.createTime = args.createTime;
}
if (args.ownerName !== undefined) {
this.ownerName = args.ownerName;
}
}
};
Role.prototype = {};
Role.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.roleName = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.createTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.ownerName = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Role.prototype.write = function(output) {
output.writeStructBegin('Role');
if (this.roleName) {
output.writeFieldBegin('roleName', Thrift.Type.STRING, 1);
output.writeString(this.roleName);
output.writeFieldEnd();
}
if (this.createTime) {
output.writeFieldBegin('createTime', Thrift.Type.I32, 2);
output.writeI32(this.createTime);
output.writeFieldEnd();
}
if (this.ownerName) {
output.writeFieldBegin('ownerName', Thrift.Type.STRING, 3);
output.writeString(this.ownerName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Database = module.exports.Database = function(args) {
this.name = null;
this.description = null;
this.locationUri = null;
this.parameters = null;
this.privileges = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.description !== undefined) {
this.description = args.description;
}
if (args.locationUri !== undefined) {
this.locationUri = args.locationUri;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
Database.prototype = {};
Database.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.description = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.locationUri = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size78 = 0;
var _rtmp382;
this.parameters = {};
var _ktype79 = 0;
var _vtype80 = 0;
_rtmp382 = input.readMapBegin();
_ktype79 = _rtmp382.ktype;
_vtype80 = _rtmp382.vtype;
_size78 = _rtmp382.size;
for (var _i83 = 0; _i83 < _size78; ++_i83)
{
if (_i83 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key84 = null;
var val85 = null;
key84 = input.readString();
val85 = input.readString();
this.parameters[key84] = val85;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.privileges = new ttypes.PrincipalPrivilegeSet();
this.privileges.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Database.prototype.write = function(output) {
output.writeStructBegin('Database');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.description) {
output.writeFieldBegin('description', Thrift.Type.STRING, 2);
output.writeString(this.description);
output.writeFieldEnd();
}
if (this.locationUri) {
output.writeFieldBegin('locationUri', Thrift.Type.STRING, 3);
output.writeString(this.locationUri);
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter86 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter86))
{
var viter87 = this.parameters[kiter86];
output.writeString(kiter86);
output.writeString(viter87);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 5);
this.privileges.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var SerDeInfo = module.exports.SerDeInfo = function(args) {
this.name = null;
this.serializationLib = null;
this.parameters = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.serializationLib !== undefined) {
this.serializationLib = args.serializationLib;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
}
};
SerDeInfo.prototype = {};
SerDeInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.serializationLib = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size88 = 0;
var _rtmp392;
this.parameters = {};
var _ktype89 = 0;
var _vtype90 = 0;
_rtmp392 = input.readMapBegin();
_ktype89 = _rtmp392.ktype;
_vtype90 = _rtmp392.vtype;
_size88 = _rtmp392.size;
for (var _i93 = 0; _i93 < _size88; ++_i93)
{
if (_i93 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key94 = null;
var val95 = null;
key94 = input.readString();
val95 = input.readString();
this.parameters[key94] = val95;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
SerDeInfo.prototype.write = function(output) {
output.writeStructBegin('SerDeInfo');
if (this.name) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.serializationLib) {
output.writeFieldBegin('serializationLib', Thrift.Type.STRING, 2);
output.writeString(this.serializationLib);
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter96 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter96))
{
var viter97 = this.parameters[kiter96];
output.writeString(kiter96);
output.writeString(viter97);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Order = module.exports.Order = function(args) {
this.col = null;
this.order = null;
if (args) {
if (args.col !== undefined) {
this.col = args.col;
}
if (args.order !== undefined) {
this.order = args.order;
}
}
};
Order.prototype = {};
Order.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.col = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.order = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Order.prototype.write = function(output) {
output.writeStructBegin('Order');
if (this.col) {
output.writeFieldBegin('col', Thrift.Type.STRING, 1);
output.writeString(this.col);
output.writeFieldEnd();
}
if (this.order) {
output.writeFieldBegin('order', Thrift.Type.I32, 2);
output.writeI32(this.order);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var StorageDescriptor = module.exports.StorageDescriptor = function(args) {
this.cols = null;
this.location = null;
this.inputFormat = null;
this.outputFormat = null;
this.compressed = null;
this.numBuckets = null;
this.serdeInfo = null;
this.bucketCols = null;
this.sortCols = null;
this.parameters = null;
if (args) {
if (args.cols !== undefined) {
this.cols = args.cols;
}
if (args.location !== undefined) {
this.location = args.location;
}
if (args.inputFormat !== undefined) {
this.inputFormat = args.inputFormat;
}
if (args.outputFormat !== undefined) {
this.outputFormat = args.outputFormat;
}
if (args.compressed !== undefined) {
this.compressed = args.compressed;
}
if (args.numBuckets !== undefined) {
this.numBuckets = args.numBuckets;
}
if (args.serdeInfo !== undefined) {
this.serdeInfo = args.serdeInfo;
}
if (args.bucketCols !== undefined) {
this.bucketCols = args.bucketCols;
}
if (args.sortCols !== undefined) {
this.sortCols = args.sortCols;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
}
};
StorageDescriptor.prototype = {};
StorageDescriptor.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size98 = 0;
var _rtmp3102;
this.cols = [];
var _etype101 = 0;
_rtmp3102 = input.readListBegin();
_etype101 = _rtmp3102.etype;
_size98 = _rtmp3102.size;
for (var _i103 = 0; _i103 < _size98; ++_i103)
{
var elem104 = null;
elem104 = new ttypes.FieldSchema();
elem104.read(input);
this.cols.push(elem104);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.location = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.inputFormat = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.outputFormat = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.BOOL) {
this.compressed = input.readBool();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I32) {
this.numBuckets = input.readI32();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRUCT) {
this.serdeInfo = new ttypes.SerDeInfo();
this.serdeInfo.read(input);
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.LIST) {
var _size105 = 0;
var _rtmp3109;
this.bucketCols = [];
var _etype108 = 0;
_rtmp3109 = input.readListBegin();
_etype108 = _rtmp3109.etype;
_size105 = _rtmp3109.size;
for (var _i110 = 0; _i110 < _size105; ++_i110)
{
var elem111 = null;
elem111 = input.readString();
this.bucketCols.push(elem111);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 9:
if (ftype == Thrift.Type.LIST) {
var _size112 = 0;
var _rtmp3116;
this.sortCols = [];
var _etype115 = 0;
_rtmp3116 = input.readListBegin();
_etype115 = _rtmp3116.etype;
_size112 = _rtmp3116.size;
for (var _i117 = 0; _i117 < _size112; ++_i117)
{
var elem118 = null;
elem118 = new ttypes.Order();
elem118.read(input);
this.sortCols.push(elem118);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 10:
if (ftype == Thrift.Type.MAP) {
var _size119 = 0;
var _rtmp3123;
this.parameters = {};
var _ktype120 = 0;
var _vtype121 = 0;
_rtmp3123 = input.readMapBegin();
_ktype120 = _rtmp3123.ktype;
_vtype121 = _rtmp3123.vtype;
_size119 = _rtmp3123.size;
for (var _i124 = 0; _i124 < _size119; ++_i124)
{
if (_i124 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key125 = null;
var val126 = null;
key125 = input.readString();
val126 = input.readString();
this.parameters[key125] = val126;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
StorageDescriptor.prototype.write = function(output) {
output.writeStructBegin('StorageDescriptor');
if (this.cols) {
output.writeFieldBegin('cols', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.cols.length);
for (var iter127 in this.cols)
{
if (this.cols.hasOwnProperty(iter127))
{
iter127 = this.cols[iter127];
iter127.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.location) {
output.writeFieldBegin('location', Thrift.Type.STRING, 2);
output.writeString(this.location);
output.writeFieldEnd();
}
if (this.inputFormat) {
output.writeFieldBegin('inputFormat', Thrift.Type.STRING, 3);
output.writeString(this.inputFormat);
output.writeFieldEnd();
}
if (this.outputFormat) {
output.writeFieldBegin('outputFormat', Thrift.Type.STRING, 4);
output.writeString(this.outputFormat);
output.writeFieldEnd();
}
if (this.compressed) {
output.writeFieldBegin('compressed', Thrift.Type.BOOL, 5);
output.writeBool(this.compressed);
output.writeFieldEnd();
}
if (this.numBuckets) {
output.writeFieldBegin('numBuckets', Thrift.Type.I32, 6);
output.writeI32(this.numBuckets);
output.writeFieldEnd();
}
if (this.serdeInfo) {
output.writeFieldBegin('serdeInfo', Thrift.Type.STRUCT, 7);
this.serdeInfo.write(output);
output.writeFieldEnd();
}
if (this.bucketCols) {
output.writeFieldBegin('bucketCols', Thrift.Type.LIST, 8);
output.writeListBegin(Thrift.Type.STRING, this.bucketCols.length);
for (var iter128 in this.bucketCols)
{
if (this.bucketCols.hasOwnProperty(iter128))
{
iter128 = this.bucketCols[iter128];
output.writeString(iter128);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.sortCols) {
output.writeFieldBegin('sortCols', Thrift.Type.LIST, 9);
output.writeListBegin(Thrift.Type.STRUCT, this.sortCols.length);
for (var iter129 in this.sortCols)
{
if (this.sortCols.hasOwnProperty(iter129))
{
iter129 = this.sortCols[iter129];
iter129.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 10);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter130 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter130))
{
var viter131 = this.parameters[kiter130];
output.writeString(kiter130);
output.writeString(viter131);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Table = module.exports.Table = function(args) {
this.tableName = null;
this.dbName = null;
this.owner = null;
this.createTime = null;
this.lastAccessTime = null;
this.retention = null;
this.sd = null;
this.partitionKeys = null;
this.parameters = null;
this.viewOriginalText = null;
this.viewExpandedText = null;
this.tableType = null;
this.privileges = null;
if (args) {
if (args.tableName !== undefined) {
this.tableName = args.tableName;
}
if (args.dbName !== undefined) {
this.dbName = args.dbName;
}
if (args.owner !== undefined) {
this.owner = args.owner;
}
if (args.createTime !== undefined) {
this.createTime = args.createTime;
}
if (args.lastAccessTime !== undefined) {
this.lastAccessTime = args.lastAccessTime;
}
if (args.retention !== undefined) {
this.retention = args.retention;
}
if (args.sd !== undefined) {
this.sd = args.sd;
}
if (args.partitionKeys !== undefined) {
this.partitionKeys = args.partitionKeys;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
if (args.viewOriginalText !== undefined) {
this.viewOriginalText = args.viewOriginalText;
}
if (args.viewExpandedText !== undefined) {
this.viewExpandedText = args.viewExpandedText;
}
if (args.tableType !== undefined) {
this.tableType = args.tableType;
}
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
Table.prototype = {};
Table.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.tableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.dbName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.owner = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.createTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.lastAccessTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I32) {
this.retention = input.readI32();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRUCT) {
this.sd = new ttypes.StorageDescriptor();
this.sd.read(input);
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.LIST) {
var _size132 = 0;
var _rtmp3136;
this.partitionKeys = [];
var _etype135 = 0;
_rtmp3136 = input.readListBegin();
_etype135 = _rtmp3136.etype;
_size132 = _rtmp3136.size;
for (var _i137 = 0; _i137 < _size132; ++_i137)
{
var elem138 = null;
elem138 = new ttypes.FieldSchema();
elem138.read(input);
this.partitionKeys.push(elem138);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 9:
if (ftype == Thrift.Type.MAP) {
var _size139 = 0;
var _rtmp3143;
this.parameters = {};
var _ktype140 = 0;
var _vtype141 = 0;
_rtmp3143 = input.readMapBegin();
_ktype140 = _rtmp3143.ktype;
_vtype141 = _rtmp3143.vtype;
_size139 = _rtmp3143.size;
for (var _i144 = 0; _i144 < _size139; ++_i144)
{
if (_i144 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key145 = null;
var val146 = null;
key145 = input.readString();
val146 = input.readString();
this.parameters[key145] = val146;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 10:
if (ftype == Thrift.Type.STRING) {
this.viewOriginalText = input.readString();
} else {
input.skip(ftype);
}
break;
case 11:
if (ftype == Thrift.Type.STRING) {
this.viewExpandedText = input.readString();
} else {
input.skip(ftype);
}
break;
case 12:
if (ftype == Thrift.Type.STRING) {
this.tableType = input.readString();
} else {
input.skip(ftype);
}
break;
case 13:
if (ftype == Thrift.Type.STRUCT) {
this.privileges = new ttypes.PrincipalPrivilegeSet();
this.privileges.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Table.prototype.write = function(output) {
output.writeStructBegin('Table');
if (this.tableName) {
output.writeFieldBegin('tableName', Thrift.Type.STRING, 1);
output.writeString(this.tableName);
output.writeFieldEnd();
}
if (this.dbName) {
output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);
output.writeString(this.dbName);
output.writeFieldEnd();
}
if (this.owner) {
output.writeFieldBegin('owner', Thrift.Type.STRING, 3);
output.writeString(this.owner);
output.writeFieldEnd();
}
if (this.createTime) {
output.writeFieldBegin('createTime', Thrift.Type.I32, 4);
output.writeI32(this.createTime);
output.writeFieldEnd();
}
if (this.lastAccessTime) {
output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 5);
output.writeI32(this.lastAccessTime);
output.writeFieldEnd();
}
if (this.retention) {
output.writeFieldBegin('retention', Thrift.Type.I32, 6);
output.writeI32(this.retention);
output.writeFieldEnd();
}
if (this.sd) {
output.writeFieldBegin('sd', Thrift.Type.STRUCT, 7);
this.sd.write(output);
output.writeFieldEnd();
}
if (this.partitionKeys) {
output.writeFieldBegin('partitionKeys', Thrift.Type.LIST, 8);
output.writeListBegin(Thrift.Type.STRUCT, this.partitionKeys.length);
for (var iter147 in this.partitionKeys)
{
if (this.partitionKeys.hasOwnProperty(iter147))
{
iter147 = this.partitionKeys[iter147];
iter147.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 9);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter148 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter148))
{
var viter149 = this.parameters[kiter148];
output.writeString(kiter148);
output.writeString(viter149);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.viewOriginalText) {
output.writeFieldBegin('viewOriginalText', Thrift.Type.STRING, 10);
output.writeString(this.viewOriginalText);
output.writeFieldEnd();
}
if (this.viewExpandedText) {
output.writeFieldBegin('viewExpandedText', Thrift.Type.STRING, 11);
output.writeString(this.viewExpandedText);
output.writeFieldEnd();
}
if (this.tableType) {
output.writeFieldBegin('tableType', Thrift.Type.STRING, 12);
output.writeString(this.tableType);
output.writeFieldEnd();
}
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 13);
this.privileges.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Partition = module.exports.Partition = function(args) {
this.values = null;
this.dbName = null;
this.tableName = null;
this.createTime = null;
this.lastAccessTime = null;
this.sd = null;
this.parameters = null;
this.privileges = null;
if (args) {
if (args.values !== undefined) {
this.values = args.values;
}
if (args.dbName !== undefined) {
this.dbName = args.dbName;
}
if (args.tableName !== undefined) {
this.tableName = args.tableName;
}
if (args.createTime !== undefined) {
this.createTime = args.createTime;
}
if (args.lastAccessTime !== undefined) {
this.lastAccessTime = args.lastAccessTime;
}
if (args.sd !== undefined) {
this.sd = args.sd;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
if (args.privileges !== undefined) {
this.privileges = args.privileges;
}
}
};
Partition.prototype = {};
Partition.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size150 = 0;
var _rtmp3154;
this.values = [];
var _etype153 = 0;
_rtmp3154 = input.readListBegin();
_etype153 = _rtmp3154.etype;
_size150 = _rtmp3154.size;
for (var _i155 = 0; _i155 < _size150; ++_i155)
{
var elem156 = null;
elem156 = input.readString();
this.values.push(elem156);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.dbName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.tableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.createTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.lastAccessTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.STRUCT) {
this.sd = new ttypes.StorageDescriptor();
this.sd.read(input);
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.MAP) {
var _size157 = 0;
var _rtmp3161;
this.parameters = {};
var _ktype158 = 0;
var _vtype159 = 0;
_rtmp3161 = input.readMapBegin();
_ktype158 = _rtmp3161.ktype;
_vtype159 = _rtmp3161.vtype;
_size157 = _rtmp3161.size;
for (var _i162 = 0; _i162 < _size157; ++_i162)
{
if (_i162 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key163 = null;
var val164 = null;
key163 = input.readString();
val164 = input.readString();
this.parameters[key163] = val164;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.STRUCT) {
this.privileges = new ttypes.PrincipalPrivilegeSet();
this.privileges.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Partition.prototype.write = function(output) {
output.writeStructBegin('Partition');
if (this.values) {
output.writeFieldBegin('values', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRING, this.values.length);
for (var iter165 in this.values)
{
if (this.values.hasOwnProperty(iter165))
{
iter165 = this.values[iter165];
output.writeString(iter165);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.dbName) {
output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);
output.writeString(this.dbName);
output.writeFieldEnd();
}
if (this.tableName) {
output.writeFieldBegin('tableName', Thrift.Type.STRING, 3);
output.writeString(this.tableName);
output.writeFieldEnd();
}
if (this.createTime) {
output.writeFieldBegin('createTime', Thrift.Type.I32, 4);
output.writeI32(this.createTime);
output.writeFieldEnd();
}
if (this.lastAccessTime) {
output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 5);
output.writeI32(this.lastAccessTime);
output.writeFieldEnd();
}
if (this.sd) {
output.writeFieldBegin('sd', Thrift.Type.STRUCT, 6);
this.sd.write(output);
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 7);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter166 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter166))
{
var viter167 = this.parameters[kiter166];
output.writeString(kiter166);
output.writeString(viter167);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.privileges) {
output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 8);
this.privileges.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Index = module.exports.Index = function(args) {
this.indexName = null;
this.indexHandlerClass = null;
this.dbName = null;
this.origTableName = null;
this.createTime = null;
this.lastAccessTime = null;
this.indexTableName = null;
this.sd = null;
this.parameters = null;
this.deferredRebuild = null;
if (args) {
if (args.indexName !== undefined) {
this.indexName = args.indexName;
}
if (args.indexHandlerClass !== undefined) {
this.indexHandlerClass = args.indexHandlerClass;
}
if (args.dbName !== undefined) {
this.dbName = args.dbName;
}
if (args.origTableName !== undefined) {
this.origTableName = args.origTableName;
}
if (args.createTime !== undefined) {
this.createTime = args.createTime;
}
if (args.lastAccessTime !== undefined) {
this.lastAccessTime = args.lastAccessTime;
}
if (args.indexTableName !== undefined) {
this.indexTableName = args.indexTableName;
}
if (args.sd !== undefined) {
this.sd = args.sd;
}
if (args.parameters !== undefined) {
this.parameters = args.parameters;
}
if (args.deferredRebuild !== undefined) {
this.deferredRebuild = args.deferredRebuild;
}
}
};
Index.prototype = {};
Index.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.indexName = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.indexHandlerClass = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.dbName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.origTableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.createTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I32) {
this.lastAccessTime = input.readI32();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRING) {
this.indexTableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.STRUCT) {
this.sd = new ttypes.StorageDescriptor();
this.sd.read(input);
} else {
input.skip(ftype);
}
break;
case 9:
if (ftype == Thrift.Type.MAP) {
var _size168 = 0;
var _rtmp3172;
this.parameters = {};
var _ktype169 = 0;
var _vtype170 = 0;
_rtmp3172 = input.readMapBegin();
_ktype169 = _rtmp3172.ktype;
_vtype170 = _rtmp3172.vtype;
_size168 = _rtmp3172.size;
for (var _i173 = 0; _i173 < _size168; ++_i173)
{
if (_i173 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key174 = null;
var val175 = null;
key174 = input.readString();
val175 = input.readString();
this.parameters[key174] = val175;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 10:
if (ftype == Thrift.Type.BOOL) {
this.deferredRebuild = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Index.prototype.write = function(output) {
output.writeStructBegin('Index');
if (this.indexName) {
output.writeFieldBegin('indexName', Thrift.Type.STRING, 1);
output.writeString(this.indexName);
output.writeFieldEnd();
}
if (this.indexHandlerClass) {
output.writeFieldBegin('indexHandlerClass', Thrift.Type.STRING, 2);
output.writeString(this.indexHandlerClass);
output.writeFieldEnd();
}
if (this.dbName) {
output.writeFieldBegin('dbName', Thrift.Type.STRING, 3);
output.writeString(this.dbName);
output.writeFieldEnd();
}
if (this.origTableName) {
output.writeFieldBegin('origTableName', Thrift.Type.STRING, 4);
output.writeString(this.origTableName);
output.writeFieldEnd();
}
if (this.createTime) {
output.writeFieldBegin('createTime', Thrift.Type.I32, 5);
output.writeI32(this.createTime);
output.writeFieldEnd();
}
if (this.lastAccessTime) {
output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 6);
output.writeI32(this.lastAccessTime);
output.writeFieldEnd();
}
if (this.indexTableName) {
output.writeFieldBegin('indexTableName', Thrift.Type.STRING, 7);
output.writeString(this.indexTableName);
output.writeFieldEnd();
}
if (this.sd) {
output.writeFieldBegin('sd', Thrift.Type.STRUCT, 8);
this.sd.write(output);
output.writeFieldEnd();
}
if (this.parameters) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 9);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (var kiter176 in this.parameters)
{
if (this.parameters.hasOwnProperty(kiter176))
{
var viter177 = this.parameters[kiter176];
output.writeString(kiter176);
output.writeString(viter177);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.deferredRebuild) {
output.writeFieldBegin('deferredRebuild', Thrift.Type.BOOL, 10);
output.writeBool(this.deferredRebuild);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Schema = module.exports.Schema = function(args) {
this.fieldSchemas = null;
this.properties = null;
if (args) {
if (args.fieldSchemas !== undefined) {
this.fieldSchemas = args.fieldSchemas;
}
if (args.properties !== undefined) {
this.properties = args.properties;
}
}
};
Schema.prototype = {};
Schema.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size178 = 0;
var _rtmp3182;
this.fieldSchemas = [];
var _etype181 = 0;
_rtmp3182 = input.readListBegin();
_etype181 = _rtmp3182.etype;
_size178 = _rtmp3182.size;
for (var _i183 = 0; _i183 < _size178; ++_i183)
{
var elem184 = null;
elem184 = new ttypes.FieldSchema();
elem184.read(input);
this.fieldSchemas.push(elem184);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.MAP) {
var _size185 = 0;
var _rtmp3189;
this.properties = {};
var _ktype186 = 0;
var _vtype187 = 0;
_rtmp3189 = input.readMapBegin();
_ktype186 = _rtmp3189.ktype;
_vtype187 = _rtmp3189.vtype;
_size185 = _rtmp3189.size;
for (var _i190 = 0; _i190 < _size185; ++_i190)
{
if (_i190 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key191 = null;
var val192 = null;
key191 = input.readString();
val192 = input.readString();
this.properties[key191] = val192;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Schema.prototype.write = function(output) {
output.writeStructBegin('Schema');
if (this.fieldSchemas) {
output.writeFieldBegin('fieldSchemas', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.fieldSchemas.length);
for (var iter193 in this.fieldSchemas)
{
if (this.fieldSchemas.hasOwnProperty(iter193))
{
iter193 = this.fieldSchemas[iter193];
iter193.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.properties) {
output.writeFieldBegin('properties', Thrift.Type.MAP, 2);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.properties));
for (var kiter194 in this.properties)
{
if (this.properties.hasOwnProperty(kiter194))
{
var viter195 = this.properties[kiter194];
output.writeString(kiter194);
output.writeString(viter195);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var MetaException = module.exports.MetaException = function(args) {
Thrift.TException.call(this, "MetaException")
this.name = "MetaException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(MetaException, Thrift.TException);
MetaException.prototype.name = 'MetaException';
MetaException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
MetaException.prototype.write = function(output) {
output.writeStructBegin('MetaException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UnknownTableException = module.exports.UnknownTableException = function(args) {
Thrift.TException.call(this, "UnknownTableException")
this.name = "UnknownTableException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(UnknownTableException, Thrift.TException);
UnknownTableException.prototype.name = 'UnknownTableException';
UnknownTableException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UnknownTableException.prototype.write = function(output) {
output.writeStructBegin('UnknownTableException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var UnknownDBException = module.exports.UnknownDBException = function(args) {
Thrift.TException.call(this, "UnknownDBException")
this.name = "UnknownDBException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(UnknownDBException, Thrift.TException);
UnknownDBException.prototype.name = 'UnknownDBException';
UnknownDBException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
UnknownDBException.prototype.write = function(output) {
output.writeStructBegin('UnknownDBException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var AlreadyExistsException = module.exports.AlreadyExistsException = function(args) {
Thrift.TException.call(this, "AlreadyExistsException")
this.name = "AlreadyExistsException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(AlreadyExistsException, Thrift.TException);
AlreadyExistsException.prototype.name = 'AlreadyExistsException';
AlreadyExistsException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
AlreadyExistsException.prototype.write = function(output) {
output.writeStructBegin('AlreadyExistsException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var InvalidObjectException = module.exports.InvalidObjectException = function(args) {
Thrift.TException.call(this, "InvalidObjectException")
this.name = "InvalidObjectException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(InvalidObjectException, Thrift.TException);
InvalidObjectException.prototype.name = 'InvalidObjectException';
InvalidObjectException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
InvalidObjectException.prototype.write = function(output) {
output.writeStructBegin('InvalidObjectException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var NoSuchObjectException = module.exports.NoSuchObjectException = function(args) {
Thrift.TException.call(this, "NoSuchObjectException")
this.name = "NoSuchObjectException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(NoSuchObjectException, Thrift.TException);
NoSuchObjectException.prototype.name = 'NoSuchObjectException';
NoSuchObjectException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
NoSuchObjectException.prototype.write = function(output) {
output.writeStructBegin('NoSuchObjectException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var IndexAlreadyExistsException = module.exports.IndexAlreadyExistsException = function(args) {
Thrift.TException.call(this, "IndexAlreadyExistsException")
this.name = "IndexAlreadyExistsException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(IndexAlreadyExistsException, Thrift.TException);
IndexAlreadyExistsException.prototype.name = 'IndexAlreadyExistsException';
IndexAlreadyExistsException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
IndexAlreadyExistsException.prototype.write = function(output) {
output.writeStructBegin('IndexAlreadyExistsException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var InvalidOperationException = module.exports.InvalidOperationException = function(args) {
Thrift.TException.call(this, "InvalidOperationException")
this.name = "InvalidOperationException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(InvalidOperationException, Thrift.TException);
InvalidOperationException.prototype.name = 'InvalidOperationException';
InvalidOperationException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
InvalidOperationException.prototype.write = function(output) {
output.writeStructBegin('InvalidOperationException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var ConfigValSecurityException = module.exports.ConfigValSecurityException = function(args) {
Thrift.TException.call(this, "ConfigValSecurityException")
this.name = "ConfigValSecurityException"
this.message = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
}
};
Thrift.inherits(ConfigValSecurityException, Thrift.TException);
ConfigValSecurityException.prototype.name = 'ConfigValSecurityException';
ConfigValSecurityException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ConfigValSecurityException.prototype.write = function(output) {
output.writeStructBegin('ConfigValSecurityException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ttypes.DDL_TIME = 'transient_lastDdlTime';
ttypes.IS_ARCHIVED = 'is_archived';
ttypes.ORIGINAL_LOCATION = 'original_location';
ttypes.META_TABLE_COLUMNS = 'columns';
ttypes.META_TABLE_COLUMN_TYPES = 'columns.types';
ttypes.BUCKET_FIELD_NAME = 'bucket_field_name';
ttypes.BUCKET_COUNT = 'bucket_count';
ttypes.FIELD_TO_DIMENSION = 'field_to_dimension';
ttypes.META_TABLE_NAME = 'name';
ttypes.META_TABLE_DB = 'db';
ttypes.META_TABLE_LOCATION = 'location';
ttypes.META_TABLE_SERDE = 'serde';
ttypes.META_TABLE_PARTITION_COLUMNS = 'partition_columns';
ttypes.FILE_INPUT_FORMAT = 'file.inputformat';
ttypes.FILE_OUTPUT_FORMAT = 'file.outputformat';
ttypes.META_TABLE_STORAGE = 'storage_handler';
================================================
FILE: lib/shib/engines/hiveserver/hive_service_types.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = module.exports = {};
ttypes.JobTrackerState = {
'INITIALIZING' : 1,
'RUNNING' : 2
};
var HiveClusterStatus = module.exports.HiveClusterStatus = function(args) {
this.taskTrackers = null;
this.mapTasks = null;
this.reduceTasks = null;
this.maxMapTasks = null;
this.maxReduceTasks = null;
this.state = null;
if (args) {
if (args.taskTrackers !== undefined) {
this.taskTrackers = args.taskTrackers;
}
if (args.mapTasks !== undefined) {
this.mapTasks = args.mapTasks;
}
if (args.reduceTasks !== undefined) {
this.reduceTasks = args.reduceTasks;
}
if (args.maxMapTasks !== undefined) {
this.maxMapTasks = args.maxMapTasks;
}
if (args.maxReduceTasks !== undefined) {
this.maxReduceTasks = args.maxReduceTasks;
}
if (args.state !== undefined) {
this.state = args.state;
}
}
};
HiveClusterStatus.prototype = {};
HiveClusterStatus.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.taskTrackers = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.mapTasks = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.reduceTasks = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.maxMapTasks = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.maxReduceTasks = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I32) {
this.state = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
HiveClusterStatus.prototype.write = function(output) {
output.writeStructBegin('HiveClusterStatus');
if (this.taskTrackers) {
output.writeFieldBegin('taskTrackers', Thrift.Type.I32, 1);
output.writeI32(this.taskTrackers);
output.writeFieldEnd();
}
if (this.mapTasks) {
output.writeFieldBegin('mapTasks', Thrift.Type.I32, 2);
output.writeI32(this.mapTasks);
output.writeFieldEnd();
}
if (this.reduceTasks) {
output.writeFieldBegin('reduceTasks', Thrift.Type.I32, 3);
output.writeI32(this.reduceTasks);
output.writeFieldEnd();
}
if (this.maxMapTasks) {
output.writeFieldBegin('maxMapTasks', Thrift.Type.I32, 4);
output.writeI32(this.maxMapTasks);
output.writeFieldEnd();
}
if (this.maxReduceTasks) {
output.writeFieldBegin('maxReduceTasks', Thrift.Type.I32, 5);
output.writeI32(this.maxReduceTasks);
output.writeFieldEnd();
}
if (this.state) {
output.writeFieldBegin('state', Thrift.Type.I32, 6);
output.writeI32(this.state);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var HiveServerException = module.exports.HiveServerException = function(args) {
Thrift.TException.call(this, "HiveServerException")
this.name = "HiveServerException"
this.message = null;
this.errorCode = null;
this.SQLState = null;
if (args) {
if (args.message !== undefined) {
this.message = args.message;
}
if (args.errorCode !== undefined) {
this.errorCode = args.errorCode;
}
if (args.SQLState !== undefined) {
this.SQLState = args.SQLState;
}
}
};
Thrift.inherits(HiveServerException, Thrift.TException);
HiveServerException.prototype.name = 'HiveServerException';
HiveServerException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.errorCode = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.SQLState = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
HiveServerException.prototype.write = function(output) {
output.writeStructBegin('HiveServerException');
if (this.message) {
output.writeFieldBegin('message', Thrift.Type.STRING, 1);
output.writeString(this.message);
output.writeFieldEnd();
}
if (this.errorCode) {
output.writeFieldBegin('errorCode', Thrift.Type.I32, 2);
output.writeI32(this.errorCode);
output.writeFieldEnd();
}
if (this.SQLState) {
output.writeFieldBegin('SQLState', Thrift.Type.STRING, 3);
output.writeString(this.SQLState);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
================================================
FILE: lib/shib/engines/hiveserver/index.js
================================================
var thrift = require('node-thrift'),
ttransport = require('node-thrift/lib/thrift/transport'),
ThriftHive = require('./ThriftHive');
var Executer = exports.Executer = function(conf, logger){
if (conf.name !== 'hiveserver')
throw "executer name mismatch for hiveserver:" + conf.name;
this.logger = logger;
this._connection = thrift.createConnection(
conf.host,
conf.port,
{transport: ttransport.TBufferedTransport}
);
this._client = thrift.createClient(ThriftHive, this._connection);
};
Executer.prototype.end = function(){
if (this._client) {
var self = this;
this._client.clean(function(){
self._connection.end();
});
}
};
Executer.prototype.supports = function(operation){
switch (operation) {
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'partitions':
case 'describe':
case 'execute':
return true;
}
throw "unknown operation name (for hiveserver.Executer):" + operation;
};
Executer.prototype.jobname = function(queryid){
return 'shib-hs1-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
if (!setups || setups.length < 1) {
callback(null); return;
}
var client = this._client;
var setupQueue = setups.concat(); // shallow copy of Array to use as queue
var executeSetup = function(queue, callback){
var q = queue.shift();
client.execute(q, function(err){
if (err)
callback(err);
else
client.fetchAll(function(err, data){
if (queue.length > 0)
executeSetup(queue, callback);
else
callback(null);
});
});
};
executeSetup(setupQueue, callback);
};
Executer.prototype.databases = function(callback){
var client = this._client;
client.execute('show databases', function(err){
if (err)
callback(err);
else
client.fetchAll(function(err, data){
if (err) { callback(err); return; }
callback(null, data);
});
});
};
Executer.prototype.tables = function(dbname, callback){
var client = this._client;
this.setup(['use ' + dbname], function(err){
if (err) { callback(err); return; }
client.execute('show tables', function(err){
if (err)
callback(err);
else
client.fetchAll(function(err, data){
if (err) { callback(err); return; }
callback(null, data);
});
});
});
};
Executer.prototype.partitions = function(dbname, tablename, callback){
var client = this._client;
this.setup(['use ' + dbname], function(err){
if (err) { callback(err); return; }
client.execute('show partitions ' + tablename, function(err){
if (err) {
callback(err);
return;
}
client.fetchAll(function(err, data){
callback(err, data);
});
});
});
};
Executer.prototype.describe = function(dbname, tablename, callback){
var client = this._client;
this.setup(['use ' + dbname], function(err){
if (err) { callback(err); return; }
client.execute('describe ' + tablename, function(err){
if (err)
callback(err);
else
client.fetchAll(function(err, data){
if (err) { callback(err); return; }
var rows = data.map(function(row){ return row.split('\t'); });
callback(null, rows);
});
});
});
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
var client = this._client;
var settings = [];
if (dbname)
settings.push('use ' + dbname);
if (jobname && jobname !== '') {
settings.push('set mapred.job.name=' + jobname);
settings.push('set mapreduce.job.name=' + jobname);
}
this.setup(settings, function(err){
if (err) { callback(err); return; }
client.execute(query, function(err){
if (err) {
callback(err); return;
}
callback(null, new Fetcher(client));
});
});
};
var Fetcher = function(client){
this._client = client;
this.schema = function(callback){
this._client.getSchema(function(err, data){
if (err) { callback(err); return; }
callback(null, data.fieldSchemas);
});
};
this.fetch = function(num, callback){
if (!num) {
this._client.fetchAll(callback);
} else {
this._client.fetchN(num, callback);
}
};
};
// has no Monitor
================================================
FILE: lib/shib/engines/hiveserver/queryplan_types.js
================================================
//
// Autogenerated by Thrift Compiler (0.8.0)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = module.exports = {};
ttypes.AdjacencyType = {
'CONJUNCTIVE' : 0,
'DISJUNCTIVE' : 1
};
ttypes.NodeType = {
'OPERATOR' : 0,
'STAGE' : 1
};
ttypes.OperatorType = {
'JOIN' : 0,
'MAPJOIN' : 1,
'EXTRACT' : 2,
'FILTER' : 3,
'FORWARD' : 4,
'GROUPBY' : 5,
'LIMIT' : 6,
'SCRIPT' : 7,
'SELECT' : 8,
'TABLESCAN' : 9,
'FILESINK' : 10,
'REDUCESINK' : 11,
'UNION' : 12,
'UDTF' : 13,
'LATERALVIEWJOIN' : 14,
'LATERALVIEWFORWARD' : 15,
'HASHTABLESINK' : 16,
'HASHTABLEDUMMY' : 17
};
ttypes.TaskType = {
'MAP' : 0,
'REDUCE' : 1,
'OTHER' : 2
};
ttypes.StageType = {
'CONDITIONAL' : 0,
'COPY' : 1,
'DDL' : 2,
'MAPRED' : 3,
'EXPLAIN' : 4,
'FETCH' : 5,
'FUNC' : 6,
'MAPREDLOCAL' : 7,
'MOVE' : 8,
'STATS' : 9
};
var Adjacency = module.exports.Adjacency = function(args) {
this.node = null;
this.children = null;
this.adjacencyType = null;
if (args) {
if (args.node !== undefined) {
this.node = args.node;
}
if (args.children !== undefined) {
this.children = args.children;
}
if (args.adjacencyType !== undefined) {
this.adjacencyType = args.adjacencyType;
}
}
};
Adjacency.prototype = {};
Adjacency.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.node = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size0 = 0;
var _rtmp34;
this.children = [];
var _etype3 = 0;
_rtmp34 = input.readListBegin();
_etype3 = _rtmp34.etype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var elem6 = null;
elem6 = input.readString();
this.children.push(elem6);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.adjacencyType = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Adjacency.prototype.write = function(output) {
output.writeStructBegin('Adjacency');
if (this.node) {
output.writeFieldBegin('node', Thrift.Type.STRING, 1);
output.writeString(this.node);
output.writeFieldEnd();
}
if (this.children) {
output.writeFieldBegin('children', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRING, this.children.length);
for (var iter7 in this.children)
{
if (this.children.hasOwnProperty(iter7))
{
iter7 = this.children[iter7];
output.writeString(iter7);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.adjacencyType) {
output.writeFieldBegin('adjacencyType', Thrift.Type.I32, 3);
output.writeI32(this.adjacencyType);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Graph = module.exports.Graph = function(args) {
this.nodeType = null;
this.roots = null;
this.adjacencyList = null;
if (args) {
if (args.nodeType !== undefined) {
this.nodeType = args.nodeType;
}
if (args.roots !== undefined) {
this.roots = args.roots;
}
if (args.adjacencyList !== undefined) {
this.adjacencyList = args.adjacencyList;
}
}
};
Graph.prototype = {};
Graph.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.nodeType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size8 = 0;
var _rtmp312;
this.roots = [];
var _etype11 = 0;
_rtmp312 = input.readListBegin();
_etype11 = _rtmp312.etype;
_size8 = _rtmp312.size;
for (var _i13 = 0; _i13 < _size8; ++_i13)
{
var elem14 = null;
elem14 = input.readString();
this.roots.push(elem14);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size15 = 0;
var _rtmp319;
this.adjacencyList = [];
var _etype18 = 0;
_rtmp319 = input.readListBegin();
_etype18 = _rtmp319.etype;
_size15 = _rtmp319.size;
for (var _i20 = 0; _i20 < _size15; ++_i20)
{
var elem21 = null;
elem21 = new ttypes.Adjacency();
elem21.read(input);
this.adjacencyList.push(elem21);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Graph.prototype.write = function(output) {
output.writeStructBegin('Graph');
if (this.nodeType) {
output.writeFieldBegin('nodeType', Thrift.Type.I32, 1);
output.writeI32(this.nodeType);
output.writeFieldEnd();
}
if (this.roots) {
output.writeFieldBegin('roots', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRING, this.roots.length);
for (var iter22 in this.roots)
{
if (this.roots.hasOwnProperty(iter22))
{
iter22 = this.roots[iter22];
output.writeString(iter22);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.adjacencyList) {
output.writeFieldBegin('adjacencyList', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRUCT, this.adjacencyList.length);
for (var iter23 in this.adjacencyList)
{
if (this.adjacencyList.hasOwnProperty(iter23))
{
iter23 = this.adjacencyList[iter23];
iter23.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Operator = module.exports.Operator = function(args) {
this.operatorId = null;
this.operatorType = null;
this.operatorAttributes = null;
this.operatorCounters = null;
this.done = null;
this.started = null;
if (args) {
if (args.operatorId !== undefined) {
this.operatorId = args.operatorId;
}
if (args.operatorType !== undefined) {
this.operatorType = args.operatorType;
}
if (args.operatorAttributes !== undefined) {
this.operatorAttributes = args.operatorAttributes;
}
if (args.operatorCounters !== undefined) {
this.operatorCounters = args.operatorCounters;
}
if (args.done !== undefined) {
this.done = args.done;
}
if (args.started !== undefined) {
this.started = args.started;
}
}
};
Operator.prototype = {};
Operator.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.operatorId = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.operatorType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size24 = 0;
var _rtmp328;
this.operatorAttributes = {};
var _ktype25 = 0;
var _vtype26 = 0;
_rtmp328 = input.readMapBegin();
_ktype25 = _rtmp328.ktype;
_vtype26 = _rtmp328.vtype;
_size24 = _rtmp328.size;
for (var _i29 = 0; _i29 < _size24; ++_i29)
{
if (_i29 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key30 = null;
var val31 = null;
key30 = input.readString();
val31 = input.readString();
this.operatorAttributes[key30] = val31;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size32 = 0;
var _rtmp336;
this.operatorCounters = {};
var _ktype33 = 0;
var _vtype34 = 0;
_rtmp336 = input.readMapBegin();
_ktype33 = _rtmp336.ktype;
_vtype34 = _rtmp336.vtype;
_size32 = _rtmp336.size;
for (var _i37 = 0; _i37 < _size32; ++_i37)
{
if (_i37 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key38 = null;
var val39 = null;
key38 = input.readString();
val39 = input.readI64();
this.operatorCounters[key38] = val39;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.BOOL) {
this.done = input.readBool();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.BOOL) {
this.started = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Operator.prototype.write = function(output) {
output.writeStructBegin('Operator');
if (this.operatorId) {
output.writeFieldBegin('operatorId', Thrift.Type.STRING, 1);
output.writeString(this.operatorId);
output.writeFieldEnd();
}
if (this.operatorType) {
output.writeFieldBegin('operatorType', Thrift.Type.I32, 2);
output.writeI32(this.operatorType);
output.writeFieldEnd();
}
if (this.operatorAttributes) {
output.writeFieldBegin('operatorAttributes', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.operatorAttributes));
for (var kiter40 in this.operatorAttributes)
{
if (this.operatorAttributes.hasOwnProperty(kiter40))
{
var viter41 = this.operatorAttributes[kiter40];
output.writeString(kiter40);
output.writeString(viter41);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.operatorCounters) {
output.writeFieldBegin('operatorCounters', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.operatorCounters));
for (var kiter42 in this.operatorCounters)
{
if (this.operatorCounters.hasOwnProperty(kiter42))
{
var viter43 = this.operatorCounters[kiter42];
output.writeString(kiter42);
output.writeI64(viter43);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.done) {
output.writeFieldBegin('done', Thrift.Type.BOOL, 5);
output.writeBool(this.done);
output.writeFieldEnd();
}
if (this.started) {
output.writeFieldBegin('started', Thrift.Type.BOOL, 6);
output.writeBool(this.started);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Task = module.exports.Task = function(args) {
this.taskId = null;
this.taskType = null;
this.taskAttributes = null;
this.taskCounters = null;
this.operatorGraph = null;
this.operatorList = null;
this.done = null;
this.started = null;
if (args) {
if (args.taskId !== undefined) {
this.taskId = args.taskId;
}
if (args.taskType !== undefined) {
this.taskType = args.taskType;
}
if (args.taskAttributes !== undefined) {
this.taskAttributes = args.taskAttributes;
}
if (args.taskCounters !== undefined) {
this.taskCounters = args.taskCounters;
}
if (args.operatorGraph !== undefined) {
this.operatorGraph = args.operatorGraph;
}
if (args.operatorList !== undefined) {
this.operatorList = args.operatorList;
}
if (args.done !== undefined) {
this.done = args.done;
}
if (args.started !== undefined) {
this.started = args.started;
}
}
};
Task.prototype = {};
Task.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.taskId = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.taskType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size44 = 0;
var _rtmp348;
this.taskAttributes = {};
var _ktype45 = 0;
var _vtype46 = 0;
_rtmp348 = input.readMapBegin();
_ktype45 = _rtmp348.ktype;
_vtype46 = _rtmp348.vtype;
_size44 = _rtmp348.size;
for (var _i49 = 0; _i49 < _size44; ++_i49)
{
if (_i49 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key50 = null;
var val51 = null;
key50 = input.readString();
val51 = input.readString();
this.taskAttributes[key50] = val51;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size52 = 0;
var _rtmp356;
this.taskCounters = {};
var _ktype53 = 0;
var _vtype54 = 0;
_rtmp356 = input.readMapBegin();
_ktype53 = _rtmp356.ktype;
_vtype54 = _rtmp356.vtype;
_size52 = _rtmp356.size;
for (var _i57 = 0; _i57 < _size52; ++_i57)
{
if (_i57 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key58 = null;
var val59 = null;
key58 = input.readString();
val59 = input.readI64();
this.taskCounters[key58] = val59;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.operatorGraph = new ttypes.Graph();
this.operatorGraph.read(input);
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.LIST) {
var _size60 = 0;
var _rtmp364;
this.operatorList = [];
var _etype63 = 0;
_rtmp364 = input.readListBegin();
_etype63 = _rtmp364.etype;
_size60 = _rtmp364.size;
for (var _i65 = 0; _i65 < _size60; ++_i65)
{
var elem66 = null;
elem66 = new ttypes.Operator();
elem66.read(input);
this.operatorList.push(elem66);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.BOOL) {
this.done = input.readBool();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.BOOL) {
this.started = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Task.prototype.write = function(output) {
output.writeStructBegin('Task');
if (this.taskId) {
output.writeFieldBegin('taskId', Thrift.Type.STRING, 1);
output.writeString(this.taskId);
output.writeFieldEnd();
}
if (this.taskType) {
output.writeFieldBegin('taskType', Thrift.Type.I32, 2);
output.writeI32(this.taskType);
output.writeFieldEnd();
}
if (this.taskAttributes) {
output.writeFieldBegin('taskAttributes', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.taskAttributes));
for (var kiter67 in this.taskAttributes)
{
if (this.taskAttributes.hasOwnProperty(kiter67))
{
var viter68 = this.taskAttributes[kiter67];
output.writeString(kiter67);
output.writeString(viter68);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.taskCounters) {
output.writeFieldBegin('taskCounters', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.taskCounters));
for (var kiter69 in this.taskCounters)
{
if (this.taskCounters.hasOwnProperty(kiter69))
{
var viter70 = this.taskCounters[kiter69];
output.writeString(kiter69);
output.writeI64(viter70);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.operatorGraph) {
output.writeFieldBegin('operatorGraph', Thrift.Type.STRUCT, 5);
this.operatorGraph.write(output);
output.writeFieldEnd();
}
if (this.operatorList) {
output.writeFieldBegin('operatorList', Thrift.Type.LIST, 6);
output.writeListBegin(Thrift.Type.STRUCT, this.operatorList.length);
for (var iter71 in this.operatorList)
{
if (this.operatorList.hasOwnProperty(iter71))
{
iter71 = this.operatorList[iter71];
iter71.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.done) {
output.writeFieldBegin('done', Thrift.Type.BOOL, 7);
output.writeBool(this.done);
output.writeFieldEnd();
}
if (this.started) {
output.writeFieldBegin('started', Thrift.Type.BOOL, 8);
output.writeBool(this.started);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Stage = module.exports.Stage = function(args) {
this.stageId = null;
this.stageType = null;
this.stageAttributes = null;
this.stageCounters = null;
this.taskList = null;
this.done = null;
this.started = null;
if (args) {
if (args.stageId !== undefined) {
this.stageId = args.stageId;
}
if (args.stageType !== undefined) {
this.stageType = args.stageType;
}
if (args.stageAttributes !== undefined) {
this.stageAttributes = args.stageAttributes;
}
if (args.stageCounters !== undefined) {
this.stageCounters = args.stageCounters;
}
if (args.taskList !== undefined) {
this.taskList = args.taskList;
}
if (args.done !== undefined) {
this.done = args.done;
}
if (args.started !== undefined) {
this.started = args.started;
}
}
};
Stage.prototype = {};
Stage.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.stageId = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.stageType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size72 = 0;
var _rtmp376;
this.stageAttributes = {};
var _ktype73 = 0;
var _vtype74 = 0;
_rtmp376 = input.readMapBegin();
_ktype73 = _rtmp376.ktype;
_vtype74 = _rtmp376.vtype;
_size72 = _rtmp376.size;
for (var _i77 = 0; _i77 < _size72; ++_i77)
{
if (_i77 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key78 = null;
var val79 = null;
key78 = input.readString();
val79 = input.readString();
this.stageAttributes[key78] = val79;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size80 = 0;
var _rtmp384;
this.stageCounters = {};
var _ktype81 = 0;
var _vtype82 = 0;
_rtmp384 = input.readMapBegin();
_ktype81 = _rtmp384.ktype;
_vtype82 = _rtmp384.vtype;
_size80 = _rtmp384.size;
for (var _i85 = 0; _i85 < _size80; ++_i85)
{
if (_i85 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key86 = null;
var val87 = null;
key86 = input.readString();
val87 = input.readI64();
this.stageCounters[key86] = val87;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.LIST) {
var _size88 = 0;
var _rtmp392;
this.taskList = [];
var _etype91 = 0;
_rtmp392 = input.readListBegin();
_etype91 = _rtmp392.etype;
_size88 = _rtmp392.size;
for (var _i93 = 0; _i93 < _size88; ++_i93)
{
var elem94 = null;
elem94 = new ttypes.Task();
elem94.read(input);
this.taskList.push(elem94);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.BOOL) {
this.done = input.readBool();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.BOOL) {
this.started = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Stage.prototype.write = function(output) {
output.writeStructBegin('Stage');
if (this.stageId) {
output.writeFieldBegin('stageId', Thrift.Type.STRING, 1);
output.writeString(this.stageId);
output.writeFieldEnd();
}
if (this.stageType) {
output.writeFieldBegin('stageType', Thrift.Type.I32, 2);
output.writeI32(this.stageType);
output.writeFieldEnd();
}
if (this.stageAttributes) {
output.writeFieldBegin('stageAttributes', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.stageAttributes));
for (var kiter95 in this.stageAttributes)
{
if (this.stageAttributes.hasOwnProperty(kiter95))
{
var viter96 = this.stageAttributes[kiter95];
output.writeString(kiter95);
output.writeString(viter96);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.stageCounters) {
output.writeFieldBegin('stageCounters', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.stageCounters));
for (var kiter97 in this.stageCounters)
{
if (this.stageCounters.hasOwnProperty(kiter97))
{
var viter98 = this.stageCounters[kiter97];
output.writeString(kiter97);
output.writeI64(viter98);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.taskList) {
output.writeFieldBegin('taskList', Thrift.Type.LIST, 5);
output.writeListBegin(Thrift.Type.STRUCT, this.taskList.length);
for (var iter99 in this.taskList)
{
if (this.taskList.hasOwnProperty(iter99))
{
iter99 = this.taskList[iter99];
iter99.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.done) {
output.writeFieldBegin('done', Thrift.Type.BOOL, 6);
output.writeBool(this.done);
output.writeFieldEnd();
}
if (this.started) {
output.writeFieldBegin('started', Thrift.Type.BOOL, 7);
output.writeBool(this.started);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var Query = module.exports.Query = function(args) {
this.queryId = null;
this.queryType = null;
this.queryAttributes = null;
this.queryCounters = null;
this.stageGraph = null;
this.stageList = null;
this.done = null;
this.started = null;
if (args) {
if (args.queryId !== undefined) {
this.queryId = args.queryId;
}
if (args.queryType !== undefined) {
this.queryType = args.queryType;
}
if (args.queryAttributes !== undefined) {
this.queryAttributes = args.queryAttributes;
}
if (args.queryCounters !== undefined) {
this.queryCounters = args.queryCounters;
}
if (args.stageGraph !== undefined) {
this.stageGraph = args.stageGraph;
}
if (args.stageList !== undefined) {
this.stageList = args.stageList;
}
if (args.done !== undefined) {
this.done = args.done;
}
if (args.started !== undefined) {
this.started = args.started;
}
}
};
Query.prototype = {};
Query.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.queryId = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.queryType = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size100 = 0;
var _rtmp3104;
this.queryAttributes = {};
var _ktype101 = 0;
var _vtype102 = 0;
_rtmp3104 = input.readMapBegin();
_ktype101 = _rtmp3104.ktype;
_vtype102 = _rtmp3104.vtype;
_size100 = _rtmp3104.size;
for (var _i105 = 0; _i105 < _size100; ++_i105)
{
if (_i105 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key106 = null;
var val107 = null;
key106 = input.readString();
val107 = input.readString();
this.queryAttributes[key106] = val107;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size108 = 0;
var _rtmp3112;
this.queryCounters = {};
var _ktype109 = 0;
var _vtype110 = 0;
_rtmp3112 = input.readMapBegin();
_ktype109 = _rtmp3112.ktype;
_vtype110 = _rtmp3112.vtype;
_size108 = _rtmp3112.size;
for (var _i113 = 0; _i113 < _size108; ++_i113)
{
if (_i113 > 0 ) {
if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
input.rstack.pop();
}
}
var key114 = null;
var val115 = null;
key114 = input.readString();
val115 = input.readI64();
this.queryCounters[key114] = val115;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.stageGraph = new ttypes.Graph();
this.stageGraph.read(input);
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.LIST) {
var _size116 = 0;
var _rtmp3120;
this.stageList = [];
var _etype119 = 0;
_rtmp3120 = input.readListBegin();
_etype119 = _rtmp3120.etype;
_size116 = _rtmp3120.size;
for (var _i121 = 0; _i121 < _size116; ++_i121)
{
var elem122 = null;
elem122 = new ttypes.Stage();
elem122.read(input);
this.stageList.push(elem122);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.BOOL) {
this.done = input.readBool();
} else {
input.skip(ftype);
}
break;
case 8:
if (ftype == Thrift.Type.BOOL) {
this.started = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
Query.prototype.write = function(output) {
output.writeStructBegin('Query');
if (this.queryId) {
output.writeFieldBegin('queryId', Thrift.Type.STRING, 1);
output.writeString(this.queryId);
output.writeFieldEnd();
}
if (this.queryType) {
output.writeFieldBegin('queryType', Thrift.Type.STRING, 2);
output.writeString(this.queryType);
output.writeFieldEnd();
}
if (this.queryAttributes) {
output.writeFieldBegin('queryAttributes', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.queryAttributes));
for (var kiter123 in this.queryAttributes)
{
if (this.queryAttributes.hasOwnProperty(kiter123))
{
var viter124 = this.queryAttributes[kiter123];
output.writeString(kiter123);
output.writeString(viter124);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.queryCounters) {
output.writeFieldBegin('queryCounters', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.queryCounters));
for (var kiter125 in this.queryCounters)
{
if (this.queryCounters.hasOwnProperty(kiter125))
{
var viter126 = this.queryCounters[kiter125];
output.writeString(kiter125);
output.writeI64(viter126);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.stageGraph) {
output.writeFieldBegin('stageGraph', Thrift.Type.STRUCT, 5);
this.stageGraph.write(output);
output.writeFieldEnd();
}
if (this.stageList) {
output.writeFieldBegin('stageList', Thrift.Type.LIST, 6);
output.writeListBegin(Thrift.Type.STRUCT, this.stageList.length);
for (var iter127 in this.stageList)
{
if (this.stageList.hasOwnProperty(iter127))
{
iter127 = this.stageList[iter127];
iter127.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.done) {
output.writeFieldBegin('done', Thrift.Type.BOOL, 7);
output.writeBool(this.done);
output.writeFieldEnd();
}
if (this.started) {
output.writeFieldBegin('started', Thrift.Type.BOOL, 8);
output.writeBool(this.started);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var QueryPlan = module.exports.QueryPlan = function(args) {
this.queries = null;
this.done = null;
this.started = null;
if (args) {
if (args.queries !== undefined) {
this.queries = args.queries;
}
if (args.done !== undefined) {
this.done = args.done;
}
if (args.started !== undefined) {
this.started = args.started;
}
}
};
QueryPlan.prototype = {};
QueryPlan.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size128 = 0;
var _rtmp3132;
this.queries = [];
var _etype131 = 0;
_rtmp3132 = input.readListBegin();
_etype131 = _rtmp3132.etype;
_size128 = _rtmp3132.size;
for (var _i133 = 0; _i133 < _size128; ++_i133)
{
var elem134 = null;
elem134 = new ttypes.Query();
elem134.read(input);
this.queries.push(elem134);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.done = input.readBool();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.BOOL) {
this.started = input.readBool();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
QueryPlan.prototype.write = function(output) {
output.writeStructBegin('QueryPlan');
if (this.queries) {
output.writeFieldBegin('queries', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.queries.length);
for (var iter135 in this.queries)
{
if (this.queries.hasOwnProperty(iter135))
{
iter135 = this.queries[iter135];
iter135.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.done) {
output.writeFieldBegin('done', Thrift.Type.BOOL, 2);
output.writeBool(this.done);
output.writeFieldEnd();
}
if (this.started) {
output.writeFieldBegin('started', Thrift.Type.BOOL, 3);
output.writeBool(this.started);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
================================================
FILE: lib/shib/engines/hiveserver2/TCLIService.js
================================================
//
// Autogenerated by Thrift Compiler (0.9.1)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = require('./TCLIService_types');
//HELPER FUNCTIONS AND STRUCTURES
var TCLIService_OpenSession_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_OpenSession_args.prototype = {};
TCLIService_OpenSession_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TOpenSessionReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_OpenSession_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_OpenSession_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_OpenSession_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_OpenSession_result.prototype = {};
TCLIService_OpenSession_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TOpenSessionResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_OpenSession_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_OpenSession_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CloseSession_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_CloseSession_args.prototype = {};
TCLIService_CloseSession_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TCloseSessionReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CloseSession_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CloseSession_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CloseSession_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_CloseSession_result.prototype = {};
TCLIService_CloseSession_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TCloseSessionResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CloseSession_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CloseSession_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetInfo_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetInfo_args.prototype = {};
TCLIService_GetInfo_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetInfoReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetInfo_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetInfo_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetInfo_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetInfo_result.prototype = {};
TCLIService_GetInfo_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetInfoResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetInfo_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetInfo_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_ExecuteStatement_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_ExecuteStatement_args.prototype = {};
TCLIService_ExecuteStatement_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TExecuteStatementReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_ExecuteStatement_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_ExecuteStatement_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_ExecuteStatement_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_ExecuteStatement_result.prototype = {};
TCLIService_ExecuteStatement_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TExecuteStatementResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_ExecuteStatement_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_ExecuteStatement_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTypeInfo_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetTypeInfo_args.prototype = {};
TCLIService_GetTypeInfo_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetTypeInfoReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTypeInfo_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTypeInfo_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTypeInfo_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetTypeInfo_result.prototype = {};
TCLIService_GetTypeInfo_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetTypeInfoResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTypeInfo_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTypeInfo_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetCatalogs_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetCatalogs_args.prototype = {};
TCLIService_GetCatalogs_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetCatalogsReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetCatalogs_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetCatalogs_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetCatalogs_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetCatalogs_result.prototype = {};
TCLIService_GetCatalogs_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetCatalogsResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetCatalogs_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetCatalogs_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetSchemas_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetSchemas_args.prototype = {};
TCLIService_GetSchemas_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetSchemasReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetSchemas_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetSchemas_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetSchemas_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetSchemas_result.prototype = {};
TCLIService_GetSchemas_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetSchemasResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetSchemas_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetSchemas_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTables_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetTables_args.prototype = {};
TCLIService_GetTables_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetTablesReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTables_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTables_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTables_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetTables_result.prototype = {};
TCLIService_GetTables_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetTablesResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTables_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTables_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTableTypes_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetTableTypes_args.prototype = {};
TCLIService_GetTableTypes_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetTableTypesReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTableTypes_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTableTypes_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetTableTypes_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetTableTypes_result.prototype = {};
TCLIService_GetTableTypes_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetTableTypesResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetTableTypes_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetTableTypes_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetColumns_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetColumns_args.prototype = {};
TCLIService_GetColumns_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetColumnsReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetColumns_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetColumns_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetColumns_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetColumns_result.prototype = {};
TCLIService_GetColumns_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetColumnsResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetColumns_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetColumns_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetFunctions_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetFunctions_args.prototype = {};
TCLIService_GetFunctions_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetFunctionsReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetFunctions_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetFunctions_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetFunctions_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetFunctions_result.prototype = {};
TCLIService_GetFunctions_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetFunctionsResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetFunctions_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetFunctions_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetOperationStatus_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetOperationStatus_args.prototype = {};
TCLIService_GetOperationStatus_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetOperationStatusReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetOperationStatus_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetOperationStatus_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetOperationStatus_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetOperationStatus_result.prototype = {};
TCLIService_GetOperationStatus_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetOperationStatusResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetOperationStatus_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetOperationStatus_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CancelOperation_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_CancelOperation_args.prototype = {};
TCLIService_CancelOperation_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TCancelOperationReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CancelOperation_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CancelOperation_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CancelOperation_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_CancelOperation_result.prototype = {};
TCLIService_CancelOperation_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TCancelOperationResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CancelOperation_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CancelOperation_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CloseOperation_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_CloseOperation_args.prototype = {};
TCLIService_CloseOperation_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TCloseOperationReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CloseOperation_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CloseOperation_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_CloseOperation_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_CloseOperation_result.prototype = {};
TCLIService_CloseOperation_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TCloseOperationResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_CloseOperation_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_CloseOperation_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetResultSetMetadata_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_GetResultSetMetadata_args.prototype = {};
TCLIService_GetResultSetMetadata_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TGetResultSetMetadataReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetResultSetMetadata_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetResultSetMetadata_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_GetResultSetMetadata_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_GetResultSetMetadata_result.prototype = {};
TCLIService_GetResultSetMetadata_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TGetResultSetMetadataResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_GetResultSetMetadata_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_GetResultSetMetadata_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_FetchResults_args = function(args) {
this.req = null;
if (args) {
if (args.req !== undefined) {
this.req = args.req;
}
}
};
TCLIService_FetchResults_args.prototype = {};
TCLIService_FetchResults_args.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.req = new ttypes.TFetchResultsReq();
this.req.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_FetchResults_args.prototype.write = function(output) {
output.writeStructBegin('TCLIService_FetchResults_args');
if (this.req !== null && this.req !== undefined) {
output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);
this.req.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIService_FetchResults_result = function(args) {
this.success = null;
if (args) {
if (args.success !== undefined) {
this.success = args.success;
}
}
};
TCLIService_FetchResults_result.prototype = {};
TCLIService_FetchResults_result.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == Thrift.Type.STRUCT) {
this.success = new ttypes.TFetchResultsResp();
this.success.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCLIService_FetchResults_result.prototype.write = function(output) {
output.writeStructBegin('TCLIService_FetchResults_result');
if (this.success !== null && this.success !== undefined) {
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
this.success.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCLIServiceClient = exports.Client = function(output, pClass) {
this.output = output;
this.pClass = pClass;
this.seqid = 0;
this._reqs = {};
};
TCLIServiceClient.prototype = {};
TCLIServiceClient.prototype.OpenSession = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_OpenSession(req);
};
TCLIServiceClient.prototype.send_OpenSession = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('OpenSession', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_OpenSession_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_OpenSession = 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 TCLIService_OpenSession_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('OpenSession failed: unknown result');
};
TCLIServiceClient.prototype.CloseSession = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_CloseSession(req);
};
TCLIServiceClient.prototype.send_CloseSession = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('CloseSession', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_CloseSession_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_CloseSession = 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 TCLIService_CloseSession_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('CloseSession failed: unknown result');
};
TCLIServiceClient.prototype.GetInfo = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetInfo(req);
};
TCLIServiceClient.prototype.send_GetInfo = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetInfo', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetInfo_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetInfo = 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 TCLIService_GetInfo_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetInfo failed: unknown result');
};
TCLIServiceClient.prototype.ExecuteStatement = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_ExecuteStatement(req);
};
TCLIServiceClient.prototype.send_ExecuteStatement = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('ExecuteStatement', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_ExecuteStatement_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_ExecuteStatement = 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 TCLIService_ExecuteStatement_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('ExecuteStatement failed: unknown result');
};
TCLIServiceClient.prototype.GetTypeInfo = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetTypeInfo(req);
};
TCLIServiceClient.prototype.send_GetTypeInfo = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetTypeInfo', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetTypeInfo_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetTypeInfo = 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 TCLIService_GetTypeInfo_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetTypeInfo failed: unknown result');
};
TCLIServiceClient.prototype.GetCatalogs = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetCatalogs(req);
};
TCLIServiceClient.prototype.send_GetCatalogs = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetCatalogs', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetCatalogs_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetCatalogs = 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 TCLIService_GetCatalogs_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetCatalogs failed: unknown result');
};
TCLIServiceClient.prototype.GetSchemas = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetSchemas(req);
};
TCLIServiceClient.prototype.send_GetSchemas = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetSchemas', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetSchemas_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetSchemas = 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 TCLIService_GetSchemas_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetSchemas failed: unknown result');
};
TCLIServiceClient.prototype.GetTables = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetTables(req);
};
TCLIServiceClient.prototype.send_GetTables = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetTables', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetTables_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetTables = 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 TCLIService_GetTables_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetTables failed: unknown result');
};
TCLIServiceClient.prototype.GetTableTypes = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetTableTypes(req);
};
TCLIServiceClient.prototype.send_GetTableTypes = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetTableTypes', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetTableTypes_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetTableTypes = 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 TCLIService_GetTableTypes_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetTableTypes failed: unknown result');
};
TCLIServiceClient.prototype.GetColumns = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetColumns(req);
};
TCLIServiceClient.prototype.send_GetColumns = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetColumns', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetColumns_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetColumns = 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 TCLIService_GetColumns_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetColumns failed: unknown result');
};
TCLIServiceClient.prototype.GetFunctions = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetFunctions(req);
};
TCLIServiceClient.prototype.send_GetFunctions = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetFunctions', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetFunctions_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetFunctions = 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 TCLIService_GetFunctions_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetFunctions failed: unknown result');
};
TCLIServiceClient.prototype.GetOperationStatus = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetOperationStatus(req);
};
TCLIServiceClient.prototype.send_GetOperationStatus = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetOperationStatus', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetOperationStatus_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetOperationStatus = 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 TCLIService_GetOperationStatus_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetOperationStatus failed: unknown result');
};
TCLIServiceClient.prototype.CancelOperation = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_CancelOperation(req);
};
TCLIServiceClient.prototype.send_CancelOperation = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('CancelOperation', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_CancelOperation_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_CancelOperation = 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 TCLIService_CancelOperation_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('CancelOperation failed: unknown result');
};
TCLIServiceClient.prototype.CloseOperation = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_CloseOperation(req);
};
TCLIServiceClient.prototype.send_CloseOperation = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('CloseOperation', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_CloseOperation_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_CloseOperation = 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 TCLIService_CloseOperation_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('CloseOperation failed: unknown result');
};
TCLIServiceClient.prototype.GetResultSetMetadata = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_GetResultSetMetadata(req);
};
TCLIServiceClient.prototype.send_GetResultSetMetadata = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('GetResultSetMetadata', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_GetResultSetMetadata_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_GetResultSetMetadata = 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 TCLIService_GetResultSetMetadata_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('GetResultSetMetadata failed: unknown result');
};
TCLIServiceClient.prototype.FetchResults = function(req, callback) {
this.seqid += 1;
this._reqs[this.seqid] = callback;
this.send_FetchResults(req);
};
TCLIServiceClient.prototype.send_FetchResults = function(req) {
var output = new this.pClass(this.output);
output.writeMessageBegin('FetchResults', Thrift.MessageType.CALL, this.seqid);
var args = new TCLIService_FetchResults_args();
args.req = req;
args.write(output);
output.writeMessageEnd();
return this.output.flush();
};
TCLIServiceClient.prototype.recv_FetchResults = 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 TCLIService_FetchResults_result();
result.read(input);
input.readMessageEnd();
if (null !== result.success) {
return callback(null, result.success);
}
return callback('FetchResults failed: unknown result');
};
var TCLIServiceProcessor = exports.Processor = function(handler) {
this._handler = handler
}
TCLIServiceProcessor.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();
}
}
TCLIServiceProcessor.prototype.process_OpenSession = function(seqid, input, output) {
var args = new TCLIService_OpenSession_args();
args.read(input);
input.readMessageEnd();
this._handler.OpenSession(args.req, function (err, result) {
var result = new TCLIService_OpenSession_result((err != null ? err : {success: result}));
output.writeMessageBegin("OpenSession", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_CloseSession = function(seqid, input, output) {
var args = new TCLIService_CloseSession_args();
args.read(input);
input.readMessageEnd();
this._handler.CloseSession(args.req, function (err, result) {
var result = new TCLIService_CloseSession_result((err != null ? err : {success: result}));
output.writeMessageBegin("CloseSession", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetInfo = function(seqid, input, output) {
var args = new TCLIService_GetInfo_args();
args.read(input);
input.readMessageEnd();
this._handler.GetInfo(args.req, function (err, result) {
var result = new TCLIService_GetInfo_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetInfo", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_ExecuteStatement = function(seqid, input, output) {
var args = new TCLIService_ExecuteStatement_args();
args.read(input);
input.readMessageEnd();
this._handler.ExecuteStatement(args.req, function (err, result) {
var result = new TCLIService_ExecuteStatement_result((err != null ? err : {success: result}));
output.writeMessageBegin("ExecuteStatement", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetTypeInfo = function(seqid, input, output) {
var args = new TCLIService_GetTypeInfo_args();
args.read(input);
input.readMessageEnd();
this._handler.GetTypeInfo(args.req, function (err, result) {
var result = new TCLIService_GetTypeInfo_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetTypeInfo", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetCatalogs = function(seqid, input, output) {
var args = new TCLIService_GetCatalogs_args();
args.read(input);
input.readMessageEnd();
this._handler.GetCatalogs(args.req, function (err, result) {
var result = new TCLIService_GetCatalogs_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetCatalogs", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetSchemas = function(seqid, input, output) {
var args = new TCLIService_GetSchemas_args();
args.read(input);
input.readMessageEnd();
this._handler.GetSchemas(args.req, function (err, result) {
var result = new TCLIService_GetSchemas_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetSchemas", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetTables = function(seqid, input, output) {
var args = new TCLIService_GetTables_args();
args.read(input);
input.readMessageEnd();
this._handler.GetTables(args.req, function (err, result) {
var result = new TCLIService_GetTables_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetTables", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetTableTypes = function(seqid, input, output) {
var args = new TCLIService_GetTableTypes_args();
args.read(input);
input.readMessageEnd();
this._handler.GetTableTypes(args.req, function (err, result) {
var result = new TCLIService_GetTableTypes_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetTableTypes", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetColumns = function(seqid, input, output) {
var args = new TCLIService_GetColumns_args();
args.read(input);
input.readMessageEnd();
this._handler.GetColumns(args.req, function (err, result) {
var result = new TCLIService_GetColumns_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetColumns", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetFunctions = function(seqid, input, output) {
var args = new TCLIService_GetFunctions_args();
args.read(input);
input.readMessageEnd();
this._handler.GetFunctions(args.req, function (err, result) {
var result = new TCLIService_GetFunctions_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetFunctions", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetOperationStatus = function(seqid, input, output) {
var args = new TCLIService_GetOperationStatus_args();
args.read(input);
input.readMessageEnd();
this._handler.GetOperationStatus(args.req, function (err, result) {
var result = new TCLIService_GetOperationStatus_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetOperationStatus", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_CancelOperation = function(seqid, input, output) {
var args = new TCLIService_CancelOperation_args();
args.read(input);
input.readMessageEnd();
this._handler.CancelOperation(args.req, function (err, result) {
var result = new TCLIService_CancelOperation_result((err != null ? err : {success: result}));
output.writeMessageBegin("CancelOperation", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_CloseOperation = function(seqid, input, output) {
var args = new TCLIService_CloseOperation_args();
args.read(input);
input.readMessageEnd();
this._handler.CloseOperation(args.req, function (err, result) {
var result = new TCLIService_CloseOperation_result((err != null ? err : {success: result}));
output.writeMessageBegin("CloseOperation", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_GetResultSetMetadata = function(seqid, input, output) {
var args = new TCLIService_GetResultSetMetadata_args();
args.read(input);
input.readMessageEnd();
this._handler.GetResultSetMetadata(args.req, function (err, result) {
var result = new TCLIService_GetResultSetMetadata_result((err != null ? err : {success: result}));
output.writeMessageBegin("GetResultSetMetadata", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
TCLIServiceProcessor.prototype.process_FetchResults = function(seqid, input, output) {
var args = new TCLIService_FetchResults_args();
args.read(input);
input.readMessageEnd();
this._handler.FetchResults(args.req, function (err, result) {
var result = new TCLIService_FetchResults_result((err != null ? err : {success: result}));
output.writeMessageBegin("FetchResults", Thrift.MessageType.REPLY, seqid);
result.write(output);
output.writeMessageEnd();
output.flush();
})
}
================================================
FILE: lib/shib/engines/hiveserver2/TCLIService_types.js
================================================
//
// Autogenerated by Thrift Compiler (0.9.1)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('node-thrift').Thrift;
var ttypes = module.exports = {};
ttypes.TProtocolVersion = {
'HIVE_CLI_SERVICE_PROTOCOL_V1' : 0
};
ttypes.TTypeId = {
'BOOLEAN_TYPE' : 0,
'TINYINT_TYPE' : 1,
'SMALLINT_TYPE' : 2,
'INT_TYPE' : 3,
'BIGINT_TYPE' : 4,
'FLOAT_TYPE' : 5,
'DOUBLE_TYPE' : 6,
'STRING_TYPE' : 7,
'TIMESTAMP_TYPE' : 8,
'BINARY_TYPE' : 9,
'ARRAY_TYPE' : 10,
'MAP_TYPE' : 11,
'STRUCT_TYPE' : 12,
'UNION_TYPE' : 13,
'USER_DEFINED_TYPE' : 14,
'DECIMAL_TYPE' : 15
};
ttypes.TStatusCode = {
'SUCCESS_STATUS' : 0,
'SUCCESS_WITH_INFO_STATUS' : 1,
'STILL_EXECUTING_STATUS' : 2,
'ERROR_STATUS' : 3,
'INVALID_HANDLE_STATUS' : 4
};
ttypes.TOperationState = {
'INITIALIZED_STATE' : 0,
'RUNNING_STATE' : 1,
'FINISHED_STATE' : 2,
'CANCELED_STATE' : 3,
'CLOSED_STATE' : 4,
'ERROR_STATE' : 5,
'UKNOWN_STATE' : 6
};
ttypes.TOperationType = {
'EXECUTE_STATEMENT' : 0,
'GET_TYPE_INFO' : 1,
'GET_CATALOGS' : 2,
'GET_SCHEMAS' : 3,
'GET_TABLES' : 4,
'GET_TABLE_TYPES' : 5,
'GET_COLUMNS' : 6,
'GET_FUNCTIONS' : 7,
'UNKNOWN' : 8
};
ttypes.TGetInfoType = {
'CLI_MAX_DRIVER_CONNECTIONS' : 0,
'CLI_MAX_CONCURRENT_ACTIVITIES' : 1,
'CLI_DATA_SOURCE_NAME' : 2,
'CLI_FETCH_DIRECTION' : 8,
'CLI_SERVER_NAME' : 13,
'CLI_SEARCH_PATTERN_ESCAPE' : 14,
'CLI_DBMS_NAME' : 17,
'CLI_DBMS_VER' : 18,
'CLI_ACCESSIBLE_TABLES' : 19,
'CLI_ACCESSIBLE_PROCEDURES' : 20,
'CLI_CURSOR_COMMIT_BEHAVIOR' : 23,
'CLI_DATA_SOURCE_READ_ONLY' : 25,
'CLI_DEFAULT_TXN_ISOLATION' : 26,
'CLI_IDENTIFIER_CASE' : 28,
'CLI_IDENTIFIER_QUOTE_CHAR' : 29,
'CLI_MAX_COLUMN_NAME_LEN' : 30,
'CLI_MAX_CURSOR_NAME_LEN' : 31,
'CLI_MAX_SCHEMA_NAME_LEN' : 32,
'CLI_MAX_CATALOG_NAME_LEN' : 34,
'CLI_MAX_TABLE_NAME_LEN' : 35,
'CLI_SCROLL_CONCURRENCY' : 43,
'CLI_TXN_CAPABLE' : 46,
'CLI_USER_NAME' : 47,
'CLI_TXN_ISOLATION_OPTION' : 72,
'CLI_INTEGRITY' : 73,
'CLI_GETDATA_EXTENSIONS' : 81,
'CLI_NULL_COLLATION' : 85,
'CLI_ALTER_TABLE' : 86,
'CLI_ORDER_BY_COLUMNS_IN_SELECT' : 90,
'CLI_SPECIAL_CHARACTERS' : 94,
'CLI_MAX_COLUMNS_IN_GROUP_BY' : 97,
'CLI_MAX_COLUMNS_IN_INDEX' : 98,
'CLI_MAX_COLUMNS_IN_ORDER_BY' : 99,
'CLI_MAX_COLUMNS_IN_SELECT' : 100,
'CLI_MAX_COLUMNS_IN_TABLE' : 101,
'CLI_MAX_INDEX_SIZE' : 102,
'CLI_MAX_ROW_SIZE' : 104,
'CLI_MAX_STATEMENT_LEN' : 105,
'CLI_MAX_TABLES_IN_SELECT' : 106,
'CLI_MAX_USER_NAME_LEN' : 107,
'CLI_OJ_CAPABILITIES' : 115,
'CLI_XOPEN_CLI_YEAR' : 10000,
'CLI_CURSOR_SENSITIVITY' : 10001,
'CLI_DESCRIBE_PARAMETER' : 10002,
'CLI_CATALOG_NAME' : 10003,
'CLI_COLLATION_SEQ' : 10004,
'CLI_MAX_IDENTIFIER_LEN' : 10005
};
ttypes.TFetchOrientation = {
'FETCH_NEXT' : 0,
'FETCH_PRIOR' : 1,
'FETCH_RELATIVE' : 2,
'FETCH_ABSOLUTE' : 3,
'FETCH_FIRST' : 4,
'FETCH_LAST' : 5
};
var TPrimitiveTypeEntry = module.exports.TPrimitiveTypeEntry = function(args) {
this.type = null;
if (args) {
if (args.type !== undefined) {
this.type = args.type;
}
}
};
TPrimitiveTypeEntry.prototype = {};
TPrimitiveTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.type = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TPrimitiveTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TPrimitiveTypeEntry');
if (this.type !== null && this.type !== undefined) {
output.writeFieldBegin('type', Thrift.Type.I32, 1);
output.writeI32(this.type);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TArrayTypeEntry = module.exports.TArrayTypeEntry = function(args) {
this.objectTypePtr = null;
if (args) {
if (args.objectTypePtr !== undefined) {
this.objectTypePtr = args.objectTypePtr;
}
}
};
TArrayTypeEntry.prototype = {};
TArrayTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.objectTypePtr = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TArrayTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TArrayTypeEntry');
if (this.objectTypePtr !== null && this.objectTypePtr !== undefined) {
output.writeFieldBegin('objectTypePtr', Thrift.Type.I32, 1);
output.writeI32(this.objectTypePtr);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TMapTypeEntry = module.exports.TMapTypeEntry = function(args) {
this.keyTypePtr = null;
this.valueTypePtr = null;
if (args) {
if (args.keyTypePtr !== undefined) {
this.keyTypePtr = args.keyTypePtr;
}
if (args.valueTypePtr !== undefined) {
this.valueTypePtr = args.valueTypePtr;
}
}
};
TMapTypeEntry.prototype = {};
TMapTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.keyTypePtr = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.valueTypePtr = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TMapTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TMapTypeEntry');
if (this.keyTypePtr !== null && this.keyTypePtr !== undefined) {
output.writeFieldBegin('keyTypePtr', Thrift.Type.I32, 1);
output.writeI32(this.keyTypePtr);
output.writeFieldEnd();
}
if (this.valueTypePtr !== null && this.valueTypePtr !== undefined) {
output.writeFieldBegin('valueTypePtr', Thrift.Type.I32, 2);
output.writeI32(this.valueTypePtr);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TStructTypeEntry = module.exports.TStructTypeEntry = function(args) {
this.nameToTypePtr = null;
if (args) {
if (args.nameToTypePtr !== undefined) {
this.nameToTypePtr = args.nameToTypePtr;
}
}
};
TStructTypeEntry.prototype = {};
TStructTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.MAP) {
var _size0 = 0;
var _rtmp34;
this.nameToTypePtr = {};
var _ktype1 = 0;
var _vtype2 = 0;
_rtmp34 = input.readMapBegin();
_ktype1 = _rtmp34.ktype;
_vtype2 = _rtmp34.vtype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var key6 = null;
var val7 = null;
key6 = input.readString();
val7 = input.readI32();
this.nameToTypePtr[key6] = val7;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TStructTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TStructTypeEntry');
if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {
output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));
for (var kiter8 in this.nameToTypePtr)
{
if (this.nameToTypePtr.hasOwnProperty(kiter8))
{
var viter9 = this.nameToTypePtr[kiter8];
output.writeString(kiter8);
output.writeI32(viter9);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TUnionTypeEntry = module.exports.TUnionTypeEntry = function(args) {
this.nameToTypePtr = null;
if (args) {
if (args.nameToTypePtr !== undefined) {
this.nameToTypePtr = args.nameToTypePtr;
}
}
};
TUnionTypeEntry.prototype = {};
TUnionTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.MAP) {
var _size10 = 0;
var _rtmp314;
this.nameToTypePtr = {};
var _ktype11 = 0;
var _vtype12 = 0;
_rtmp314 = input.readMapBegin();
_ktype11 = _rtmp314.ktype;
_vtype12 = _rtmp314.vtype;
_size10 = _rtmp314.size;
for (var _i15 = 0; _i15 < _size10; ++_i15)
{
var key16 = null;
var val17 = null;
key16 = input.readString();
val17 = input.readI32();
this.nameToTypePtr[key16] = val17;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TUnionTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TUnionTypeEntry');
if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {
output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));
for (var kiter18 in this.nameToTypePtr)
{
if (this.nameToTypePtr.hasOwnProperty(kiter18))
{
var viter19 = this.nameToTypePtr[kiter18];
output.writeString(kiter18);
output.writeI32(viter19);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TUserDefinedTypeEntry = module.exports.TUserDefinedTypeEntry = function(args) {
this.typeClassName = null;
if (args) {
if (args.typeClassName !== undefined) {
this.typeClassName = args.typeClassName;
}
}
};
TUserDefinedTypeEntry.prototype = {};
TUserDefinedTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.typeClassName = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TUserDefinedTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TUserDefinedTypeEntry');
if (this.typeClassName !== null && this.typeClassName !== undefined) {
output.writeFieldBegin('typeClassName', Thrift.Type.STRING, 1);
output.writeString(this.typeClassName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TTypeEntry = module.exports.TTypeEntry = function(args) {
this.primitiveEntry = null;
this.arrayEntry = null;
this.mapEntry = null;
this.structEntry = null;
this.unionEntry = null;
this.userDefinedTypeEntry = null;
if (args) {
if (args.primitiveEntry !== undefined) {
this.primitiveEntry = args.primitiveEntry;
}
if (args.arrayEntry !== undefined) {
this.arrayEntry = args.arrayEntry;
}
if (args.mapEntry !== undefined) {
this.mapEntry = args.mapEntry;
}
if (args.structEntry !== undefined) {
this.structEntry = args.structEntry;
}
if (args.unionEntry !== undefined) {
this.unionEntry = args.unionEntry;
}
if (args.userDefinedTypeEntry !== undefined) {
this.userDefinedTypeEntry = args.userDefinedTypeEntry;
}
}
};
TTypeEntry.prototype = {};
TTypeEntry.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.primitiveEntry = new ttypes.TPrimitiveTypeEntry();
this.primitiveEntry.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.arrayEntry = new ttypes.TArrayTypeEntry();
this.arrayEntry.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.mapEntry = new ttypes.TMapTypeEntry();
this.mapEntry.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.structEntry = new ttypes.TStructTypeEntry();
this.structEntry.read(input);
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.unionEntry = new ttypes.TUnionTypeEntry();
this.unionEntry.read(input);
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.STRUCT) {
this.userDefinedTypeEntry = new ttypes.TUserDefinedTypeEntry();
this.userDefinedTypeEntry.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TTypeEntry.prototype.write = function(output) {
output.writeStructBegin('TTypeEntry');
if (this.primitiveEntry !== null && this.primitiveEntry !== undefined) {
output.writeFieldBegin('primitiveEntry', Thrift.Type.STRUCT, 1);
this.primitiveEntry.write(output);
output.writeFieldEnd();
}
if (this.arrayEntry !== null && this.arrayEntry !== undefined) {
output.writeFieldBegin('arrayEntry', Thrift.Type.STRUCT, 2);
this.arrayEntry.write(output);
output.writeFieldEnd();
}
if (this.mapEntry !== null && this.mapEntry !== undefined) {
output.writeFieldBegin('mapEntry', Thrift.Type.STRUCT, 3);
this.mapEntry.write(output);
output.writeFieldEnd();
}
if (this.structEntry !== null && this.structEntry !== undefined) {
output.writeFieldBegin('structEntry', Thrift.Type.STRUCT, 4);
this.structEntry.write(output);
output.writeFieldEnd();
}
if (this.unionEntry !== null && this.unionEntry !== undefined) {
output.writeFieldBegin('unionEntry', Thrift.Type.STRUCT, 5);
this.unionEntry.write(output);
output.writeFieldEnd();
}
if (this.userDefinedTypeEntry !== null && this.userDefinedTypeEntry !== undefined) {
output.writeFieldBegin('userDefinedTypeEntry', Thrift.Type.STRUCT, 6);
this.userDefinedTypeEntry.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TTypeDesc = module.exports.TTypeDesc = function(args) {
this.types = null;
if (args) {
if (args.types !== undefined) {
this.types = args.types;
}
}
};
TTypeDesc.prototype = {};
TTypeDesc.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size20 = 0;
var _rtmp324;
this.types = [];
var _etype23 = 0;
_rtmp324 = input.readListBegin();
_etype23 = _rtmp324.etype;
_size20 = _rtmp324.size;
for (var _i25 = 0; _i25 < _size20; ++_i25)
{
var elem26 = null;
elem26 = new ttypes.TTypeEntry();
elem26.read(input);
this.types.push(elem26);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TTypeDesc.prototype.write = function(output) {
output.writeStructBegin('TTypeDesc');
if (this.types !== null && this.types !== undefined) {
output.writeFieldBegin('types', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.types.length);
for (var iter27 in this.types)
{
if (this.types.hasOwnProperty(iter27))
{
iter27 = this.types[iter27];
iter27.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TColumnDesc = module.exports.TColumnDesc = function(args) {
this.columnName = null;
this.typeDesc = null;
this.position = null;
this.comment = null;
if (args) {
if (args.columnName !== undefined) {
this.columnName = args.columnName;
}
if (args.typeDesc !== undefined) {
this.typeDesc = args.typeDesc;
}
if (args.position !== undefined) {
this.position = args.position;
}
if (args.comment !== undefined) {
this.comment = args.comment;
}
}
};
TColumnDesc.prototype = {};
TColumnDesc.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.columnName = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.typeDesc = new ttypes.TTypeDesc();
this.typeDesc.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.position = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.comment = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TColumnDesc.prototype.write = function(output) {
output.writeStructBegin('TColumnDesc');
if (this.columnName !== null && this.columnName !== undefined) {
output.writeFieldBegin('columnName', Thrift.Type.STRING, 1);
output.writeString(this.columnName);
output.writeFieldEnd();
}
if (this.typeDesc !== null && this.typeDesc !== undefined) {
output.writeFieldBegin('typeDesc', Thrift.Type.STRUCT, 2);
this.typeDesc.write(output);
output.writeFieldEnd();
}
if (this.position !== null && this.position !== undefined) {
output.writeFieldBegin('position', Thrift.Type.I32, 3);
output.writeI32(this.position);
output.writeFieldEnd();
}
if (this.comment !== null && this.comment !== undefined) {
output.writeFieldBegin('comment', Thrift.Type.STRING, 4);
output.writeString(this.comment);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TTableSchema = module.exports.TTableSchema = function(args) {
this.columns = null;
if (args) {
if (args.columns !== undefined) {
this.columns = args.columns;
}
}
};
TTableSchema.prototype = {};
TTableSchema.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size28 = 0;
var _rtmp332;
this.columns = [];
var _etype31 = 0;
_rtmp332 = input.readListBegin();
_etype31 = _rtmp332.etype;
_size28 = _rtmp332.size;
for (var _i33 = 0; _i33 < _size28; ++_i33)
{
var elem34 = null;
elem34 = new ttypes.TColumnDesc();
elem34.read(input);
this.columns.push(elem34);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TTableSchema.prototype.write = function(output) {
output.writeStructBegin('TTableSchema');
if (this.columns !== null && this.columns !== undefined) {
output.writeFieldBegin('columns', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);
for (var iter35 in this.columns)
{
if (this.columns.hasOwnProperty(iter35))
{
iter35 = this.columns[iter35];
iter35.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TBoolValue = module.exports.TBoolValue = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TBoolValue.prototype = {};
TBoolValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.BOOL) {
this.value = input.readBool();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TBoolValue.prototype.write = function(output) {
output.writeStructBegin('TBoolValue');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.BOOL, 1);
output.writeBool(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TByteValue = module.exports.TByteValue = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TByteValue.prototype = {};
TByteValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.BYTE) {
this.value = input.readByte();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TByteValue.prototype.write = function(output) {
output.writeStructBegin('TByteValue');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.BYTE, 1);
output.writeByte(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TI16Value = module.exports.TI16Value = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TI16Value.prototype = {};
TI16Value.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I16) {
this.value = input.readI16();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TI16Value.prototype.write = function(output) {
output.writeStructBegin('TI16Value');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.I16, 1);
output.writeI16(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TI32Value = module.exports.TI32Value = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TI32Value.prototype = {};
TI32Value.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.value = input.readI32();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TI32Value.prototype.write = function(output) {
output.writeStructBegin('TI32Value');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.I32, 1);
output.writeI32(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TI64Value = module.exports.TI64Value = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TI64Value.prototype = {};
TI64Value.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I64) {
this.value = input.readI64();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TI64Value.prototype.write = function(output) {
output.writeStructBegin('TI64Value');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.I64, 1);
output.writeI64(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TDoubleValue = module.exports.TDoubleValue = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TDoubleValue.prototype = {};
TDoubleValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.DOUBLE) {
this.value = input.readDouble();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TDoubleValue.prototype.write = function(output) {
output.writeStructBegin('TDoubleValue');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.DOUBLE, 1);
output.writeDouble(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TStringValue = module.exports.TStringValue = function(args) {
this.value = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
}
};
TStringValue.prototype = {};
TStringValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.value = input.readString();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TStringValue.prototype.write = function(output) {
output.writeStructBegin('TStringValue');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.STRING, 1);
output.writeString(this.value);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TColumn = module.exports.TColumn = function(args) {
this.boolColumn = null;
this.byteColumn = null;
this.i16Column = null;
this.i32Column = null;
this.i64Column = null;
this.doubleColumn = null;
this.stringColumn = null;
if (args) {
if (args.boolColumn !== undefined) {
this.boolColumn = args.boolColumn;
}
if (args.byteColumn !== undefined) {
this.byteColumn = args.byteColumn;
}
if (args.i16Column !== undefined) {
this.i16Column = args.i16Column;
}
if (args.i32Column !== undefined) {
this.i32Column = args.i32Column;
}
if (args.i64Column !== undefined) {
this.i64Column = args.i64Column;
}
if (args.doubleColumn !== undefined) {
this.doubleColumn = args.doubleColumn;
}
if (args.stringColumn !== undefined) {
this.stringColumn = args.stringColumn;
}
}
};
TColumn.prototype = {};
TColumn.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size36 = 0;
var _rtmp340;
this.boolColumn = [];
var _etype39 = 0;
_rtmp340 = input.readListBegin();
_etype39 = _rtmp340.etype;
_size36 = _rtmp340.size;
for (var _i41 = 0; _i41 < _size36; ++_i41)
{
var elem42 = null;
elem42 = new ttypes.TBoolValue();
elem42.read(input);
this.boolColumn.push(elem42);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size43 = 0;
var _rtmp347;
this.byteColumn = [];
var _etype46 = 0;
_rtmp347 = input.readListBegin();
_etype46 = _rtmp347.etype;
_size43 = _rtmp347.size;
for (var _i48 = 0; _i48 < _size43; ++_i48)
{
var elem49 = null;
elem49 = new ttypes.TByteValue();
elem49.read(input);
this.byteColumn.push(elem49);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size50 = 0;
var _rtmp354;
this.i16Column = [];
var _etype53 = 0;
_rtmp354 = input.readListBegin();
_etype53 = _rtmp354.etype;
_size50 = _rtmp354.size;
for (var _i55 = 0; _i55 < _size50; ++_i55)
{
var elem56 = null;
elem56 = new ttypes.TI16Value();
elem56.read(input);
this.i16Column.push(elem56);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.LIST) {
var _size57 = 0;
var _rtmp361;
this.i32Column = [];
var _etype60 = 0;
_rtmp361 = input.readListBegin();
_etype60 = _rtmp361.etype;
_size57 = _rtmp361.size;
for (var _i62 = 0; _i62 < _size57; ++_i62)
{
var elem63 = null;
elem63 = new ttypes.TI32Value();
elem63.read(input);
this.i32Column.push(elem63);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.LIST) {
var _size64 = 0;
var _rtmp368;
this.i64Column = [];
var _etype67 = 0;
_rtmp368 = input.readListBegin();
_etype67 = _rtmp368.etype;
_size64 = _rtmp368.size;
for (var _i69 = 0; _i69 < _size64; ++_i69)
{
var elem70 = null;
elem70 = new ttypes.TI64Value();
elem70.read(input);
this.i64Column.push(elem70);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.LIST) {
var _size71 = 0;
var _rtmp375;
this.doubleColumn = [];
var _etype74 = 0;
_rtmp375 = input.readListBegin();
_etype74 = _rtmp375.etype;
_size71 = _rtmp375.size;
for (var _i76 = 0; _i76 < _size71; ++_i76)
{
var elem77 = null;
elem77 = new ttypes.TDoubleValue();
elem77.read(input);
this.doubleColumn.push(elem77);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.LIST) {
var _size78 = 0;
var _rtmp382;
this.stringColumn = [];
var _etype81 = 0;
_rtmp382 = input.readListBegin();
_etype81 = _rtmp382.etype;
_size78 = _rtmp382.size;
for (var _i83 = 0; _i83 < _size78; ++_i83)
{
var elem84 = null;
elem84 = new ttypes.TStringValue();
elem84.read(input);
this.stringColumn.push(elem84);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TColumn.prototype.write = function(output) {
output.writeStructBegin('TColumn');
if (this.boolColumn !== null && this.boolColumn !== undefined) {
output.writeFieldBegin('boolColumn', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.boolColumn.length);
for (var iter85 in this.boolColumn)
{
if (this.boolColumn.hasOwnProperty(iter85))
{
iter85 = this.boolColumn[iter85];
iter85.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.byteColumn !== null && this.byteColumn !== undefined) {
output.writeFieldBegin('byteColumn', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRUCT, this.byteColumn.length);
for (var iter86 in this.byteColumn)
{
if (this.byteColumn.hasOwnProperty(iter86))
{
iter86 = this.byteColumn[iter86];
iter86.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.i16Column !== null && this.i16Column !== undefined) {
output.writeFieldBegin('i16Column', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRUCT, this.i16Column.length);
for (var iter87 in this.i16Column)
{
if (this.i16Column.hasOwnProperty(iter87))
{
iter87 = this.i16Column[iter87];
iter87.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.i32Column !== null && this.i32Column !== undefined) {
output.writeFieldBegin('i32Column', Thrift.Type.LIST, 4);
output.writeListBegin(Thrift.Type.STRUCT, this.i32Column.length);
for (var iter88 in this.i32Column)
{
if (this.i32Column.hasOwnProperty(iter88))
{
iter88 = this.i32Column[iter88];
iter88.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.i64Column !== null && this.i64Column !== undefined) {
output.writeFieldBegin('i64Column', Thrift.Type.LIST, 5);
output.writeListBegin(Thrift.Type.STRUCT, this.i64Column.length);
for (var iter89 in this.i64Column)
{
if (this.i64Column.hasOwnProperty(iter89))
{
iter89 = this.i64Column[iter89];
iter89.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.doubleColumn !== null && this.doubleColumn !== undefined) {
output.writeFieldBegin('doubleColumn', Thrift.Type.LIST, 6);
output.writeListBegin(Thrift.Type.STRUCT, this.doubleColumn.length);
for (var iter90 in this.doubleColumn)
{
if (this.doubleColumn.hasOwnProperty(iter90))
{
iter90 = this.doubleColumn[iter90];
iter90.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.stringColumn !== null && this.stringColumn !== undefined) {
output.writeFieldBegin('stringColumn', Thrift.Type.LIST, 7);
output.writeListBegin(Thrift.Type.STRUCT, this.stringColumn.length);
for (var iter91 in this.stringColumn)
{
if (this.stringColumn.hasOwnProperty(iter91))
{
iter91 = this.stringColumn[iter91];
iter91.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TColumnValue = module.exports.TColumnValue = function(args) {
this.boolVal = null;
this.byteVal = null;
this.i16Val = null;
this.i32Val = null;
this.i64Val = null;
this.doubleVal = null;
this.stringVal = null;
if (args) {
if (args.boolVal !== undefined) {
this.boolVal = args.boolVal;
}
if (args.byteVal !== undefined) {
this.byteVal = args.byteVal;
}
if (args.i16Val !== undefined) {
this.i16Val = args.i16Val;
}
if (args.i32Val !== undefined) {
this.i32Val = args.i32Val;
}
if (args.i64Val !== undefined) {
this.i64Val = args.i64Val;
}
if (args.doubleVal !== undefined) {
this.doubleVal = args.doubleVal;
}
if (args.stringVal !== undefined) {
this.stringVal = args.stringVal;
}
}
};
TColumnValue.prototype = {};
TColumnValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.boolVal = new ttypes.TBoolValue();
this.boolVal.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.byteVal = new ttypes.TByteValue();
this.byteVal.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.i16Val = new ttypes.TI16Value();
this.i16Val.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRUCT) {
this.i32Val = new ttypes.TI32Value();
this.i32Val.read(input);
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRUCT) {
this.i64Val = new ttypes.TI64Value();
this.i64Val.read(input);
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.STRUCT) {
this.doubleVal = new ttypes.TDoubleValue();
this.doubleVal.read(input);
} else {
input.skip(ftype);
}
break;
case 7:
if (ftype == Thrift.Type.STRUCT) {
this.stringVal = new ttypes.TStringValue();
this.stringVal.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TColumnValue.prototype.write = function(output) {
output.writeStructBegin('TColumnValue');
if (this.boolVal !== null && this.boolVal !== undefined) {
output.writeFieldBegin('boolVal', Thrift.Type.STRUCT, 1);
this.boolVal.write(output);
output.writeFieldEnd();
}
if (this.byteVal !== null && this.byteVal !== undefined) {
output.writeFieldBegin('byteVal', Thrift.Type.STRUCT, 2);
this.byteVal.write(output);
output.writeFieldEnd();
}
if (this.i16Val !== null && this.i16Val !== undefined) {
output.writeFieldBegin('i16Val', Thrift.Type.STRUCT, 3);
this.i16Val.write(output);
output.writeFieldEnd();
}
if (this.i32Val !== null && this.i32Val !== undefined) {
output.writeFieldBegin('i32Val', Thrift.Type.STRUCT, 4);
this.i32Val.write(output);
output.writeFieldEnd();
}
if (this.i64Val !== null && this.i64Val !== undefined) {
output.writeFieldBegin('i64Val', Thrift.Type.STRUCT, 5);
this.i64Val.write(output);
output.writeFieldEnd();
}
if (this.doubleVal !== null && this.doubleVal !== undefined) {
output.writeFieldBegin('doubleVal', Thrift.Type.STRUCT, 6);
this.doubleVal.write(output);
output.writeFieldEnd();
}
if (this.stringVal !== null && this.stringVal !== undefined) {
output.writeFieldBegin('stringVal', Thrift.Type.STRUCT, 7);
this.stringVal.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRow = module.exports.TRow = function(args) {
this.colVals = null;
if (args) {
if (args.colVals !== undefined) {
this.colVals = args.colVals;
}
}
};
TRow.prototype = {};
TRow.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.LIST) {
var _size92 = 0;
var _rtmp396;
this.colVals = [];
var _etype95 = 0;
_rtmp396 = input.readListBegin();
_etype95 = _rtmp396.etype;
_size92 = _rtmp396.size;
for (var _i97 = 0; _i97 < _size92; ++_i97)
{
var elem98 = null;
elem98 = new ttypes.TColumnValue();
elem98.read(input);
this.colVals.push(elem98);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRow.prototype.write = function(output) {
output.writeStructBegin('TRow');
if (this.colVals !== null && this.colVals !== undefined) {
output.writeFieldBegin('colVals', Thrift.Type.LIST, 1);
output.writeListBegin(Thrift.Type.STRUCT, this.colVals.length);
for (var iter99 in this.colVals)
{
if (this.colVals.hasOwnProperty(iter99))
{
iter99 = this.colVals[iter99];
iter99.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TRowSet = module.exports.TRowSet = function(args) {
this.startRowOffset = null;
this.rows = null;
this.columns = null;
if (args) {
if (args.startRowOffset !== undefined) {
this.startRowOffset = args.startRowOffset;
}
if (args.rows !== undefined) {
this.rows = args.rows;
}
if (args.columns !== undefined) {
this.columns = args.columns;
}
}
};
TRowSet.prototype = {};
TRowSet.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I64) {
this.startRowOffset = input.readI64();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size100 = 0;
var _rtmp3104;
this.rows = [];
var _etype103 = 0;
_rtmp3104 = input.readListBegin();
_etype103 = _rtmp3104.etype;
_size100 = _rtmp3104.size;
for (var _i105 = 0; _i105 < _size100; ++_i105)
{
var elem106 = null;
elem106 = new ttypes.TRow();
elem106.read(input);
this.rows.push(elem106);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.LIST) {
var _size107 = 0;
var _rtmp3111;
this.columns = [];
var _etype110 = 0;
_rtmp3111 = input.readListBegin();
_etype110 = _rtmp3111.etype;
_size107 = _rtmp3111.size;
for (var _i112 = 0; _i112 < _size107; ++_i112)
{
var elem113 = null;
elem113 = new ttypes.TColumn();
elem113.read(input);
this.columns.push(elem113);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TRowSet.prototype.write = function(output) {
output.writeStructBegin('TRowSet');
if (this.startRowOffset !== null && this.startRowOffset !== undefined) {
output.writeFieldBegin('startRowOffset', Thrift.Type.I64, 1);
output.writeI64(this.startRowOffset);
output.writeFieldEnd();
}
if (this.rows !== null && this.rows !== undefined) {
output.writeFieldBegin('rows', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRUCT, this.rows.length);
for (var iter114 in this.rows)
{
if (this.rows.hasOwnProperty(iter114))
{
iter114 = this.rows[iter114];
iter114.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.columns !== null && this.columns !== undefined) {
output.writeFieldBegin('columns', Thrift.Type.LIST, 3);
output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);
for (var iter115 in this.columns)
{
if (this.columns.hasOwnProperty(iter115))
{
iter115 = this.columns[iter115];
iter115.write(output);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TStatus = module.exports.TStatus = function(args) {
this.statusCode = null;
this.infoMessages = null;
this.sqlState = null;
this.errorCode = null;
this.errorMessage = null;
if (args) {
if (args.statusCode !== undefined) {
this.statusCode = args.statusCode;
}
if (args.infoMessages !== undefined) {
this.infoMessages = args.infoMessages;
}
if (args.sqlState !== undefined) {
this.sqlState = args.sqlState;
}
if (args.errorCode !== undefined) {
this.errorCode = args.errorCode;
}
if (args.errorMessage !== undefined) {
this.errorMessage = args.errorMessage;
}
}
};
TStatus.prototype = {};
TStatus.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.statusCode = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size116 = 0;
var _rtmp3120;
this.infoMessages = [];
var _etype119 = 0;
_rtmp3120 = input.readListBegin();
_etype119 = _rtmp3120.etype;
_size116 = _rtmp3120.size;
for (var _i121 = 0; _i121 < _size116; ++_i121)
{
var elem122 = null;
elem122 = input.readString();
this.infoMessages.push(elem122);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.sqlState = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.errorCode = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.errorMessage = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TStatus.prototype.write = function(output) {
output.writeStructBegin('TStatus');
if (this.statusCode !== null && this.statusCode !== undefined) {
output.writeFieldBegin('statusCode', Thrift.Type.I32, 1);
output.writeI32(this.statusCode);
output.writeFieldEnd();
}
if (this.infoMessages !== null && this.infoMessages !== undefined) {
output.writeFieldBegin('infoMessages', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.STRING, this.infoMessages.length);
for (var iter123 in this.infoMessages)
{
if (this.infoMessages.hasOwnProperty(iter123))
{
iter123 = this.infoMessages[iter123];
output.writeString(iter123);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
if (this.sqlState !== null && this.sqlState !== undefined) {
output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3);
output.writeString(this.sqlState);
output.writeFieldEnd();
}
if (this.errorCode !== null && this.errorCode !== undefined) {
output.writeFieldBegin('errorCode', Thrift.Type.I32, 4);
output.writeI32(this.errorCode);
output.writeFieldEnd();
}
if (this.errorMessage !== null && this.errorMessage !== undefined) {
output.writeFieldBegin('errorMessage', Thrift.Type.STRING, 5);
output.writeString(this.errorMessage);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var THandleIdentifier = module.exports.THandleIdentifier = function(args) {
this.guid = null;
this.secret = null;
if (args) {
if (args.guid !== undefined) {
this.guid = args.guid;
}
if (args.secret !== undefined) {
this.secret = args.secret;
}
}
};
THandleIdentifier.prototype = {};
THandleIdentifier.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.guid = input.readBinary();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.secret = input.readBinary();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
THandleIdentifier.prototype.write = function(output) {
output.writeStructBegin('THandleIdentifier');
if (this.guid !== null && this.guid !== undefined) {
output.writeFieldBegin('guid', Thrift.Type.STRING, 1);
output.writeBinary(this.guid);
output.writeFieldEnd();
}
if (this.secret !== null && this.secret !== undefined) {
output.writeFieldBegin('secret', Thrift.Type.STRING, 2);
output.writeBinary(this.secret);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TSessionHandle = module.exports.TSessionHandle = function(args) {
this.sessionId = null;
if (args) {
if (args.sessionId !== undefined) {
this.sessionId = args.sessionId;
}
}
};
TSessionHandle.prototype = {};
TSessionHandle.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionId = new ttypes.THandleIdentifier();
this.sessionId.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TSessionHandle.prototype.write = function(output) {
output.writeStructBegin('TSessionHandle');
if (this.sessionId !== null && this.sessionId !== undefined) {
output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 1);
this.sessionId.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TOperationHandle = module.exports.TOperationHandle = function(args) {
this.operationId = null;
this.operationType = null;
this.hasResultSet = null;
this.modifiedRowCount = null;
if (args) {
if (args.operationId !== undefined) {
this.operationId = args.operationId;
}
if (args.operationType !== undefined) {
this.operationType = args.operationType;
}
if (args.hasResultSet !== undefined) {
this.hasResultSet = args.hasResultSet;
}
if (args.modifiedRowCount !== undefined) {
this.modifiedRowCount = args.modifiedRowCount;
}
}
};
TOperationHandle.prototype = {};
TOperationHandle.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationId = new ttypes.THandleIdentifier();
this.operationId.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.operationType = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.BOOL) {
this.hasResultSet = input.readBool();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.DOUBLE) {
this.modifiedRowCount = input.readDouble();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TOperationHandle.prototype.write = function(output) {
output.writeStructBegin('TOperationHandle');
if (this.operationId !== null && this.operationId !== undefined) {
output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 1);
this.operationId.write(output);
output.writeFieldEnd();
}
if (this.operationType !== null && this.operationType !== undefined) {
output.writeFieldBegin('operationType', Thrift.Type.I32, 2);
output.writeI32(this.operationType);
output.writeFieldEnd();
}
if (this.hasResultSet !== null && this.hasResultSet !== undefined) {
output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 3);
output.writeBool(this.hasResultSet);
output.writeFieldEnd();
}
if (this.modifiedRowCount !== null && this.modifiedRowCount !== undefined) {
output.writeFieldBegin('modifiedRowCount', Thrift.Type.DOUBLE, 4);
output.writeDouble(this.modifiedRowCount);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TOpenSessionReq = module.exports.TOpenSessionReq = function(args) {
this.client_protocol = 0;
this.username = null;
this.password = null;
this.configuration = null;
if (args) {
if (args.client_protocol !== undefined) {
this.client_protocol = args.client_protocol;
}
if (args.username !== undefined) {
this.username = args.username;
}
if (args.password !== undefined) {
this.password = args.password;
}
if (args.configuration !== undefined) {
this.configuration = args.configuration;
}
}
};
TOpenSessionReq.prototype = {};
TOpenSessionReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.client_protocol = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.username = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.password = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size124 = 0;
var _rtmp3128;
this.configuration = {};
var _ktype125 = 0;
var _vtype126 = 0;
_rtmp3128 = input.readMapBegin();
_ktype125 = _rtmp3128.ktype;
_vtype126 = _rtmp3128.vtype;
_size124 = _rtmp3128.size;
for (var _i129 = 0; _i129 < _size124; ++_i129)
{
var key130 = null;
var val131 = null;
key130 = input.readString();
val131 = input.readString();
this.configuration[key130] = val131;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TOpenSessionReq.prototype.write = function(output) {
output.writeStructBegin('TOpenSessionReq');
if (this.client_protocol !== null && this.client_protocol !== undefined) {
output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1);
output.writeI32(this.client_protocol);
output.writeFieldEnd();
}
if (this.username !== null && this.username !== undefined) {
output.writeFieldBegin('username', Thrift.Type.STRING, 2);
output.writeString(this.username);
output.writeFieldEnd();
}
if (this.password !== null && this.password !== undefined) {
output.writeFieldBegin('password', Thrift.Type.STRING, 3);
output.writeString(this.password);
output.writeFieldEnd();
}
if (this.configuration !== null && this.configuration !== undefined) {
output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));
for (var kiter132 in this.configuration)
{
if (this.configuration.hasOwnProperty(kiter132))
{
var viter133 = this.configuration[kiter132];
output.writeString(kiter132);
output.writeString(viter133);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TOpenSessionResp = module.exports.TOpenSessionResp = function(args) {
this.status = null;
this.serverProtocolVersion = 0;
this.sessionHandle = null;
this.configuration = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.serverProtocolVersion !== undefined) {
this.serverProtocolVersion = args.serverProtocolVersion;
}
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.configuration !== undefined) {
this.configuration = args.configuration;
}
}
};
TOpenSessionResp.prototype = {};
TOpenSessionResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.serverProtocolVersion = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.MAP) {
var _size134 = 0;
var _rtmp3138;
this.configuration = {};
var _ktype135 = 0;
var _vtype136 = 0;
_rtmp3138 = input.readMapBegin();
_ktype135 = _rtmp3138.ktype;
_vtype136 = _rtmp3138.vtype;
_size134 = _rtmp3138.size;
for (var _i139 = 0; _i139 < _size134; ++_i139)
{
var key140 = null;
var val141 = null;
key140 = input.readString();
val141 = input.readString();
this.configuration[key140] = val141;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TOpenSessionResp.prototype.write = function(output) {
output.writeStructBegin('TOpenSessionResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) {
output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2);
output.writeI32(this.serverProtocolVersion);
output.writeFieldEnd();
}
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 3);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.configuration !== null && this.configuration !== undefined) {
output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));
for (var kiter142 in this.configuration)
{
if (this.configuration.hasOwnProperty(kiter142))
{
var viter143 = this.configuration[kiter142];
output.writeString(kiter142);
output.writeString(viter143);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCloseSessionReq = module.exports.TCloseSessionReq = function(args) {
this.sessionHandle = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
}
};
TCloseSessionReq.prototype = {};
TCloseSessionReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCloseSessionReq.prototype.write = function(output) {
output.writeStructBegin('TCloseSessionReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCloseSessionResp = module.exports.TCloseSessionResp = function(args) {
this.status = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
}
};
TCloseSessionResp.prototype = {};
TCloseSessionResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCloseSessionResp.prototype.write = function(output) {
output.writeStructBegin('TCloseSessionResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetInfoValue = module.exports.TGetInfoValue = function(args) {
this.stringValue = null;
this.smallIntValue = null;
this.integerBitmask = null;
this.integerFlag = null;
this.binaryValue = null;
this.lenValue = null;
if (args) {
if (args.stringValue !== undefined) {
this.stringValue = args.stringValue;
}
if (args.smallIntValue !== undefined) {
this.smallIntValue = args.smallIntValue;
}
if (args.integerBitmask !== undefined) {
this.integerBitmask = args.integerBitmask;
}
if (args.integerFlag !== undefined) {
this.integerFlag = args.integerFlag;
}
if (args.binaryValue !== undefined) {
this.binaryValue = args.binaryValue;
}
if (args.lenValue !== undefined) {
this.lenValue = args.lenValue;
}
}
};
TGetInfoValue.prototype = {};
TGetInfoValue.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.stringValue = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I16) {
this.smallIntValue = input.readI16();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.integerBitmask = input.readI32();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.I32) {
this.integerFlag = input.readI32();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.I32) {
this.binaryValue = input.readI32();
} else {
input.skip(ftype);
}
break;
case 6:
if (ftype == Thrift.Type.I64) {
this.lenValue = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetInfoValue.prototype.write = function(output) {
output.writeStructBegin('TGetInfoValue');
if (this.stringValue !== null && this.stringValue !== undefined) {
output.writeFieldBegin('stringValue', Thrift.Type.STRING, 1);
output.writeString(this.stringValue);
output.writeFieldEnd();
}
if (this.smallIntValue !== null && this.smallIntValue !== undefined) {
output.writeFieldBegin('smallIntValue', Thrift.Type.I16, 2);
output.writeI16(this.smallIntValue);
output.writeFieldEnd();
}
if (this.integerBitmask !== null && this.integerBitmask !== undefined) {
output.writeFieldBegin('integerBitmask', Thrift.Type.I32, 3);
output.writeI32(this.integerBitmask);
output.writeFieldEnd();
}
if (this.integerFlag !== null && this.integerFlag !== undefined) {
output.writeFieldBegin('integerFlag', Thrift.Type.I32, 4);
output.writeI32(this.integerFlag);
output.writeFieldEnd();
}
if (this.binaryValue !== null && this.binaryValue !== undefined) {
output.writeFieldBegin('binaryValue', Thrift.Type.I32, 5);
output.writeI32(this.binaryValue);
output.writeFieldEnd();
}
if (this.lenValue !== null && this.lenValue !== undefined) {
output.writeFieldBegin('lenValue', Thrift.Type.I64, 6);
output.writeI64(this.lenValue);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetInfoReq = module.exports.TGetInfoReq = function(args) {
this.sessionHandle = null;
this.infoType = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.infoType !== undefined) {
this.infoType = args.infoType;
}
}
};
TGetInfoReq.prototype = {};
TGetInfoReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.infoType = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetInfoReq.prototype.write = function(output) {
output.writeStructBegin('TGetInfoReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.infoType !== null && this.infoType !== undefined) {
output.writeFieldBegin('infoType', Thrift.Type.I32, 2);
output.writeI32(this.infoType);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetInfoResp = module.exports.TGetInfoResp = function(args) {
this.status = null;
this.infoValue = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.infoValue !== undefined) {
this.infoValue = args.infoValue;
}
}
};
TGetInfoResp.prototype = {};
TGetInfoResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.infoValue = new ttypes.TGetInfoValue();
this.infoValue.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetInfoResp.prototype.write = function(output) {
output.writeStructBegin('TGetInfoResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.infoValue !== null && this.infoValue !== undefined) {
output.writeFieldBegin('infoValue', Thrift.Type.STRUCT, 2);
this.infoValue.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TExecuteStatementReq = module.exports.TExecuteStatementReq = function(args) {
this.sessionHandle = null;
this.statement = null;
this.confOverlay = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.statement !== undefined) {
this.statement = args.statement;
}
if (args.confOverlay !== undefined) {
this.confOverlay = args.confOverlay;
}
}
};
TExecuteStatementReq.prototype = {};
TExecuteStatementReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.statement = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
var _size144 = 0;
var _rtmp3148;
this.confOverlay = {};
var _ktype145 = 0;
var _vtype146 = 0;
_rtmp3148 = input.readMapBegin();
_ktype145 = _rtmp3148.ktype;
_vtype146 = _rtmp3148.vtype;
_size144 = _rtmp3148.size;
for (var _i149 = 0; _i149 < _size144; ++_i149)
{
var key150 = null;
var val151 = null;
key150 = input.readString();
val151 = input.readString();
this.confOverlay[key150] = val151;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TExecuteStatementReq.prototype.write = function(output) {
output.writeStructBegin('TExecuteStatementReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.statement !== null && this.statement !== undefined) {
output.writeFieldBegin('statement', Thrift.Type.STRING, 2);
output.writeString(this.statement);
output.writeFieldEnd();
}
if (this.confOverlay !== null && this.confOverlay !== undefined) {
output.writeFieldBegin('confOverlay', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.confOverlay));
for (var kiter152 in this.confOverlay)
{
if (this.confOverlay.hasOwnProperty(kiter152))
{
var viter153 = this.confOverlay[kiter152];
output.writeString(kiter152);
output.writeString(viter153);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TExecuteStatementResp = module.exports.TExecuteStatementResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TExecuteStatementResp.prototype = {};
TExecuteStatementResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TExecuteStatementResp.prototype.write = function(output) {
output.writeStructBegin('TExecuteStatementResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTypeInfoReq = module.exports.TGetTypeInfoReq = function(args) {
this.sessionHandle = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
}
};
TGetTypeInfoReq.prototype = {};
TGetTypeInfoReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTypeInfoReq.prototype.write = function(output) {
output.writeStructBegin('TGetTypeInfoReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTypeInfoResp = module.exports.TGetTypeInfoResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetTypeInfoResp.prototype = {};
TGetTypeInfoResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTypeInfoResp.prototype.write = function(output) {
output.writeStructBegin('TGetTypeInfoResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetCatalogsReq = module.exports.TGetCatalogsReq = function(args) {
this.sessionHandle = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
}
};
TGetCatalogsReq.prototype = {};
TGetCatalogsReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetCatalogsReq.prototype.write = function(output) {
output.writeStructBegin('TGetCatalogsReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetCatalogsResp = module.exports.TGetCatalogsResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetCatalogsResp.prototype = {};
TGetCatalogsResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetCatalogsResp.prototype.write = function(output) {
output.writeStructBegin('TGetCatalogsResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetSchemasReq = module.exports.TGetSchemasReq = function(args) {
this.sessionHandle = null;
this.catalogName = null;
this.schemaName = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.catalogName !== undefined) {
this.catalogName = args.catalogName;
}
if (args.schemaName !== undefined) {
this.schemaName = args.schemaName;
}
}
};
TGetSchemasReq.prototype = {};
TGetSchemasReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.catalogName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.schemaName = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetSchemasReq.prototype.write = function(output) {
output.writeStructBegin('TGetSchemasReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.catalogName !== null && this.catalogName !== undefined) {
output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
output.writeString(this.catalogName);
output.writeFieldEnd();
}
if (this.schemaName !== null && this.schemaName !== undefined) {
output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
output.writeString(this.schemaName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetSchemasResp = module.exports.TGetSchemasResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetSchemasResp.prototype = {};
TGetSchemasResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetSchemasResp.prototype.write = function(output) {
output.writeStructBegin('TGetSchemasResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTablesReq = module.exports.TGetTablesReq = function(args) {
this.sessionHandle = null;
this.catalogName = null;
this.schemaName = null;
this.tableName = null;
this.tableTypes = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.catalogName !== undefined) {
this.catalogName = args.catalogName;
}
if (args.schemaName !== undefined) {
this.schemaName = args.schemaName;
}
if (args.tableName !== undefined) {
this.tableName = args.tableName;
}
if (args.tableTypes !== undefined) {
this.tableTypes = args.tableTypes;
}
}
};
TGetTablesReq.prototype = {};
TGetTablesReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.catalogName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.schemaName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.tableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.LIST) {
var _size154 = 0;
var _rtmp3158;
this.tableTypes = [];
var _etype157 = 0;
_rtmp3158 = input.readListBegin();
_etype157 = _rtmp3158.etype;
_size154 = _rtmp3158.size;
for (var _i159 = 0; _i159 < _size154; ++_i159)
{
var elem160 = null;
elem160 = input.readString();
this.tableTypes.push(elem160);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTablesReq.prototype.write = function(output) {
output.writeStructBegin('TGetTablesReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.catalogName !== null && this.catalogName !== undefined) {
output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
output.writeString(this.catalogName);
output.writeFieldEnd();
}
if (this.schemaName !== null && this.schemaName !== undefined) {
output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
output.writeString(this.schemaName);
output.writeFieldEnd();
}
if (this.tableName !== null && this.tableName !== undefined) {
output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);
output.writeString(this.tableName);
output.writeFieldEnd();
}
if (this.tableTypes !== null && this.tableTypes !== undefined) {
output.writeFieldBegin('tableTypes', Thrift.Type.LIST, 5);
output.writeListBegin(Thrift.Type.STRING, this.tableTypes.length);
for (var iter161 in this.tableTypes)
{
if (this.tableTypes.hasOwnProperty(iter161))
{
iter161 = this.tableTypes[iter161];
output.writeString(iter161);
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTablesResp = module.exports.TGetTablesResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetTablesResp.prototype = {};
TGetTablesResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTablesResp.prototype.write = function(output) {
output.writeStructBegin('TGetTablesResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTableTypesReq = module.exports.TGetTableTypesReq = function(args) {
this.sessionHandle = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
}
};
TGetTableTypesReq.prototype = {};
TGetTableTypesReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTableTypesReq.prototype.write = function(output) {
output.writeStructBegin('TGetTableTypesReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetTableTypesResp = module.exports.TGetTableTypesResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetTableTypesResp.prototype = {};
TGetTableTypesResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetTableTypesResp.prototype.write = function(output) {
output.writeStructBegin('TGetTableTypesResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetColumnsReq = module.exports.TGetColumnsReq = function(args) {
this.sessionHandle = null;
this.catalogName = null;
this.schemaName = null;
this.tableName = null;
this.columnName = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.catalogName !== undefined) {
this.catalogName = args.catalogName;
}
if (args.schemaName !== undefined) {
this.schemaName = args.schemaName;
}
if (args.tableName !== undefined) {
this.tableName = args.tableName;
}
if (args.columnName !== undefined) {
this.columnName = args.columnName;
}
}
};
TGetColumnsReq.prototype = {};
TGetColumnsReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.catalogName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.schemaName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.tableName = input.readString();
} else {
input.skip(ftype);
}
break;
case 5:
if (ftype == Thrift.Type.STRING) {
this.columnName = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetColumnsReq.prototype.write = function(output) {
output.writeStructBegin('TGetColumnsReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.catalogName !== null && this.catalogName !== undefined) {
output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
output.writeString(this.catalogName);
output.writeFieldEnd();
}
if (this.schemaName !== null && this.schemaName !== undefined) {
output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
output.writeString(this.schemaName);
output.writeFieldEnd();
}
if (this.tableName !== null && this.tableName !== undefined) {
output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);
output.writeString(this.tableName);
output.writeFieldEnd();
}
if (this.columnName !== null && this.columnName !== undefined) {
output.writeFieldBegin('columnName', Thrift.Type.STRING, 5);
output.writeString(this.columnName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetColumnsResp = module.exports.TGetColumnsResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetColumnsResp.prototype = {};
TGetColumnsResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetColumnsResp.prototype.write = function(output) {
output.writeStructBegin('TGetColumnsResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetFunctionsReq = module.exports.TGetFunctionsReq = function(args) {
this.sessionHandle = null;
this.catalogName = null;
this.schemaName = null;
this.functionName = null;
if (args) {
if (args.sessionHandle !== undefined) {
this.sessionHandle = args.sessionHandle;
}
if (args.catalogName !== undefined) {
this.catalogName = args.catalogName;
}
if (args.schemaName !== undefined) {
this.schemaName = args.schemaName;
}
if (args.functionName !== undefined) {
this.functionName = args.functionName;
}
}
};
TGetFunctionsReq.prototype = {};
TGetFunctionsReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.catalogName = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.schemaName = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.functionName = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetFunctionsReq.prototype.write = function(output) {
output.writeStructBegin('TGetFunctionsReq');
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.catalogName !== null && this.catalogName !== undefined) {
output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
output.writeString(this.catalogName);
output.writeFieldEnd();
}
if (this.schemaName !== null && this.schemaName !== undefined) {
output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
output.writeString(this.schemaName);
output.writeFieldEnd();
}
if (this.functionName !== null && this.functionName !== undefined) {
output.writeFieldBegin('functionName', Thrift.Type.STRING, 4);
output.writeString(this.functionName);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetFunctionsResp = module.exports.TGetFunctionsResp = function(args) {
this.status = null;
this.operationHandle = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetFunctionsResp.prototype = {};
TGetFunctionsResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetFunctionsResp.prototype.write = function(output) {
output.writeStructBegin('TGetFunctionsResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetOperationStatusReq = module.exports.TGetOperationStatusReq = function(args) {
this.operationHandle = null;
if (args) {
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetOperationStatusReq.prototype = {};
TGetOperationStatusReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetOperationStatusReq.prototype.write = function(output) {
output.writeStructBegin('TGetOperationStatusReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetOperationStatusResp = module.exports.TGetOperationStatusResp = function(args) {
this.status = null;
this.operationState = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.operationState !== undefined) {
this.operationState = args.operationState;
}
}
};
TGetOperationStatusResp.prototype = {};
TGetOperationStatusResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.operationState = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetOperationStatusResp.prototype.write = function(output) {
output.writeStructBegin('TGetOperationStatusResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.operationState !== null && this.operationState !== undefined) {
output.writeFieldBegin('operationState', Thrift.Type.I32, 2);
output.writeI32(this.operationState);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCancelOperationReq = module.exports.TCancelOperationReq = function(args) {
this.operationHandle = null;
if (args) {
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TCancelOperationReq.prototype = {};
TCancelOperationReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCancelOperationReq.prototype.write = function(output) {
output.writeStructBegin('TCancelOperationReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCancelOperationResp = module.exports.TCancelOperationResp = function(args) {
this.status = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
}
};
TCancelOperationResp.prototype = {};
TCancelOperationResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCancelOperationResp.prototype.write = function(output) {
output.writeStructBegin('TCancelOperationResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCloseOperationReq = module.exports.TCloseOperationReq = function(args) {
this.operationHandle = null;
if (args) {
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TCloseOperationReq.prototype = {};
TCloseOperationReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCloseOperationReq.prototype.write = function(output) {
output.writeStructBegin('TCloseOperationReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TCloseOperationResp = module.exports.TCloseOperationResp = function(args) {
this.status = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
}
};
TCloseOperationResp.prototype = {};
TCloseOperationResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TCloseOperationResp.prototype.write = function(output) {
output.writeStructBegin('TCloseOperationResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetResultSetMetadataReq = module.exports.TGetResultSetMetadataReq = function(args) {
this.operationHandle = null;
if (args) {
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
}
};
TGetResultSetMetadataReq.prototype = {};
TGetResultSetMetadataReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetResultSetMetadataReq.prototype.write = function(output) {
output.writeStructBegin('TGetResultSetMetadataReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetResultSetMetadataResp = module.exports.TGetResultSetMetadataResp = function(args) {
this.status = null;
this.schema = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.schema !== undefined) {
this.schema = args.schema;
}
}
};
TGetResultSetMetadataResp.prototype = {};
TGetResultSetMetadataResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.schema = new ttypes.TTableSchema();
this.schema.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetResultSetMetadataResp.prototype.write = function(output) {
output.writeStructBegin('TGetResultSetMetadataResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.schema !== null && this.schema !== undefined) {
output.writeFieldBegin('schema', Thrift.Type.STRUCT, 2);
this.schema.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TFetchResultsReq = module.exports.TFetchResultsReq = function(args) {
this.operationHandle = null;
this.orientation = 0;
this.maxRows = null;
if (args) {
if (args.operationHandle !== undefined) {
this.operationHandle = args.operationHandle;
}
if (args.orientation !== undefined) {
this.orientation = args.orientation;
}
if (args.maxRows !== undefined) {
this.maxRows = args.maxRows;
}
}
};
TFetchResultsReq.prototype = {};
TFetchResultsReq.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.operationHandle = new ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I32) {
this.orientation = input.readI32();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I64) {
this.maxRows = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TFetchResultsReq.prototype.write = function(output) {
output.writeStructBegin('TFetchResultsReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
if (this.orientation !== null && this.orientation !== undefined) {
output.writeFieldBegin('orientation', Thrift.Type.I32, 2);
output.writeI32(this.orientation);
output.writeFieldEnd();
}
if (this.maxRows !== null && this.maxRows !== undefined) {
output.writeFieldBegin('maxRows', Thrift.Type.I64, 3);
output.writeI64(this.maxRows);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TFetchResultsResp = module.exports.TFetchResultsResp = function(args) {
this.status = null;
this.hasMoreRows = null;
this.results = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.hasMoreRows !== undefined) {
this.hasMoreRows = args.hasMoreRows;
}
if (args.results !== undefined) {
this.results = args.results;
}
}
};
TFetchResultsResp.prototype = {};
TFetchResultsResp.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.BOOL) {
this.hasMoreRows = input.readBool();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.results = new ttypes.TRowSet();
this.results.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TFetchResultsResp.prototype.write = function(output) {
output.writeStructBegin('TFetchResultsResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.hasMoreRows !== null && this.hasMoreRows !== undefined) {
output.writeFieldBegin('hasMoreRows', Thrift.Type.BOOL, 2);
output.writeBool(this.hasMoreRows);
output.writeFieldEnd();
}
if (this.results !== null && this.results !== undefined) {
output.writeFieldBegin('results', Thrift.Type.STRUCT, 3);
this.results.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ttypes.PRIMITIVE_TYPES = [0,1,2,3,4,5,6,7,8,9,15];
ttypes.COMPLEX_TYPES = [10,11,12,13,14];
ttypes.COLLECTION_TYPES = [10,11];
ttypes.TYPE_NAMES = {0 : 'BOOLEAN',
1 : 'TINYINT',
2 : 'SMALLINT',
3 : 'INT',
4 : 'BIGINT',
5 : 'FLOAT',
6 : 'DOUBLE',
7 : 'STRING',
8 : 'TIMESTAMP',
9 : 'BINARY',
10 : 'ARRAY',
11 : 'MAP',
12 : 'STRUCT',
13 : 'UNIONTYPE',
15 : 'DECIMAL'
};
================================================
FILE: lib/shib/engines/hiveserver2/index.js
================================================
var thrift = require('node-thrift')
, ttransport = require('node-thrift/lib/thrift/transport')
, TCLIService = require('./TCLIService')
, TTypes = require('./TCLIService_types');
var bignumber = require('bignumber.js');
/* HiveServer2 Monitor is disabled in engine.js
*
* HiveServer's ExecuteStatement blocks until query finishes.
* ExecuteStatement returns operationHandle, and
* CancelOperation needs operationHandle.
* => We cannot monitor/cancel running ExecuteStatement operations ....
*/
var MaxRows = 100000;
var QueryStatusPollingInterval = 5000 // 5sec
, OperationStatusPollingInterval = 300; // 0.3sec
var runningOperations = {}; // For Monitor methods
var NotSupportedOptionError = exports.NotSupportedOptionError = function(){};
var Executer = exports.Executer = function(conf, logger){
if (conf.name !== 'hiveserver2')
throw "executer name mismatch for hiveserver2:" + conf.name;
this.logger = logger;
/* hive.server2.authentication='NOSASL' or SASLTransport ... */
this._connection = thrift.createConnection(
conf.host,
conf.port,
{transport: ttransport.TBufferedTransport}
);
this._username = conf.username;
this._password = conf.password || 'pass'; //TODO: this is not used for NOSASL transport
this._client = thrift.createClient(TCLIService, this._connection);
this._sessionHandle = null;
this._maxRows = conf['maxRows'] || MaxRows;
};
Executer.prototype._inSession = function(callback){
if (this._sessionHandle) {
callback(null); return;
}
var self = this;
var openSessionReq = new TTypes.TOpenSessionReq({username: this._username, password: this._password});
this._client.OpenSession(openSessionReq, function(err, res){
if (err) { callback(err); return; }
if (! res.sessionHandle){ callback({message: "sessionHandle missing without any reason"}); return; }
self._sessionHandle = res.sessionHandle;
callback(null);
});
};
Executer.prototype.end = function(){
if (this._client) {
var self = this;
if (! this._sessionHandle) {
this._connection.end();
return;
}
var closeReq = new TTypes.TCloseSessionReq({sessionHandle: this._sessionHandle});
this._client.CloseSession(closeReq, function(){ self._connection.end(); });
}
};
Executer.prototype.supports = function(operation){
switch (operation) {
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'partitions':
case 'describe':
case 'execute':
return true;
}
throw "unknown operation name (for hiveserver2.Executer):" + operation;
};
Executer.prototype.jobname = function(queryid){
return 'shib-hs2-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
if (!setups || setups.length < 1) {
callback(null); return;
}
var self = this;
var client = this._client;
var setupQueue = setups.concat(); // shallow copy of Array to use as queue
var executeSetup = function(queue, callback){
var q = queue.shift();
// Executer.prototype.execute = function(jobname, dbname, query, callback){ ... }
self.execute(null, null, q, function(err, fetcher){
if (err) { callback(err); return; }
fetcher.waitInterval = OperationStatusPollingInterval;
fetcher.fetch(null,function(err,rows){
if (err) { callback(err); return; }
if (queue.length > 0)
executeSetup(queue, callback);
else
callback(null);
});
});
};
this._inSession(function(err){
if (err){ callback(err); return; }
executeSetup(setupQueue, callback);
});
};
Executer.prototype.databases = function(callback){
var self = this;
var client = this._client;
this._inSession(function(err){
if (err) { callback(err); return; }
// TGetSchemasReq(sessionHandle, catalogName, schemaName)
var reqSpec = {sessionHandle:self._sessionHandle};
var req = new TTypes.TGetSchemasReq(reqSpec);
client.GetSchemas(req, function(err, res){
if (err) { callback(err); return; }
if (! res['operationHandle']) {
self.logger.error("operationHandle missing for schemas");
callback({message:"operationHandle missing for schemas"});
return;
}
// fetch operation fesult
var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);
fetcher.fetch(null, function(err, result){
if (err) { callback(err); return; }
var dbnames = result.map(function(line){ return line.split('\t')[0]; }); // DBNAME\tCATALOG ?
callback(null, dbnames);
});
});
});
};
Executer.prototype.tables = function(dbname, callback){
var self = this;
var client = this._client;
this._inSession(function(err){
if (err) { callback(err); return; }
// TGetTablesReq(sessionHandle, catalogName, schemaName, tableName, tableTypes)
var reqSpec = {sessionHandle:self._sessionHandle};
if (dbname && dbname !== '')
reqSpec['schemaName'] = dbname;
var req = new TTypes.TGetTablesReq(reqSpec);
client.GetTables(req, function(err, res){
if (err) { callback(err); return; }
if (! res['operationHandle']) {
self.logger.error("operationHandle missing for tables");
callback({message:"operationHandle missing for tables"});
return;
}
// fetch operation fesult
var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);
fetcher.fetch(null, function(err, result){
if (err) { callback(err); return; }
/*
* catalog(?), dbname, tablename, tabletype, remarks(comment)
var result = [
'\tdefault\taccess_log\tMANAGED_TABLE\tNULL',
'\tdefault\tapplog\tMANAGED_TABLE\tNULL',
'\tdefault\tapplogdev\tMANAGED_TABLE\tNULL',
'\tdefault\thourly_log\tMANAGED_TABLE\tNULL',
'\tdefault\tpageviews\tMANAGED_TABLE\tNULL',
'\tdefault\takamai\tMANAGED_TABLE\tNULL',
'\tdefault\takamai_tmp\tMANAGED_TABLE\tNULL'
];
*/
var tables = result.map(function(line){ return line.split('\t')[2]; });
callback(null, tables);
});
});
});
};
Executer.prototype.partitions = function(dbname, tablename, callback){
var self = this;
var client = this._client;
var statement = 'show partitions ' + tablename;
this.execute(null, dbname, statement, function(err, fetcher){
if (err) { callback(err); return; }
fetcher.waitInterval = OperationStatusPollingInterval;
fetcher.fetch(null, function(err, result){
if (err) { callback(err); return; }
callback(null, result);
});
});
};
Executer.prototype.describe = function(dbname, tablename, callback){
var self = this;
var client = this._client;
this._inSession(function(err){
if (err) { callback(err); return; }
// TGetColumnsReq(sessionHandle, catalogName, schemaName, tableName, columnName)
var reqSpec = {sessionHandle:self._sessionHandle, tableName:tablename};
if (dbname && dbname !== '')
reqSpec['schemaName'] = dbname;
var req = new TTypes.TGetColumnsReq(reqSpec);
client.GetColumns(req, function(err, res){
if (err) { callback(err); return; }
if (! res['operationHandle']) {
self.logger.error("operationHandle missing for describe");
callback({message:"operationHandle missing for describe"});
return;
}
// fetch operation fesult
var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);
fetcher.fetch(null, function(err, result){
if (err) { callback(err); return; }
/*
* result: array of string, tab separated values of these.
NULL default logs hhmmss 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 1 YES NULL NULL NULL NULL NO
NULL default logs vhost 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 2 YES NULL NULL NULL NULL NO
NULL default logs path 12 STRING 2147483647 NULL NULL NULL 1 with query NULL NULL NULL NULL 3 YES NULL NULL NULL NULL NO
NULL default logs method 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 4 YES NULL NULL NULL NULL NO
NULL default logs status 5 SMALLINT 5 NULL 0 10 1 NULL NULL NULL NULL NULL 5 YES NULL NULL NULL NULL NO
NULL default logs bytes -5 BIGINT 19 NULL 0 10 1 NULL NULL NULL NULL NULL 6 YES NULL NULL NULL NULL NO
NULL default logs duration -5 BIGINT 19 NULL 0 10 1 micro sec NULL NULL NULL NULL 7 YES NULL NULL NULL NULL NO
NULL default logs referer 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 8 YES NULL NULL NULL NULL NO
NULL default logs rhost 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 9 YES NULL NULL NULL NULL NO
NULL default logs agent 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 10 YES NULL NULL NULL NULL NO
NULL default logs flag 16 BOOLEAN NULL NULL 0 NULL 1 pageviews NULL NULL NULL NULL 11 YES NULL NULL NULL NULL NO
NULL default logs service 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 12 YES NULL NULL NULL NULL NO
NULL default logs yyyymmdd 12 STRING 2147483647 NULL NULL NULL 1 NULL NULL NULL NULL NULL 13 YES NULL NULL NULL NULL NO
(0)catalog, (1)schema, (2)table, (3)field, (4)typeNum?, (5)type, (6)maxChars?, (7)NULL,
(8)?, (9)?, (10)1(?), (11)comment, (12-15)NULL, (16)index, (17)YES(nullable?), (18-21)NULL, (22)NO?
*/
var fields = result.map(function(row){
var cols = row.split('\t');
return [ cols[3], cols[5], (cols[11] === 'NULL' ? '' : cols[11]) ];
});
callback(null, fields);
});
});
});
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
var self = this;
var client = this._client;
/* confOverlay argument of TExecuteStatementReq doesn't works with 'mapred.job.name' and 'mapreduce.job.name' ... */
var setups = [];
if (dbname && dbname !== '') {
setups.push('use ' + dbname);
}
if (jobname && jobname !== '') {
setups.push('set mapred.job.name=' + jobname);
setups.push('set mapreduce.job.name=' + jobname);
}
this._inSession(function(err){
if (err) { callback(err); return; }
self.setup(setups, function(err){
if (err) { callback(err); return; }
var executeReq = new TTypes.TExecuteStatementReq({sessionHandle:self._sessionHandle, statement:query});
client.ExecuteStatement(executeReq, function(err, res){
if (err) { callback(err); return; }
/*
ttypes.TStatusCode = {
'SUCCESS_STATUS' : 0,
'SUCCESS_WITH_INFO_STATUS' : 1,
'STILL_EXECUTING_STATUS' : 2,
'ERROR_STATUS' : 3,
'INVALID_HANDLE_STATUS' : 4
};
ttypes.TOperationState = {
'INITIALIZED_STATE' : 0,
'RUNNING_STATE' : 1,
'FINISHED_STATE' : 2,
'CANCELED_STATE' : 3,
'CLOSED_STATE' : 4,
'ERROR_STATE' : 5,
'UKNOWN_STATE' : 6
};
*/
if (!res || !res['status'] || res.status['statusCode'] !== TTypes.TStatusCode['SUCCESS_STATUS']) {
self.logger.warn("Failed to execute statement", {query:query, res:res});
callback({message:"Failed to execute statement:" + res.status.errorMessage});
/*
var resExample1 = { status:
{ statusCode: 3,
infoMessages: null,
sqlState: '08S01',
errorCode: 1,
errorMessage: 'Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask' },
operationHandle: null
};
*/
return;
}
if (! res['operationHandle']) {
self.logger.error("operationHandle missing for query");
callback({message:"operationHandle missing for query"});
return;
}
if (jobname)
runningOperations[jobname] = {jobname: jobname, handle: res.operationHandle, startedAt: new Date()};
var fetcher = new Fetcher(client, jobname, res.operationHandle, self._maxRows);
fetcher.waitInterval = QueryStatusPollingInterval;
callback(null, fetcher);
});
});
});
};
var Fetcher = function(client, jobname, operationHandle, maxRows){
this._client = client;
this._jobname = jobname;
this._oph = operationHandle;
this._opStatus = null;
this._noMoreResults = false;
this._maxRows = maxRows;
this.waitInterval = OperationStatusPollingInterval;
this._typeName = function(num) {
// ttypes.TTypeId = {
switch (num) {
case 0: return 'boolean'; // 'BOOLEAN_TYPE' : 0,
case 1: return 'tinyint'; // 'TINYINT_TYPE' : 1,
case 2: return 'smallint'; // 'SMALLINT_TYPE' : 2,
case 3: return 'int'; // 'INT_TYPE' : 3,
case 4: return 'bigint'; // 'BIGINT_TYPE' : 4,
case 5: return 'float'; // 'FLOAT_TYPE' : 5,
case 6: return 'double'; // 'DOUBLE_TYPE' : 6,
case 7: return 'string'; // 'STRING_TYPE' : 7,
case 8: return 'timestamp'; // 'TIMESTAMP_TYPE' : 8,
case 9: return 'binary'; // 'BINARY_TYPE' : 9,
case 10: return 'array'; // 'ARRAY_TYPE' : 10,
case 11: return 'map'; // 'MAP_TYPE' : 11,
case 12: return 'struct'; // 'STRUCT_TYPE' : 12,
case 13: return 'union'; // 'UNION_TYPE' : 13,
case 14: return 'userdefined'; // 'USER_DEFINED_TYPE' : 14,
case 15: return 'decimal'; // 'DECIMAL_TYPE' : 15
}
// };
return "unknown(" + String(num) + ")";
};
this.schema = function(callback){
var self = this;
var req = new TTypes.TGetResultSetMetadataReq({operationHandle: this._oph});
this._client.GetResultSetMetadata(req, function(err,res){
if (err) { callback(err); return; }
//TODO: res.status ?
var result = res.schema.columns.map(function(c){
var colname = c.columnName;
var coltypeNum = c.typeDesc["types"][0]["primitiveEntry"]["type"];
return {name:colname, type:self._typeName(coltypeNum)};
});
callback(null, result);
/* res.schema
{
"columns": [
{ "columnName": "service",
"typeDesc": {
"types": [
{ "primitiveEntry": { "type": 7 },
"arrayEntry": null,
"mapEntry": null,
"structEntry": null,
"unionEntry": null,
"userDefinedTypeEntry": null }
]
},
"position": 1,
"comment": null
},
{ "columnName": "cnt",
"typeDesc": {
"types": [
{ "primitiveEntry": { "type": 4 },
"arrayEntry": null,
"mapEntry": null,
"structEntry": null,
"unionEntry": null,
"userDefinedTypeEntry": null
}
]
},
"position": 2,
"comment": null
}
]
}
*/
});
};
// stringify value of each columns
this._colValue = function(obj) {
/*
colVals = [
{ "boolVal": null, "byteVal": null, "i16Val": null, "i32Val": null, "i64Val": null, "doubleVal": null,
"stringVal": { "value": "blog" } },
{ "boolVal": null, "byteVal": null, "i16Val": null, "i32Val": null,
"i64Val": { "value": { "buffer": [0, 0, 0, 0, 63, 218, 72, 34], "offset": 0 } },
"doubleVal": null, "stringVal": null },
{ "boolVal": { "value": false },
"byteVal": null, "i16Val": null, "i32Val": null, "i64Val": null, "doubleVal": null, "stringVal": null },
{ "boolVal": null, "byteVal": null, "i16Val": null, "i32Val": null, "i64Val": null,
"doubleVal": { "value": 0.01 },
"stringVal": null },
{ "boolVal": null, "byteVal": null, "i16Val": null,
"i32Val": { "value": 1 },
"i64Val": null, "doubleVal": null, "stringVal": null },
{ "boolVal": null, "byteVal": null, "i16Val": null, "i32Val": null, "i64Val": null, "doubleVal": null,
"stringVal": { "value": "[1, 2, 3]" } }
]
*/
var value = null;
var non_null_checker = function(object, typef) {
if (obj[typef]) {
var v = obj[typef]['value'];
if (v !== null && v !== undefined)
return true;
}
return false;
};
if (non_null_checker(obj, 'stringVal'))
return obj.stringVal.value;
if (non_null_checker(obj, 'boolVal'))
return String(obj.boolVal.value).toUpperCase();
// rest are numerics, or NULL
// byteVal, i16Val, i32Val, i64Val, doubleVal
if (non_null_checker(obj, 'i64Val')) // i64Val is instanceof node-int64
value = new bignumber(obj.i64Val.value.buffer.toString('hex'), 16);
else if (non_null_checker(obj, 'i32Val'))
value = obj.i32Val.value;
else if (non_null_checker(obj, 'i16Val'))
value = obj.i16Val.value;
else if (non_null_checker(obj, 'doubleVal'))
value = obj.doubleVal.value;
else if (non_null_checker(obj, 'byteVal'))
value = obj.byteVal.value;
if (value === null)
return 'NULL';
return value;
};
this.fetch = function(num, callback){
if (!num) {
this._fetchAll(callback);
return;
}
var fetchNum = num;
if (fetchNum > this._maxRows)
fetchNum = this._maxRows;
if (this._noMoreResults) {
callback(null, null);
this._closeOperation();
return;
}
var self = this;
this._waitComplete(function(err){
if (err) {
callback(err);
self._closeOperation();
return;
}
/*
ttypes.TFetchOrientation = {
'FETCH_NEXT' : 0,
'FETCH_PRIOR' : 1,
'FETCH_RELATIVE' : 2,
'FETCH_ABSOLUTE' : 3,
'FETCH_FIRST' : 4,
'FETCH_LAST' : 5
};
*/
var orientation = TTypes.TFetchOrientation['FETCH_NEXT'];
var req = new TTypes.TFetchResultsReq({operationHandle:self._oph, orientation:orientation, maxRows:num});
self._client.FetchResults(req, function(err, res){
if (err) {
if (res['status'])
self.logger.error('error for fetch result', res.status);
callback(err);
self._closeOperation();
return;
}
/*
"status": {
"statusCode": 0,
"infoMessages": null,
"sqlState": null,
"errorCode": null,
"errorMessage": null
},
"hasMoreRows": false,
"results": {
"startRowOffset": { "buffer": [0,0,0,0,0,0,0,0], "offset": 0 },
"rows": [
{ "colVals": [ ... ] },
{ "colVals": [ ... ] }
],
"columns": null
}
*/
/* hasMoreRows is always false !!!!!!!!!!!!!!!! */
var fetchedRows = res.results && res.results.rows || [];
var fetchedLength = fetchedRows.length;
var rows = [];
if (fetchedLength < 1) {
self._noMoreResults = true;
} else {
for (var i = 0; i < fetchedLength; i++) {
var cols = [];
var colVals = fetchedRows[i].colVals;
var colValsLength = colVals.length;
for (var j = 0; j < colValsLength; j++) {
cols.push(self._colValue(colVals[j]));
}
rows.push(cols.join("\t"));
}
}
callback(null, rows);
});
});
};
this._fetchAll = function(callback){
var r = [];
var self = this;
var fetcher = function(){
self.fetch(self._maxRows, function(err, results){
if (err) { callback(err); return; }
if (results === null || results.length < 1 || results.length === 1 && results[0].length < 1) {
callback(null, r);
return;
}
r = r.concat(results);
fetcher();
});
};
fetcher();
};
this._closeOperation = function(callback){
var req = new TTypes.TCloseOperationReq({operationHandle: this._oph});
if (this._jobname)
delete runningOperations[this._jobname];
client.CloseOperation(req, function(err, res){
if (callback) {
callback();
}
});
};
this._waitComplete = function(callback){
if (this._opStatus !== null) {
callback(null);
return;
}
var self = this;
var oph = this._oph;
var client = this._client;
var poller = function(){
var req = new TTypes.TGetOperationStatusReq({operationHandle: oph});
client.GetOperationStatus(req, function(err,res){
if (err) { callback(err); return; }
/*
ttypes.TStatusCode = {
'SUCCESS_STATUS' : 0,
'SUCCESS_WITH_INFO_STATUS' : 1,
'STILL_EXECUTING_STATUS' : 2,
'ERROR_STATUS' : 3,
'INVALID_HANDLE_STATUS' : 4
};
ttypes.TOperationState = {
'INITIALIZED_STATE' : 0,
'RUNNING_STATE' : 1,
'FINISHED_STATE' : 2,
'CANCELED_STATE' : 3,
'CLOSED_STATE' : 4,
'ERROR_STATE' : 5,
'UKNOWN_STATE' : 6
};
*/
var statusCode = res && res['operationState'];
if (statusCode === TTypes.TOperationState['INITIALIZED_STATE'] ||
statusCode === TTypes.TOperationState['RUNNING_STATE']) {
setTimeout(poller, this.waitInterval);
return;
}
self._opStatus = statusCode;
if (statusCode === TTypes.TOperationState['FINISHED_STATE']) {
callback(null);
return;
}
var msg;
if (statusCode === TTypes.TOperationState['CANCELED_STATE'])
msg = 'Query canceled';
else if (statusCode === TTypes.TOperationState['CLOSED_STATE'])
msg = 'Query closed';
else if (statusCode === TTypes.TOperationState['ERROR_STATE'])
msg = 'Query process ended with errror';
else if (statusCode === TTypes.TOperationState['UNKNOWN_STATE'])
msg = 'Query status unknown';
else
msg = 'Statement failed with unknown status:' + ' (' + String(statusCode) + ')';
callback({message:msg, status:res.status});
return;
});
};
poller();
};
};
================================================
FILE: lib/shib/engines/huahin_mrv1/index.js
================================================
var RESTClient = require('./rest').Client;
var Monitor = exports.Monitor = function(conf, logger) {
if (conf.name !== 'huahin_mrv1')
throw "monitor name mismatch for huahin_mrv1:" + conf.name;
this.logger = logger;
this._client = new RESTClient(conf.host, conf.port);
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) {
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for huahin_mrv1.Monitor):" + operation;
};
function convertStatus(status) {
// detail status object by huahin manager 0.2.2 mrv1
/*
var data = {
configuration: {
// job configuration properties. for full list, see end of this file
// ...
'hive.query.id': 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',
'hive.query.string':
'--- 3578d8d4 SELECT count(*) AS cnt FROM access_log WHERE (service=\'blog\' OR service=\'blogimg\') AND yyyymmdd=\'20130410\'',
},
groups:
{ 'File System Counters': [Object],
'Job Counters ': [Object],
'Map-Reduce Framework': [Object],
'org.apache.hadoop.hive.ql.exec.MapOperator$Counter': [Object],
'org.apache.hadoop.mapreduce.lib.input.FileInputFormatCounter': [Object] },
jobid: 'job_201304011701_1912',
name: 'shib-3578d8d4f5a1812de7a7714f5b108776',
state: 'RUNNING',
priority: 'NORMAL',
mapComplete: '89.014534%',
reduceComplete: '29.147774%',
schedulingInfo: 'NA',
startTime: 'Thu Apr 11 16:06:40 JST 2013',
trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',
jobFile: 'hdfs://namenodehaclustername/mapred/staging/hive/.staging/job_201304011701_1912/job.xml',
user: 'hive' }
*/
/*
var returnedValus = {
jobid: 'job_201304011701_1912',
name: 'shib-3578d8d4f5a1812de7a7714f5b108776',
priority: 'NORMAL',
state: 'RUNNING',
trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',
startTime: 'Thu Apr 11 2013 16:06:40 (JST)',
mapComplete: 89,
reduceComplete: 29,
hiveQueryId: 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',
hiveQueryString: 'SELECT ...'
};
*/
if (status === undefined) {
return null;
}
var retval = {};
retval['jobid'] = status['jobid'];
retval['name'] = status['name'];
retval['priority'] = status['priority'];
retval['state'] = status['state'];
retval['trackingURL'] = status['trackingURL'];
retval['startTime'] = (function(sourceDate){
// convert for `new Date(string)` acceptable format
// 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'
// [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year
var match = /^([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d\d:\d\d:\d\d) ([a-zA-Z]+) (\d+)$/.exec(sourceDate);
if (! match) { return null; }
// -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)
return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');
})(status['startTime']);
retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);
retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);
retval['hiveQueryId'] = (status['configuration'] || {})['hive.query.id'];
retval['hiveQueryString'] = (status['configuration'] || {})['hive.query.string'];
return retval;
};
Monitor.prototype.status = function(jobname, callback){
var client = this._client;
client.listAll(function(err, result){
if (err || !result) { callback(err, null); return; }
var jobid = null;
result.forEach(function(job){
if (job.name === jobname)
jobid = job.jobid;
});
if (!jobid) { callback(null, null); return; }
client.detail(jobid, function(err, data){
if (err) { callback(err); return; }
callback(null, convertStatus(data));
});
});
};
Monitor.prototype.kill = function(jobid, callback){
this._client.kill(jobid, callback);
};
/*
{ 'datanucleus.autoCreateSchema': 'true',
'datanucleus.autoCreateTables': 'true',
'datanucleus.autoStartMechanismMode': 'checked',
'datanucleus.cache.level2': 'false',
'datanucleus.cache.level2.type': 'none',
'datanucleus.connectionPoolingType': 'DBCP',
'datanucleus.fixedDatastore': 'true',
'datanucleus.identifierFactory': 'datanucleus',
'datanucleus.plugin.pluginRegistryBundleCheck': 'LOG',
'datanucleus.storeManagerType': 'rdbms',
'datanucleus.transactionIsolation': 'repeatable-read',
'datanucleus.validateColumns': 'false',
'datanucleus.validateConstraints': 'false',
'datanucleus.validateTables': 'false',
'datanucleus.valuegeneration.transactionIsolation': 'repeatable-read',
'dfs.block.access.key.update.interval': '600',
'dfs.block.access.token.enable': 'false',
'dfs.block.access.token.lifetime': '600',
'dfs.blockreport.initialDelay': '0',
'dfs.blockreport.intervalMsec': '21600000',
'dfs.blocksize': '256m',
'dfs.bytes-per-checksum': '512',
'dfs.client-write-packet-size': '65536',
'dfs.client.block.write.replace-datanode-on-failure.enable': 'true',
'dfs.client.block.write.replace-datanode-on-failure.policy': 'DEFAULT',
'dfs.client.block.write.retries': '3',
'dfs.client.failover.connection.retries': '0',
'dfs.client.failover.connection.retries.on.timeouts': '0',
'dfs.client.failover.max.attempts': '15',
'dfs.client.failover.proxy.provider.namenodehaclustername': 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider',
'dfs.client.failover.sleep.base.millis': '500',
'dfs.client.failover.sleep.max.millis': '15000',
'dfs.client.file-block-storage-locations.num-threads': '10',
'dfs.client.file-block-storage-locations.timeout': '60',
'dfs.client.https.keystore.resource': 'ssl-client.xml',
'dfs.client.https.need-auth': 'false',
'dfs.client.use.datanode.hostname': 'false',
'dfs.datanode.address': '0.0.0.0:50010',
'dfs.datanode.balance.bandwidthPerSec': '3145728',
'dfs.datanode.data.dir': 'file:///var/hadoop/disk01/dfs/dn, file:///var/hadoop/disk02/dfs/dn, file:///var/hadoop/disk03/dfs/dn, file:///var/hadoop/disk04/dfs/dn',
'dfs.datanode.data.dir.perm': '700',
'dfs.datanode.directoryscan.interval': '21600',
'dfs.datanode.directoryscan.threads': '1',
'dfs.datanode.dns.interface': 'default',
'dfs.datanode.dns.nameserver': 'default',
'dfs.datanode.drop.cache.behind.reads': 'false',
'dfs.datanode.drop.cache.behind.writes': 'false',
'dfs.datanode.du.reserved': '10737418240',
'dfs.datanode.failed.volumes.tolerated': '0',
'dfs.datanode.handler.count': '10',
'dfs.datanode.hdfs-blocks-metadata.enabled': 'true',
'dfs.datanode.http.address': '0.0.0.0:50075',
'dfs.datanode.https.address': '0.0.0.0:50475',
'dfs.datanode.ipc.address': '0.0.0.0:50020',
'dfs.datanode.max.transfer.threads': '8192',
'dfs.datanode.readahead.bytes': '4193404',
'dfs.datanode.sync.behind.writes': 'false',
'dfs.datanode.use.datanode.hostname': 'false',
'dfs.default.chunk.view.size': '32768',
'dfs.domain.socket.path': '/var/run/hadoop-hdfs/dn._PORT',
'dfs.encrypt.data.transfer': 'false',
'dfs.ha.automatic-failover.enabled': 'false',
'dfs.ha.fencing.methods': 'shell(/bin/true)',
'dfs.ha.fencing.ssh.connect-timeout': '30000',
'dfs.ha.log-roll.period': '120',
'dfs.ha.namenodes.namenodehaclustername': 'master01,master02',
'dfs.ha.tail-edits.period': '60',
'dfs.heartbeat.interval': '3',
'dfs.https.enable': 'false',
'dfs.https.server.keystore.resource': 'ssl-server.xml',
'dfs.image.compress': 'false',
'dfs.image.compression.codec': 'org.apache.hadoop.io.compress.DefaultCodec',
'dfs.image.transfer.bandwidthPerSec': '0',
'dfs.journalnode.edits.dir': '/var/hadoop/disk01/dfs/jn',
'dfs.journalnode.http-address': '0.0.0.0:8480',
'dfs.journalnode.rpc-address': '0.0.0.0:8485',
'dfs.namenode.accesstime.precision': '3600000',
'dfs.namenode.audit.loggers': 'default',
'dfs.namenode.backup.address': '0.0.0.0:50100',
'dfs.namenode.backup.http-address': '0.0.0.0:50105',
'dfs.namenode.checkpoint.check.period': '3600',
'dfs.namenode.checkpoint.dir': 'file:///var/hadoop/tmp/cache/dfs',
'dfs.namenode.checkpoint.edits.dir': 'file:///var/hadoop/tmp/cache/dfs',
'dfs.namenode.checkpoint.period': '3600',
'dfs.namenode.checkpoint.txns': '40000',
'dfs.namenode.decommission.interval': '30',
'dfs.namenode.decommission.nodes.per.interval': '5',
'dfs.namenode.delegation.key.update-interval': '86400000',
'dfs.namenode.delegation.token.max-lifetime': '604800000',
'dfs.namenode.delegation.token.renew-interval': '86400000',
'dfs.namenode.edits.dir': '${dfs.namenode.name.dir}',
'dfs.namenode.edits.journal-plugin.qjournal': 'org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager',
'dfs.namenode.fs-limits.max-component-length': '0',
'dfs.namenode.fs-limits.max-directory-items': '0',
'dfs.namenode.handler.count': '20',
'dfs.namenode.http-address': '0.0.0.0:50070',
'dfs.namenode.http-address.namenodehaclustername.master01': 'master01.hadoop.local:50070',
'dfs.namenode.http-address.namenodehaclustername.master02': 'master02.hadoop.local:50070',
'dfs.namenode.https-address': '0.0.0.0:50470',
'dfs.namenode.invalidate.work.pct.per.iteration': '0.32f',
'dfs.namenode.kerberos.internal.spnego.principal': '${dfs.web.authentication.kerberos.principal}',
'dfs.namenode.logging.level': 'info',
'dfs.namenode.max.extra.edits.segments.retained': '10000',
'dfs.namenode.max.objects': '0',
'dfs.namenode.name.dir': 'file:///var/hadoop/disk01/dfs/nn',
'dfs.namenode.name.dir.restore': 'false',
'dfs.namenode.num.checkpoints.retained': '2',
'dfs.namenode.num.extra.edits.retained': '1000000',
'dfs.namenode.replication.considerLoad': 'true',
'dfs.namenode.replication.interval': '3',
'dfs.namenode.replication.min': '1',
'dfs.namenode.replication.work.multiplier.per.iteration': '2',
'dfs.namenode.rpc-address.namenodeclustername.master01': 'master01.hadoop.local:8020',
'dfs.namenode.rpc-address.namenodeclustername.master02': 'master02.hadoop.local:8020',
'dfs.namenode.safemode.extension': '30000',
'dfs.namenode.safemode.min.datanodes': '0',
'dfs.namenode.safemode.threshold-pct': '0.999f',
'dfs.namenode.secondary.http-address': '0.0.0.0:50090',
'dfs.namenode.shared.edits.dir': 'qjournal://journalnode01.hadoop.local:8485;journalnode02.hadoop.local:8485;journalnode03.hadoop.local:8485/mycluster',
'dfs.namenode.support.allow.format': 'true',
'dfs.nameservices': 'namenodehaclustername',
'dfs.permissions.enabled': 'false',
'dfs.permissions.superusergroup': 'hadoop',
'dfs.replication': '3',
'dfs.replication.max': '512',
'dfs.secondary.namenode.kerberos.internal.spnego.principal': '${dfs.web.authentication.kerberos.principal}',
'dfs.stream-buffer-size': '4096',
'dfs.support.append': 'true',
'dfs.webhdfs.enabled': 'true',
'file.blocksize': '67108864',
'file.bytes-per-checksum': '512',
'file.client-write-packet-size': '65536',
'file.replication': '1',
'file.stream-buffer-size': '4096',
'fs.AbstractFileSystem.file.impl': 'org.apache.hadoop.fs.local.LocalFs',
'fs.AbstractFileSystem.hdfs.impl': 'org.apache.hadoop.fs.Hdfs',
'fs.AbstractFileSystem.viewfs.impl': 'org.apache.hadoop.fs.viewfs.ViewFs',
'fs.automatic.close': 'true',
'fs.defaultFS': 'hdfs://namenodehaclustername',
'fs.df.interval': '60000',
'fs.ftp.host': '0.0.0.0',
'fs.ftp.host.port': '21',
'fs.har.impl': 'org.apache.hadoop.hive.shims.HiveHarFileSystem',
'fs.permissions.umask-mode': '022',
'fs.s3.block.size': '67108864',
'fs.s3.buffer.dir': '${hadoop.tmp.dir}/s3',
'fs.s3.maxRetries': '4',
'fs.s3.sleepTimeSeconds': '10',
'fs.s3n.block.size': '67108864',
'fs.trash.checkpoint.interval': '0',
'fs.trash.interval': '0',
'ftp.blocksize': '67108864',
'ftp.bytes-per-checksum': '512',
'ftp.client-write-packet-size': '65536',
'ftp.replication': '3',
'ftp.stream-buffer-size': '4096',
'group.name': 'hive',
'ha.failover-controller.cli-check.rpc-timeout.ms': '20000',
'ha.failover-controller.graceful-fence.connection.retries': '1',
'ha.failover-controller.graceful-fence.rpc-timeout.ms': '5000',
'ha.failover-controller.new-active.rpc-timeout.ms': '60000',
'ha.health-monitor.check-interval.ms': '1000',
'ha.health-monitor.connect-retry-interval.ms': '1000',
'ha.health-monitor.rpc-timeout.ms': '45000',
'ha.health-monitor.sleep-after-disconnect.ms': '1000',
'ha.zookeeper.acl': 'world:anyone:rwcda',
'ha.zookeeper.parent-znode': '/hadoop-ha',
'ha.zookeeper.quorum': 'jornalnode01.hadoop.local,journalnode02.hadoop.local,journalnode03.hadoop.local',
'ha.zookeeper.session-timeout.ms': '5000',
'hadoop.bin.path': '//usr/lib/hadoop/bin/hadoop',
'hadoop.common.configuration.version': '0.23.0',
'hadoop.conf.dir': '/etc/hadoop/conf',
'hadoop.fuse.connection.timeout': '300',
'hadoop.fuse.timer.period': '5',
'hadoop.hdfs.configuration.version': '1',
'hadoop.http.authentication.kerberos.keytab': '${user.home}/hadoop.keytab',
'hadoop.http.authentication.kerberos.principal': 'HTTP/_HOST@LOCALHOST',
'hadoop.http.authentication.signature.secret.file': '${user.home}/hadoop-http-auth-signature-secret',
'hadoop.http.authentication.simple.anonymous.allowed': 'true',
'hadoop.http.authentication.token.validity': '36000',
'hadoop.http.authentication.type': 'simple',
'hadoop.http.filter.initializers': 'org.apache.hadoop.http.lib.StaticUserWebFilter',
'hadoop.http.staticuser.user': 'webuser,webgroup',
'hadoop.jetty.logs.serve.aliases': 'true',
'hadoop.job.history.location': '/mrv1-history',
'hadoop.kerberos.kinit.command': 'kinit',
'hadoop.proxyuser.httpfs.groups': '*',
'hadoop.proxyuser.httpfs.hosts': '*',
'hadoop.relaxed.worker.version.check': 'true',
'hadoop.rpc.protection': 'authentication',
'hadoop.rpc.socket.factory.class.default': 'org.apache.hadoop.net.StandardSocketFactory',
'hadoop.security.authentication': 'simple',
'hadoop.security.authorization': 'false',
'hadoop.security.group.mapping': 'org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback',
'hadoop.security.group.mapping.ldap.search.attr.group.name': 'cn',
'hadoop.security.group.mapping.ldap.search.attr.member': 'member',
'hadoop.security.group.mapping.ldap.search.filter.group': '(objectClass=group)',
'hadoop.security.group.mapping.ldap.search.filter.user': '(&(objectClass=user)(sAMAccountName={0}))',
'hadoop.security.group.mapping.ldap.ssl': 'false',
'hadoop.security.groups.cache.secs': '300',
'hadoop.security.instrumentation.requires.admin': 'false',
'hadoop.security.uid.cache.secs': '14400',
'hadoop.skip.worker.version.check': 'false',
'hadoop.ssl.client.conf': 'ssl-client.xml',
'hadoop.ssl.enabled': 'false',
'hadoop.ssl.hostname.verifier': 'DEFAULT',
'hadoop.ssl.keystores.factory.class': 'org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory',
'hadoop.ssl.require.client.cert': 'false',
'hadoop.ssl.server.conf': 'ssl-server.xml',
'hadoop.tmp.dir': '/var/hadoop/tmp/${user.name}',
'hadoop.util.hash.type': 'murmur',
'hadoop.work.around.non.threadsafe.getpwuid': 'false',
'hive.added.jars.path': 'file:///home/user/woothee.jar,file:///usr/lib/hive/lib/hive-builtins-0.10.0-cdh4.2.0.jar',
'hive.archive.enabled': 'false',
'hive.archive.har.parentdir.settable': 'true',
'hive.auto.convert.join': 'false',
'hive.auto.progress.timeout': '0',
'hive.autogen.columnalias.prefix.includefuncname': 'false',
'hive.autogen.columnalias.prefix.label': '_c',
'hive.binary.record.max.length': '1000',
'hive.cli.errors.ignore': 'false',
'hive.cli.print.current.db': 'false',
'hive.cli.print.header': 'false',
'hive.cli.prompt': 'hive',
'hive.cluster.delegation.token.store.class': 'org.apache.hadoop.hive.thrift.MemoryTokenStore',
'hive.cluster.delegation.token.store.zookeeper.znode': '/hive/cluster/delegation',
'hive.conf.validation': 'true',
'hive.debug.localtask': 'false',
'hive.default.fileformat': 'TextFile',
'hive.downloaded.resources.dir': '/tmp/hive/hive_resources',
'hive.enforce.bucketing': 'false',
'hive.enforce.bucketmapjoin': 'false',
'hive.enforce.sorting': 'false',
'hive.enforce.sortmergebucketmapjoin': 'false',
'hive.entity.separator': '@',
'hive.error.on.empty.partition': 'false',
'hive.exec.compress.intermediate': 'false',
'hive.exec.compress.output': 'true',
'hive.exec.concatenate.check.index': 'true',
'hive.exec.counters.pull.interval': '1000',
'hive.exec.default.partition.name': '__HIVE_DEFAULT_PARTITION__',
'hive.exec.drop.ignorenonexistent': 'true',
'hive.exec.dynamic.partition': 'false',
'hive.exec.dynamic.partition.mode': 'strict',
'hive.exec.job.debug.capture.stacktraces': 'true',
'hive.exec.job.debug.timeout': '30000',
'hive.exec.list.bucketing.default.dir': 'HIVE_DEFAULT_LIST_BUCKETING_DIR_NAME',
'hive.exec.local.scratchdir': '/tmp/hive',
'hive.exec.max.created.files': '100000',
'hive.exec.max.dynamic.partitions': '1000',
'hive.exec.max.dynamic.partitions.pernode': '100',
'hive.exec.mode.local.auto': 'false',
'hive.exec.mode.local.auto.input.files.max': '4',
'hive.exec.mode.local.auto.inputbytes.max': '134217728',
'hive.exec.parallel': 'true',
'hive.exec.parallel.thread.number': '8',
'hive.exec.perf.logger': 'org.apache.hadoop.hive.ql.log.PerfLogger',
'hive.exec.plan': 'hdfs://namenodehaclustername/tmp/hive-hive/hive_2013-04-11_16-06-38_373_6837539457494191559/-mr-10003/ef2e8dfd-6717-4969-a599-42708098c616',
'hive.exec.rcfile.use.explicit.header': 'true',
'hive.exec.reducers.bytes.per.reducer': '1000000000',
'hive.exec.reducers.max': '30',
'hive.exec.rowoffset': 'false',
'hive.exec.scratchdir': '/tmp/hive-${user.name}',
'hive.exec.script.allow.partial.consumption': 'false',
'hive.exec.script.maxerrsize': '100000',
'hive.exec.script.trust': 'false',
'hive.exec.show.job.failure.debug.info': 'true',
'hive.exec.submitviachild': 'false',
'hive.exec.tasklog.debug.timeout': '20000',
'hive.exim.uri.scheme.whitelist': 'hdfs,pfile',
'hive.fetch.output.serde': 'org.apache.hadoop.hive.serde2.DelimitedJSONSerDe',
'hive.fetch.task.conversion': 'minimal',
'hive.fileformat.check': 'true',
'hive.groupby.mapaggr.checkinterval': '100000',
'hive.groupby.skewindata': 'false',
'hive.hadoop.supports.splittable.combineinputformat': 'false',
'hive.hashtable.initialCapacity': '100000',
'hive.hashtable.loadfactor': '0.75',
'hive.hbase.wal.enabled': 'true',
'hive.heartbeat.interval': '1000',
'hive.hmshandler.force.reload.conf': 'false',
'hive.hmshandler.retry.attempts': '1',
'hive.hmshandler.retry.interval': '1000',
'hive.hwi.listen.host': '0.0.0.0',
'hive.hwi.listen.port': '9999',
'hive.index.compact.binary.search': 'true',
'hive.index.compact.file.ignore.hdfs': 'false',
'hive.index.compact.query.max.entries': '10000000',
'hive.index.compact.query.max.size': '10737418240',
'hive.input.format': 'org.apache.hadoop.hive.ql.io.CombineHiveInputFormat',
'hive.input.format.sorted': 'false',
'hive.insert.into.external.tables': 'true',
'hive.insert.into.multilevel.dirs': 'false',
'hive.internal.ddl.list.bucketing.enable': 'false',
'hive.jobname.length': '50',
'hive.join.cache.size': '25000',
'hive.join.emit.interval': '1000',
'hive.limit.optimize.enable': 'false',
'hive.limit.optimize.fetch.max': '50000',
'hive.limit.optimize.limit.file': '10',
'hive.limit.row.max.size': '100000',
'hive.lock.manager': 'org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager',
'hive.lock.mapred.only.operation': 'false',
'hive.lock.numretries': '100',
'hive.lock.sleep.between.retries': '60',
'hive.lockmgr.zookeeper.default.partition.name': '__HIVE_DEFAULT_ZOOKEEPER_PARTITION__',
'hive.map.aggr': 'true',
'hive.map.aggr.hash.force.flush.memory.threshold': '0.9',
'hive.map.aggr.hash.min.reduction': '0.5',
'hive.map.aggr.hash.percentmemory': '0.5',
'hive.map.groupby.sorted': 'false',
'hive.mapjoin.bucket.cache.size': '100',
'hive.mapjoin.cache.numrows': '25000',
'hive.mapjoin.check.memory.rows': '100000',
'hive.mapjoin.followby.gby.localtask.max.memory.usage': '0.55',
'hive.mapjoin.followby.map.aggr.hash.percentmemory': '0.3',
'hive.mapjoin.localtask.max.memory.usage': '0.9',
'hive.mapjoin.size.key': '10000',
'hive.mapjoin.smalltable.filesize': '25000000',
'hive.mapper.cannot.span.multiple.partitions': 'false',
'hive.mapred.local.mem': '0',
'hive.mapred.mode': 'nonstrict',
'hive.mapred.partitioner': 'org.apache.hadoop.hive.ql.io.DefaultHivePartitioner',
'hive.mapred.reduce.tasks.speculative.execution': 'true',
'hive.mapred.supports.subdirectories': 'false',
'hive.merge.current.job.has.dynamic.partitions': 'false',
'hive.merge.input.format.block.level': 'org.apache.hadoop.hive.ql.io.rcfile.merge.RCFileBlockMergeInputFormat',
'hive.merge.mapfiles': 'true',
'hive.merge.mapredfiles': 'false',
'hive.merge.rcfile.block.level': 'true',
'hive.merge.size.per.task': '256000000',
'hive.merge.smallfiles.avgsize': '16000000',
'hive.mergejob.maponly': 'true',
'hive.metadata.move.exported.metadata.to.trash': 'true',
'hive.metastore.archive.intermediate.archived': '_INTERMEDIATE_ARCHIVED',
'hive.metastore.archive.intermediate.extracted': '_INTERMEDIATE_EXTRACTED',
'hive.metastore.archive.intermediate.original': '_INTERMEDIATE_ORIGINAL',
'hive.metastore.authorization.storage.checks': 'false',
'hive.metastore.batch.retrieve.max': '300',
'hive.metastore.batch.retrieve.table.partition.max': '1000',
'hive.metastore.cache.pinobjtypes': 'Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order',
'hive.metastore.client.connect.retry.delay': '1',
'hive.metastore.client.socket.timeout': '20',
'hive.metastore.connect.retries': '3',
'hive.metastore.ds.retry.attempts': '1',
'hive.metastore.ds.retry.interval': '1000',
'hive.metastore.event.clean.freq': '0',
'hive.metastore.event.expiry.duration': '0',
'hive.metastore.execute.setugi': 'false',
'hive.metastore.failure.retries': '1',
'hive.metastore.force.reload.conf': 'false',
'hive.metastore.fs.handler.class': 'org.apache.hadoop.hive.metastore.HiveMetaStoreFsImpl',
'hive.metastore.kerberos.principal': 'hive-metastore/_HOST@EXAMPLE.COM',
'hive.metastore.rawstore.impl': 'org.apache.hadoop.hive.metastore.ObjectStore',
'hive.metastore.sasl.enabled': 'false',
'hive.metastore.server.max.threads': '100000',
'hive.metastore.server.min.threads': '200',
'hive.metastore.server.tcp.keepalive': 'true',
'hive.metastore.thrift.framed.transport.enabled': 'false',
'hive.metastore.warehouse.dir': '/shib/warehouse',
'hive.multi.insert.move.tasks.share.dependencies': 'false',
'hive.multigroupby.singlereducer': 'true',
'hive.optimize.bucketmapjoin': 'false',
'hive.optimize.bucketmapjoin.sortedmerge': 'false',
'hive.optimize.cp': 'true',
'hive.optimize.groupby': 'true',
'hive.optimize.index.autoupdate': 'false',
'hive.optimize.index.filter': 'false',
'hive.optimize.index.filter.compact.maxsize': '-1',
'hive.optimize.index.filter.compact.minsize': '5368709120',
'hive.optimize.index.groupby': 'false',
'hive.optimize.listbucketing': 'false',
'hive.optimize.metadataonly': 'true',
'hive.optimize.ppd': 'true',
'hive.optimize.ppd.storage': 'true',
'hive.optimize.reducededuplication': 'true',
'hive.optimize.skewjoin': 'false',
'hive.optimize.skewjoin.compiletime': 'false',
'hive.optimize.union.remove': 'false',
'hive.outerjoin.supports.filters': 'true',
'hive.ppd.recognizetransivity': 'true',
'hive.ppd.remove.duplicatefilters': 'true',
'hive.query.id': 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',
'hive.query.result.fileformat': 'TextFile',
'hive.query.string': '--- 3578d8d4 SELECT count(*) AS cnt FROM access_log WHERE (service=\'blog\' OR service=\'blogimg\') AND yyyymmdd=\'20130410\'',
'hive.querylog.enable.plan.progress': 'true',
'hive.querylog.location': '/tmp/hive',
'hive.querylog.plan.progress.interval': '60000',
'hive.rework.mapredwork': 'false',
'hive.sample.seednumber': '0',
'hive.script.auto.progress': 'false',
'hive.script.operator.id.env.var': 'HIVE_SCRIPT_OPERATOR_ID',
'hive.script.operator.truncate.env': 'false',
'hive.script.recordreader': 'org.apache.hadoop.hive.ql.exec.TextRecordReader',
'hive.script.recordwriter': 'org.apache.hadoop.hive.ql.exec.TextRecordWriter',
'hive.script.serde': 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe',
'hive.security.authenticator.manager': 'org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator',
'hive.security.authorization.enabled': 'false',
'hive.security.authorization.manager': 'org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider',
'hive.security.metastore.authenticator.manager': 'org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator',
'hive.security.metastore.authorization.manager': 'org.apache.hadoop.hive.ql.security.authorization.DefaultHiveMetastoreAuthorizationProvider',
'hive.server.read.socket.timeout': '10',
'hive.server.tcp.keepalive': 'true',
'hive.server2.authentication': 'NONE',
'hive.server2.enable.impersonation': 'false',
'hive.server2.thrift.max.worker.threads': '100',
'hive.server2.thrift.min.worker.threads': '5',
'hive.server2.thrift.port': '10000',
'hive.session.id': 'hive_201304111606',
'hive.session.silent': 'false',
'hive.skewjoin.key': '100000',
'hive.skewjoin.mapjoin.map.tasks': '10000',
'hive.skewjoin.mapjoin.min.split': '33554432',
'hive.start.cleanup.scratchdir': 'false',
'hive.stats.atomic': 'false',
'hive.stats.autogather': 'false',
'hive.stats.collect.rawdatasize': 'true',
'hive.stats.collect.tablekeys': 'false',
'hive.stats.dbclass': 'jdbc:derby',
'hive.stats.dbconnectionstring': 'jdbc:derby:;databaseName=TempStatsStore;create=true',
'hive.stats.jdbc.timeout': '30',
'hive.stats.jdbcdriver': 'org.apache.derby.jdbc.EmbeddedDriver',
'hive.stats.ndv.error': '20.0',
'hive.stats.reliable': 'false',
'hive.stats.retries.max': '0',
'hive.stats.retries.wait': '3000',
'hive.support.concurrency': 'false',
'hive.task.progress': 'false',
'hive.test.mode': 'false',
'hive.test.mode.prefix': 'test_',
'hive.test.mode.samplefreq': '32',
'hive.transform.escape.input': 'false',
'hive.udtf.auto.progress': 'false',
'hive.unlock.numretries': '10',
'hive.variable.substitute': 'true',
'hive.variable.substitute.depth': '40',
'hive.warehouse.subdir.inherit.perms': 'true',
'hive.zookeeper.clean.extra.nodes': 'false',
'hive.zookeeper.client.port': '2181',
'hive.zookeeper.namespace': 'hive_zookeeper_namespace',
'hive.zookeeper.session.timeout': '600000',
'io.compression.codecs': 'org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.BZip2Codec,org.apache.hadoop.io.compress.DeflateCodec,org.apache.hadoop.io.compress.SnappyCodec',
'io.file.buffer.size': '131072',
'io.map.index.interval': '128',
'io.map.index.skip': '0',
'io.mapfile.bloom.error.rate': '0.005',
'io.mapfile.bloom.size': '1048576',
'io.native.lib.available': 'true',
'io.seqfile.compress.blocksize': '1000000',
'io.seqfile.lazydecompress': 'true',
'io.seqfile.local.dir': '/path/to/seqfile/local/dir/list',
'io.seqfile.sorter.recordlimit': '1000000',
'io.serializations': 'org.apache.hadoop.io.serializer.WritableSerialization,org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization,org.apache.hadoop.io.serializer.avro.AvroReflectSerialization',
'io.skip.checksum.errors': 'false',
'io.sort.factor': '10',
'io.sort.mb': '100',
'io.sort.record.percent': '0.05',
'io.sort.spill.percent': '0.80',
'ipc.client.connect.max.retries': '10',
'ipc.client.connect.max.retries.on.timeouts': '45',
'ipc.client.connection.maxidletime': '10000',
'ipc.client.idlethreshold': '4000',
'ipc.client.kill.max': '10',
'ipc.client.tcpnodelay': 'false',
'ipc.server.listen.queue.size': '128',
'ipc.server.tcpnodelay': 'false',
'javax.jdo.PersistenceManagerFactoryClass': 'org.datanucleus.jdo.JDOPersistenceManagerFactory',
'javax.jdo.option.ConnectionDriverName': 'com.mysql.jdbc.Driver',
'javax.jdo.option.ConnectionPassword': 'HIVE',
'javax.jdo.option.ConnectionURL': 'jdbc:mysql://database.metastore.hadoo.local/metastore',
'javax.jdo.option.ConnectionUserName': 'hive',
'javax.jdo.option.DetachAllOnCommit': 'true',
'javax.jdo.option.Multithreaded': 'true',
'javax.jdo.option.NonTransactionalRead': 'true',
'job.end.retry.attempts': '0',
'job.end.retry.interval': '30000',
'jobclient.completion.poll.interval': '5000',
'jobclient.output.filter': 'FAILED',
'jobclient.progress.monitor.poll.interval': '1000',
'keep.failed.task.files': 'false',
'kfs.blocksize': '67108864',
'kfs.bytes-per-checksum': '512',
'kfs.client-write-packet-size': '65536',
'kfs.replication': '3',
'kfs.stream-buffer-size': '4096',
'local.cache.size': '10737418240',
'map.sort.class': 'org.apache.hadoop.util.QuickSort',
'mapred.acls.enabled': 'false',
'mapred.cache.files': 'hdfs://namenodehacluster/tmp/hive-hive/hive_2013-04-11_16-06-38_373_6837539457494191559/-mr-10003/ef2e8dfd-6717-4969-a599-42708098c616#HIVE_PLANef2e8dfd-6717-4969-a599-42708098c616,hdfs://namenodehacluster/mapred/staging/hive/.staging/job_201304011701_1912/libjars/woothee.jar,hdfs://namenodehaclustername/mapred/staging/hive/.staging/job_201304011701_1912/libjars/hive-builtins-0.10.0-cdh4.2.0.jar',
'mapred.cache.files.filesizes': '69754,57899,3909',
'mapred.cache.files.timestamps': '1365663998711,1365663998741,1365663998755',
'mapred.child.java.opts': '-Xmx2048m',
'mapred.child.tmp': './tmp',
'mapred.cluster.map.memory.mb': '-1',
'mapred.cluster.max.map.memory.mb': '-1',
'mapred.cluster.max.reduce.memory.mb': '-1',
'mapred.cluster.reduce.memory.mb': '-1',
'mapred.committer.job.setup.cleanup.needed': 'false',
'mapred.compress.map.output': 'false',
'mapred.create.symlink': 'yes',
'mapred.disk.healthChecker.interval': '60000',
'mapred.healthChecker.interval': '60000',
'mapred.healthChecker.script.timeout': '600000',
'mapred.heartbeats.in.second': '100',
'mapred.inmem.merge.threshold': '1000',
'mapred.input.dir': 'hdfs://namenodehacluster/shib/warehouse/access_log/service=blog/yyyymmdd=20130410,hdfs://namenodehaclustername/shib/warehouse/access_log/service=blogimg/yyyymmdd=20130410',
'mapred.input.dir.recursive': 'false',
'mapred.input.format.class': 'org.apache.hadoop.hive.ql.io.CombineHiveInputFormat',
'mapred.jar': '/mapred/staging/hive/.staging/job_201304011701_1912/job.jar',
'mapred.job.classpath.files': '/mapred/staging/hive/.staging/job_201304011701_1912/libjars/woothee.jar:/mapred/staging/hive/.staging/job_201304011701_1912/libjars/hive-builtins-0.10.0-cdh4.2.0.jar',
'mapred.job.map.memory.mb': '-1',
'mapred.job.name': 'shib-3578d8d4f5a1812de7a7714f5b108776',
'mapred.job.queue.name': 'default',
'mapred.job.reduce.input.buffer.percent': '0.0',
'mapred.job.reduce.memory.mb': '-1',
'mapred.job.restart.recover': 'true',
'mapred.job.reuse.jvm.num.tasks': '1',
'mapred.job.shuffle.input.buffer.percent': '0.70',
'mapred.job.shuffle.merge.percent': '0.66',
'mapred.job.tracker': 'master.hadoop.local:8021',
'mapred.job.tracker.handler.count': '150',
'mapred.job.tracker.http.address': 'master.hadoop.local:50030',
'mapred.job.tracker.jobhistory.lru.cache.size': '5',
'mapred.job.tracker.persist.jobstatus.active': 'false',
'mapred.job.tracker.persist.jobstatus.dir': '/jobtracker/jobsInfo',
'mapred.job.tracker.persist.jobstatus.hours': '0',
'mapred.job.tracker.retiredjobs.cache.size': '1000',
'mapred.jobtracker.completeuserjobs.maximum': '100',
'mapred.jobtracker.instrumentation': 'org.apache.hadoop.mapred.JobTrackerMetricsInst',
'mapred.jobtracker.job.history.block.size': '3145728',
'mapred.jobtracker.maxtasks.per.job': '-1',
'mapred.jobtracker.restart.recover': 'false',
'mapred.jobtracker.taskScheduler': 'org.apache.hadoop.mapred.JobQueueTaskScheduler',
'mapred.line.input.format.linespermap': '1',
'mapred.local.dir': '/mapred/local/dir/list',
'mapred.local.dir.minspacekill': '0',
'mapred.local.dir.minspacestart': '0',
'mapred.map.child.log.level': 'INFO',
'mapred.map.max.attempts': '4',
'mapred.map.output.compression.codec': 'org.apache.hadoop.io.compress.DefaultCodec',
'mapred.map.tasks': '2867',
'mapred.map.tasks.speculative.execution': 'false',
'mapred.mapoutput.key.class': 'org.apache.hadoop.hive.ql.io.HiveKey',
'mapred.mapoutput.value.class': 'org.apache.hadoop.io.BytesWritable',
'mapred.mapper.class': 'org.apache.hadoop.hive.ql.exec.ExecMapper',
'mapred.max.split.size': '256000000',
'mapred.max.tracker.blacklists': '4',
'mapred.max.tracker.failures': '4',
'mapred.merge.recordsBeforeProgress': '10000',
'mapred.min.split.size': '1',
'mapred.min.split.size.per.node': '1',
'mapred.min.split.size.per.rack': '1',
'mapred.output.committer.class': 'org.apache.hadoop.hive.shims.HadoopShimsSecure$NullOutputCommitter',
'mapred.output.compress': 'true',
'mapred.output.compression.codec': 'org.apache.hadoop.io.compress.GzipCodec',
'mapred.output.compression.type': 'BLOCK',
'mapred.output.format.class': 'org.apache.hadoop.hive.ql.io.HiveOutputFormatImpl',
'mapred.output.key.class': 'org.apache.hadoop.io.Text',
'mapred.output.value.class': 'org.apache.hadoop.io.Text',
'mapred.partitioner.class': 'org.apache.hadoop.hive.ql.io.DefaultHivePartitioner',
'mapred.queue.default.acl-administer-jobs': '*',
'mapred.queue.default.state': 'RUNNING',
'mapred.queue.names': 'default',
'mapred.reduce.child.log.level': 'INFO',
'mapred.reduce.max.attempts': '4',
'mapred.reduce.parallel.copies': '5',
'mapred.reduce.slowstart.completed.maps': '0.05',
'mapred.reduce.tasks': '1',
'mapred.reduce.tasks.speculative.execution': 'true',
'mapred.reducer.class': 'org.apache.hadoop.hive.ql.exec.ExecReducer',
'mapred.skip.attempts.to.start.skipping': '2',
'mapred.skip.map.auto.incr.proc.count': 'true',
'mapred.skip.map.max.skip.records': '0',
'mapred.skip.reduce.auto.incr.proc.count': 'true',
'mapred.skip.reduce.max.skip.groups': '0',
'mapred.submit.replication': '10',
'mapred.system.dir': '/mapred/system',
'mapred.task.cache.levels': '2',
'mapred.task.profile': 'false',
'mapred.task.profile.maps': '0-2',
'mapred.task.profile.reduces': '0-2',
'mapred.task.timeout': '600000',
'mapred.task.tracker.http.address': '0.0.0.0:50060',
'mapred.task.tracker.report.address': '127.0.0.1:0',
'mapred.task.tracker.task-controller': 'org.apache.hadoop.mapred.DefaultTaskController',
'mapred.tasktracker.dns.interface': 'default',
'mapred.tasktracker.dns.nameserver': 'default',
'mapred.tasktracker.expiry.interval': '600000',
'mapred.tasktracker.indexcache.mb': '10',
'mapred.tasktracker.instrumentation': 'org.apache.hadoop.mapred.TaskTrackerMetricsInst',
'mapred.tasktracker.map.tasks.maximum': '6',
'mapred.tasktracker.reduce.tasks.maximum': '2',
'mapred.tasktracker.taskmemorymanager.monitoring-interval': '5000',
'mapred.tasktracker.tasks.sleeptime-before-sigkill': '5000',
'mapred.temp.dir': '${hadoop.tmp.dir}/mapred/temp',
'mapred.user.jobconf.limit': '5242880',
'mapred.userlog.limit.kb': '0',
'mapred.userlog.retain.hours': '96',
'mapred.working.dir': 'hdfs://namenodeclustername/user/hive',
'mapreduce.framework.name': 'classic',
'mapreduce.ifile.readahead': 'true',
'mapreduce.ifile.readahead.bytes': '4194304',
'mapreduce.job.acl-modify-job': '',
'mapreduce.job.acl-view-job': '',
'mapreduce.job.cache.files.visibilities': 'true,false,false',
'mapreduce.job.committer.task.cleanup.needed': 'false',
'mapreduce.job.complete.cancel.delegation.tokens': 'true',
'mapreduce.job.dir': 'hdfs://namenodehaclustername/mapred/staging/hive/.staging/job_201304011701_1912',
'mapreduce.job.map.output.collector.class': 'org.apache.hadoop.mapred.MapTask$MapOutputBuffer',
'mapreduce.job.maps.speculative.execution': 'false',
'mapreduce.job.name': 'shib-3578d8d4f5a1812de7a7714f5b108776',
'mapreduce.job.reduce.shuffle.consumer.plugin.class': 'org.apache.hadoop.mapred.ReduceTask$ReduceCopier',
'mapreduce.job.reduces.speculative.execution': 'false',
'mapreduce.job.submithost': '4c3bd1118.livedoor',
'mapreduce.job.submithostaddress': '10.130.74.79',
'mapreduce.jobtracker.split.metainfo.maxsize': '10000000',
'mapreduce.jobtracker.staging.root.dir': '/mapred/staging',
'mapreduce.map.log.level': 'WARN',
'mapreduce.map.memory.mb': '1024',
'mapreduce.reduce.input.limit': '-1',
'mapreduce.reduce.log.level': 'WARN',
'mapreduce.reduce.memory.mb': '2048',
'mapreduce.reduce.shuffle.connect.timeout': '180000',
'mapreduce.reduce.shuffle.maxfetchfailures': '10',
'mapreduce.reduce.shuffle.read.timeout': '180000',
'mapreduce.shuffle.ssl.address': '0.0.0.0',
'mapreduce.shuffle.ssl.enabled': '${hadoop.ssl.enabled}',
'mapreduce.shuffle.ssl.port': '50443',
'mapreduce.tasktracker.cache.local.numberdirectories': '10000',
'mapreduce.tasktracker.outofband.heartbeat': 'false',
'net.topology.node.switch.mapping.impl': 'org.apache.hadoop.net.ScriptBasedMapping',
'net.topology.script.number.args': '100',
's3.blocksize': '67108864',
's3.bytes-per-checksum': '512',
's3.client-write-packet-size': '65536',
's3.replication': '3',
's3.stream-buffer-size': '4096',
's3native.blocksize': '67108864',
's3native.bytes-per-checksum': '512',
's3native.client-write-packet-size': '65536',
's3native.replication': '3',
's3native.stream-buffer-size': '4096',
'tasktracker.http.threads': '120',
'tfile.fs.input.buffer.size': '262144',
'tfile.fs.output.buffer.size': '262144',
'tfile.io.chunk.size': '1048576',
tmpjars: 'file:///home/user/woothee.jar,file:///usr/lib/hive/lib/hive-builtins-0.10.0-cdh4.2.0.jar',
'user.name': 'hive'
},
*/
================================================
FILE: lib/shib/engines/huahin_mrv1/rest.js
================================================
var http = require('http');
var Client = exports.Client = function(host, port){
this.host = host;
this.port = port;
};
Client.prototype.listAll = function(callback){
return this.list('all', callback);
};
Client.prototype.list = function(type, callback){
var path = '/job/list';
switch(type) {
case 'failed': path = '/job/list/failed'; break;
case 'killed': path = '/job/list/killed'; break;
case 'prep': path = '/job/list/prep'; break;
case 'running': path = '/job/list/running'; break;
case 'succeeded': path = '/job/list/succeeded'; break;
}
this.request('GET', path, callback);
};
Client.prototype.status = function(jobid, callback){
this.request('GET', '/job/status/' + jobid, callback);
};
Client.prototype.detail = function(jobid, callback){
this.request('GET', '/job/detail/' + jobid, callback);
};
Client.prototype.kill = function(jobid, callback){
this.request('DELETE', '/job/kill/id/' + jobid, callback);
};
Client.prototype.killByName = function(jobname, callback){
this.request('DELETE', '/job/kill/name/' + jobname, callback);
};
Client.prototype.request = function(method, path, callback){
var options = {
host: this.host,
port: this.port,
path: path,
method: method
};
var cb = function(res){
if (res.statusCode < 200 || res.statusCode >= 300) {
callback({message: "Huahin Manager returns response code " + res.statusCode});
return;
}
// status: 2xx
if (! res.headers['content-type'].match(/^application\/json/)) {
callback(null);
return;
}
// content-type: application/json
var jsondata = '';
res.on('data', function(chunk){
jsondata += chunk;
var data = null;
try {
data = JSON.parse(jsondata);
}
catch (e) { /* jsondata is not complete */
data = null;
}
if (data) {
callback(null,data);
jsondata = null;
}
});
};
var errcb = function(e){ callback(e, null); };
http.request(options, cb).on('error', errcb).end();
};
================================================
FILE: lib/shib/engines/huahin_yarn/index.js
================================================
var RESTClient = require('./rest').Client;
var Monitor = exports.Monitor = function(conf, logger) {
if (conf.name !== 'huahin_yarn')
throw "monitor name mismatch for huahin_yarn:" + conf.name;
this.logger = logger;
this._client = new RESTClient(conf.host, conf.port);
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) {
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for huahin_yarn.Monitor):" + operation;
};
function convertStatus(status, info) { // 'status' is one of members of "app", and 'info' is value of 'info'
/*
{"apps": {"app": [
{
"diagnostics": "",
"elapsedTime": "23sec",
"finalStatus": "UNDEFINED",
"finishTime": "",
"id": "application_1362452667651_1406",
"name": "'test job 1'",
"queue": "default",
"startTime": "Mon Mar 11 15:37:48 JST 2013",
"state": "RUNNING",
"trackingUI": "ApplicationMaster",
"trackingURL": "4c3bd1118.livedoor:8088/proxy/application_1362452667651_1406/",
"user": "hive"
},
{
"diagnostics": "",
"elapsedTime": "40sec",
"finalStatus": "SUCCEEDED",
"finishTime": "Sun Mar 10 05:40:43 JST 2013",
"id": "application_1362452667651_1075",
"name": "--- 57991d00\nSELECT count(*) as cnt, y...100(Stage-2)",
"queue": "default",
"startTime": "Sun Mar 10 05:40:02 JST 2013",
"state": "FINISHED",
"trackingUI": "History",
"trackingURL": "4c3bd1118.livedoor:8088/proxy/application_1362452667651_1075/jobhistory/job/job_1362452667651_1075",
"user": "hive"
},
]}}
*/
/*
{"info": {
"appId": "application_1363145337412_0001",
"elapsedTime": 61245,
"name": "select count(*) as cnt from...service='blog'(Stage-1)",
"startedOn": 1365758130628,
"user": "hive"
}}
*/
/*
var returnedValus = {
jobid: 'job_201304011701_1912',
name: 'shib-3578d8d4f5a1812de7a7714f5b108776',
priority: 'NORMAL',
state: 'RUNNING',
trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',
startTime: 'Thu Apr 11 2013 16:06:40 (JST)',
mapComplete: 89,
reduceComplete: 29,
hiveQueryId: 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',
hiveQueryString: 'SELECT ...'
};
*/
if (status === undefined) {
return null;
}
var retval = {};
retval['jobid'] = status['id'];
retval['name'] = status['name'];
retval['priority'] = 'unknown';
retval['state'] = (status['state'] === 'FINISHED' ? status['finalStatus'] : status['state']);
retval['trackingURL'] = status['trackingURL'];
retval['startTime'] = (function(sourceDate){
// convert for `new Date(string)` acceptable format
// 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'
// [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year
var match = /^([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d\d:\d\d:\d\d) ([a-zA-Z]+) (\d+)$/.exec(sourceDate);
if (! match) { return null; }
// -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)
return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');
})(status['startTime']);
retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);
retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);
retval['hiveQueryId'] = (status['configuration'] || {})['hive.query.id'];
retval['hiveQueryString'] = (status['configuration'] || {})['hive.query.string'];
return retval;
};
Monitor.prototype.status = function(jobname, callback){
var client = this._client;
client.list(function(err, result){
if (err || !result || !result['apps'] || !result['apps']['app']) { callback(err, null); return; }
var appstatus = null;
result['apps']['app'].forEach(function(app){
if (app.name === jobname)
appstatus = app;
});
if (!appstatus) { callback(null, null); return; }
client.mapreduceinfo(appstatus['id'], function(err, info){
if (err || !info['info']) { callback(err, null); return; }
callback(null, convertStatus(appstatus, info['info']));
});
});
};
Monitor.prototype.kill = function(jobname, callback){
var client = this._client;
this.status(jobname, function(err, app){
if (!app) { callback({message:'kill target application not found:' + jobname}); return; }
//TODO: check attribute name
client.kill(app.id, callback);
});
};
================================================
FILE: lib/shib/engines/huahin_yarn/rest.js
================================================
var http = require('http');
var Client = exports.Client = function(host, port){
this._host = host;
this._port = port;
};
// curl -X GET "http://:9010/application/list"
Client.prototype.list = function(callback){
this.request('GET', '/application/list', callback);
};
// curl -X GET "http://:9010/application/cluster"
Client.prototype.cluster = function(callback){
this.request('GET', '/application/cluster', callback);
};
// curl -X DELETE "http://:9010/application/kill/{appid}"
Client.prototype.kill = function(appid, callback){
this.request('DELETE', '/application/kill/' + appid, callback);
};
// curl -X GET "http://:9010/api/proxy/{appid}/ws/v1/mapreduce/info"
Client.prototype.mapreduceinfo = function(appid, callback){
this.request('GET', '/api/proxy/' + appid + '/ws/v1/mapreduce/info', callback);
};
Client.prototype.request = function(method, path, callback){
var options = {
host: this._host,
port: this._port,
path: path,
method: method
};
var cb = function(res){
if (res.statusCode < 200 || res.statusCode >= 300) {
callback({message: "Huahin Manager returns response code " + res.statusCode});
return;
}
// status: 2xx
if (! res.headers['content-type'].match(/^application\/json/)) {
callback(null);
return;
}
// content-type: application/json
var jsondata = '';
res.on('data', function(chunk){
jsondata += chunk;
var data = null;
try {
data = JSON.parse(jsondata);
}
catch (e) { /* jsondata is not complete */
data = null;
}
if (data) {
callback(null,data);
jsondata = null;
}
});
};
var errcb = function(e){ callback(e, null); };
http.request(options, cb).on('error', errcb).end();
};
================================================
FILE: lib/shib/engines/jobtracker/client.js
================================================
var http = require('http')
, child_process = require('child_process');
var cheerio = require('cheerio');
var MRv1Client = exports.MRv1Client = function(host, port, mapred){
this.host = host; // jobtracker.hostname.local
this.port = port; // 50030
this.mapred = mapred;
};
MRv1Client.prototype.listAll = function(callback){
this.request('/jobtracker.jsp', function(err, html){
if (err) { callback(err); return; }
var $ = cheerio.load(html);
var jobs = [];
['h2#running_jobs', 'h2#completed_jobs', 'h2#failed_jobs'].forEach(function(marker){
if ($(marker).next().is('table') && $(marker).next().find('tr td').text() !== 'none') {
$(marker).next().find('tbody tr').each(function(i, e){
var row = $(e).find('td');
jobs.push({ jobid: row.eq(0).text(), name: row.eq(3).text(), priority: row.eq(1).text() });
});
}
});
callback(null, jobs);
});
};
MRv1Client.prototype.detail = function(jobid, opts, callback){
var self = this;
var path = '/jobdetails.jsp?jobid=' + jobid;
this.request(path, function(err, html){
if (err) { callback(err); return; }
var job = {
jobid: jobid,
name: '',
priority: opts.priority,
state: '',
trackingURL: 'http://' + self.host + ':' + self.port + path,
startTime: '',
mapComplete: 0,
reduceComplete: 0
};
var $ = cheerio.load(html);
$('body').html().split('\n').forEach(function(line){
var match = /^(.+):<\/b> (.*) $/.exec(line);
if (match) {
if (match[1] === 'Job Name') {
job['name'] = match[2];
} else if (match[1] === 'Status') {
job['state'] = match[2];
} else if (match[1] === 'Started at') {
job['startTime'] = match[2];
}
}
});
var progress = $('table').first();
job['mapComplete'] = parseInt(progress.children().eq(1).find('td').first().text());
job['reduceComplete'] = parseInt(progress.children().eq(2).find('td').first().text());
callback(null, job);
});
};
MRv1Client.prototype.kill = function(jobid, callback){
var command = this.mapred + " job -kill " + jobid;
child_process.exec(command, function(err, stdout, stderr){
callback(err);
});
};
MRv1Client.prototype.request = function(path, callback){
var options = {
host: this.host,
port: this.port,
path: path,
method: 'GET'
};
var cb = function(res){
if (res.statusCode < 200 || res.statusCode >= 300) {
callback({message: "JobTracker returns response code " + res.statusCode});
return;
}
res.setEncoding('utf8');
var html = '';
res.on('data', function(chunk){
html += chunk;
});
res.on('end', function(){
callback(null, html);
});
};
var errcb = function(e){ callback(e, null); };
http.request(options, cb).on('error', errcb).end();
};
================================================
FILE: lib/shib/engines/jobtracker/index.js
================================================
var MRv1Client = require('./client').MRv1Client;
var Monitor = exports.Monitor = function(conf, logger) {
if (conf.name !== 'jobtracker')
throw "monitor name mismatch for jobtracker:" + conf.name;
if (!conf.host || !conf.port) {
throw "JobTracker WebUI host/port not specified";
}
var mapred = conf.mapred;
if (! conf.mapred) {
mapred = 'mapred';
}
this.logger = logger;
this._client = new MRv1Client(conf.host, conf.port, mapred);
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) {
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for jobtracker.Monitor):" + operation;
};
function convertStatus(status) {
if (status === undefined) {
return null;
}
var retval = {};
retval['jobid'] = status['jobid'];
retval['name'] = status['name'];
retval['priority'] = status['priority'];
retval['state'] = status['state'];
retval['trackingURL'] = status['trackingURL'];
retval['startTime'] = (function(sourceDate){
// convert for `new Date(string)` acceptable format
// 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'
// [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year
var match = /^([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d\d:\d\d:\d\d) ([a-zA-Z]+) (\d+)$/.exec(sourceDate);
if (! match) { return null; }
// -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)
return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');
})(status['startTime']);
retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);
retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);
return retval;
};
Monitor.prototype.status = function(jobname, callback){
var client = this._client;
client.listAll(function(err, result){
if (err || !result) { callback(err, null); return; }
var jobid = null;
var opts = {
};
result.forEach(function(job){
if (job.name === jobname) {
jobid = job.jobid;
opts['priority'] = job.priority;
}
});
if (!jobid) { callback(null, null); return; }
client.detail(jobid, opts, function(err, data){
if (err) { callback(err); return; }
callback(null, convertStatus(data));
});
});
};
Monitor.prototype.kill = function(jobid, callback){
this._client.kill(jobid, callback);
};
================================================
FILE: lib/shib/engines/presto/index.js
================================================
var Client = require('presto-client').Client
, JSONbig = require('json-bigint');
// check interval for real queries, not system queries
var BLOCK_CHECK_INTERVAL = 1000; // 1sec
var jobname_queryid_map = {};
var Executer = exports.Executer = function(conf, logger){
if (conf.name !== 'presto')
throw "executer name mismatch for presto:" + conf.name;
if (!conf.host)
throw "host MUST be specified for presto executer";
if (!conf.port)
throw "port MUST be specified for presto executer";
if (!conf.catalog)
throw "catalog MUST be specified for presto executer";
this.logger = logger;
this._client = new Client({
host: conf.host,
port: conf.port,
user: conf.user,
catalog: conf.catalog,
jsonParser: JSONbig
});
};
Executer.prototype.end = function(){
// Nothing to do for HTTP API :-)
};
Executer.prototype.supports = function(operation){
switch (operation) { // "executer" methods
case 'jobname':
case 'setup':
case 'databases':
case 'tables':
case 'partitions':
case 'describe':
case 'execute':
return true;
}
throw "unknown operation name (for presto.Executer):" + operation;
};
Executer.prototype.jobname = function(queryid) {
return 'shib-presto-' + queryid;
};
Executer.prototype.setup = function(setups, callback){
// presto engine currently does not support 'setup', because of lack of UDFs
callback(null);
};
Executer.prototype.options = function(query, schema, func){
var options = {
query: query,
schema: schema,
state: function(error, query_id, stats){ /*console.log({message:"status changed", id:query_id, stats:stats});*/ },
columns: function(error, data){ /*console.log({resultColumns: data});*/ },
data: function(error, data, columns, stats){ func(error, data) },
success: function(error, stats){},
error: function(error){console.log(error);}
};
return options
};
Executer.prototype.databases = function(callback){
this._client.execute(this.options('show schemas', 'dummy', function(err, data){
if (err) { callback(err); return; }
// [ [ 'default' ], [ 'information_schema' ], [ 'sys' ] ]
// database names may be always string...
var results = [];
data.forEach(function(row){
var dbname = row[0];
if (dbname !== 'information_schema' && dbname !== 'sys' )
results.push(dbname);
});
callback(null, results);
}));
};
Executer.prototype.tables = function(dbname, callback){
this._client.execute(this.options('show tables', dbname, function(err, data){
if (err) { callback(err); return; }
// [ [ 'table1' ], [ 'table2' ], ... ]
// table names may be always string...
var results = data.map(function(row){ return row[0]; });
callback(null, results);
}));
};
Executer.prototype.partitions = function(dbname, tablename, callback){
var client = this._client;
var show_partitions_query = 'show partitions from ' + tablename;
var options_ = this.options;
client.execute(options_('show columns from ' + tablename, dbname, function(err, data){
if (err) { callback(err); return; }
// [ [ 'fieldname', 'typename', boolean_null, boolean_partition_key ], ... ]
// partition names may be always string...
var partitionKeys = [];
data.forEach(function(row){
if (row[2])
partitionKeys.push(row[0]);
});
client.execute(options_(show_partitions_query, dbname, function(err, data){
if (err) { callback(err); return; }
// data: [ [ 'partkey1_value', 'partkey2_value' ], ... ]
// expected: ['f1=va1/f2=vb1', 'f1=va1/f2=vb2']
var results = [];
data.forEach(function(row){
var part = row.map(function(v,i){ return partitionKeys[i] + '=' + String(v); }).join('/');
results.push( part );
});
callback(null, results);
}));
}));
};
Executer.prototype.describe = function(dbname, tablename, callback){
// presto "show columns from ..." does not return column comments in hive metastore
// schema info members may not include numeric values
this._client.execute(this.options('show columns from ' + tablename, dbname, function(err, data){
if (err) { callback(err); return; }
// data: [ [ 'fieldname', 'typename', boolean_null, boolean_partition_key ], ... ]
// expected: [ [ 'fieldname', 'type', 'comment' ], ... ]
var results = data.map(function(row){ return [ row[0], row[1], (row[2] ? 'partition key' : '') ]; });
callback(null, results);
}));
};
Executer.prototype.execute = function(jobname, dbname, query, callback){
var client = this._client;
var fetcher = new Fetcher(client);
var state_callback = function(e, query_id, stats){
jobname_queryid_map[jobname] = query_id;
};
var columns_callback = function(e, columns){
fetcher._cache.schema = columns;
};
var data_callback = function(e, data){
fetcher._hasResults = true;
var buf = []
, len = data.length;
for ( var i = 0 ; i < len ; i++ ) {
// data may contain BIGINT values ...
// AND join does 'toString()' automatically!
buf.push( data[i].join('\t') );
}
fetcher._push( buf );
};
var success_callback = function(e, stats){
fetcher._noMoreResults = true;
delete jobname_queryid_map[jobname];
};
var error_callback = function(e){
delete jobname_queryid_map[jobname];
if (! fetcher._rpcError) // only first error is stored
fetcher._rpcError = e;
};
var opts = {
query: query,
schema: dbname || 'default',
state: state_callback,
columns: columns_callback,
data: data_callback,
success: success_callback,
error: error_callback
};
client.execute(opts);
callback(null, fetcher);
};
var Fetcher = function(client){
this._client = client;
this._hasResults = false;
this._noMoreResults = false;
this._rpcError = null;
this._cache = { data: [], schema: null };
this._push = function(data) {
this._cache.data = this._cache.data.concat(data);
};
this._waitComplete = function(callback) {
var self = this;
var check = function() {
if (self._rpcError)
callback(self._rpcError);
else if (self._hasResults)
callback(null);
else if (self._noMoreResults)
callback(null);
else
setTimeout(check, BLOCK_CHECK_INTERVAL);
};
check();
};
this.schema = function(callback){
/*
* schema(callback): callback(err, schema)
* schema: {fieldSchemas: [{name:'fieldname1'}, {name:'fieldname2'}, {name:'fieldname3'}, ...]}
* //?? schema: [{name:'fieldname1'}, {name:'fieldname2'}, ...]
*/
var self = this;
this._waitComplete(function(err){
if (err) { callback(err); return; }
// self._cache.schema: [ { name: "username", type: "varchar" }, { name: "cnt", type: "bigint" } ]
callback(null, self._cache.schema);
});
};
this.fetch = function(num, callback){
if (!num) {
this._fetchAll(callback);
return;
}
var self = this;
if (self._cache.data.length < 1 && self._noMoreResults) {
// if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {
// end of fetched rows
callback(null, null);
return;
}
var buf = [];
var fill = function() {
if (self._rpcError) { callback(self._rpcError); return; }
var chunk = self._cache.data.splice(0, num - buf.length);
if (chunk.length < 1) {
if (self._noMoreResults) {
var tmpbuf = buf;
buf = [];
callback(null, tmpbuf); // if tmpbuf is empty, this is end of fetching
return;
}
else {
setTimeout(fill, BLOCK_CHECK_INTERVAL);
return;
}
}
buf = buf.concat(chunk);
if (buf.length >= num || self._noMoreResults) {
var fullchunk = buf;
buf = [];
callback(null, fullchunk);
}
else
setTimeout(fill, BLOCK_CHECK_INTERVAL);
};
this._waitComplete(function(err){
if (err) { callback(err); return; }
fill();
});
};
this._fetchAll = function(callback) {
var self = this;
var check = function() {
if (self._rpcError)
callback(self._rpcError);
else if (self._noMoreResults)
callback(null, self._cache.data);
else
setTimeout(check, BLOCK_CHECK_INTERVAL);
};
check();
};
};
var Monitor = exports.Monitor = function(conf){
if (conf.name !== 'presto')
throw "executer name mismatch for presto:" + conf.name;
if (!conf.host)
throw "host MUST be specified for presto executer";
if (!conf.port)
throw "port MUST be specified for presto executer";
if (!conf.catalog)
throw "catalog MUST be specified for presto executer";
this._client = new Client({
host: conf.host,
port: conf.port,
user: conf.user,
catalog: conf.catalog
});
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) { // "monitor" methods
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for presto.Monitor):" + operation;
};
function convertStatus(jobname, status) {
/*
var status = {
"queryId" : "20140214_083451_00012_9w6p5",
"session" : {
"user" : "www",
"source" : "presto-cli",
"catalog" : "hive",
"schema" : "default",
"remoteUserAddress" : "127.0.0.1",
"userAgent" : "StatementClient/0.56",
"startTime" : 1392366891516
},
"state" : "RUNNING",
"self" : "http://10.0.0.1:8080/v1/query/20140214_083451_00012_9w6p5",
"fieldNames" : [ "cnt" ],
"query" : "select count(*) as cnt from tablename where date_time LIKE \u00272014020%\u0027",
"queryStats" : {
"createTime" : "2014-02-14T17:34:51.518+09:00",
"executionStartTime" : "2014-02-14T17:34:52.008+09:00",
"lastHeartbeat" : "2014-02-14T17:35:10.048+09:00",
"elapsedTime" : "18.53s",
"queuedTime" : "2.21ms",
"analysisTime" : "482.62ms",
"distributedPlanningTime" : "760.83us",
"totalPlanningTime" : "485.67ms",
"totalTasks" : 9,
"runningTasks" : 9,
"completedTasks" : 0,
"totalDrivers" : 43631,
"queuedDrivers" : 38,
"runningDrivers" : 1111,
"completedDrivers" : 42482,
"totalMemoryReservation" : "0B",
"totalScheduledTime" : "3.30h",
"totalCpuTime" : "13.36m",
"totalUserTime" : "12.07m",
"totalBlockedTime" : "12.35s",
"rawInputDataSize" : "14.06GB",
"rawInputPositions" : 602557401,
"processedInputDataSize" : "9.98GB",
"processedInputPositions" : 594796027,
"outputDataSize" : "0B",
"outputPositions" : 0
},
"outputStage" : {
"stageId" : "20140214_083451_00012_9w6p5.0",
"state" : "RUNNING",
"self" : "http://10.0.0.1:8080/v1/stage/20140214_083451_00012_9w6p5.0",
"plan" : { ... },
"tupleInfos" : [ "bigint" ],
"stageStats" : {
"schedulingComplete" : "2014-02-14T17:34:52.008+09:00",
...
}
var returnedValus = {
jobid: '20140214_083451_00012_9w6p5',
name: 'shib-presto-3578d8d4f5a1812de7a7714f5b108776',
priority: 'unknown',
state: 'RUNNING',
trackingURL: 'http://10.0.0.1:8080/v1/query/20140214_083451_00012_9w6p5?pretty',
startTime: 'Thu Apr 11 2013 16:06:40 (JST)',
mapComplete: null,
reduceComplete: null,
complete: 80
};
*/
if (status === undefined) {
return null;
}
var retval = {};
retval['jobid'] = status['queryId'];
retval['name'] = jobname;
retval['priority'] = 'unknown';
retval['state'] = status['state'];
retval['trackingURL'] = status['self'] + '?pretty';
retval['startTime'] = status['queryStats']['createTime'];
var splits = status.queryStats.totalDrivers;
var completedSplits = status.queryStats.completedDrivers;
retval['complete'] = parseInt(completedSplits * 1000 / splits) / 10;
return retval;
};
Monitor.prototype.status = function(jobname, callback){
var queryid = jobname_queryid_map[jobname];
if (! queryid) {
callback({message:"query already expired (maybe completed)"}, null);
return;
}
this._client.query(queryid, function(err, data){
if (err) { callback(err); return; }
callback(null, convertStatus(jobname, data));
});
};
Monitor.prototype.kill = function(query_id, callback){
this._client.kill(query_id, callback);
};
================================================
FILE: lib/shib/engines/yarn/client.js
================================================
var http = require('http')
, child_process = require('child_process');
var YARNClient = exports.YARNClient = function(host, port, yarn){
this.host = host; // rm.hostname.local
this.port = port;
this.yarn = yarn;
};
// https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Applications_API
//
// GET "http:///ws/v1/cluster/apps"
YARNClient.prototype.applications = function(callback){
this.request('GET', '/ws/v1/cluster/apps', callback);
};
// https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Application_API
//
// GET "http:///ws/v1/cluster/apps/{appid}"
YARNClient.prototype.application = function(appid, callback){
this.request('GET', '/ws/v1/cluster/apps/' + appid, callback);
};
YARNClient.prototype.request = function(method, path, callback){
var options = {
host: this.host,
port: this.port,
path: path,
method: method
};
var cb = function(res){
if (res.statusCode != 200 ) {
callback({message: "YARN REST API returns response code " + res.statusCode});
return;
}
// status: 2xx
if (! res.headers['content-type'].match(/^application\/json/)) {
callback(null);
return;
}
// content-type: application/json
var jsondata = '';
res.on('data', function(chunk){
jsondata += chunk;
});
res.on('end', function(){
var data = JSON.parse(jsondata);
callback(null,data);
});
};
var errcb = function(e){ callback(e, null); };
http.request(options, cb).on('error', errcb).end();
};
YARNClient.prototype.status = function(jobname, callback){
var restClient = this;
restClient.applications(function(err, result){
if (err || !result || !result['apps'] || !result['apps']['app']) { callback(err, null); return; }
var appstatus = null;
result['apps']['app'].forEach(function(app){
if (app.name === jobname)
appstatus = app;
});
if (!appstatus) { callback(null, null); return; }
restClient.application(appstatus['id'], function(err, info){
if (err) { callback(err, null); return; }
/*
{
"app" : {
"finishedTime" : 1326824991300,
"amContainerLogs" : "http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001",
"trackingUI" : "History",
"state" : "FINISHED",
"user" : "user1",
"id" : "application_1326821518301_0005",
"clusterId" : 1326821518301,
"finalStatus" : "SUCCEEDED",
"amHostHttpAddress" : "host.domain.com:8042",
"progress" : 100,
"name" : "shib-hs2-0ef88408da216fc6f40530c3af38f9ec",
"applicationType" : "Yarn",
"startedTime" : 1326824544552,
"elapsedTime" : 446748,
"diagnostics" : "",
"trackingUrl" : "http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5",
"queue" : "a1",
"memorySeconds" : 151730,
"vcoreSeconds" : 103
}
}
*/
var status = {};
status['jobid'] = info['app']['id'];
status['name'] = info['app']['name'];
status['state'] = info['app']['state'];
status['trackingURL'] = info['app']['trackingUrl'];
status['startTime'] = new Date(parseInt(info['app']['startedTime'])).toLocaleString();
status['mapComplete'] = null;
status['reduceComplete'] = null;
callback(null, status);
});
});
};
YARNClient.prototype.kill = function(appid, callback){
if(this.yarn) {
var command = this.yarn + " application -kill " + appid;
child_process.exec(command, function(err, stdout, stderr){
callback(err);
});
} else {
var options = {
host: this.host,
port: this.port,
path: "/ws/v1/cluster/apps/" + appid + "/state",
method: "PUT",
headers: {'Content-Type': 'application/json'}
};
var cb = function(res){
// status: 2xx
var code = String(res.statusCode);
if (!code.match(/^2/)) {
callback({message: "YARN REST API returns response code " + res.statusCode});
return;
}
};
var req = http.request(options, cb)
req.write('{"state":"KILLED"}');
req.on('error', function(error) {
callback(error);
});
req.end();
}
};
================================================
FILE: lib/shib/engines/yarn/index.js
================================================
var YARNClient = require('./client').YARNClient;
var Monitor = exports.Monitor = function(conf, logger) {
if (conf.name !== 'yarn')
throw "monitor name mismatch for yarn:" + conf.name;
if (!conf.host || !conf.port) {
throw "YARN WebUI host/port not specified";
}
var yarn = conf.yarn;
this.logger = logger;
this._client = new YARNClient(conf.host, conf.port, yarn);
};
Monitor.prototype.end = function(){
};
Monitor.prototype.supports = function(operation){
switch (operation) {
case 'status':
case 'kill':
return true;
}
throw "unknown operation name (for yarn.Monitor):" + operation;
};
Monitor.prototype.status = function(jobname, callback){
this._client.status(jobname, callback);
};
// kill YARN application, and 'jobid' means application id
Monitor.prototype.kill = function(jobid, callback){
this._client.kill(jobid, callback);
};
================================================
FILE: lib/shib/huahin_client.js
================================================
var http = require('http');
var HuahinClient = exports.HuahinClient = function(host, port){
this.host = host;
this.port = port;
};
HuahinClient.prototype.listAll = function(callback){
return this.list('all', callback);
};
HuahinClient.prototype.list = function(type, callback){
var path = '/job/list';
switch(type) {
case 'failed': path = '/job/list/failed'; break;
case 'killed': path = '/job/list/killed'; break;
case 'prep': path = '/job/list/prep'; break;
case 'running': path = '/job/list/running'; break;
case 'succeeded': path = '/job/list/succeeded'; break;
}
this.request('GET', path, callback);
};
HuahinClient.prototype.status = function(jobid, callback){
this.request('GET', '/job/status/' + jobid, callback);
};
HuahinClient.prototype.detail = function(jobid, callback){
this.request('GET', '/job/detail/' + jobid, callback);
};
HuahinClient.prototype.kill = function(jobid, callback){
this.request('DELETE', '/job/kill/id/' + jobid, callback);
};
HuahinClient.prototype.killByName = function(jobname, callback){
this.request('DELETE', '/job/kill/name/' + jobname, callback);
};
HuahinClient.prototype.request = function(method, path, callback){
var options = {
host: this.host,
port: this.port,
path: path,
method: method
};
var cb = function(res){
if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.headers['content-type'].match(/^application\/json/)) {
var jsondata = '';
res.on('data', function(chunk){
jsondata += chunk;
var data = null;
try {
data = JSON.parse(jsondata);
}
catch (e) {
/* jsondata is not complete */
data = null;
}
if (data) {
callback(null, {success: true, data: data});
jsondata = null;
}
});
return;
}
callback(null, {success: true});
return;
}
callback({message: "Huahin Manager returns response code " + res.statusCode});
};
var errcb = function(e){ callback(e, null); };
http.request(options, cb).on('error', errcb).end();
};
================================================
FILE: lib/shib/index.js
================================================
var client = require('./client')
, auth = require('./auth')
, logger = require('./logger');
var default_configs = {
listen: 3000,
fetch_lines: 1000,
query_timeout: null,
setup_queries: [],
setup_queries_auth: [],
max_result_file_byte_size: null,
storage: {
datadir: './var'
},
disable_history: false,
auth: null,
engines: [
{
label: 'hive',
executer: {
name: 'hiveserver',
host: 'localhost',
port: 10000,
support_database: true,
default_database: 'default',
query_timeout: null,
setup_queries: [],
setup_queries_auth: []
},
monitor: null
}
]
};
var config = null;
var log = null;
exports.init = function(arg){
var merge = function(destination, source) {
for (var property in source) {
if (source.hasOwnProperty(property)) {
destination[property] = source[property];
}
}
return destination;
};
config = merge(merge({}, default_configs), arg);
log = new logger.Logger(config.logger || {});
};
exports.setting = function(key){
return config[key];
};
exports.client = function(arg){
if (!arg)
arg = {};
return new client.Client(config, log, arg.credential);
};
exports.auth = function(arg){
return new auth.Auth(config.auth || {}, log);
};
exports.logger = function(){
return log;
};
================================================
FILE: lib/shib/localdiskstore.js
================================================
var fs = require('fs'),
async = require('async'),
sqlite3 = require('sqlite3');
var Query = require('./query').Query;
var DATABASE_SQLITE_FILENAME = 'database.sqlite3';
/*
* v0 data schema:
* * results raw data -> ${datadir}/results/char[0]/char[1]/resultid
* queries/results/history/tags -> ${datadir}/database
* [queries] id -> json
* [results] id -> json
* [history] id, datetime, queryid
* [tags] id, queryid, tag
*/
var SQLITE_TABLE_DEFINITIONS_v0 = [
'CREATE TABLE IF NOT EXISTS queries (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',
'CREATE TABLE IF NOT EXISTS results (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',
'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',
'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
];
/*
* v1 data schema:
* * results raw data -> ${datadir}/results/char[0]/char[1]/resultid
* queries/tags -> ${datadir}/database
* [queries] id -> auto_increment_id, datetime(new Date().toJSON(), Zulu), expression, state, resultid, result(JSON)
*/
var SQLITE_TABLE_DEFINITIONS = [
'CREATE TABLE IF NOT EXISTS queries (autoid INTEGER PRIMARY KEY AUTOINCREMENT, id VARCHAR(32) NOT NULL UNIQUE, datetime TEXT NOT NULL, scheduled INTEGER DEFAULT NULL, engine TEXT DEFAULT NULL, dbname DEFAULT NULL, expression TEXT NOT NULL, state VARCHAR(32) NOT NULL, resultid VARCHAR(32) NOT NULL UNIQUE, result DEFAULT NULL)',
'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
];
var KNOWN_TABLES = ['queries', 'tags', 'sqlite_sequence'];
/*
** "SELECT name FROM sqlite_master WHERE type='table'"
[ { name: 'queries' },
{ name: 'sqlite_sequence' },
{ name: 'tags' } ]
*/
var sqlite_initialized = false; // this variable is changed as 'true' when first initialize executed.
var SchemaVersionError = exports.SchemaVersionError = function(msg){
this.name = 'SchemaVersionError';
Error.call(this, msg);
Error.captureStackTrace(this, arguments.callee);
};
SchemaVersionError.prototype.__proto__ = Error.prototype;
var LocalDiskStoreError = exports.LocalDiskStoreError = function(msg){
this.name = 'LocalDiskStoreError';
Error.call(this, msg);
Error.captureStackTrace(this, arguments.callee);
};
LocalDiskStoreError.prototype.__proto__ = Error.prototype;
var LocalDiskStore = exports.LocalDiskStore = function(datadir, logger) {
this.datadir = fs.realpathSync(datadir);
this.logger = logger;
if (! this.datadir )
throw new LocalDiskStoreError("Invalid datadir path: " + datadir);
var self = this;
var stat = fs.statSync(this.datadir);
if (! stat) {
fs.mkdirSync(this.datadir);
} else if (! stat.isDirectory()) {
throw new LocalDiskStoreError("Specified path is not directory: " + datadir);
}
var db;
var on_connect = function(error){
if (error) {
self.logger.error("failed to open sqlite3", error);
throw new LocalDiskStoreError("sqlite3 database open error:" + error.message);
}
if (!db) {
self.logger.error("failed to initialize database");
throw new LocalDiskStoreError("db variable is unset, maybe not initialized"); }
};
if (!sqlite_initialized) {
on_connect = function(error){
if (error) {
self.logger.error("failed to open sqlite3", error);
throw new LocalDiskStoreError("sqlite3 database open error:" + error.message);
}
if (!db) {
self.logger.error("failed to initialize database");
throw new LocalDiskStoreError("db variable is unset, maybe not initialized");
}
var schemaChecker = function(cb){
db.all("SELECT name FROM sqlite_master WHERE type='table'", function(err, rows){
if (err) { cb(err.message); return; }
if (rows.some(function(row){ return KNOWN_TABLES.indexOf(row.name) < 0; })) {
self.logger.error("Database schema is of v0.");
self.logger.error('EXECUTE: "npm run-script migrate"');
throw new SchemaVersionError();
}
cb(null);
});
};
var setup = [schemaChecker].concat(SQLITE_TABLE_DEFINITIONS.map(function(sql){
return function(callback) {
db.run(sql, function(error){
if (error) { callback(error.message); return; }
callback(null);
});
};
}));
async.series(setup, function(err,results){
if (err) {
self.logger.error("failed to initialize database", err);
throw new LocalDiskStoreError("database initialize failed");
}
sqlite_initialized = true;
});
};
}
db = this.db = new sqlite3.Database(
datadir + '/' + DATABASE_SQLITE_FILENAME,
(sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE),
on_connect
);
};
LocalDiskStore.prototype.close = function(){
this.db.close();
};
// operations with sqlite3
function generatePlaceholders(num) {
if (num < 1)
throw "placeholder num must bigger than zero";
var p = '?';
for (var i = 1; i < num; i++) {
p = p.concat(',?');
}
return p;
}
// 'CREATE TABLE IF NOT EXISTS queries (autoid INTEGER PRIMARY KEY AUTOINCREMENT, id VARCHAR(32) NOT NULL UNIQUE, datetime TEXT NOT NULL, scheduled INTEGER DEFAULT NULL, engine TEXT DEFAULT NULL, dbname DEFAULT NULL, expression TEXT NOT NULL, state VARCHAR(32) NOT NULL, resultid VARCHAR(32) DEFAULT NULL, result DEFAULT NULL)',
LocalDiskStore.prototype.query = function(queryid, callback){
var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE id=?';
this.db.get(sql, [queryid], function(err,row){
if (err) { callback(err); return; }
if (!row) { callback(null, null); return; }
callback(null, new Query(row));
});
};
LocalDiskStore.prototype.queryByResultId = function(resultid, callback){
var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE resultid=?';
this.db.get(sql, [resultid], function(err,row){
if (err) { callback(err); return; }
if (!row) { callback(null, null); return; }
callback(null, new Query(row));
});
};
LocalDiskStore.prototype.queries = function(queryids, callback){
var placeholders = '(' + generatePlaceholders(queryids.length) + ')';
var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE id IN ' + placeholders;
this.db.all(sql, queryids, function(err,rows){
if (err) { callback(err); return; }
callback(null, rows.map(function(r){ return new Query(r);}));
});
};
LocalDiskStore.prototype.insertQuery = function(query, callback){
var sql = 'INSERT INTO queries (id,datetime,scheduled,engine,dbname,expression,state,resultid,result) VALUES (?,?,?,?,?,?,?,?,?)';
this.db.run(sql, query.serialized(), function(err){
if (callback) callback(err);
});
};
LocalDiskStore.prototype.updateQuery = function(query, callback){
this.db.run('UPDATE queries SET state=?, result=? WHERE id=?', query.serializedForUpdate(), function(err){
if (callback) callback(err);
});
};
LocalDiskStore.prototype.deleteQuery = function(queryid, callback){
this.db.run('DELETE FROM queries WHERE id=?', [queryid], function(err){
if (callback) callback(err);
});
};
LocalDiskStore.prototype.recentQueries = function(num, callback){
var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE scheduled IS NULL ORDER BY datetime DESC LIMIT ' + parseInt(num);
var db = this.db;
this.db.all(sql, function(err, rows){
if (err) { callback(err); return; }
callback(null, rows.map(function(r){ return new Query(r); }));
});
};
// 'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'
LocalDiskStore.prototype.tagList = function(callback){
this.db.all('SELECT DISTINCT tag FROM tags ORDER BY tag', function(err, rows){
if (err) { callback(err); return; }
callback(null, rows.map(function(obj){ return obj.tag; }));
});
};
LocalDiskStore.prototype.taggedQueries = function(tag, callback){
this.db.all('SELECT queryid FROM tags WHERE tag=?', [tag], function(err, rows){
if (err) { callback(err); return; }
callback(null, rows.map(function(obj){ return obj.queryid; }));
});
};
LocalDiskStore.prototype.tags = function(queryid, callback){
this.db.all('SELECT tag FROM tags WHERE queryid=?', [queryid], function(err, rows){
if (err) { callback(err); return; }
callback(null, rows.map(function(obj){ return obj.tag; }));
});
};
LocalDiskStore.prototype.addTag = function(queryid, tag, callback){
var self = this;
this.db.all('SELECT queryid, tag FROM tags WHERE queryid=? AND tag=?', [queryid, tag], function(err, rows){
if (err) { callback(err); return; }
if (rows && rows.length > 0) {
// specified tag already exists: ignore
if (callback) callback(null);
return;
}
self.db.run('INSERT INTO tags (queryid,tag) VALUES (?,?)', [queryid, tag], function(err){
if (callback) callback(err);
});
});
};
LocalDiskStore.prototype.deleteTag = function(queryid, tag, callback){
this.db.run('DELETE FROM tags WHERE queryid=? AND tag=?', [queryid, tag], function(err){
if (callback) callback(err);
});
};
LocalDiskStore.prototype.deleteTagForQuery = function(queryid, callback){
this.db.run('DELETE FROM tags WHERE queryid=?', [queryid], function(err){
if (callback) callback(err);
});
};
/* result data path utilities */
LocalDiskStore.prototype.generatePathElements = function(key){
return [this.datadir, 'results', key[0], key[1], key];
};
LocalDiskStore.prototype.generatePathFromElements = function(elements){
return elements.join("/");
};
LocalDiskStore.prototype.generatePath = function(key){
return this.generatePathFromElements(this.generatePathElements(key));
};
LocalDiskStore.prototype.keyExists = function(key){
return fs.existsSync(this.generatePath(key));
};
LocalDiskStore.prototype.prepare = function(key, callback){
var elements = this.generatePathElements(key);
elements.pop(); // purge file basename (is not target for mkdir)
var store = this;
var dig = function(elements, depth, cb){
var path = store.generatePathFromElements(elements.slice(0,depth));
fs.exists(path, function(exists){
if (!exists) {
fs.mkdir(path, function(){ cb(depth); });
return;
}
cb(depth);
});
};
var dig_callback = function(digged){
if (digged < elements.length) {
dig(elements, digged + 1, dig_callback);
return;
}
callback();
};
dig(elements, 1, dig_callback);
};
LocalDiskStore.prototype.readResultData = function(key, callback){
if (! this.keyExists(key)) { callback(null,null); return; }
var path = this.generatePath(key);
fs.readFile(path, 'utf8', function(err, data){
callback(err, data);
});
};
LocalDiskStore.prototype.writeResultData = function(key, data, callback){
if (this.keyExists(key)) {
this.logger.warn("specified result data to write is already exists", {key: key});
callback({message:"specified result data to write is already exists, key:" + key});
return;
}
var path = this.generatePath(key);
this.prepare(key, function(){
fs.writeFile(path, data, 'utf8', function(err){
callback(err);
});
});
};
LocalDiskStore.prototype.appendResultData = function(key, data, callback){
var path = this.generatePath(key);
this.prepare(key, function(){
fs.appendFile(path, data, 'utf8', function(err){
callback(err);
});
});
};
LocalDiskStore.prototype.deleteResultData = function(key, callback){
var path = this.generatePath(key);
fs.exists(path, function(exists){
if (exists)
fs.unlink(path, callback);
else
callback(null);
});
};
================================================
FILE: lib/shib/logger.js
================================================
var util = require('util');
var TRACE = 0
, DEBUG = 1
, INFO = 2
, WARN = 3
, ERROR = 4
, FATAL = 5;
var LOGLEVELS = ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'];
var LOG_FORMAT_SIMPLE = "%s [%s] : %s"
, LOG_FORMAT_WITH_DUMP = "%s [%s] : %s, %s";
var Logger = exports.Logger = function(args){
this.level = args.level || INFO;
};
Logger.prototype.log = function(level, msg, optional){
if (level < this.level)
return;
var date = new Date();
var log_string;
if (optional)
log_string = util.format(LOG_FORMAT_WITH_DUMP, date.toLocaleString(), LOGLEVELS[level], msg, util.inspect(optional));
else
log_string = util.format(LOG_FORMAT_SIMPLE, date.toLocaleString(), LOGLEVELS[level], msg);
util.puts(log_string);
};
Logger.prototype.trace = function(msg, optional){
this.log(TRACE, msg, optional);
};
Logger.prototype.debug = function(msg, optional){
this.log(DEBUG, msg, optional);
};
Logger.prototype.info = function(msg, optional){
this.log(INFO, msg, optional);
};
Logger.prototype.warn = function(msg, optional){
this.log(WARN, msg, optional);
};
Logger.prototype.error = function(msg, optional){
this.log(ERROR, msg, optional);
};
Logger.prototype.fatal = function(msg, optional){
this.log(FATAL, msg, optional);
};
================================================
FILE: lib/shib/query.js
================================================
var crypto = require('crypto');
var STATE_RUNNING = "running",
STATE_DONE = "done",
STATE_ERROR = "error";
var removeNewLines = exports.removeNewLines = function(str){
return str.split(/\r\n|\r|\n/).join(' ');
};
var removeNewLinesAndComments = exports.removeNewLinesAndComments = function(str){
return str.replace(/--.*$/mg, '').split(/\r\n|\r|\n/).join(' ');
};
var InvalidQueryError = exports.InvalidQueryError = function(msg){
this.name = 'InvalidQueryError';
this.message = msg;
Error.captureStackTrace(this, arguments.callee);
};
InvalidQueryError.prototype = Error.prototype;
var Query = exports.Query = function(args){
if (args.querystring)
Query.checkQueryString(args.querystring);
// 'SELECT id,datetime,scheduled,engine,dbname,expression,state,resultid,result FROM queries';
this.querystring = args.expression || args.querystring;
this.queryid = args.id || args.queryid || Query.generateQueryId(this.querystring, args.seed);
this.datetime = new Date();
if (args.datetime)
this.datetime = new Date(args.datetime);
this.scheduled = null;
if (args.scheduled)
this.scheduled = 1;
this.engine = args.engine;
this.dbname = args.dbname;
this.auth = args.auth;
this.state = args.state || STATE_RUNNING;
this.resultid = args.resultid || Query.generateResultId(this.queryid, this.datetime.toLocaleString());
if (args.result && typeof(args.result) == 'string')
this.result = Query.generateResult({json: args.result});
else if (args.result)
this.result = args.result;
else
this.result = Query.generateResult(null);
};
Query.generateResult = function(args){
if (args === null)
args = {};
if (args.json) {
// Date object is weak to be stringified, and cannot be restored from JSON.parse()
// loaded result object does not have executed_time/completed_time
args = JSON.parse(args.json);
delete args.executed_time;
delete args.completed_time;
}
var r = {};
r.error = args.error || "";
r.lines = args.lines || null;
r.bytes = args.bytes || null;
r.completed_at = args.completed_at || null;
r.completed_msec = args.completed_msec || null;
if (! r.completed_msec && r.completed_at)
r.completed_msec = new Date(r.completed_at).getTime();
/* [ { name: 'x', type: 'string', comment: null },
{ name: 'cnt', type: 'bigint', comment: null } ] */
r.schema = args.schema || [];
return r;
};
Query.prototype.running = function(){
return this.state === STATE_RUNNING;
};
Query.prototype.withError = function(){
if (this.state === STATE_DONE || this.state === STATE_ERROR)
return this.state === STATE_ERROR;
throw new Error("called without done/error status");
};
Query.prototype.markAsExecuted = function(err, lines, bytes){
if (err) {
this.state = STATE_ERROR;
this.result.error = err.message;
}
else {
this.state = STATE_DONE;
}
if (lines)
this.result.lines = lines;
if (bytes)
this.result.bytes = bytes;
this.result.completed_time = new Date();
this.result.completed_msec = this.result.completed_time.getTime();
this.result.completed_at = this.result.completed_time.toLocaleString();
};
Query.prototype.addSchema = function(schemaData){
this.result.schema = schemaData;
};
Query.prototype.serializedResult = function(){
// Date object is weak to be stringified, and cannot be restored from JSON.parse()
// loaded result object does not have executed_time/completed_time
var result = this.result;
delete result.executed_time;
delete result.completed_time;
return JSON.stringify(result);
};
Query.prototype.serialized = function(){
return [
this.queryid,
this.datetime.toJSON(),
this.scheduled,
this.engine,
this.dbname,
this.querystring,
this.state,
this.resultid,
this.serializedResult()
];
};
Query.prototype.serializedForUpdate = function(){
// UPDATE queries SET state=?, result=? WHERE id=?
return [
this.state,
this.serializedResult(),
this.queryid
];
};
Query.prototype.composed = function(){
var q = this.querystring;
var dateformat = function(format, date) {
function pad2(n){return n < 10 ? '0' + n : n ;}
switch(format) {
case '%Y%m%d':
return date.getFullYear() + pad2(date.getMonth() + 1) + pad2(date.getDate());
case '%Y%m':
return date.getFullYear() + pad2(date.getMonth() + 1);
}
return undefined;
};
var d = new Date();
var today = dateformat('%Y%m%d', d);
var month = dateformat('%Y%m', d);
var yesterday = dateformat('%Y%m%d', new Date(d - 86400000));
var lastmonth = dateformat('%Y%m', new Date(d - 86400000 * (d.getDate() + 1)));
q = q.replace(/__TODAY__/g, today)
.replace(/__YESTERDAY__/g, yesterday)
.replace(/__MONTH__/g, month)
.replace(/__LASTMONTH__/g, lastmonth);
var re = /__(\d)DAYS_AGO__/;
var match;
while ((match = re.exec(q)) !== null) {
var regexp = RegExp('__' + match[1] + 'DAYS_AGO__', 'g');
q = q.replace(regexp, dateformat('%Y%m%d', new Date(d - 86400000 * parseInt(match[1]))));
}
return q;
};
Query.checkQueryString = function(querystring){
if (! querystring || querystring.length < 1) {
throw new InvalidQueryError("Blank or too short query.");
}
if (querystring.indexOf(';') >= 0) {
throw new InvalidQueryError("Two or more queries detected! Semicolon prohibited.");
}
// query type of create/drop/..../alter/load/insert/explain too many query types!!!
// white list now...
if (/^\s*(with .*)?\s*(explain\s+)?select .* from .+$/i.exec(removeNewLinesAndComments(querystring))){
return;
}
throw new InvalidQueryError("Invalid query type. Allowed methods: 'SELECT', 'EXPLAIN'.");
};
Query.parseTableNames = function(querystring){
var result = [];
var regexp = /\s(?:FROM|JOIN)\s+([_.a-zA-Z0-9]+)/img; // ignoreCase, multiline, global
var match;
while ( (match = regexp.exec(querystring)) ) {
var specified = match[1];
if (specified.indexOf('.') != -1) {
result.push( specified.split(".", 2).reverse() );
} else {
result.push( [ specified, null] );
}
}
return result;
};
Query.generateQueryId = function(querystring, seed){
if (!seed)
seed = '';
var md5sum = crypto.createHash('md5');
md5sum.update(new Buffer(querystring + ';' + seed, 'utf8'));
return md5sum.digest('hex');
};
Query.generateResultId = function(queryid, executed_at) {
var md5sum = crypto.createHash('md5');
md5sum.update(new Buffer(queryid + executed_at, 'utf8'));
return md5sum.digest('hex');
};
================================================
FILE: lib/shib/simple_csv_builder.js
================================================
var SimpleCSVBuilder = exports.SimpleCSVBuilder = function(args){
};
SimpleCSVBuilder.escape = function(value){
return String(value).replace(/"/g, '""');
};
SimpleCSVBuilder.build = function(data){
if (data.length < 1)
return '';
var values = [];
for(var i = 0; i < data.length; i++) {
var d = data[i];
if (d === undefined || d === null)
d = '';
values.push('"' + SimpleCSVBuilder.escape(d) + '"');
}
return values.join(',') + '\n';
};
================================================
FILE: package.json
================================================
{
"name": "shib",
"version": "1.0.0",
"engines": {
"node": ">= 0.8"
},
"description": "Hive Client Web Application",
"homepage": "https://github.com/tagomoris/shib",
"author": "TAGOMORI Satoshi ",
"keywords": [
"hive",
"hadoop"
],
"directories": {
"lib": "./lib",
"views": "./views",
"public": "./public",
"bin": "./bin"
},
"files": [
"README.md",
"app.js",
"config.js"
],
"dependencies": {
"async": ">= 0.1.22",
"bignumber.js": ">= 1.4.1",
"cheerio": ">= 0.17.0",
"csv": ">= 0.0.13",
"express": "~> 3.1.1",
"gcloud": "^0.12.0",
"jade": ">= 0.26.1",
"json-bigint": ">= 0.1.4",
"node-thrift": ">= 1.0.0-dev",
"presto-client": "git://github.com/wyukawa/presto-client-node.git#timezone",
"sqlite3": ">= 2.1.5"
},
"repository": {
"type": "git",
"url": "git://github.com/tagomoris/shib.git"
},
"bugs": {
"url": "https://github.com/tagomoris/shib/issues"
},
"licenses": [
{
"type": "APLv2"
}
],
"scripts": {
"start": "NODE_PATH=lib node app.js",
"test": "NODE_PATH=lib node_modules/nodeunit/bin/nodeunit test/*.js",
"purge": "node bin/purge.js var/database.sqlite3",
"migrate": "node bin/dbmigrate.js var/database.sqlite3"
},
"main": "app.js",
"devDependencies": {
"nodeunit": "~0.8.6"
}
}
================================================
FILE: public/css/redmond/jquery-ui-1.8.13.custom.css
================================================
/*
* jQuery UI CSS Framework 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
.ui-widget-header a { color: #ffffff; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; }
.ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
/* http://bugs.jqueryui.com/ticket/7233
- Resizable: resizable handles fail to work in IE if transparent and content overlaps
*/
background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
}
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.13
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
/*
* jQuery UI Button 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
================================================
FILE: public/css/shib.css
================================================
/* overwrite jquery-ui style */
.ui-tabs .ui-tabs-panel {padding: 1px;}
body {font: 62.5% "Trebuchet MS", sans-serif; min-width: 980px; width: 98%;}
/* css for test */
ul#icons1 {margin: 0; padding: 0;}
ul#icons1 li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
ul#icons1 span.ui-icon {float: left; margin: 0 4px;}
ul#icons2 {margin: 0; padding: 0;}
ul#icons2 li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;}
ul#icons2 span.ui-icon {float: left; margin: 0 4px;}
/* *** */
ul.operationitems {margin: 0; padding: 0;}
ul.operationitems li {margin: 2px; position: relative; padding: 4px 8px 4px 4px; cursor: pointer; float: left; list-style: none;}
ul.operationitems span.ui-icon {float: left; margin: 0 4px;}
ul.querytags {margin: 0; padding: 0;}
ul.querytags li {margin: 2px; position: relative; padding: 4px 8px 4px 4px; cursor: pointer; float: left; list-style: none;}
ul.querytags span.ui-icon {float: left; margin: 0 4px;}
span.status_not_executed {font-weight: bold; color: orange;}
span.status_running {font-weight: bold; color: navy;}
span.status_executed {font-weight: bold; color: green;}
span.status_done {font-weight: bold; color: green;}
span.status_error {font-weight: bold; color: red;}
span.status_re-running {font-weight: bold; color: orange;}
#titlearea {position: relative; min-width: 980px; width: 98%; margin-top: 15px; text-align: center;}
#title {
font-family: 'Artifika', serif; font-size: 40px; font-style: normal; font-weight: 400;
text-align: center; text-shadow: none; text-decoration: none; text-transform: none;
letter-spacing: 0em; word-spacing: 0em; line-height: 1.2;
}
#title a {
text-decoration: none; color: black;
}
span#subtitle {
font-size: 18px; font-style: normal; font-weight: 400;
letter-spacing: 0em; word-spacing: 0em; line-height: 1.2;
}
#noticearea {width: 50%; height: 5em; margin: 0px auto 2px auto;}
#errorarea {margin: 0 0 0 0;}
#infoarea {margin: 0 0 0 0;}
#mainarea {position: relative; max-width: 980px; min-width: 750px; margin: -15px auto; }
td#mainviewcell {margin: 0; padding: 0; vertical-align: top;}
#mainview {display: block; position: relative; clear: both; max-width: 560px; width: 560px; margin-right: 0px;}
td#tabviewcell {margin: 0; padding: 0; vertical-align: top;}
#tabview {display: block; position: relative; clear: both; max-width: 420px; width: 420px; margin-left: 10px;}
#runningarea {max-width: 980px; margin: 30px auto 10px auto; padding: .5em; text-align: center;}
#runnings {border: 1px solid #c0c0f8; background-color: #f8f8ff;}
#creditarea {margin: 10px auto; text-align: center;}
/* for main view (left pane) */
#querybox {}
#queryeditor {
width: 100%; border: 1px solid #c0c0f8;
font-family: 'Anonymous Pro', serif;
font-size: 18px;
font-style: normal;
font-weight: 700;
text-decoration: none;
text-transform: none;
letter-spacing: 0em;
word-spacing: 0em;
line-height: 1.2;
}
#querybox textarea.readonly {background-color: #f0f0f0;}
#keywordbox {display: none; width: 99%; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}
#keywordbox div {display: none; fond-weight: bold; font-size: small; width: 100%;}
#keywordbox div .keywordname {display: inline; width: 30%; text-align: right;}
#keywordbox div input {margin-left: 1em; width: 40%; border: 1px solid #c0c0f8; font-size: medium;}
#keywordbox div input.readonly {background-color: #f0f0f0;}
#dangereditbox {width: 99%; margin-top: .5em; padding: .5em; border: 1px solid #c0c0f8; background-color: #fff0f0;}
#editbox {width: 99%; margin-top: .5em; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}
#statusview {margin: 10px; font-size: small;}
#queryexec {margin: 10px; font-size: small;}
#queryresult {margin: 10px; font-size: small;}
#graphbox {margin-top: .5em; margin-bottom: .5em;}
#graphboxdummy {width: 100%; border: 1px dotted gray;}
#controlbox {width: 99%; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}
/* *** */
/* for tab view (right pane) */
.queryitem {padding-bottom: 2px; margin-bottom: 3px; border-bottom: 1px dotted;}
.queryitem_selected {background-color: #fdfdf0;}
.queryitem_information {width: 100%; font-weight: bold; background-color: #e8e8ef;}
.queryitem_statement {
font-family: 'Inconsolata', serif;
/*
font-family: 'Allerta', serif;
font-family: 'Anonymous Pro', serif;
font-family: 'Cousine', serif;
*/
font-size: 12px;
font-style: normal;
font-weight: 400;
text-shadow: none;
text-decoration: none;
text-transform: none;
letter-spacing: 0em;
word-spacing: 0em;
line-height: 1.2;
}
.queryitem_status {font-weight: bold; width: 100%;}
span.queryitem_etc {padding-left: 5px;}
/* *** */
================================================
FILE: public/css/ui.dynatree.css
================================================
/*******************************************************************************
* Tree container
*/
ul.dynatree-container
{
font-family: tahoma, arial, helvetica;
font-size: 10pt; /* font size should not be too big */
white-space: nowrap;
padding: 3px;
background-color: white;
border: 1px dotted gray;
overflow: auto;
}
ul.dynatree-container ul
{
padding: 0 0 0 16px;
margin: 0;
}
ul.dynatree-container li
{
list-style-image: none;
list-style-position: outside;
list-style-type: none;
-moz-background-clip:border;
-moz-background-inline-policy: continuous;
-moz-background-origin: padding;
background-attachment: scroll;
background-color: transparent;
background-repeat: repeat-y;
background-image: url("vline.gif");
background-position: 0 0;
/*
background-image: url("icons_96x256.gif");
background-position: -80px -64px;
*/
margin: 0;
padding: 1px 0 0 0;
}
/* Suppress lines for last child node */
ul.dynatree-container li.dynatree-lastsib
{
background-image: none;
}
/* Suppress lines if level is fixed expanded (option minExpandLevel) */
ul.dynatree-no-connector > li
{
background-image: none;
}
/* Style, when control is disabled */
.ui-dynatree-disabled ul.dynatree-container
{
opacity: 0.5;
/* filter: alpha(opacity=50); /* Yields a css warning */
background-color: silver;
}
/*******************************************************************************
* Common icon definitions
*/
span.dynatree-empty,
span.dynatree-vline,
span.dynatree-connector,
span.dynatree-expander,
span.dynatree-icon,
span.dynatree-checkbox,
span.dynatree-radio,
span.dynatree-drag-helper-img,
#dynatree-drop-marker
{
width: 16px;
height: 16px;
display: -moz-inline-box; /* @ FF 1+2 */
display: inline-block; /* Required to make a span sizeable */
vertical-align: top;
background-repeat: no-repeat;
background-position: left;
background-image: url("/image/jquery.dynatree/icons.gif");
background-position: 0 0;
}
/** Used by 'icon' node option: */
ul.dynatree-container img
{
width: 16px;
height: 16px;
margin-left: 3px;
vertical-align: top;
border-style: none;
}
/*******************************************************************************
* Lines and connectors
*/
span.dynatree-connector
{
background-position: -16px -64px;
}
/*******************************************************************************
* Expander icon
* Note: IE6 doesn't correctly evaluate multiples class names,
* so we create combined class names that can be used in the CSS.
*
* Prefix: dynatree-exp-
* 1st character: 'e': expanded, 'c': collapsed
* 2nd character (optional): 'd': lazy (Delayed)
* 3rd character (optional): 'l': Last sibling
*/
span.dynatree-expander
{
background-position: 0px -80px;
cursor: pointer;
}
.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */
{
background-position: 0px -96px;
}
.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */
{
background-position: -64px -80px;
}
.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */
{
background-position: -64px -96px;
}
.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */
.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */
{
background-position: -32px -80px;
}
.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */
.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */
{
background-position: -32px -96px;
}
.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */
{
background-position: 0 0;
background-image: url("/image/jquery.dynatree/loading.gif");
}
/*******************************************************************************
* Checkbox icon
*/
span.dynatree-checkbox
{
margin-left: 3px;
background-position: 0px -32px;
}
span.dynatree-checkbox:hover
{
background-position: -16px -32px;
}
.dynatree-partsel span.dynatree-checkbox
{
background-position: -64px -32px;
}
.dynatree-partsel span.dynatree-checkbox:hover
{
background-position: -80px -32px;
}
.dynatree-selected span.dynatree-checkbox
{
background-position: -32px -32px;
}
.dynatree-selected span.dynatree-checkbox:hover
{
background-position: -48px -32px;
}
/*******************************************************************************
* Radiobutton icon
* This is a customization, that may be activated by overriding the 'checkbox'
* class name as 'dynatree-radio' in the tree options.
*/
span.dynatree-radio
{
margin-left: 3px;
background-position: 0px -48px;
}
span.dynatree-radio:hover
{
background-position: -16px -48px;
}
.dynatree-partsel span.dynatree-radio
{
background-position: -64px -48px;
}
.dynatree-partsel span.dynatree-radio:hover
{
background-position: -80px -48px;
}
.dynatree-selected span.dynatree-radio
{
background-position: -32px -48px;
}
.dynatree-selected span.dynatree-radio:hover
{
background-position: -48px -48px;
}
/*******************************************************************************
* Node type icon
* Note: IE6 doesn't correctly evaluate multiples class names,
* so we create combined class names that can be used in the CSS.
*
* Prefix: dynatree-ico-
* 1st character: 'e': expanded, 'c': collapsed
* 2nd character (optional): 'f': folder
*/
span.dynatree-icon /* Default icon */
{
margin-left: 3px;
background-position: 0px 0px;
}
.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */
{
background-position: 0px -16px;
}
.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */
{
background-position: -64px -16px;
}
/* Status node icons */
.dynatree-statusnode-wait span.dynatree-icon
{
background-image: url("/image/jquery.dynatree/loading.gif");
}
.dynatree-statusnode-error span.dynatree-icon
{
background-position: 0px -112px;
/* background-image: url("/image/jquery.dynatree/ltError.gif");*/
}
/*******************************************************************************
* Node titles
*/
/* @Chrome: otherwise hit area of node titles is broken (issue 133)
Removed again for issue 165; (133 couldn't be reproduced) */
span.dynatree-node
{
/* display: -moz-inline-box; /* @ FF 1+2 */
/* display: inline-block; /* Required to make a span sizeable */
}
/* Remove blue color and underline from title links */
ul.dynatree-container a
/*, ul.dynatree-container a:visited*/
{
color: black; /* inherit doesn't work on IE */
text-decoration: none;
vertical-align: top;
margin: 0px;
margin-left: 3px;
/* outline: 0; /* @ Firefox, prevent dotted border after click */
}
ul.dynatree-container a:hover
{
/* text-decoration: underline; */
background: #F2F7FD; /* light blue */
border-color: #B8D6FB; /* darker light blue */
}
span.dynatree-node a
{
display: inline-block; /* Better alignment, when title contains */
/* vertical-align: top;*/
padding-left: 3px;
padding-right: 3px; /* Otherwise italic font will be outside bounds */
/* line-height: 16px; /* should be the same as img height, in case 16 px */
}
span.dynatree-folder a
{
font-weight: bold;
}
ul.dynatree-container a:focus,
span.dynatree-focused a:link /* @IE */
{
background-color: #EFEBDE; /* gray */
}
span.dynatree-has-children a
{
}
span.dynatree-expanded a
{
}
span.dynatree-selected a
{
color: green;
font-style: italic;
}
span.dynatree-active a
{
background-color: #3169C6 !important;
color: white !important; /* @ IE6 */
}
/*******************************************************************************
* Drag'n'drop support
*/
/*** Helper object ************************************************************/
div.dynatree-drag-helper
{
}
div.dynatree-drag-helper a
{
border: 1px solid gray;
background-color: white;
padding-left: 5px;
padding-right: 5px;
opacity: 0.8;
}
span.dynatree-drag-helper-img
{
/*
position: relative;
left: -16px;
*/
}
div.dynatree-drag-helper /*.dynatree-drop-accept*/
{
/* border-color: green;
background-color: red;*/
}
div.dynatree-drop-accept span.dynatree-drag-helper-img
{
background-position: -32px -112px;
}
div.dynatree-drag-helper.dynatree-drop-reject
{
border-color: red;
}
div.dynatree-drop-reject span.dynatree-drag-helper-img
{
background-position: -16px -112px;
}
/*** Drop marker icon *********************************************************/
#dynatree-drop-marker
{
width: 24px;
position: absolute;
background-position: 0 -128px;
}
#dynatree-drop-marker.dynatree-drop-after,
#dynatree-drop-marker.dynatree-drop-before
{
width:64px;
background-position: 0 -144px;
}
#dynatree-drop-marker.dynatree-drop-copy
{
background-position: -64px -128px;
}
#dynatree-drop-marker.dynatree-drop-move
{
background-position: -64px -128px;
}
/*** Source node while dragging ***********************************************/
span.dynatree-drag-source
{
/* border: 1px dotted gray; */
background-color: #e0e0e0;
}
span.dynatree-drag-source a
{
color: gray;
}
/*** Target node while dragging cursor is over it *****************************/
span.dynatree-drop-target
{
/*border: 1px solid gray;*/
}
span.dynatree-drop-target a
{
/*background-repeat: no-repeat;
background-position: right;
background-image: url("/image/jquery.dynatree/drop_child.gif");*/
}
span.dynatree-drop-target.dynatree-drop-accept a
{
/*border: 1px solid green;*/
background-color: #3169C6 !important;
color: white !important; /* @ IE6 */
text-decoration: none;
}
span.dynatree-drop-target.dynatree-drop-reject
{
/*border: 1px solid red;*/
}
span.dynatree-drop-target.dynatree-drop-after a
{
/*background-repeat: repeat-x;
background-position: bottom;
background-image: url("/image/jquery.dynatree/drop_append.gif");*/
}
/*******************************************************************************
* Custom node classes (sample)
*/
span.custom1 a
{
background-color: maroon;
color: yellow;
}
================================================
FILE: public/index.graphtest.html
================================================
shib - Query your Hive!
Welcome to jQuery UI!
This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of jQuery, your personalized copy of jQuery UI (js/jquery-ui-1.8.13.custom.min.js), and css/redmond/jquery-ui-1.8.13.custom.css which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs.
You've downloaded components and a theme that are compatible with jQuery 1.3+. Please make sure you are using jQuery 1.3+ in your production environment.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
Overlay and Shadow Classes (not currently used in UI widgets)
Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.
Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.
Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.
Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.
Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.
Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Framework Icons (content color preview)
Slider
Datepicker
Progressbar
Highlight / Error
Hey! Sample ui-state-highlight style.
Alert: Sample ui-state-error style.
================================================
FILE: public/index.jquery-ui-default.html
================================================
jQuery UI Example Page
Welcome to jQuery UI!
This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to minified versions of jQuery, your personalized copy of jQuery UI (js/jquery-ui-1.8.13.custom.min.js), and css/redmond/jquery-ui-1.8.13.custom.css which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs.
You've downloaded components and a theme that are compatible with jQuery 1.3+. Please make sure you are using jQuery 1.3+ in your production environment.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
Overlay and Shadow Classes (not currently used in UI widgets)
Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.
Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.
Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.
Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.
Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.
Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Framework Icons (content color preview)
Slider
Datepicker
Progressbar
Highlight / Error
Hey! Sample ui-state-highlight style.
Alert: Sample ui-state-error style.
================================================
FILE: public/js/shib.js
================================================
var shibnotifications = [];
var shibdata = {};
var shibselectedquery = null;
var shibselectedquery_dom = null;
var shib_QUERY_STATUS_CHECK_INTERVAL = 5000;
var shib_QUERY_EDITOR_WATCHER_INTERVAL = 500;
var shib_NOTIFICATION_CHECK_INTERVAL = 100;
var shib_NOTIFICATION_DEFAULT_DURATION_SECONDS = 10;
var shib_RUNNING_QUERY_UPDATE_INTERVAL = 15000;
var shib_RUNNING_QUERY_LOAD_INITIALY = 2000;
var engineInfo = null;
var authInfo = null;
var authEnabled = false;
function authAjax(req){
if (authInfo)
req['headers'] = { 'X-Shib-AuthInfo': authInfo };
$.ajax(req);
}
function authGet(url, callback){
authAjax({url: url, success: callback});
}
function authGetJSON(url, callback){
authAjax({url: url, success: callback, dataType: "json"});
}
function authGetText(url, callback){
authAjax({url: url, success: callback, dataType: "text"});
}
$(function(){
check_auth_initial();
load_tabs({callback:function(){
follow_current_uri();
setInterval(check_selected_running_query_state, shib_QUERY_STATUS_CHECK_INTERVAL);
setInterval(show_notification, shib_NOTIFICATION_CHECK_INTERVAL);
setInterval(update_running_queries, shib_RUNNING_QUERY_UPDATE_INTERVAL);
setTimeout(update_running_queries, shib_RUNNING_QUERY_LOAD_INITIALY);
}});
//hover states on the static widgets
$('ul.operationitems li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
$('#tables_diag,#describe_diag')
.css('text-decoration', 'line-through')
.css('cursor', 'wait');
load_pairs(function(){
$('#tables_diag').click(function(event){show_tables_dialog();});
$('#table_pairs').change(function(event){show_tables_dialog();});
$('#describe_diag').click(function(event){show_describe_dialog();});
$('#desc_pairs').change(function(event){show_describe_dialog();});
$('#taglist_diag').click(function(event){show_taglist_dialog();});
$('#tables_diag,#describe_diag,#taglist_diag')
.css('text-decoration', '')
.css('cursor', 'pointer');
});
$('#new_button').click(initiate_mainview);
$('#copy_button').click(copy_selected_query);
$('#clip_button').click(clip_selected_query);
$('#unclip_button').click(unclip_selected_query);
$('#auth_button').click(show_auth_dialog);
$('#execute_button').click(execute_query);
$('#giveup_button').click(giveup_query);
$('#status_button').click(show_status_query);
$('#delete_button').click(delete_query);
$('#display_full_button').click(function(){show_result_query({range:'full'});});
$('#display_head_button').click(function(){show_result_query({range:'head'});});
$('#download_tsv_button').click(function(){download_result_query({format:'tsv'});});
$('#download_csv_button').click(function(){download_result_query({format:'csv'});});
$('#edit_tag_button').click(show_edit_tag_dialog);
$('#add_tag_submit').click(execute_add_tag);
$('#remove_tag_submit').click(execute_remove_tag);
$('#auth_submit').click(check_auth);
});
/* engine/database pairs list loading (just after page loading) */
$.template("pairTemplate",
'');
function load_pairs(callback) {
authGet('/engines?=' + (new Date()).getTime(), function(data){
engineInfo = data;
$('select#table_pairs,select#desc_pairs,select#exec_pairs').empty();
$.tmpl('pairTemplate',
engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })
).appendTo('select#table_pairs');
$.tmpl('pairTemplate',
engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })
).appendTo('select#desc_pairs');
$.tmpl('pairTemplate',
engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })
).appendTo('select#exec_pairs');
if (callback)
callback();
});
};
/* authentication check initially */
function check_auth_initial() {
authAjax({
type: "POST",
url: '/auth',
data: {},
cache: false,
success: function(data){
authInfo = data.authInfo;
authEnabled = data.enabled;
// show execute button instead of auth button
if ($('#auth_button:visible').size() > 0)
show_editbox_buttons(['execute_button']);
$('span#authRealm').text(data.realm);
},
error: function(jqXHR, textStatus, errorThrown){
authInfo = null;
var data = JSON.parse(jqXHR.responseText);
authEnabled = data.enabled;
$('span#authRealm').text(data.realm);
}
});
}
/* basic data operations */
function set_execute_query_list(list) {
if (! window.localStorage) return;
window.localStorage.executeList = JSON.stringify(list);
};
function delete_execute_query_item(queryid) {
if (! window.localStorage) return;
window.localStorage.executeList = JSON.stringify(execute_query_list().filter(function(v){return v !== queryid;}));
};
function execute_query_list() {
if (! window.localStorage) return [];
var list = [];
try {
var listString = window.localStorage.executeList;
if (listString && listString.length > 0)
list = JSON.parse(listString);
} catch (e) { set_execute_query_list([]); list = []; }
return list;
};
function push_execute_query_list(queryid, refresh) {
if (! window.localStorage) return;
var list = execute_query_list();
if (refresh)
list = list.filter(function(v){return v !== queryid;});
else if (list.filter(function(v){return v === queryid;}).length > 0)
return;
if (list.length > 10) list = list.slice(0,10);
list.unshift(queryid);
set_execute_query_list(list);
};
function set_bookmark_query_list(list) {
if (! window.localStorage) return;
window.localStorage.bookmark = JSON.stringify(list);
};
function delete_bookmark_query_list(queryid) {
if (! window.localStorage) return;
window.localStorage.bookmark = JSON.stringify(bookmark_query_list().filter(function(v){return v !== queryid;}));
};
function bookmark_query_list() {
if (! window.localStorage) return [];
var list = [];
try {
var listString = window.localStorage.bookmark;
if (listString && listString.length > 0)
list = JSON.parse(listString);
} catch (e) { set_bookmark_query_list([]); list = []; }
return list;
};
function exists_in_bookmark_query_list(queryid) {
if (! window.localStorage) return false;
return bookmark_query_list().filter(function(v){return v === queryid;}).length > 0;
};
function push_bookmark_query_list(queryid) {
if (! window.localStorage) return;
var list = bookmark_query_list().filter(function(v){return v !== queryid;});
list.unshift(queryid);
set_bookmark_query_list(list);
};
function query_last_result(query) {
var obj = null;
if (query && query.results && query.results.length > 0 && query.results[query.results.length - 1])
if ((obj = shibdata.result_cache[query.results[query.results.length - 1].resultid]) !== null)
return obj;
return null;
};
function query_second_last_result(query) {
var obj = null;
if (query && query.results && query.results.length > 1 && query.results[query.results.length - 2])
if ((obj = shibdata.result_cache[query.results[query.results.length - 2].resultid]) !== null)
return obj;
return null;
};
function query_last_done_result(query) {
var last = query_last_result(query);
if (last && last.state == 'done')
return last;
return query_second_last_result(query);
}
function query_result_schema_label(result){
return 'fields: ' + result.schema.map(function(field){return field.name + '(' + field.type + ')';}).join(', ');
};
function query_current_state(query) {
if (!query)
return null;
if (query && (! query.queryid))
show_error('UI Bug', 'query id unknown', 5, query);
if (shibdata.query_state_cache[query.queryid])
return shibdata.query_state_cache[query.queryid];
var state = null;
var lastresult = query_last_result(query);
if (! lastresult)
state = 'running';
else if (lastresult.state === 'running') {
var secondlast = query_second_last_result(query);
if (secondlast && secondlast.state === 'done')
state = 're-running';
else
state = 'running';
}
else if (lastresult.state === 'error')
state = 'error';
else
state = 'executed';
shibdata.query_state_cache[query.queryid] = state;
return state;
};
function timelabel_elapsed(completed_at, executed_at){
if (!completed_at || !executed_at)
return 'unknown times';
var seconds = Math.floor(((new Date(completed_at)) - (new Date(executed_at))) / 1000);
if (seconds < 60)
return seconds + ' seconds';
var minutes = Math.floor(seconds / 60);
if (minutes < 60)
return minutes + ' minutes';
return Math.floor(minutes / 60) + ' hours';
};
/* uri and history operation */
function follow_current_uri() {
if (window.location.pathname.indexOf('/q/') === 0) {
var queryid = window.location.pathname.substring('/q/'.length);
if (/^[0-9a-z]{32}$/.exec(queryid)) // queryid is md5 (16bytes) hexdigest (32chars)
follow_current_uri_query(queryid);
}
if (window.location.pathname.indexOf('/t/') === 0) {
var tag = window.location.pathname.substring('/t/'.length);
follow_current_uri_tag(tag);
}
};
function follow_current_uri_query(queryid){
var query = shibdata.query_cache[queryid];
if (query) {
update_mainview(query);
return;
}
authAjax({
url: '/query/' + queryid,
type: 'GET',
cache: false,
error: function(jqXHR, textStatus, errorThrown){
show_error('Unknown query id', 'cannot get query object with specified id', 10);
},
success: function(data, textStatus, jqXHR){
query = data;
shibdata.query_cache[queryid] = query;
var resultids = data.results.map(function(v){return v.resultid;});
authAjax({
url: '/results',
type: 'POST',
dataType: 'json',
data: {ids: resultids},
success: function(data){
data.results.forEach(function(result1){
if (! result1)
return;
shibdata.result_cache[result1.resultid] = result1;
});
update_mainview(query);
}
});
}
});
}
function follow_current_uri_tag(tag){
authAjax({
url: '/tagged/' + tag,
type: 'GET',
cache: false,
error: function(jqXHR, textStatus, err) {
console.log(jqXHR);
console.log(textStatus);
var msg = null;
try { msg = JSON.parse(jqXHR.responseText).message; }
catch (e) { msg = jqXHR.responseText; }
show_error('Failed to get detail status', msg);
},
success: function(queryids) {
load_query_tree(queryids, function(){
update_tabs(true, {tag:tag, queryids:queryids});
});
}
});
}
function update_history_by_query(query) {
if (! window.history.pushState ) // if pushState not ready
return;
if (query === null) {
window.history.pushState('','', '/');
return;
}
window.history.pushState(query.queryid, '', '/q/' + query.queryid);
};
window.addEventListener("popstate", function (event) {
if (event.state === null || event.state === undefined || event.state.length < 32)
return;
var query = shibdata.query_cache[event.state];
if (! query) {
show_error('UI BUG', 'unknown queryid from history event.state', 10);
return;
}
update_mainview(query);
}, false);
/* notifications */
var shib_current_notification = null;
var shib_current_notification_counter = 0;
function show_notification(event){ /* event object is not used */
if (shib_current_notification === null && shibnotifications.length == 0)
return;
if (shib_current_notification !== null && shibnotifications.length == 0){
shib_current_notification_counter -= 1;
if (shib_current_notification_counter < 1) {
shib_current_notification.fadeOut(100);
shib_current_notification_counter = 0;
}
return;
}
var next = shibnotifications.shift();
shib_current_notification_counter = ( next.duration || shib_NOTIFICATION_DEFAULT_DURATION_SECONDS ) * 10;
if (shib_current_notification) {
shib_current_notification.fadeOut(100, function(){
shib_current_notification = update_notification(next.type, next.title, next.message);
shib_current_notification.fadeIn(100);
});
}
else {
shib_current_notification = update_notification(next.type, next.title, next.message);
shib_current_notification.fadeIn(100);
}
};
function update_notification(type, title, message){
if (type === 'info') {
$('#infotitle').text(title);
$('#infomessage').text(message);
return $('#infoarea');
}
$('#errortitle').text(title);
$('#errormessage').text(message);
return $('#errorarea');
};
function show_info(title, message, duration){
shibnotifications.push({type:'info', title:title, message:message, duration:duration});
};
function show_error(title, message, duration, optional_object){
shibnotifications.push({type:'error', title:title, message:message, duration:duration});
if (optional_object)
console.log(optional_object);
};
/* dialog */
function show_tables_dialog() {
$('#tables')
.dynatree('destroy')
.empty()
.hide();
$('#tablesdiag').dialog({modal:false, resizable:true, height:400, width:400, maxHeight:650, maxWidth:950});
$('#tablesdiag .loadingimg').show();
var selected = $('#table_pairs option:selected');
var engine = selected.data('engine');
var dbname = selected.data('database');
var get_path = '/tables?engine=' + encodeURIComponent(engine) + '&db=' + encodeURIComponent(dbname);
authGet(get_path, function(data){
$('#tablesdiag .loadingimg').hide();
$('#tables')
.show()
.dynatree({
children: data.map(function(v){return {title: v, key: v, isFolder: true, isLazy: true};}),
autoFocus: false,
autoCollapse: true,
clickFolderMode: 2,
activeVisible: false,
onLazyRead: function(node){
node.appendAjax({
url: '/partitions',
data: { key: node.data.key, engine: engine, db: dbname },
cache: false
});
}
});
});
};
function show_describe_dialog() {
$('#describes')
.dynatree('destroy')
.empty()
.hide();
$('#describediag').dialog({modal:false, resizable:true, height:400, width:400, maxHeight:650, maxWidth:950});
$('#describediag .loadingimg').show();
var selected = $('#desc_pairs option:selected');
var engine = selected.data('engine');
var dbname = selected.data('database');
var get_path = '/tables?engine=' + encodeURIComponent(engine) + '&db=' + encodeURIComponent(dbname);
authGet(get_path, function(data){
$('#describediag .loadingimg').hide();
$('#describes')
.show()
.dynatree({
children: data.map(function(v){return {title: v, key: v, isFolder: true, isLazy: true};}),
autoFocus: false,
autoCollapse: true,
clickFolderMode: 2,
activeVisible: false,
onLazyRead: function(node){
node.appendAjax({
url: '/describe',
data: { key: node.data.key, engine: engine, db: dbname },
cache: false
});
}
});
});
};
$.template("tagForTagListTemplate", '
');
function update_running_queries(event){
authGet('/runnings', function(data){
$('#runnings').empty();
if (data.length < 1) {
$('
no running queries
').appendTo('#runnings');
return;
}
$('#runnings').show();
$.tmpl("runningsTemplate",
data.map(function(pair){return {QueryId: pair[0], Runnings: pair[1]};})
).appendTo('#runnings');
});
};
/* left pane interactions (user-operation interactions) */
function check_auth(e) {
e.preventDefault();
var username = $('#username').val();
var password = $('#password').val();
authAjax({
type: "POST",
url: '/auth',
data: {username: username, password: password},
cache: false,
success: function(data, textStatus, jqXHR){
authInfo = data.authInfo;
if ($('#auth_button:visible').size() > 0)
show_editbox_buttons(['execute_button']);
$('#authinputdiag').dialog('close');
show_info('User/Pass check', 'success');
load_pairs(); // reload engine-database pairs w/ authenticated username
},
error: function(jqXHR, textStatus, errorThrown){
authInfo = null;
$('#authinputdiag').dialog('close');
show_error('User/Pass check', 'failed', 10);
}
});
}
function execute_query() {
if (! authInfo) {
show_error('UI Bug', 'check authentication at first!');
return;
}
if (shibselectedquery) {
show_error('UI Bug', 'execute_query should be enable with not-saved-query objects');
return;
}
var selected = $('#exec_pairs option:selected');
var engine = selected.data('engine');
var dbname = selected.data('database');
var querystring = $('#queryeditor').val();
var postdata = {
engineLabel: engine,
dbname: dbname,
querystring: querystring,
authInfo: authInfo
};
authAjax({
url: '/execute',
type: 'POST',
dataType: 'json',
data: postdata,
error: function(jqXHR, textStatus, err){
var msg = null;
try {
msg = JSON.parse(jqXHR.responseText).message;
}
catch (e) {
msg = jqXHR.responseText;
}
show_error('Cannot Execute Query', msg);
},
success: function(query){
show_info('Query now waiting to run', '');
shibdata.query_cache[query.queryid] = query;
update_mainview(query);
if (window.localStorage) {
push_execute_query_list(query.queryid);
}
update_history_by_query(query);
load_tabs({reload:true});
}
});
};
function giveup_query() {
if (! shibselectedquery) {
show_error('UI Bug', 'giveup_query should be enable with non-saved-query objects');
return;
}
authAjax({
url: '/giveup',
type: 'POST',
dataType: 'json',
data: {queryid: shibselectedquery.queryid},
error: function(jqXHR, textStatus, err){
console.log(jqXHR);
console.log(textStatus);
var msg = null;
try {
msg = JSON.parse(jqXHR.responseText).message;
}
catch (e) {
msg = jqXHR.responseText;
}
show_error('Cannot GiveUp Query', msg);
},
success: function(query){
show_info('Query gived-up', '');
shibdata.query_cache[query.queryid] = query;
shibdata.query_state_cache[query.queryid] = 'error';
load_results(query.results.map(function(v){return v.resultid;}), function(err){
update_mainview(query);
load_tabs({reload:true});
});
}
});
};
function show_status_query(eventNotUsed) {
if (! shibselectedquery)
return;
if (! engineInfo || !engineInfo.monitor[shibselectedquery.engine])
return;
show_status_dialog(shibselectedquery);
}
function delete_query(event) {
if (! shibselectedquery)
return;
var target = shibselectedquery;
authAjax({
url: '/delete',
type: 'POST',
dataType: 'json',
data: {queryid: target.queryid},
error: function(jqXHR, textStatus, err){
console.log(jqXHR);
console.log(textStatus);
var msg = null;
try {
msg = JSON.parse(jqXHR.responseText).message;
}
catch (e) {
msg = jqXHR.responseText;
}
show_error('Failed to delete query', msg);
},
success: function(data){
show_info('Selected query successfully deleted', '');
initiate_mainview(null, true);
delete_execute_query_item(target.queryid);
load_tabs({reload:true});
}
});
};
function show_result_query(opts) { /* opts: {range:full/head} */
var size = 'full';
var height = 400;
var width = 600;
if (opts.range == 'head'){
size = 'head';
height = 200;
}
authGetText('/show/' + size + '/' + query_last_done_result(shibselectedquery).resultid, function(data){
$('pre#resultdisplay').text(data);
$('#resultdiag').dialog({modal:true, resizable:true, height:400, width:600, maxHeight:650, maxWidth:950});
});
};
function download_result_query(opts) { /* opts: {format:tsv/csv} */
var format = 'tsv';
if (opts.format == 'csv') {
format = 'csv';
}
window.location = '/download/' + format + '/' + query_last_done_result(shibselectedquery).resultid;
};
================================================
FILE: src/hiveserver/if/TCLIService.thrift
================================================
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Coding Conventions for this file:
//
// Structs/Enums/Unions
// * Struct, Enum, and Union names begin with a "T",
// and use a capital letter for each new word, with no underscores.
// * All fields should be declared as either optional or required.
//
// Functions
// * Function names start with a capital letter and have a capital letter for
// each new word, with no underscores.
// * Each function should take exactly one parameter, named TFunctionNameReq,
// and should return either void or TFunctionNameResp. This convention allows
// incremental updates.
//
// Services
// * Service names begin with the letter "T", use a capital letter for each
// new word (with no underscores), and end with the word "Service".
namespace java org.apache.hive.service.cli.thrift
namespace cpp apache.hive.service.cli.thrift
// List of protocol versions. A new token should be
// added to the end of this list every time a change is made.
enum TProtocolVersion {
HIVE_CLI_SERVICE_PROTOCOL_V1
}
enum TTypeId {
BOOLEAN_TYPE,
TINYINT_TYPE,
SMALLINT_TYPE,
INT_TYPE,
BIGINT_TYPE,
FLOAT_TYPE,
DOUBLE_TYPE,
STRING_TYPE,
TIMESTAMP_TYPE,
BINARY_TYPE,
ARRAY_TYPE,
MAP_TYPE,
STRUCT_TYPE,
UNION_TYPE,
USER_DEFINED_TYPE,
DECIMAL_TYPE
}
const set PRIMITIVE_TYPES = [
TTypeId.BOOLEAN_TYPE
TTypeId.TINYINT_TYPE
TTypeId.SMALLINT_TYPE
TTypeId.INT_TYPE
TTypeId.BIGINT_TYPE
TTypeId.FLOAT_TYPE
TTypeId.DOUBLE_TYPE
TTypeId.STRING_TYPE
TTypeId.TIMESTAMP_TYPE
TTypeId.BINARY_TYPE,
TTypeId.DECIMAL_TYPE
]
const set COMPLEX_TYPES = [
TTypeId.ARRAY_TYPE
TTypeId.MAP_TYPE
TTypeId.STRUCT_TYPE
TTypeId.UNION_TYPE
TTypeId.USER_DEFINED_TYPE
]
const set COLLECTION_TYPES = [
TTypeId.ARRAY_TYPE
TTypeId.MAP_TYPE
]
const map TYPE_NAMES = {
TTypeId.BOOLEAN_TYPE: "BOOLEAN",
TTypeId.TINYINT_TYPE: "TINYINT",
TTypeId.SMALLINT_TYPE: "SMALLINT",
TTypeId.INT_TYPE: "INT",
TTypeId.BIGINT_TYPE: "BIGINT",
TTypeId.FLOAT_TYPE: "FLOAT",
TTypeId.DOUBLE_TYPE: "DOUBLE",
TTypeId.STRING_TYPE: "STRING",
TTypeId.TIMESTAMP_TYPE: "TIMESTAMP",
TTypeId.BINARY_TYPE: "BINARY",
TTypeId.ARRAY_TYPE: "ARRAY",
TTypeId.MAP_TYPE: "MAP",
TTypeId.STRUCT_TYPE: "STRUCT",
TTypeId.UNION_TYPE: "UNIONTYPE"
TTypeId.DECIMAL_TYPE: "DECIMAL"
}
// Thrift does not support recursively defined types or forward declarations,
// which makes it difficult to represent Hive's nested types.
// To get around these limitations TTypeDesc employs a type list that maps
// integer "pointers" to TTypeEntry objects. The following examples show
// how different types are represented using this scheme:
//
// "INT":
// TTypeDesc {
// types = [
// TTypeEntry.primitive_entry {
// type = INT_TYPE
// }
// ]
// }
//
// "ARRAY":
// TTypeDesc {
// types = [
// TTypeEntry.array_entry {
// object_type_ptr = 1
// },
// TTypeEntry.primitive_entry {
// type = INT_TYPE
// }
// ]
// }
//
// "MAP":
// TTypeDesc {
// types = [
// TTypeEntry.map_entry {
// key_type_ptr = 1
// value_type_ptr = 2
// },
// TTypeEntry.primitive_entry {
// type = INT_TYPE
// },
// TTypeEntry.primitive_entry {
// type = STRING_TYPE
// }
// ]
// }
typedef i32 TTypeEntryPtr
// Type entry for a primitive type.
struct TPrimitiveTypeEntry {
// The primitive type token. This must satisfy the condition
// that type is in the PRIMITIVE_TYPES set.
1: required TTypeId type
}
// Type entry for an ARRAY type.
struct TArrayTypeEntry {
1: required TTypeEntryPtr objectTypePtr
}
// Type entry for a MAP type.
struct TMapTypeEntry {
1: required TTypeEntryPtr keyTypePtr
2: required TTypeEntryPtr valueTypePtr
}
// Type entry for a STRUCT type.
struct TStructTypeEntry {
1: required map nameToTypePtr
}
// Type entry for a UNIONTYPE type.
struct TUnionTypeEntry {
1: required map nameToTypePtr
}
struct TUserDefinedTypeEntry {
// The fully qualified name of the class implementing this type.
1: required string typeClassName
}
// We use a union here since Thrift does not support inheritance.
union TTypeEntry {
1: TPrimitiveTypeEntry primitiveEntry
2: TArrayTypeEntry arrayEntry
3: TMapTypeEntry mapEntry
4: TStructTypeEntry structEntry
5: TUnionTypeEntry unionEntry
6: TUserDefinedTypeEntry userDefinedTypeEntry
}
// Type descriptor for columns.
struct TTypeDesc {
// The "top" type is always the first element of the list.
// If the top type is an ARRAY, MAP, STRUCT, or UNIONTYPE
// type, then subsequent elements represent nested types.
1: required list types
}
// A result set column descriptor.
struct TColumnDesc {
// The name of the column
1: required string columnName
// The type descriptor for this column
2: required TTypeDesc typeDesc
// The ordinal position of this column in the schema
3: required i32 position
4: optional string comment
}
// Metadata used to describe the schema (column names, types, comments)
// of result sets.
struct TTableSchema {
1: required list columns
}
// A Boolean column value.
struct TBoolValue {
// NULL if value is unset.
1: optional bool value
}
// A Byte column value.
struct TByteValue {
// NULL if value is unset.
1: optional byte value
}
// A signed, 16 bit column value.
struct TI16Value {
// NULL if value is unset
1: optional i16 value
}
// A signed, 32 bit column value
struct TI32Value {
// NULL if value is unset
1: optional i32 value
}
// A signed 64 bit column value
struct TI64Value {
// NULL if value is unset
1: optional i64 value
}
// A floating point 64 bit column value
struct TDoubleValue {
// NULL if value is unset
1: optional double value
}
struct TStringValue {
// NULL if value is unset
1: optional string value
}
union TColumn {
1: list boolColumn
2: list byteColumn
3: list i16Column
4: list i32Column
5: list i64Column
6: list doubleColumn
7: list stringColumn
}
// A single column value in a result set.
// Note that Hive's type system is richer than Thrift's,
// so in some cases we have to map multiple Hive types
// to the same Thrift type. On the client-side this is
// disambiguated by looking at the Schema of the
// result set.
union TColumnValue {
1: TBoolValue boolVal // BOOLEAN
2: TByteValue byteVal // TINYINT
3: TI16Value i16Val // SMALLINT
4: TI32Value i32Val // INT
5: TI64Value i64Val // BIGINT, TIMESTAMP
6: TDoubleValue doubleVal // FLOAT, DOUBLE
7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL
}
// Represents a row in a rowset.
struct TRow {
1: required list colVals
}
// Represents a rowset
struct TRowSet {
// The starting row offset of this rowset.
1: required i64 startRowOffset
2: required list rows
3: optional list columns
}
// The return status code contained in each response.
enum TStatusCode {
SUCCESS_STATUS,
SUCCESS_WITH_INFO_STATUS,
STILL_EXECUTING_STATUS,
ERROR_STATUS,
INVALID_HANDLE_STATUS
}
// The return status of a remote request
struct TStatus {
1: required TStatusCode statusCode
// If status is SUCCESS_WITH_INFO, info_msgs may be populated with
// additional diagnostic information.
2: optional list infoMessages
// If status is ERROR, then the following fields may be set
3: optional string sqlState // as defined in the ISO/IEF CLI specification
4: optional i32 errorCode // internal error code
5: optional string errorMessage
}
// The state of an operation (i.e. a query or other
// asynchronous operation that generates a result set)
// on the server.
enum TOperationState {
// The operation has been initialized
INITIALIZED_STATE,
// The operation is running. In this state the result
// set is not available.
RUNNING_STATE,
// The operation has completed. When an operation is in
// this state its result set may be fetched.
FINISHED_STATE,
// The operation was canceled by a client
CANCELED_STATE,
// The operation was closed by a client
CLOSED_STATE,
// The operation failed due to an error
ERROR_STATE,
// The operation is in an unrecognized state
UKNOWN_STATE,
}
// A string identifier. This is interpreted literally.
typedef string TIdentifier
// A search pattern.
//
// Valid search pattern characters:
// '_': Any single character.
// '%': Any sequence of zero or more characters.
// '\': Escape character used to include special characters,
// e.g. '_', '%', '\'. If a '\' precedes a non-special
// character it has no special meaning and is interpreted
// literally.
typedef string TPattern
// A search pattern or identifier. Used as input
// parameter for many of the catalog functions.
typedef string TPatternOrIdentifier
struct THandleIdentifier {
// 16 byte globally unique identifier
// This is the public ID of the handle and
// can be used for reporting.
1: required binary guid,
// 16 byte secret generated by the server
// and used to verify that the handle is not
// being hijacked by another user.
2: required binary secret,
}
// Client-side handle to persistent
// session information on the server-side.
struct TSessionHandle {
1: required THandleIdentifier sessionId
}
// The subtype of an OperationHandle.
enum TOperationType {
EXECUTE_STATEMENT,
GET_TYPE_INFO,
GET_CATALOGS,
GET_SCHEMAS,
GET_TABLES,
GET_TABLE_TYPES,
GET_COLUMNS,
GET_FUNCTIONS,
UNKNOWN,
}
// Client-side reference to a task running
// asynchronously on the server.
struct TOperationHandle {
1: required THandleIdentifier operationId
2: required TOperationType operationType
// If hasResultSet = TRUE, then this operation
// generates a result set that can be fetched.
// Note that the result set may be empty.
//
// If hasResultSet = FALSE, then this operation
// does not generate a result set, and calling
// GetResultSetMetadata or FetchResults against
// this OperationHandle will generate an error.
3: required bool hasResultSet
// For operations that don't generate result sets,
// modifiedRowCount is either:
//
// 1) The number of rows that were modified by
// the DML operation (e.g. number of rows inserted,
// number of rows deleted, etc).
//
// 2) 0 for operations that don't modify or add rows.
//
// 3) < 0 if the operation is capable of modifiying rows,
// but Hive is unable to determine how many rows were
// modified. For example, Hive's LOAD DATA command
// doesn't generate row count information because
// Hive doesn't inspect the data as it is loaded.
//
// modifiedRowCount is unset if the operation generates
// a result set.
4: optional double modifiedRowCount
}
// OpenSession()
//
// Open a session (connection) on the server against
// which operations may be executed.
struct TOpenSessionReq {
// The version of the HiveServer2 protocol that the client is using.
1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1
// Username and password for authentication.
// Depending on the authentication scheme being used,
// this information may instead be provided by a lower
// protocol layer, in which case these fields may be
// left unset.
2: optional string username
3: optional string password
// Configuration overlay which is applied when the session is
// first created.
4: optional map configuration
}
struct TOpenSessionResp {
1: required TStatus status
// The protocol version that the server is using.
2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1
// Session Handle
3: optional TSessionHandle sessionHandle
// The configuration settings for this session.
4: optional map configuration
}
// CloseSession()
//
// Closes the specified session and frees any resources
// currently allocated to that session. Any open
// operations in that session will be canceled.
struct TCloseSessionReq {
1: required TSessionHandle sessionHandle
}
struct TCloseSessionResp {
1: required TStatus status
}
enum TGetInfoType {
CLI_MAX_DRIVER_CONNECTIONS = 0,
CLI_MAX_CONCURRENT_ACTIVITIES = 1,
CLI_DATA_SOURCE_NAME = 2,
CLI_FETCH_DIRECTION = 8,
CLI_SERVER_NAME = 13,
CLI_SEARCH_PATTERN_ESCAPE = 14,
CLI_DBMS_NAME = 17,
CLI_DBMS_VER = 18,
CLI_ACCESSIBLE_TABLES = 19,
CLI_ACCESSIBLE_PROCEDURES = 20,
CLI_CURSOR_COMMIT_BEHAVIOR = 23,
CLI_DATA_SOURCE_READ_ONLY = 25,
CLI_DEFAULT_TXN_ISOLATION = 26,
CLI_IDENTIFIER_CASE = 28,
CLI_IDENTIFIER_QUOTE_CHAR = 29,
CLI_MAX_COLUMN_NAME_LEN = 30,
CLI_MAX_CURSOR_NAME_LEN = 31,
CLI_MAX_SCHEMA_NAME_LEN = 32,
CLI_MAX_CATALOG_NAME_LEN = 34,
CLI_MAX_TABLE_NAME_LEN = 35,
CLI_SCROLL_CONCURRENCY = 43,
CLI_TXN_CAPABLE = 46,
CLI_USER_NAME = 47,
CLI_TXN_ISOLATION_OPTION = 72,
CLI_INTEGRITY = 73,
CLI_GETDATA_EXTENSIONS = 81,
CLI_NULL_COLLATION = 85,
CLI_ALTER_TABLE = 86,
CLI_ORDER_BY_COLUMNS_IN_SELECT = 90,
CLI_SPECIAL_CHARACTERS = 94,
CLI_MAX_COLUMNS_IN_GROUP_BY = 97,
CLI_MAX_COLUMNS_IN_INDEX = 98,
CLI_MAX_COLUMNS_IN_ORDER_BY = 99,
CLI_MAX_COLUMNS_IN_SELECT = 100,
CLI_MAX_COLUMNS_IN_TABLE = 101,
CLI_MAX_INDEX_SIZE = 102,
CLI_MAX_ROW_SIZE = 104,
CLI_MAX_STATEMENT_LEN = 105,
CLI_MAX_TABLES_IN_SELECT = 106,
CLI_MAX_USER_NAME_LEN = 107,
CLI_OJ_CAPABILITIES = 115,
CLI_XOPEN_CLI_YEAR = 10000,
CLI_CURSOR_SENSITIVITY = 10001,
CLI_DESCRIBE_PARAMETER = 10002,
CLI_CATALOG_NAME = 10003,
CLI_COLLATION_SEQ = 10004,
CLI_MAX_IDENTIFIER_LEN = 10005,
}
union TGetInfoValue {
1: string stringValue
2: i16 smallIntValue
3: i32 integerBitmask
4: i32 integerFlag
5: i32 binaryValue
6: i64 lenValue
}
// GetInfo()
//
// This function is based on ODBC's CLIGetInfo() function.
// The function returns general information about the data source
// using the same keys as ODBC.
struct TGetInfoReq {
// The sesssion to run this request against
1: required TSessionHandle sessionHandle
2: required TGetInfoType infoType
}
struct TGetInfoResp {
1: required TStatus status
2: required TGetInfoValue infoValue
}
// ExecuteStatement()
//
// Execute a statement.
// The returned OperationHandle can be used to check on the
// status of the statement, and to fetch results once the
// statement has finished executing.
struct TExecuteStatementReq {
// The session to exexcute the statement against
1: required TSessionHandle sessionHandle
// The statement to be executed (DML, DDL, SET, etc)
2: required string statement
// Configuration properties that are overlayed on top of the
// the existing session configuration before this statement
// is executed. These properties apply to this statement
// only and will not affect the subsequent state of the Session.
3: optional map confOverlay
}
struct TExecuteStatementResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetTypeInfo()
//
// Get information about types supported by the HiveServer instance.
// The information is returned as a result set which can be fetched
// using the OperationHandle provided in the response.
//
// Refer to the documentation for ODBC's CLIGetTypeInfo function for
// the format of the result set.
struct TGetTypeInfoReq {
// The session to run this request against.
1: required TSessionHandle sessionHandle
}
struct TGetTypeInfoResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetCatalogs()
//
// Returns the list of catalogs (databases)
// Results are ordered by TABLE_CATALOG
//
// Resultset columns :
// col1
// name: TABLE_CAT
// type: STRING
// desc: Catalog name. NULL if not applicable.
//
struct TGetCatalogsReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
}
struct TGetCatalogsResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetSchemas()
//
// Retrieves the schema names available in this database.
// The results are ordered by TABLE_CATALOG and TABLE_SCHEM.
// col1
// name: TABLE_SCHEM
// type: STRING
// desc: schema name
// col2
// name: TABLE_CATALOG
// type: STRING
// desc: catalog name
struct TGetSchemasReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
// Name of the catalog. Must not contain a search pattern.
2: optional TIdentifier catalogName
// schema name or pattern
3: optional TPatternOrIdentifier schemaName
}
struct TGetSchemasResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetTables()
//
// Returns a list of tables with catalog, schema, and table
// type information. The information is returned as a result
// set which can be fetched using the OperationHandle
// provided in the response.
// Results are ordered by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, and TABLE_NAME
//
// Result Set Columns:
//
// col1
// name: TABLE_CAT
// type: STRING
// desc: Catalog name. NULL if not applicable.
//
// col2
// name: TABLE_SCHEM
// type: STRING
// desc: Schema name.
//
// col3
// name: TABLE_NAME
// type: STRING
// desc: Table name.
//
// col4
// name: TABLE_TYPE
// type: STRING
// desc: The table type, e.g. "TABLE", "VIEW", etc.
//
// col5
// name: REMARKS
// type: STRING
// desc: Comments about the table
//
struct TGetTablesReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
// Name of the catalog or a search pattern.
2: optional TPatternOrIdentifier catalogName
// Name of the schema or a search pattern.
3: optional TPatternOrIdentifier schemaName
// Name of the table or a search pattern.
4: optional TPatternOrIdentifier tableName
// List of table types to match
// e.g. "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
// "LOCAL TEMPORARY", "ALIAS", "SYNONYM", etc.
5: optional list tableTypes
}
struct TGetTablesResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetTableTypes()
//
// Returns the table types available in this database.
// The results are ordered by table type.
//
// col1
// name: TABLE_TYPE
// type: STRING
// desc: Table type name.
struct TGetTableTypesReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
}
struct TGetTableTypesResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetColumns()
//
// Returns a list of columns in the specified tables.
// The information is returned as a result set which can be fetched
// using the OperationHandle provided in the response.
// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME,
// and ORDINAL_POSITION.
//
// Result Set Columns are the same as those for the ODBC CLIColumns
// function.
//
struct TGetColumnsReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
// Name of the catalog. Must not contain a search pattern.
2: optional TIdentifier catalogName
// Schema name or search pattern
3: optional TPatternOrIdentifier schemaName
// Table name or search pattern
4: optional TPatternOrIdentifier tableName
// Column name or search pattern
5: optional TPatternOrIdentifier columnName
}
struct TGetColumnsResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetFunctions()
//
// Returns a list of functions supported by the data source. The
// behavior of this function matches
// java.sql.DatabaseMetaData.getFunctions() both in terms of
// inputs and outputs.
//
// Result Set Columns:
//
// col1
// name: FUNCTION_CAT
// type: STRING
// desc: Function catalog (may be null)
//
// col2
// name: FUNCTION_SCHEM
// type: STRING
// desc: Function schema (may be null)
//
// col3
// name: FUNCTION_NAME
// type: STRING
// desc: Function name. This is the name used to invoke the function.
//
// col4
// name: REMARKS
// type: STRING
// desc: Explanatory comment on the function.
//
// col5
// name: FUNCTION_TYPE
// type: SMALLINT
// desc: Kind of function. One of:
// * functionResultUnknown - Cannot determine if a return value or a table
// will be returned.
// * functionNoTable - Does not a return a table.
// * functionReturnsTable - Returns a table.
//
// col6
// name: SPECIFIC_NAME
// type: STRING
// desc: The name which uniquely identifies this function within its schema.
// In this case this is the fully qualified class name of the class
// that implements this function.
//
struct TGetFunctionsReq {
// Session to run this request against
1: required TSessionHandle sessionHandle
// A catalog name; must match the catalog name as it is stored in the
// database; "" retrieves those without a catalog; null means
// that the catalog name should not be used to narrow the search.
2: optional TIdentifier catalogName
// A schema name pattern; must match the schema name as it is stored
// in the database; "" retrieves those without a schema; null means
// that the schema name should not be used to narrow the search.
3: optional TPatternOrIdentifier schemaName
// A function name pattern; must match the function name as it is stored
// in the database.
4: required TPatternOrIdentifier functionName
}
struct TGetFunctionsResp {
1: required TStatus status
2: optional TOperationHandle operationHandle
}
// GetOperationStatus()
//
// Get the status of an operation running on the server.
struct TGetOperationStatusReq {
// Session to run this request against
1: required TOperationHandle operationHandle
}
struct TGetOperationStatusResp {
1: required TStatus status
2: optional TOperationState operationState
}
// CancelOperation()
//
// Cancels processing on the specified operation handle and
// frees any resources which were allocated.
struct TCancelOperationReq {
// Operation to cancel
1: required TOperationHandle operationHandle
}
struct TCancelOperationResp {
1: required TStatus status
}
// CloseOperation()
//
// Given an operation in the FINISHED, CANCELED,
// or ERROR states, CloseOperation() will free
// all of the resources which were allocated on
// the server to service the operation.
struct TCloseOperationReq {
1: required TOperationHandle operationHandle
}
struct TCloseOperationResp {
1: required TStatus status
}
// GetResultSetMetadata()
//
// Retrieves schema information for the specified operation
struct TGetResultSetMetadataReq {
// Operation for which to fetch result set schema information
1: required TOperationHandle operationHandle
}
struct TGetResultSetMetadataResp {
1: required TStatus status
2: optional TTableSchema schema
}
enum TFetchOrientation {
// Get the next rowset. The fetch offset is ignored.
FETCH_NEXT,
// Get the previous rowset. The fetch offset is ignored.
// NOT SUPPORTED
FETCH_PRIOR,
// Return the rowset at the given fetch offset relative
// to the curren rowset.
// NOT SUPPORTED
FETCH_RELATIVE,
// Return the rowset at the specified fetch offset.
// NOT SUPPORTED
FETCH_ABSOLUTE,
// Get the first rowset in the result set.
FETCH_FIRST,
// Get the last rowset in the result set.
// NOT SUPPORTED
FETCH_LAST
}
// FetchResults()
//
// Fetch rows from the server corresponding to
// a particular OperationHandle.
struct TFetchResultsReq {
// Operation from which to fetch results.
1: required TOperationHandle operationHandle
// The fetch orientation. For V1 this must be either
// FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT.
2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT
// Max number of rows that should be returned in
// the rowset.
3: required i64 maxRows
}
struct TFetchResultsResp {
1: required TStatus status
// TRUE if there are more rows left to fetch from the server.
2: optional bool hasMoreRows
// The rowset. This is optional so that we have the
// option in the future of adding alternate formats for
// representing result set data, e.g. delimited strings,
// binary encoded, etc.
3: optional TRowSet results
}
service TCLIService {
TOpenSessionResp OpenSession(1:TOpenSessionReq req);
TCloseSessionResp CloseSession(1:TCloseSessionReq req);
TGetInfoResp GetInfo(1:TGetInfoReq req);
TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req);
TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req);
TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req);
TGetSchemasResp GetSchemas(1:TGetSchemasReq req);
TGetTablesResp GetTables(1:TGetTablesReq req);
TGetTableTypesResp GetTableTypes(1:TGetTableTypesReq req);
TGetColumnsResp GetColumns(1:TGetColumnsReq req);
TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req);
TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req);
TCancelOperationResp CancelOperation(1:TCancelOperationReq req);
TCloseOperationResp CloseOperation(1:TCloseOperationReq req);
TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req);
TFetchResultsResp FetchResults(1:TFetchResultsReq req);
}
================================================
FILE: src/hiveserver/if/hive_service.thrift
================================================
#!/usr/local/bin/thrift -java
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Thrift Service that the hive service is built on
#
#
# TODO: include/thrift is shared among different components. It
# should not be under metastore.
include "share/fb303/if/fb303.thrift"
include "metastore/if/hive_metastore.thrift"
include "ql/if/queryplan.thrift"
namespace java org.apache.hadoop.hive.service
namespace cpp Apache.Hadoop.Hive
// Enumeration of JobTracker.State
enum JobTrackerState {
INITIALIZING = 1,
RUNNING = 2,
}
// Map-Reduce cluster status information
struct HiveClusterStatus {
1: i32 taskTrackers,
2: i32 mapTasks,
3: i32 reduceTasks,
4: i32 maxMapTasks,
5: i32 maxReduceTasks,
6: JobTrackerState state,
}
exception HiveServerException {
1: string message
2: i32 errorCode
3: string SQLState
}
# Interface for Thrift Hive Server
service ThriftHive extends hive_metastore.ThriftHiveMetastore {
# Execute a query. Takes a HiveQL string
void execute(1:string query) throws(1:HiveServerException ex)
# Fetch one row. This row is the serialized form
# of the result of the query
string fetchOne() throws(1:HiveServerException ex)
# Fetch a given number of rows or remaining number of
# rows whichever is smaller.
list fetchN(1:i32 numRows) throws(1:HiveServerException ex)
# Fetch all rows of the query result
list fetchAll() throws(1:HiveServerException ex)
# Get a schema object with fields represented with native Hive types
hive_metastore.Schema getSchema() throws(1:HiveServerException ex)
# Get a schema object with fields represented with Thrift DDL types
hive_metastore.Schema getThriftSchema() throws(1:HiveServerException ex)
# Get the status information about the Map-Reduce cluster
HiveClusterStatus getClusterStatus() throws(1:HiveServerException ex)
# Get the queryplan annotated with counter information
queryplan.QueryPlan getQueryPlan() throws(1:HiveServerException ex)
# clean up last Hive query (releasing locks etc.)
void clean()
}
================================================
FILE: src/hiveserver/if/metastore/if/hive_metastore.thrift
================================================
#!/usr/local/bin/thrift -java
#
# Thrift Service that the MetaStore is built on
#
include "share/fb303/if/fb303.thrift"
namespace java org.apache.hadoop.hive.metastore.api
namespace php metastore
namespace cpp Apache.Hadoop.Hive
const string DDL_TIME = "transient_lastDdlTime"
struct Version {
1: string version,
2: string comments
}
struct FieldSchema {
1: string name, // name of the field
2: string type, // type of the field. primitive types defined above, specify list, map for lists & maps
3: string comment
}
struct Type {
1: string name, // one of the types in PrimitiveTypes or CollectionTypes or User defined types
2: optional string type1, // object type if the name is 'list' (LIST_TYPE), key type if the name is 'map' (MAP_TYPE)
3: optional string type2, // val type if the name is 'map' (MAP_TYPE)
4: optional list fields // if the name is one of the user defined types
}
enum HiveObjectType {
GLOBAL = 1,
DATABASE = 2,
TABLE = 3,
PARTITION = 4,
COLUMN = 5,
}
enum PrincipalType {
USER = 1,
ROLE = 2,
GROUP = 3,
}
struct HiveObjectRef{
1: HiveObjectType objectType,
2: string dbName,
3: string objectName,
4: list partValues,
5: string columnName,
}
struct PrivilegeGrantInfo {
1: string privilege,
2: i32 createTime,
3: string grantor,
4: PrincipalType grantorType,
5: bool grantOption,
}
struct HiveObjectPrivilege {
1: HiveObjectRef hiveObject,
2: string principalName,
3: PrincipalType principalType,
4: PrivilegeGrantInfo grantInfo,
}
struct PrivilegeBag {
1: list privileges,
}
struct PrincipalPrivilegeSet {
1: map> userPrivileges, // user name -> privilege grant info
2: map> groupPrivileges, // group name -> privilege grant info
3: map> rolePrivileges, //role name -> privilege grant info
}
struct Role {
1: string roleName,
2: i32 createTime,
3: string ownerName,
}
// namespace for tables
struct Database {
1: string name,
2: string description,
3: string locationUri,
4: map parameters, // properties associated with the database
5: optional PrincipalPrivilegeSet privileges
}
// This object holds the information needed by SerDes
struct SerDeInfo {
1: string name, // name of the serde, table name by default
2: string serializationLib, // usually the class that implements the extractor & loader
3: map parameters // initialization parameters
}
// sort order of a column (column name along with asc(1)/desc(0))
struct Order {
1: string col, // sort column name
2: i32 order // asc(1) or desc(0)
}
// this object holds all the information about physical storage of the data belonging to a table
struct StorageDescriptor {
1: list cols, // required (refer to types defined above)
2: string location, // defaults to //tablename
3: string inputFormat, // SequenceFileInputFormat (binary) or TextInputFormat` or custom format
4: string outputFormat, // SequenceFileOutputFormat (binary) or IgnoreKeyTextOutputFormat or custom format
5: bool compressed, // compressed or not
6: i32 numBuckets, // this must be specified if there are any dimension columns
7: SerDeInfo serdeInfo, // serialization and deserialization information
8: list bucketCols, // reducer grouping columns and clustering columns and bucketing columns`
9: list sortCols, // sort order of the data in each bucket
10: map parameters // any user supplied key value hash
}
// table information
struct Table {
1: string tableName, // name of the table
2: string dbName, // database name ('default')
3: string owner, // owner of this table
4: i32 createTime, // creation time of the table
5: i32 lastAccessTime, // last access time (usually this will be filled from HDFS and shouldn't be relied on)
6: i32 retention, // retention time
7: StorageDescriptor sd, // storage descriptor of the table
8: list partitionKeys, // partition keys of the table. only primitive types are supported
9: map parameters, // to store comments or any other user level parameters
10: string viewOriginalText, // original view text, null for non-view
11: string viewExpandedText, // expanded view text, null for non-view
12: string tableType, // table type enum, e.g. EXTERNAL_TABLE
13: optional PrincipalPrivilegeSet privileges,
}
struct Partition {
1: list values // string value is converted to appropriate partition key type
2: string dbName,
3: string tableName,
4: i32 createTime,
5: i32 lastAccessTime,
6: StorageDescriptor sd,
7: map parameters,
8: optional PrincipalPrivilegeSet privileges
}
struct Index {
1: string indexName, // unique with in the whole database namespace
2: string indexHandlerClass, // reserved
3: string dbName,
4: string origTableName,
5: i32 createTime,
6: i32 lastAccessTime,
7: string indexTableName,
8: StorageDescriptor sd,
9: map parameters,
10: bool deferredRebuild
}
// schema of the table/query results etc.
struct Schema {
// column names, types, comments
1: list fieldSchemas, // delimiters etc
2: map properties
}
exception MetaException {
1: string message
}
exception UnknownTableException {
1: string message
}
exception UnknownDBException {
1: string message
}
exception AlreadyExistsException {
1: string message
}
exception InvalidObjectException {
1: string message
}
exception NoSuchObjectException {
1: string message
}
exception IndexAlreadyExistsException {
1: string message
}
exception InvalidOperationException {
1: string message
}
exception ConfigValSecurityException {
1: string message
}
/**
* This interface is live.
*/
service ThriftHiveMetastore extends fb303.FacebookService
{
void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)
Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2)
void drop_database(1:string name, 2:bool deleteData) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3)
list get_databases(1:string pattern) throws(1:MetaException o1)
list get_all_databases() throws(1:MetaException o1)
void alter_database(1:string dbname, 2:Database db) throws(1:MetaException o1, 2:NoSuchObjectException o2)
// returns the type with given name (make seperate calls for the dependent types if needed)
Type get_type(1:string name) throws(1:MetaException o1, 2:NoSuchObjectException o2)
bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)
bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2)
map get_type_all(1:string name)
throws(1:MetaException o2)
// Gets a list of FieldSchemas describing the columns of a particular table
list get_fields(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3),
// Gets a list of FieldSchemas describing both the columns and the partition keys of a particular table
list get_schema(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3)
// create a Hive table. Following fields must be set
// tableName
// database (only 'default' for now until Hive QL supports databases)
// owner (not needed, but good to have for tracking purposes)
// sd.cols (list of field schemas)
// sd.inputFormat (SequenceFileInputFormat (binary like falcon tables or u_full) or TextInputFormat)
// sd.outputFormat (SequenceFileInputFormat (binary) or TextInputFormat)
// sd.serdeInfo.serializationLib (SerDe class name eg org.apache.hadoop.hive.serde.simple_meta.MetadataTypedColumnsetSerDe
// * See notes on DDL_TIME
void create_table(1:Table tbl) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4)
// drops the table and all the partitions associated with it if the table has partitions
// delete data (including partitions) if deleteData is set to true
void drop_table(1:string dbname, 2:string name, 3:bool deleteData)
throws(1:NoSuchObjectException o1, 2:MetaException o3)
list get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1)
list get_all_tables(1: string db_name) throws (1: MetaException o1)
Table get_table(1:string dbname, 2:string tbl_name)
throws (1:MetaException o1, 2:NoSuchObjectException o2)
// alter table applies to only future partitions not for existing partitions
// * See notes on DDL_TIME
void alter_table(1:string dbname, 2:string tbl_name, 3:Table new_tbl)
throws (1:InvalidOperationException o1, 2:MetaException o2)
// the following applies to only tables that have partitions
// * See notes on DDL_TIME
Partition add_partition(1:Partition new_part)
throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
Partition append_partition(1:string db_name, 2:string tbl_name, 3:list part_vals)
throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
Partition append_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name)
throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
bool drop_partition(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:bool deleteData)
throws(1:NoSuchObjectException o1, 2:MetaException o2)
bool drop_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name, 4:bool deleteData)
throws(1:NoSuchObjectException o1, 2:MetaException o2)
Partition get_partition(1:string db_name, 2:string tbl_name, 3:list part_vals)
throws(1:MetaException o1, 2:NoSuchObjectException o2)
Partition get_partition_with_auth(1:string db_name, 2:string tbl_name, 3:list part_vals,
4: string user_name, 5: list group_names) throws(1:MetaException o1, 2:NoSuchObjectException o2)
Partition get_partition_by_name(1:string db_name 2:string tbl_name, 3:string part_name)
throws(1:MetaException o1, 2:NoSuchObjectException o2)
// returns all the partitions for this table in reverse chronological order.
// If max parts is given then it will return only that many.
list get_partitions(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)
throws(1:NoSuchObjectException o1, 2:MetaException o2)
list get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1,
4: string user_name, 5: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)
list get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)
throws(1:MetaException o2)
// get_partition*_ps methods allow filtering by a partial partition specification,
// as needed for dynamic partitions. The values that are not restricted should
// be empty strings. Nulls were considered (instead of "") but caused errors in
// generated Python code. The size of part_vals may be smaller than the
// number of partition columns - the unspecified values are considered the same
// as "".
list get_partitions_ps(1:string db_name 2:string tbl_name
3:list part_vals, 4:i16 max_parts=-1)
throws(1:MetaException o1)
list get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1,
5: string user_name, 6: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)
list get_partition_names_ps(1:string db_name,
2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1)
throws(1:MetaException o1)
// get the partitions matching the given partition filter
list get_partitions_by_filter(1:string db_name 2:string tbl_name
3:string filter, 4:i16 max_parts=-1)
throws(1:MetaException o1, 2:NoSuchObjectException o2)
// changes the partition to the new partition object. partition is identified from the part values
// in the new_part
// * See notes on DDL_TIME
void alter_partition(1:string db_name, 2:string tbl_name, 3:Partition new_part)
throws(1:InvalidOperationException o1, 2:MetaException o2)
// gets the value of the configuration key in the metastore server. returns
// defaultValue if the key does not exist. if the configuration key does not
// begin with "hive", "mapred", or "hdfs", a ConfigValSecurityException is
// thrown.
string get_config_value(1:string name, 2:string defaultValue)
throws(1:ConfigValSecurityException o1)
// converts a partition name into a partition values array
list partition_name_to_vals(1: string part_name)
throws(1: MetaException o1)
// converts a partition name into a partition specification (a mapping from
// the partition cols to the values)
map partition_name_to_spec(1: string part_name)
throws(1: MetaException o1)
//index
Index add_index(1:Index new_index, 2: Table index_table)
throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
void alter_index(1:string dbname, 2:string base_tbl_name, 3:string idx_name, 4:Index new_idx)
throws (1:InvalidOperationException o1, 2:MetaException o2)
bool drop_index_by_name(1:string db_name, 2:string tbl_name, 3:string index_name, 4:bool deleteData)
throws(1:NoSuchObjectException o1, 2:MetaException o2)
Index get_index_by_name(1:string db_name 2:string tbl_name, 3:string index_name)
throws(1:MetaException o1, 2:NoSuchObjectException o2)
list get_indexes(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)
throws(1:NoSuchObjectException o1, 2:MetaException o2)
list get_index_names(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)
throws(1:MetaException o2)
//authorization privileges
bool create_role(1:Role role) throws(1:MetaException o1)
bool drop_role(1:string role_name) throws(1:MetaException o1)
list get_role_names() throws(1:MetaException o1)
bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type,
4:string grantor, 5:PrincipalType grantorType, 6:bool grant_option) throws(1:MetaException o1)
bool revoke_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type)
throws(1:MetaException o1)
list list_roles(1:string principal_name, 2:PrincipalType principal_type) throws(1:MetaException o1)
PrincipalPrivilegeSet get_privilege_set(1:HiveObjectRef hiveObject, 2:string user_name,
3: list group_names) throws(1:MetaException o1)
list list_privileges(1:string principal_name, 2:PrincipalType principal_type,
3: HiveObjectRef hiveObject) throws(1:MetaException o1)
bool grant_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)
bool revoke_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)
//Authentication (delegation token) interfaces
// get metastore server delegation token for use from the map/reduce tasks to authenticate
// to metastore server
string get_delegation_token(1:string renewer_kerberos_principal_name) throws (1:MetaException o1)
// get metastore server delegation token for use from the map/reduce tasks to authenticate
// to metastore server - this method takes an extra token signature string which is just
// an identifier to associate with the token - this will be used by the token selector code
// to pick the right token given the associated identifier.
string get_delegation_token_with_signature(1:string renewer_kerberos_principal_name,
2:string token_signature) throws (1:MetaException o1)
// method to renew delegation token obtained from metastore server
i64 renew_delegation_token(1:string token_str_form) throws (1:MetaException o1)
// method to cancel delegation token obtained from metastore server
void cancel_delegation_token(1:string token_str_form) throws (1:MetaException o1)
}
// * Note about the DDL_TIME: When creating or altering a table or a partition,
// if the DDL_TIME is not set, the current time will be used.
// For storing info about archived partitions in parameters
// Whether the partition is archived
const string IS_ARCHIVED = "is_archived",
// The original location of the partition, before archiving. After archiving,
// this directory will contain the archive. When the partition
// is dropped, this directory will be deleted
const string ORIGINAL_LOCATION = "original_location",
// these should be needed only for backward compatibility with filestore
const string META_TABLE_COLUMNS = "columns",
const string META_TABLE_COLUMN_TYPES = "columns.types",
const string BUCKET_FIELD_NAME = "bucket_field_name",
const string BUCKET_COUNT = "bucket_count",
const string FIELD_TO_DIMENSION = "field_to_dimension",
const string META_TABLE_NAME = "name",
const string META_TABLE_DB = "db",
const string META_TABLE_LOCATION = "location",
const string META_TABLE_SERDE = "serde",
const string META_TABLE_PARTITION_COLUMNS = "partition_columns",
const string FILE_INPUT_FORMAT = "file.inputformat",
const string FILE_OUTPUT_FORMAT = "file.outputformat",
const string META_TABLE_STORAGE = "storage_handler",
================================================
FILE: src/hiveserver/if/ql/if/queryplan.thrift
================================================
namespace java org.apache.hadoop.hive.ql.plan.api
namespace cpp Apache.Hadoop.Hive
enum AdjacencyType { CONJUNCTIVE, DISJUNCTIVE }
struct Adjacency {
1: string node,
2: list children,
3: AdjacencyType adjacencyType,
}
enum NodeType { OPERATOR, STAGE }
struct Graph {
1: NodeType nodeType,
2: list roots,
3: list adjacencyList,
}
#Represents a operator along with its counters
enum OperatorType {
JOIN,
MAPJOIN,
EXTRACT,
FILTER,
FORWARD,
GROUPBY,
LIMIT,
SCRIPT,
SELECT,
TABLESCAN,
FILESINK,
REDUCESINK,
UNION,
UDTF,
LATERALVIEWJOIN,
LATERALVIEWFORWARD,
HASHTABLESINK,
HASHTABLEDUMMY,
}
struct Operator {
1: string operatorId,
2: OperatorType operatorType,
3: map operatorAttributes,
4: map operatorCounters,
5: bool done,
6: bool started,
}
# Represents whether it is a map-reduce job or not. In future, different tasks can add their dependencies
# The operator graph shows the operator tree
enum TaskType { MAP, REDUCE, OTHER }
struct Task {
1: string taskId,
2: TaskType taskType
3: map taskAttributes,
4: map taskCounters,
5: optional Graph operatorGraph,
6: optional list operatorList,
7: bool done,
8: bool started,
}
# Represents a Stage - unfortunately, it is represented as Task in ql/exec
enum StageType {
CONDITIONAL,
COPY,
DDL,
MAPRED,
EXPLAIN,
FETCH,
FUNC,
MAPREDLOCAL,
MOVE,
STATS,
}
struct Stage {
1: string stageId,
2: StageType stageType,
3: map stageAttributes,
4: map stageCounters,
5: list taskList,
6: bool done,
7: bool started,
}
# Represents a query -
# The graph maintains the stage dependency.In case of conditional tasks, it is represented as if only
# one of the dependencies need to be executed
struct Query {
1: string queryId,
2: string queryType,
3: map queryAttributes,
4: map queryCounters,
5: Graph stageGraph,
6: list stageList,
7: bool done,
8: bool started,
}
# List of all queries - each query maintains if it is done or started
# This can be used to track all the queries in the session
struct QueryPlan {
1: list queries,
2: bool done,
3: bool started,
}
================================================
FILE: src/hiveserver/if/share/fb303/if/fb303.thrift
================================================
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* fb303.thrift
*/
namespace java com.facebook.fb303
namespace cpp facebook.fb303
namespace perl Facebook.FB303
/**
* Common status reporting mechanism across all services
*/
enum fb_status {
DEAD = 0,
STARTING = 1,
ALIVE = 2,
STOPPING = 3,
STOPPED = 4,
WARNING = 5,
}
/**
* Standard base service
*/
service FacebookService {
/**
* Returns a descriptive name of the service
*/
string getName(),
/**
* Returns the version of the service
*/
string getVersion(),
/**
* Gets the status of this service
*/
fb_status getStatus(),
/**
* User friendly description of status, such as why the service is in
* the dead or warning state, or what is being started or stopped.
*/
string getStatusDetails(),
/**
* Gets the counters for this service
*/
map getCounters(),
/**
* Gets the value of a single counter
*/
i64 getCounter(1: string key),
/**
* Sets an option
*/
void setOption(1: string key, 2: string value),
/**
* Gets an option
*/
string getOption(1: string key),
/**
* Gets all options
*/
map getOptions(),
/**
* Returns a CPU profile over the given time interval (client and server
* must agree on the profile format).
*/
string getCpuProfile(1: i32 profileDurationInSec),
/**
* Returns the unix time that the server has been running since
*/
i64 aliveSince(),
/**
* Tell the server to reload its configuration, reopen log files, etc
*/
oneway void reinitialize(),
/**
* Suggest a shutdown to the server
*/
oneway void shutdown(),
}
================================================
FILE: test/t_access_control.js
================================================
var testCase = require('nodeunit').testCase;
var access_control = require('shib/access_control'),
AccessControl = access_control.AccessControl;
module.exports = testCase({
/*
setUp: function (callback) {
this.foo = 'bar';
callback();
},
*/
test1: function (test) {
test.equals('bar', 'bar');
test.done();
},
default_rule: function(test){
var rule = {};
var acl = new AccessControl(rule);
test.ok(acl.visible('default'));
test.ok(acl.visible('db1'));
test.ok(acl.allowed('t1', 'default'));
test.ok(acl.allowed('t2', 'default'));
test.ok(acl.allowed('WhatsTable', 'db1'));
test.done();
},
default_allowed: function(test){
var rule = {
default: "allow",
databases: {
secret: { default: "deny" },
secret2: { default: "deny", allow: ["t1"] }
}
};
var acl = new AccessControl(rule);
test.ok(acl.visible('default'));
test.ok(! acl.visible('secret'));
test.ok(acl.visible('secret2'));
test.ok(acl.allowed('t1', 'default'));
test.ok(acl.allowed('t2', 'default'));
test.ok(acl.allowed('WhatsTable', 'db1'));
test.ok(! acl.allowed('table', 'secret'));
test.ok(! acl.allowed('table', 'secret2'));
test.ok(acl.allowed('t1', 'secret2'));
test.done();
},
default_denied: function(test){
var rule = {
default: "deny",
databases: {
default: { default: "allow" },
test: { default: "allow", deny: ["IDMaster", "secretTest"] },
data: { default: "deny", allow: ["t1", "t2"] }
}
};
var acl = new AccessControl(rule);
test.ok(! acl.visible("unknown"));
test.ok(acl.visible("default"));
test.ok(acl.visible("test"));
test.ok(acl.visible("data"));
test.ok(acl.allowed('t1', 'default'));
test.ok(acl.allowed('t2', 'default'));
test.ok(! acl.allowed('WhatsTable', 'db1'));
test.ok(acl.allowed('table', 'test'));
test.ok(acl.allowed('t1', 'test'));
test.ok(! acl.allowed('IDMaster', 'test'));
test.ok(! acl.allowed('secretTest', 'test'));
test.ok(! acl.allowed('table', 'data'));
test.ok(! acl.allowed('table2', 'data'));
test.ok(acl.allowed('t1', 'data'));
test.ok(acl.allowed('t2', 'data'));
test.done();
},
tearDown: function (callback) {
// clean up
callback();
}
});
================================================
FILE: test/t_query.js
================================================
var testCase = require('nodeunit').testCase;
var query = require('shib/query'),
Query = query.Query;
var convertSerializedQueryToArgs = function(array){
var obj = {
id: array[0],
datetime: array[1],
scheduled: array[2],
engine: array[3] || null,
dbname: array[4] || null,
querystring: array[5],
state: array[6],
resultid: array[7],
result: array[8]
};
return obj;
};
module.exports = testCase({
/*
setUp: function (callback) {
this.foo = 'bar';
callback();
},
*/
test1: function (test) {
test.equals('bar', 'bar');
test.done();
},
removeNewLines: function(test) {
test.equals(query.removeNewLines('hoge'), 'hoge');
test.equals(query.removeNewLines("hoge\n"), 'hoge ');
test.equals(query.removeNewLines("ho\nge"), 'ho ge');
test.equals(query.removeNewLines("\nhoge"), ' hoge');
test.equals(query.removeNewLines("\nhoge\n"), ' hoge ');
test.equals(query.removeNewLines("\nho\n\nge\n"), ' ho ge ');
test.done();
},
removeNewLinesAndComments: function(test) {
test.equals(query.removeNewLinesAndComments('hoge'), 'hoge');
test.equals(query.removeNewLinesAndComments("hoge\n"), 'hoge ');
test.equals(query.removeNewLinesAndComments("ho\nge"), 'ho ge');
test.equals(query.removeNewLinesAndComments("\nhoge"), ' hoge');
test.equals(query.removeNewLinesAndComments("\nhoge\n"), ' hoge ');
test.equals(query.removeNewLinesAndComments("\nho\n\nge\n"), ' ho ge ');
test.equals(query.removeNewLinesAndComments('hoge\n--pos'), 'hoge ');
test.equals(query.removeNewLinesAndComments('hoge\n--pos\nmoge'), 'hoge moge');
test.equals(query.removeNewLinesAndComments('--koge\nhoge\n--pos\nmoge'), ' hoge moge');
test.equals(query.removeNewLinesAndComments('hoge --koge\nhoge\n--pos\nmoge'), 'hoge hoge moge');
test.equals(query.removeNewLinesAndComments(' --koge\nhoge\n--pos\nmoge'), ' hoge moge');
test.done();
},
checkQueryString: function(test) {
test.throws(function(){Query.checkQueryString('');});
test.throws(function(){Query.checkQueryString('select count(*)');});
test.throws(function(){Query.checkQueryString('show tables');});
test.throws(function(){Query.checkQueryString('describe hoge_table');});
test.throws(function(){Query.checkQueryString('create table hoge (col1 as string, col2 as bigint)');});
test.throws(function(){Query.checkQueryString('drop table hoge');});
test.throws(function(){Query.checkQueryString('alter table hoge (col1 as smallint)');});
test.throws(function(){Query.checkQueryString("insert overwrite into hoge\nselect col1,col2 from hoge where moge='pos'");});
test.doesNotThrow(function(){Query.checkQueryString("select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()");});
test.doesNotThrow(function(){Query.checkQueryString(" select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()");});
test.doesNotThrow(function(){Query.checkQueryString("with tbl as (select id from source where id > 10) select count(id) from tbl");});
test.doesNotThrow(function(){Query.checkQueryString(" with tbl as (select id from source where id > 10) select count(id) from tbl");});
test.doesNotThrow(function(){Query.checkQueryString("explain select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()");});
test.doesNotThrow(function(){Query.checkQueryString(" explain select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()");});
test.throws(function(){
Query.checkQueryString("select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today(); drop table hoge_table");
});
test.doesNotThrow(function(){Query.checkQueryString("-- TEST Query \n select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()");});
test.done();
},
generateQueryId: function(test) {
test.equals(Query.generateQueryId('select * from hoge where id=111'), 'cec9ab9d980c1b3ed582471dc79eb65b');
test.equals(Query.generateQueryId('select x,y from hoge where id=111'), '4f9adf64784f5cb7d0f32fc67e2f387c');
test.equals(Query.generateQueryId('select * from hoge where id=111', '201108'), '14838f269a5aed68f61bc60615d21330');
test.equals(Query.generateQueryId('select x,y from hoge where id=111', '201108'), '5949bf0ce322195db18f045fc70c6159');
test.done();
},
instanciate: function(test) {
var q1 = new Query({querystring:'select f1,f2 from hoge_table'});
test.equals(q1.queryid, Query.generateQueryId('select f1,f2 from hoge_table'));
test.equals(q1.querystring, 'select f1,f2 from hoge_table');
test.deepEqual(q1.result, Query.generateResult(null));
var q2 = new Query({querystring:'select f1,f2 from hoge_table where service="news"'});
test.equals(q2.queryid, Query.generateQueryId('select f1,f2 from hoge_table where service="news"'));
test.equals(q2.querystring, 'select f1,f2 from hoge_table where service="news"');
test.deepEqual(q2.result, Query.generateResult(null));
var q3 = new Query({querystring:'select f1,f2 from hoge_table where service="news"', seed:'201108'});
test.equals(q3.queryid, Query.generateQueryId('select f1,f2 from hoge_table where service="news"', '201108'));
test.equals(q3.querystring, 'select f1,f2 from hoge_table where service="news"');
test.deepEqual(q3.result, Query.generateResult(null));
test.done();
},
serialized: function(test) {
// id,datetime,engine,dbname,expression,state,resultid,result
var q1 = new Query({querystring:'select f1,f2 from hoge_table'});
test.deepEqual(
q1.serialized(),
[
"c148cdb90a70ef34dab88d8e1af967a6",
q1.datetime.toJSON(),
null,
undefined,
undefined,
"select f1,f2 from hoge_table",
'running',
Query.generateResultId("c148cdb90a70ef34dab88d8e1af967a6", q1.datetime.toLocaleString()),
'{"error":"","lines":null,"bytes":null,"completed_at":null,"completed_msec":null,"schema":[]}'
]
);
var q1x = new Query(convertSerializedQueryToArgs(q1.serialized()));
test.equals(q1x.queryid, q1.queryid);
test.equals(q1x.querystring, q1.querystring);
test.equals(q1x.state, q1.state);
test.equals(q1x.resultid, q1.resultid); // resultid depends on executed_at (default, current time)
test.deepEqual(q1x.result, q1.result);
var q2 = new Query({querystring:'select f1,f2 from hoge_table where service="news"'});
test.deepEqual(
q2.serialized(),
[
"2734efa50f0dff08129e3485b523f782",
q2.datetime.toJSON(),
null,
undefined,
undefined,
'select f1,f2 from hoge_table where service="news"',
'running',
Query.generateResultId("2734efa50f0dff08129e3485b523f782", q2.datetime.toLocaleString()),
'{"error":"","lines":null,"bytes":null,"completed_at":null,"completed_msec":null,"schema":[]}'
]
);
var q2x = new Query(convertSerializedQueryToArgs(q2.serialized()));
test.equals(q2x.queryid, q2.queryid);
test.equals(q2x.querystring, q2.querystring);
test.equals(q2x.state, q2.state);
test.equals(q2x.resultid, q2.resultid);
test.deepEqual(q2x.result, q2.result);
test.done();
},
serializedForUpdate: function(test){
var data = (new Query({querystring:'select f1,f2 from hoge_table'})).serializedForUpdate();
test.deepEqual(
data,
[
'running',
'{"error":"","lines":null,"bytes":null,"completed_at":null,"completed_msec":null,"schema":[]}',
"c148cdb90a70ef34dab88d8e1af967a6"
]
);
test.done();
},
composed: function(test) {
var s0 = "select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xtable where f1='value1'";
var q0 = new Query({querystring:s0});
test.equals(q0.composed(), s0);
var s1 = "select f1,f2,f3,f4,f5,f6,f7,f8,f9 from moge where f1='value1'";
var q1 = new Query({querystring:s1});
test.equals(q1.composed(), "select f1,f2,f3,f4,f5,f6,f7,f8,f9 from moge where f1='value1'");
var s2 = "select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xxx where f1='test' and f2='test'";
var q2 = new Query({querystring:s2});
test.equals(q2.composed(), "select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xxx where f1='test' and f2='test'");
test.done();
},
parseTableNames: function(test) {
var q0 = 'SELECT * FROM t1';
test.deepEqual(Query.parseTableNames(q0), [['t1', null]]);
var q1 = 'SELECT * FROM db1.sales WHERE amount > 10 AND region = "US"';
test.deepEqual(Query.parseTableNames(q1), [['sales', 'db1']]);
var q2 = 'SELECT page_views.* FROM page_views\nWHERE page_views.date >= "2008-03-01" \nAND page_views.date <= "2008-03-31"';
test.deepEqual(Query.parseTableNames(q2), [['page_views', null]]);
var q3 = 'SELECT * FROM Source TABLESAMPLE(BUCKET 3 OUT OF 32 ON rand()) s;';
test.deepEqual(Query.parseTableNames(q3), [['Source', null]]);
var q4 = "SELECT u.id, actions.date\nFROM (\n SELECT av.uid AS uid\n FROM action_video av\n WHERE av.date = '2008-06-03'\n UNION ALL\n SELECT ac.uid AS uid\n FROM action_comment ac\n WHERE ac.date = '2008-06-03'\n ) actions JOIN users u ON (u.id = actions.uid)";
test.deepEqual(Query.parseTableNames(q4), [['action_video', null], ['action_comment', null], ['users', null]]);
var j0 = 'SELECT a.* FROM a JOIN b ON (a.id = b.id AND a.department = b.department)';
test.deepEqual(Query.parseTableNames(j0), [['a', null], ['b', null]]);
var j1 = 'SELECT a.val, b.val, c.val FROM db1.a JOIN db2.b ON (a.key = b.key1) JOIN c ON (c.key = b.key2)';
test.deepEqual(Query.parseTableNames(j1), [['a', 'db1'], ['b', 'db2'], ['c', null]]);
var j2 = 'SELECT a.val, b.val FROM a LEFT OUTER JOIN b ON (a.key=b.key)';
test.deepEqual(Query.parseTableNames(j2), [['a', null], ['b', null]]);
var j3 = 'SELECT a.key, a.val\nFROM a LEFT SEMI JOIN b on (a.key = b.key)';
test.deepEqual(Query.parseTableNames(j3), [['a', null], ['b', null]]);
var j4 = 'SELECT page_views.*\nFROM page_views JOIN dim_users\n ON (page_views.user_id = dim_users.id AND page_views.date >= "2008-03-01" AND page_views.date <= "2008-03-31")';
test.deepEqual(Query.parseTableNames(j4), [['page_views', null], ['dim_users', null]]);
/*
select idOne, idTwo, value FROM
( select idOne, idTwo, value FROM
bigTable JOIN smallTableOne on (bigTable.idOne = smallTableOne.idOne)
) firstjoin
JOIN
smallTableTwo on (firstjoin.idTwo = smallTableTwo.idTwo)
*/
var j5 = 'select idOne, idTwo, value FROM\n ( select idOne, idTwo, value FROM\n bigTable JOIN smallTableOne on (bigTable.idOne = smallTableOne.idOne) \n ) firstjoin \n JOIN \n smallTableTwo on (firstjoin.idTwo = smallTableTwo.idTwo) ';
test.deepEqual(Query.parseTableNames(j5), [['bigTable', null], ['smallTableOne', null], ['smallTableTwo', null]]);
var s0 = 'SELECT col\nFROM (\n SELECT a+b AS col\n FROM t1\n) t2';
test.deepEqual(Query.parseTableNames(s0), [['t1', null]]);
var s1 = 'SELECT t3.col FROM ( SELECT a+b AS col FROM d1.t1 UNION ALL SELECT c+d AS col FROM d2.t2 ) t3';
test.deepEqual(Query.parseTableNames(s1), [['t1', 'd1'], ['t2', 'd2']]);
var s2 = 'SELECT *\nFROM A\nWHERE A.a IN (SELECT foo FROM B);';
test.deepEqual(Query.parseTableNames(s2), [['A', null], ['B', null]]);
var s3 = 'SELECT A FROM T1 WHERE EXISTS (SELECT B FROM T2 WHERE T1.X = T2.Y)';
test.deepEqual(Query.parseTableNames(s3), [['T1', null], ['T2', null]]);
var s4 = 'SELECT col1 FROM (SELECT col1, SUM(col2) AS col2sum FROM t1 GROUP BY col1) t2 WHERE t2.col2sum > 10';
test.deepEqual(Query.parseTableNames(s4), [['t1', null]]);
test.done();
},
tearDown: function (callback) {
// clean up
callback();
}
});
================================================
FILE: test/t_simple_csv_builder.js
================================================
var testCase = require('nodeunit').testCase;
var builder = require('shib/simple_csv_builder').SimpleCSVBuilder;
module.exports = testCase({
/*
setUp: function (callback) {
this.foo = 'bar';
callback();
},
*/
test1: function (test) {
test.equals('bar', 'bar');
test.done();
},
escape: function (test) {
test.equals(builder.escape(''), '');
test.equals(builder.escape('hoge'), 'hoge');
test.equals(builder.escape('hoge hoge'), 'hoge hoge');
test.equals(builder.escape('hoge,pos'), 'hoge,pos');
test.equals(builder.escape('hoge"pos'), 'hoge""pos');
test.equals(builder.escape('hoge\'pos'), 'hoge\'pos');
test.equals(builder.escape('"hoge"pos'), '""hoge""pos');
test.equals(builder.escape('hoge""pos'), 'hoge""""pos');
test.done();
},
build: function (test) {
test.equals(builder.build([]), '');
test.equals(builder.build(['']), '""\n');
test.equals(builder.build(['','']), '"",""\n');
test.equals(builder.build(['a']), '"a"\n');
test.equals(builder.build(['aa']), '"aa"\n');
test.equals(builder.build(['a"b']), '"a""b"\n');
test.equals(builder.build(['a','b']), '"a","b"\n');
test.equals(builder.build(['a"x','b']), '"a""x","b"\n');
test.equals(builder.build(['a"','b']), '"a""","b"\n');
test.equals(builder.build(['a','b', 'c']), '"a","b","c"\n');
test.equals(builder.build(['a','b', '', 'c']), '"a","b","","c"\n');
test.equals(builder.build(['a','b', null, 'c']), '"a","b","","c"\n');
test.equals(builder.build(['a','b', undefined, 'c']), '"a","b","","c"\n');
test.equals(builder.build(['a','b', 0, 'c']), '"a","b","0","c"\n');
test.done();
}
});
================================================
FILE: test/t_thrifthivemock.js
================================================
var testCase = require('nodeunit').testCase;
var mock = require('./../testtools/ThriftHiveMock');
module.exports = testCase({
/*
setUp: function (callback) {
this.foo = 'bar';
callback();
},
*/
test1: function (test) {
test.equals('bar', 'bar');
test.done();
},
generate_tablename: function(test) {
var tname = null;
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
tname = mock.generate_tablename();
test.ok(/^[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d(_[a-z]{1,3}\d)?)?)?$/.exec(tname));
test.done();
},
generate_subtree: function(test){
test.deepEqual(mock.generate_subtree('xxx1'), ['xxx=0']);
test.deepEqual(mock.generate_subtree('xxx3'), ['xxx=0','xxx=1','xxx=2']);
test.deepEqual(mock.generate_subtree('xxx2'), ['xxx=0','xxx=1']);
test.deepEqual(mock.generate_subtree('xxx10'), ['xxx=0','xxx=1','xxx=2','xxx=3','xxx=4','xxx=5','xxx=6','xxx=7','xxx=8','xxx=9']);
test.deepEqual(mock.generate_subtree('xxy1_abc2'), ['xxy=0/abc=0', 'xxy=0/abc=1']);
test.deepEqual(mock.generate_subtree('xxy1_abc3'), ['xxy=0/abc=0', 'xxy=0/abc=1', 'xxy=0/abc=2']);
test.deepEqual(mock.generate_subtree('xxy2_abc2'), ['xxy=0/abc=0', 'xxy=0/abc=1', 'xxy=1/abc=0', 'xxy=1/abc=1']);
test.deepEqual(mock.generate_subtree('xxy1_abc2_ppp2'), ['xxy=0/abc=0/ppp=0', 'xxy=0/abc=0/ppp=1', 'xxy=0/abc=1/ppp=0', 'xxy=0/abc=1/ppp=1']);
test.done();
}
});
================================================
FILE: testtools/ThriftHiveMock.js
================================================
var hive_service_types = require('shib/engines/hiveserver/hive_service_types'),
hive_metastore_types = require('shib/engines/hiveserver/hive_metastore_types'),
queryplan_types = require('shib/engines/hiveserver/queryplan_types');
var chars = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'-', ' ', '_', '\'', '"', '?', '!', '=', '+', '/', '.', ','
];
var namechars = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
];
var alphabet_namechars = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
];
var kana_chars = [
'あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ',
'さ', 'し', 'す', 'せ', 'そ', 'た', 'ち', 'つ', 'て', 'と',
'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'へ', 'ほ',
'ま', 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ',
'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'を', 'ん'
];
var random_num = function(max){ return Math.floor(Math.random() * max) + 1; };
var random_index = function(max){ return Math.floor(Math.random() * max); };
var choose = function(list){
return list[random_index(list.length)];
};
var random_string = function(len){
var ret = '';
for (var i = 0; i < len; i++){ ret += choose(chars); }
return ret;
};
var random_name = function(len){
var ret = '';
for (var i = 0; i < len; i++){ ret += choose(namechars); }
return ret;
};
var random_kana = function(len){
var ret = '';
for (var i = 0; i < len; i++){ ret += choose(kana_chars); }
return ret;
};
var random_alphabetname = function(len){
var ret = '';
for (var i = 0; i < len; i++){ ret += choose(alphabet_namechars); }
return ret;
};
exports.cluster_status = function(){
return new hive_service_types.HiveClusterStatus({
taskTrackers: 1,
mapTasks: 0,
reduceTasks: 0,
maxMapTasks: 2,
maxReduceTasks: 2,
state: 2
});
};
var idlist = ['hadoop_20110408154949_8b2be199-02ae-40fe-9492-d197ade572f2',
'hadoop_20110408154949_8b2be199-03ff-40fe-9492-d197ade572f2',
'hadoop_20110408154949_8b2be199-04bc-40fe-9492-d197ade572f2',
'hadoop_20110408154949_8b2be199-05db-40fe-9492-d197ade572f2',
'hadoop_20110408154949_8b2be199-06fc-40fe-9492-d197ade572f2'];
var queryId = function(){ return choose(idlist); };
var operator = function(num){
var o = new queryplan_types.Operator({
operatorId: 'TS_12' + num,
operatorType: Math.floor(Math.random() * 10),
operatorAttributes: null,
operatorCounters: null,
done: true,
started: true
});
return o;
};
var operatorGraph = function(ops){
var al = [];
for (var i = 0; i < ops.length - 1; i++){
al.push(new queryplan_types.Adjacency({ node: ops[i].operatorId, children: [ ops[i+1].operatorId ], adjacencyType: 0 }));
}
return new queryplan_types.Graph({
nodeType: 0,
roots: null,
adjacencyList: al
});
};
var task = function(stage,mapreduce,operators){
var ops = [];
for (var i = 0; i < operators; i++){ ops.push(operator(i)); }
return new queryplan_types.Task({
taskId: 'Stage-' + stage + '_' + mapreduce,
taskType: (mapreduce == 'MAP' ? 0 : 1),
taskAttributes: null,
taskCounters: null,
operatorList: ops,
operatorGraph: operatorGraph(ops),
done: true,
started: true
});
};
var stage = function(stage){
var cntr_map = 'CNTR_NAME_Stage-' + stage + '_MAP_PROGRESS';
var cntr_reduce = 'CNTR_NAME_Stage-' + stage + '_REDUCE_PROGRESS';
var counters = {};
counters[cntr_map] = 100;
counters[cntr_reduce] = 100;
return new queryplan_types.Stage({
stageId: 'Stage-' + stage,
stageType: 3,
stageAttributes: null,
stageCounters: counters,
taskList: [task(stage,'MAP',3), task(stage,'REDUCE',1)],
done: true,
started: true
});
};
exports.query_plan = function(querystring){
if (querystring == undefined){
return new queryplan_types.QueryPlan({});
}
var query = new queryplan_types.Query({
queryId: queryId(),
queryType: null,
queryAttributes: { queryString: querystring },
queryCounters: null,
stageList: [stage(1), stage(2)],
stageGraph: new queryplan_types.Graph({
nodeType: 1,
roots: null,
adjacencyList: [ new queryplan_types.Adjacency({ node: 'Stage-1', children: [ 'Stage-2' ], adjacencyType: 0 }) ]
}),
done: true,
started: true
});
return new queryplan_types.QueryPlan({ queries: [query], done: false, started: false });
};
var columns = function(query){
var match = /select (.*) from .*/im.exec(query);
if (! match)
throw new Error('query field definition invalid!');
return match[1].split(/, /).map(function(s){return s.trim();});
};
var columninfo = function(column){
var name = column;
var type = 'string';
var ex = undefined;
var match = /as ([_a-zA-Z0-9]*)$/im.exec(column);
if (match){
name = match[1];
}
if (/^count/im.exec(column)) {
type = 'bigint';
ex = 'count';
}
else if (/^(sum|avg|min|max)/im.exec(column)) {
type = 'bigint';
ex = 'aggr';
}
else if (/id$/.exec(name)) {
type = 'bigint';
ex = 'id';
}
if (/^"(.*)"$/.exec(name)) {
name = /^"(.*)"$/.exec(name)[1];
ex = "strcopy";
}
else if (name == 'yyyymmdd') {
ex = 'date';
}
else if (name == 'hhmm' || name == 'hhmmss') {
ex = 'time';
}
else if (/name$/i.exec(name)) {
ex = 'name';
}
else if (/kana$/i.exec(name)) {
ex = 'kana';
}
return {name: name, type: type, ex: ex};
};
exports.schema = function(query){
if (! query) {
return new hive_metastore_types.Schema({});
}
if (/^show (databases|tables|partitions)/i.exec(query)) {
return new hive_metastore_types.Schema({
fieldSchemas: [new hive_metastore_types.FieldSchema({name: 'name', type: 'string', comment: undefined})],
properties: null
});
}
if (/^describe/i.exec(query)) {
return new hive_metastore_types.Schema({
fieldSchemas: [
new hive_metastore_types.FieldSchema({name: 'col_name', type: 'string', comment: 'from deserializer'}),
new hive_metastore_types.FieldSchema({name: 'data_type', type: 'string', comment: 'from deserializer'}),
new hive_metastore_types.FieldSchema({name: 'comment', type: 'string', comment: 'from deserializer'})
],
properties: null
});
}
var cols = columns(query.split('\n').join(' '));
return new hive_metastore_types.Schema({
fieldSchemas: cols.map(function(c){
var i = columninfo(c);
return new hive_metastore_types.FieldSchema({name: i.name, type: i.type, comment: undefined});
}),
properties: null
});
};
var generateValue = function(colinfo){
function pad(n){return n<10 ? '0'+n : n;}
switch(colinfo.ex) {
case 'strcopy':
return colinfo.name;
case 'date':
var d1 = new Date((new Date()).getTime() - random_num(50) * 86400 * 1000);
return '' + d1.getFullYear() + pad(d1.getMonth()+1) + pad(d1.getDate());
case 'time':
var d2 = new Date((new Date()).getTime() - random_num(12 * 60) * 60 * 1000);
return '' + pad(d2.getHours()) + pad(d2.getMinutes());
case 'id':
return random_num(500);
case 'aggr':
return random_num(10000);
case 'count':
return random_num(2000);
case 'name':
return random_name(random_num(10));
case 'kana':
return random_kana(random_num(10));
}
if (colinfo.type == 'string'){
return random_string(random_num(50));
}
return random_num(100);
};
var generate_tablename = exports.generate_tablename = function(){
var part_depth = choose([1,1,2,2,3,4]);
var name = '';
for (var i = 0; i < part_depth; i++) {
if (name.length > 0)
name += '_';
name += random_alphabetname(3) + random_num(3);
}
return name;
};
var generate_subtree = exports.generate_subtree = function(subtree_label, parent) {
var parent_part = parent ? parent + '/' : '';
var current_depth_label = subtree_label;
var children_label = null;
if (subtree_label.indexOf('_') > -1) {
var separator = subtree_label.indexOf('_');
current_depth_label = subtree_label.substring(0, separator);
children_label = subtree_label.substring(separator + 1);
}
var matched = /^([a-z]+)(\d+)$/.exec(current_depth_label);
var fieldname = matched[1];
var partsNum = Number(matched[2]);
var parts = [];
for (var i = 0; i < partsNum; i++) {
var current_part = parent_part + fieldname + '=' + i;
if (children_label) {
parts = parts.concat(generate_subtree(children_label, current_part));
}
else {
parts.push(current_part);
}
}
return parts;
};
exports.result = function(query){
var rows = choose([0,1,1,1,1,2,3,5,7,10,20,50]);
var matched = null;
if ((matched = /^show (databases|tables|partitions)( (.*))?$/i.exec(query)) != null) {
if (/^databases$/i.exec(matched[1])) { /* show databases */
if (rows < 1)
rows = 1;
var dbs = [];
for (var x = 0; x < rows; x++) {
var dbname = generate_tablename();
while (dbs.indexOf(dbname) > -1)
dbname = generate_tablename();
dbs.push(dbname);
}
return dbs;
}
else if (/^tables$/i.exec(matched[1])) { /* show tables */
if (rows < 1)
rows = 1;
var tables = [];
for (var i = 0; i < rows; i++) {
var name = generate_tablename();
while (tables.indexOf(name) > -1)
name = generate_tablename();
tables.push(name);
}
return tables;
}
else { /* show partitions hogetable */
var tablename = matched[3];
if (! tablename)
return [];
return generate_subtree(tablename);
}
}
if ((matched = /^describe (.*)$/i.exec(query)) != null) {
var tname = matched[1];
var fields = [];
var types = ['string', 'string', 'string', 'smallint', 'bigint', 'boolean'];
if (rows < 1)
rows = 1;
for (var k = 0; k < rows; k++){
fields.push(random_name(10) + '\t' + choose(types) + '\t' + tname + '___' + k);
}
return fields;
}
else {
var colinfos = columns(query).map(function(c){return columninfo(c);});
var limitmatch = /limit (\d+)/i.exec(query);
if (colinfos.length == 1 && colinfos[0].ex == 'count') {
rows = 1;
}
else if (limitmatch) {
rows = limitmatch[1];
}
var values = [];
for (var j = 0; j < rows; j++){
values.push(colinfos.map(function(c){ return generateValue(c); }).join("\t"));
}
return values;
}
};
================================================
FILE: testtools/check_database_hs2_engine.js
================================================
var async = require('async');
var Executer = require('shib/engines/hiveserver2/test').Executer;
var host = ''
, port = 10000
, username = ''
, password = '';
var test_database = ''
, test_table = '';
var executer = new Executer({
name: 'hiveserver2',
host: host,
port: port,
username: username,
password: password
});
// Executer.prototype.execute = function(jobname, dbname, query, callback)
async.series([
function(cb){
executer.databases(function(err, result){
console.log({label:"RESULT: databases()", result:result});
cb();
});
},
function(cb){
executer.tables(test_database, function(err, result){
console.log({label:"RESULT tables()", result:result});
cb();
});
},
function(cb){
executer.describe(test_database, test_table, function(err, result){
console.log({label:"RESULT describe()", result:result});
cb();
});
},
function(cb){
executer.partitions(test_database, test_table, function(err, result){
console.log({label:"RESULT partitions()", result:result});
cb();
});
}
], function(err,results){ executer.end(); console.log("END."); });
================================================
FILE: testtools/check_database_hs2_use.js
================================================
var async = require('async');
var Executer = require('shib/engines/hiveserver2').Executer;
var host = ''
, port = 10000
, username = ''
, password = '';
var test_database = ''
, test_table = '';
var use_database_statement = "use " + test_database;
var executer = new Executer({
name: 'hiveserver2',
host: host,
port: port,
username: username,
password: password
});
// Executer.prototype.execute = function(jobname, dbname, query, callback)
async.series([
function(cb){
executer.execute(null, null, "show databases", function(err, fetcher){
fetcher.fetch(null, function(err, result){
console.log({label:"RESULT: show databases", result:result});
cb();
});
});
},
function(cb){
executer.setup([use_database_statement], function(err){
executer.execute(null, null, "show tables", function(err, fetcher){
fetcher.fetch(null, function(err, result){
console.log({label:"RESULT show tables", result:result});
cb();
});
});
});
},
function(cb){
executer.setup([use_database_statement], function(err){
executer.execute(null, null, "describe " + test_table, function(err, fetcher){
fetcher.fetch(null, function(err, result){
console.log({label:"RESULT describe", result:result});
cb();
});
});
});
},
function(cb){
executer.setup([use_database_statement], function(err){
executer.execute(null, null, "show partitions " + test_table, function(err, fetcher){
fetcher.fetch(null, function(err, result){
console.log({label:"RESULT show partitions", result:result});
cb();
});
});
});
}
], function(err,results){ executer.end(); console.log("END."); });
================================================
FILE: testtools/check_engine.js
================================================
var engine = require('shib/engine');
// node check_engine.js CONFIG_JS_PATH OPERATION args ...
//
// ex: node check_engine ./config.js execute "SELECT ..."
// node check_engine ./config.js status JOBID JOBNAME
// argv: ['node', 'script_path', arguments]
var args = process.argv.concat();
args.shift(); args.shift();
var conf_path = args.shift(),
operation = args.shift();
var conf = (function(path){
var exports = {};
var ret = eval(require('fs').readFileSync(path).toString());
return exports.servers;
})(conf_path);
var obj = new engine.Engine(conf.executer, conf.monitor);
console.log('engine operation:' + operation + ', args:' + JSON.stringify(args));
var shutdown = function(){ obj.close(); };
if (operation === 'supports') {
console.log('supports ' + operation + ':' + obj.supports(args[0]));
} else if (operation === 'execute') {
obj.execute('check-engine-query', args[0], {callback: function(err,data){
if (err) {
console.log('error:');
console.log(err);
}
console.log('data:');
console.log(data);
shutdown();
}});
} else if (operation === 'status') {
obj.status(args[0], function(err,status){
console.log({err:err, status:status});
shutdown();
});
} else if (operation === 'kill') {
obj.kill(args[0], args[1], function(err){
console.log({err:err});
shutdown();
});
} else {
console.log('unknown operation:' + operation);
shutdown();
}
================================================
FILE: testtools/check_engine_huahin_mrv1.js
================================================
var huahin_mrv1 = require('shib/engines/huahin_mrv1');
// node check_engine_huahin_mrv1.js HUAHIN_HOST HUAHIN_PORT OPERATION ARGS
//
// ex: node check_engine_huahin_mrv1.js localhost 9010 status jobname-foo1
// node check_engine_huahin_mrv1.js localhost 9010 kill jobname-foo1
// argv: ['node', 'script_path', arguments]
var monitor = new huahin_mrv1.Monitor({
name: 'huahin_mrv1',
host: process.argv[2],
port: parseInt(process.argv[3])
});
var operation = process.argv[4],
jobname = process.argv[5];
console.log('huahin_mrv1 ' + operation + ':' + jobname);
var shutdown = function(){ monitor.close(); };
if (operation === 'status') {
monitor.status(jobname, function(err,status){
console.log({err:err, status:status});
shutdown();
});
} else if (operation === 'kill') {
monitor.kill(null, jobname, function(err){
console.log({err:err});
shutdown();
});
} else {
console.log('unknown operation:' + operation);
shutdown();
}
================================================
FILE: testtools/hive_server_mock.js
================================================
var thrift = require('node-thrift'),
ttransport = require('node-thrift/lib/thrift/transport');
var ThriftHive = require('shib/engines/hiveserver/ThriftHive');
var mock = require('ThriftHiveMock');
/*
* ThriftHive server mock with dummy response,
* cannot handle concurrent connections...
* cannot send response with exceptions...
*/
var query = undefined;
var query_plan = undefined;
var query_schema = undefined;
var query_result = [];
var waited_queries = [];
var init_status = function(){
query_plan = query_schema = query = undefined;
query_result = [];
};
setInterval(function(){
if (query != undefined || waited_queries.length < 1) {
return;
}
query_plan = mock.query_plan(waited_queries[0]);
query_schema = mock.schema(waited_queries[0]);
query_result = mock.result(waited_queries[0]);
query = waited_queries.shift();
}, 250);
var execute = function(queued_query, success){
var q = queued_query.split('\n').join(' ');
var executeDelay = 0;
var matched = null;
console.log('=================================================');
console.log(q);
if ((matched = /-- sleep ([0-9]+)$/im.exec(queued_query)) !== null) {
executeDelay = Number(matched[1]) * 1000;
console.log('sleep detected:' + executeDelay);
}
console.log('=================================================');
if (/^set .*/.exec(queued_query)) {
success();
return;
}
setTimeout(function(){
waited_queries.push(q);
console.log("query pushed:" + q);
}, executeDelay);
var timer = setInterval(function(){
if (query != q) {
return;
};
console.log('target query executed');
clearInterval(timer);
success();
}, 500);
};
var getClusterStatus = function(success){
success(mock.cluster_status());
};
var fetchOne = function(success){
if (query == undefined) {
success('');
return;
}
var val = '';
if (query_result.length > 0) {
val = query_result.shift();
}
if (query_result.length == 0) {
init_status();
}
console.log(val);
success(val);
};
var fetchN = function(rows, success){
if (query == undefined) {
success(['']);
return;
}
var val = [];
for (var i = 0; i < rows; i++) {
val.push(query_result.shift());
if (query_result.length < 1) {
init_status();
break;
}
}
console.log(val);
success(val);
};
var fetchAll = function(success){
if (query == undefined) {
success(['']);
return;
}
var val = query_result;
init_status();
console.log(val);
success(val);
};
var getSchema = function(success){
if (query_schema == undefined) {
success(mock.schema());
return;
}
success(query_schema);
};
var getThriftSchema = function(success){
getSchema(success);
};
var getQueryPlan = function(success){
if (query_plan == undefined) {
success(mock.query_plan());
}
success(query_plan);
};
var clean = function(success){
success();
};
var server_mock = thrift.createServer(ThriftHive, {
getClusterStatus: getClusterStatus,
execute: execute,
fetchOne: fetchOne,
fetchN: fetchN,
fetchAll: fetchAll,
getSchema: getSchema,
getThriftSchema: getThriftSchema,
getQueryPlan: getQueryPlan,
clean: clean
}, {transport: ttransport.TBufferedTransport});
server_mock.listen(10000);
================================================
FILE: var/.datadir
================================================
================================================
FILE: views/index.jade
================================================
doctype html
html
head
meta(http-equiv="Content-Type", content="text/html", charset="utf-8")
title shib - Query your Hive!
link(type="text/css", href="/css/redmond/jquery-ui-1.8.13.custom.css", rel="stylesheet")
link(type="text/css", href="/css/ui.dynatree.css", rel="stylesheet")
link(type="text/css", href="/css/shib.css", rel="stylesheet")
link(type="text/css", href="http://fonts.googleapis.com/css?family=Artifika:regular", rel="stylesheet")
link(type="text/css", href="http://fonts.googleapis.com/css?family=Anonymous+Pro:regular,italic,bold,bolditalic", rel="stylesheet")
script(type="text/javascript", src="/js/jquery-1.7.2.min.js")
script(type="text/javascript", src="/js/jquery-ui-1.8.13.custom.min.js")
script(type="text/javascript", src="/js/jquery.tmpl.min.js")
script(type="text/javascript", src="/js/jquery.dynatree.min.js")
script(type="text/javascript", src="/js/shib.js")
body
#titlearea
#title
a(href="/") shib
#noticearea
.ui-widget#errorarea(style="display: none;")
.ui-state-error.ui-corner-all(style="padding: 0 .7em;")
p
span.ui-icon.ui-icon-alert(style="float: left; margin-right: .3em;")
strong#errortitle Alert
span#errormessage(style="margin-left: .7em;") Error Message
.ui-widget#infoarea(style="display: none;")
.ui-state-highlight.ui-corner-all(style="padding: 0 .7em;")
p
span.ui-icon.ui-icon-info(style="float: left; margin-right: .3em;")
strong#infotitle TITLE
span#infomessage(style="margin-left: .7em;") Highlighted Message
#resultdiag(title="show result", style="display:none;")
pre#resultdisplay
#tablesdiag(title="tables status", style="display:none;")
select#table_pairs(style="width: 300px;")
option not loaded
.loadingimg(style="display:none; padding-top: 2em; text-align: center; vertical-align: center;")
image(src="/image/ajax-loader.gif")
#tables(style="display: none;")
#describediag(title="table schema", style="display:none;")
select#desc_pairs(style="width: 300px;")
option not loaded
.loadingimg(style="display:none; padding-top: 2em; text-align: center; vertical-align: center;")
image(src="/image/ajax-loader.gif")
#describes
#taglistdiag(title="tag list", style="display:none;")
.loadingimg(style="display:none; padding-top: 2em; text-align: center; vertical-align: center;")
image(src="/image/ajax-loader.gif")
ul#taglist
#detailstatusdiag(title="query status", style="display:none;")
.loadingimg(style="display:none; padding-top: 2em; text-align: center; vertical-align: center;")
image(src="/image/ajax-loader.gif")
#detailstatus(style="display: none;")
#edittagdiag(title="add/remove tag", style="display: none;")
input#add_tag_text(type="text", size="16")
button#add_tag_submit
| Add
#removeTagPart(style="display: none;")
hr
select#remove_tag_list
option not loaded
button#remove_tag_submit
| Remove
#authinputdiag(title="username/password check", style="display:none;")
form
div
| Username:
input#username(type="text", size="16", placeholder="username")
span#authRealm
|
div
| Password:
input#password(type="password", size="16", placeholder="password")
button#auth_submit(type="submit")
| Check username/password
#mainarea
table
tr
td#mainviewcell
#mainview
#tablesbox.ui-corner-all
ul.operationitems.ui-widget.ui-helper-clearfix
li#tables_diag.ui-state-default.ui-corner-all(title="show tables dialog")
span.ui-icon.ui-icon-info
| show tables and partitions
li#describe_diag.ui-state-default.ui-corner-all(title="show table schema")
span.ui-icon.ui-icon-info
| show table schemas
li#taglist_diag.ui-state-default.ui-corner-all(title="show all tags")
span.ui-icon.ui-icon-info
| show all tags
#dangereditbox.ui-corner-all
ul.dangeritems.operationitems.ui-widget.ui-helper-clearfix
li#new_button.ui-state-default.ui-corner-all
span.ui-icon.ui-icon-document
| new query
li#copy_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-copy
| copy to new query
li#clip_button.ui-state-default.ui-corner-all(style="display: none; margin-left: 12em;")
span.ui-icon.ui-icon-link
| add to your bookmark
li#unclip_button.ui-state-default.ui-corner-all(style="display: none; margin-left: 12em;")
span.ui-icon.ui-icon-cancel
| remove from bookmark
#querybox
textarea#queryeditor(rows="14")
#editbox.ui-corner-all
#engineselector
select#exec_pairs(style="width: 300px;")
option not loaded
ul.operationitems.ui-widget.ui-helper-clearfix
li#auth_button.ui-state-default.ui-corner-all
span.ui-icon.ui-icon-play
| ...authenticate
li#execute_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-play
| execute
li#giveup_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-pause
| give up
li#status_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-search
| status
li#delete_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-trash
| delete
li#display_full_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-newwin
| show full
li#display_head_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-newwin
| show head
li#download_tsv_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-arrowthickstop-1-s
| tsv
li#download_csv_button.ui-state-default.ui-corner-all(style="display: none;")
span.ui-icon.ui-icon-arrowthickstop-1-s
| csv
#statusview
span
| Query Status:
span#querystatus.status_not_executed not executed
#queryexec(style="display: none;")
div
| Engine:
span#queryengine
| , Database:
span#querydatabase
#queryresult(style="display: none;")
div
| Result:
span#queryresultlines 0 lines,
span#queryresultbytes 0 bytes
div#queryresultelapsed
div#queryresultschema
ul#querytags.querytags.ui-widget.ui-helper-clearfix(style="display: none;")
li#edit_tag_button.ui-state-default.ui-corner-all
span.ui-icon.ui-icon-pencil
| Edit tag
td#tabviewcell
#tabview
#listSelector
ul
li#index-tag
a(href="#tab-tag") tag
li#index-yours
a(href="#tab-yours") yours
li#index-bookmark
a(href="#tab-bookmark") bookmark
li#index-history
a(href="#tab-history") history
#tab-tag
#tab-yours
#tab-bookmark
#tab-history
#runningarea
#runnings.ui-corner-all
div no running queries
#creditarea
#credits
| shib by tagomoris